summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-tidy17
-rw-r--r--Auxiliary/vim/syntax/cmake.vim8
-rw-r--r--CMakeLists.txt45
-rw-r--r--CONTRIBUTING.rst4
-rw-r--r--CTestCustom.cmake.in1
-rw-r--r--CompileFlags.cmake7
-rw-r--r--Copyright.txt7
-rw-r--r--Help/command/FIND_XXX.txt2
-rw-r--r--Help/command/add_compile_definitions.rst4
-rw-r--r--Help/command/add_compile_options.rst43
-rw-r--r--Help/command/add_custom_command.rst6
-rw-r--r--Help/command/add_custom_target.rst2
-rw-r--r--Help/command/add_definitions.rst4
-rw-r--r--Help/command/add_dependencies.rst4
-rw-r--r--Help/command/add_executable.rst6
-rw-r--r--Help/command/add_library.rst10
-rw-r--r--Help/command/add_link_options.rst4
-rw-r--r--Help/command/add_subdirectory.rst7
-rw-r--r--Help/command/add_test.rst10
-rw-r--r--Help/command/aux_source_directory.rst2
-rw-r--r--Help/command/break.rst4
-rw-r--r--Help/command/build_name.rst2
-rw-r--r--Help/command/cmake_host_system_information.rst2
-rw-r--r--Help/command/cmake_minimum_required.rst16
-rw-r--r--Help/command/cmake_parse_arguments.rst22
-rw-r--r--Help/command/cmake_policy.rst12
-rw-r--r--Help/command/configure_file.rst22
-rw-r--r--Help/command/continue.rst6
-rw-r--r--Help/command/create_test_sourcelist.rst2
-rw-r--r--Help/command/ctest_build.rst4
-rw-r--r--Help/command/ctest_submit.rst11
-rw-r--r--Help/command/define_property.rst4
-rw-r--r--Help/command/else.rst4
-rw-r--r--Help/command/elseif.rst9
-rw-r--r--Help/command/enable_language.rst6
-rw-r--r--Help/command/enable_testing.rst2
-rw-r--r--Help/command/endforeach.rst8
-rw-r--r--Help/command/endfunction.rst8
-rw-r--r--Help/command/endif.rst8
-rw-r--r--Help/command/endmacro.rst8
-rw-r--r--Help/command/endwhile.rst8
-rw-r--r--Help/command/exec_program.rst4
-rw-r--r--Help/command/execute_process.rst6
-rw-r--r--Help/command/export.rst10
-rw-r--r--Help/command/export_library_dependencies.rst2
-rw-r--r--Help/command/file.rst90
-rw-r--r--Help/command/find_package.rst28
-rw-r--r--Help/command/fltk_wrap_ui.rst2
-rw-r--r--Help/command/foreach.rst99
-rw-r--r--Help/command/function.rst88
-rw-r--r--Help/command/get_cmake_property.rst12
-rw-r--r--Help/command/get_directory_property.rst6
-rw-r--r--Help/command/get_filename_component.rst37
-rw-r--r--Help/command/get_property.rst20
-rw-r--r--Help/command/get_source_file_property.rst4
-rw-r--r--Help/command/get_target_property.rst4
-rw-r--r--Help/command/get_test_property.rst2
-rw-r--r--Help/command/if.rst120
-rw-r--r--Help/command/include.rst10
-rw-r--r--Help/command/include_directories.rst2
-rw-r--r--Help/command/include_external_msproject.rst2
-rw-r--r--Help/command/include_guard.rst2
-rw-r--r--Help/command/include_regular_expression.rst4
-rw-r--r--Help/command/install.rst176
-rw-r--r--Help/command/install_files.rst4
-rw-r--r--Help/command/install_programs.rst4
-rw-r--r--Help/command/install_targets.rst4
-rw-r--r--Help/command/link_directories.rst4
-rw-r--r--Help/command/link_libraries.rst2
-rw-r--r--Help/command/list.rst60
-rw-r--r--Help/command/load_cache.rst11
-rw-r--r--Help/command/load_command.rst2
-rw-r--r--Help/command/macro.rst138
-rw-r--r--Help/command/make_directory.rst4
-rw-r--r--Help/command/mark_as_advanced.rst27
-rw-r--r--Help/command/math.rst40
-rw-r--r--Help/command/message.rst2
-rw-r--r--Help/command/option.rst15
-rw-r--r--Help/command/output_required_files.rst2
-rw-r--r--Help/command/project.rst147
-rw-r--r--Help/command/qt_wrap_cpp.rst21
-rw-r--r--Help/command/qt_wrap_ui.rst18
-rw-r--r--Help/command/remove.rst4
-rw-r--r--Help/command/remove_definitions.rst4
-rw-r--r--Help/command/return.rst7
-rw-r--r--Help/command/separate_arguments.rst46
-rw-r--r--Help/command/set.rst29
-rw-r--r--Help/command/set_directory_properties.rst10
-rw-r--r--Help/command/set_property.rst36
-rw-r--r--Help/command/set_source_files_properties.rst10
-rw-r--r--Help/command/set_target_properties.rst4
-rw-r--r--Help/command/set_tests_properties.rst11
-rw-r--r--Help/command/site_name.rst2
-rw-r--r--Help/command/source_group.rst2
-rw-r--r--Help/command/string.rst46
-rw-r--r--Help/command/subdir_depends.rst2
-rw-r--r--Help/command/subdirs.rst4
-rw-r--r--Help/command/target_compile_definitions.rst4
-rw-r--r--Help/command/target_compile_features.rst4
-rw-r--r--Help/command/target_compile_options.rst32
-rw-r--r--Help/command/target_include_directories.rst4
-rw-r--r--Help/command/target_link_directories.rst4
-rw-r--r--Help/command/target_link_libraries.rst14
-rw-r--r--Help/command/target_link_options.rst4
-rw-r--r--Help/command/target_sources.rst4
-rw-r--r--Help/command/try_compile.rst60
-rw-r--r--Help/command/try_run.rst23
-rw-r--r--Help/command/unset.rst21
-rw-r--r--Help/command/use_mangled_mesa.rst2
-rw-r--r--Help/command/utility_source.rst2
-rw-r--r--Help/command/variable_requires.rst2
-rw-r--r--Help/command/variable_watch.rst14
-rw-r--r--Help/command/while.rst24
-rw-r--r--Help/command/write_file.rst4
-rw-r--r--Help/cpack_gen/deb.rst32
-rw-r--r--Help/cpack_gen/freebsd.rst2
-rw-r--r--Help/cpack_gen/nuget.rst2
-rw-r--r--Help/cpack_gen/rpm.rst4
-rw-r--r--Help/dev/README.rst2
-rw-r--r--Help/dev/documentation.rst530
-rw-r--r--Help/dev/review.rst27
-rw-r--r--Help/dev/source.rst20
-rw-r--r--Help/envvar/ASM_DIALECT.rst2
-rw-r--r--Help/envvar/ASM_DIALECTFLAGS.rst2
-rw-r--r--Help/envvar/CC.rst2
-rw-r--r--Help/envvar/CFLAGS.rst2
-rw-r--r--Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst2
-rw-r--r--Help/envvar/CMAKE_CONFIG_TYPE.rst2
-rw-r--r--Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst2
-rw-r--r--Help/envvar/CMAKE_NO_VERBOSE.rst8
-rw-r--r--Help/envvar/CMAKE_OSX_ARCHITECTURES.rst2
-rw-r--r--Help/envvar/CSFLAGS.rst2
-rw-r--r--Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst2
-rw-r--r--Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst2
-rw-r--r--Help/envvar/CTEST_PARALLEL_LEVEL.rst2
-rw-r--r--Help/envvar/CTEST_PROGRESS_OUTPUT.rst2
-rw-r--r--Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst2
-rw-r--r--Help/envvar/CUDACXX.rst2
-rw-r--r--Help/envvar/CUDAFLAGS.rst2
-rw-r--r--Help/envvar/CUDAHOSTCXX.rst2
-rw-r--r--Help/envvar/CXX.rst2
-rw-r--r--Help/envvar/CXXFLAGS.rst2
-rw-r--r--Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst2
-rw-r--r--Help/envvar/DESTDIR.rst2
-rw-r--r--Help/envvar/ENV_VAR.txt3
-rw-r--r--Help/envvar/FC.rst2
-rw-r--r--Help/envvar/FFLAGS.rst2
-rw-r--r--Help/envvar/LDFLAGS.rst2
-rw-r--r--Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst2
-rw-r--r--Help/envvar/PackageName_ROOT.rst2
-rw-r--r--Help/envvar/RC.rst2
-rw-r--r--Help/envvar/RCFLAGS.rst2
-rw-r--r--Help/envvar/VERBOSE.rst10
-rw-r--r--Help/generator/Green Hills MULTI.rst41
-rw-r--r--Help/generator/VS_TOOLSET_HOST_ARCH.txt7
-rw-r--r--Help/generator/Visual Studio 10 2010.rst2
-rw-r--r--Help/generator/Visual Studio 11 2012.rst2
-rw-r--r--Help/generator/Visual Studio 12 2013.rst5
-rw-r--r--Help/generator/Visual Studio 14 2015.rst5
-rw-r--r--Help/generator/Visual Studio 15 2017.rst5
-rw-r--r--Help/generator/Visual Studio 16 2019.rst53
-rw-r--r--Help/generator/Visual Studio 9 2008.rst2
-rw-r--r--Help/generator/Xcode.rst4
-rw-r--r--Help/index.rst1
-rw-r--r--Help/manual/ccmake.1.rst2
-rw-r--r--Help/manual/cmake-buildsystem.7.rst1
-rw-r--r--Help/manual/cmake-commands.7.rst14
-rw-r--r--Help/manual/cmake-developer.7.rst676
-rw-r--r--Help/manual/cmake-env-variables.7.rst10
-rw-r--r--Help/manual/cmake-file-api.7.rst1111
-rw-r--r--Help/manual/cmake-generator-expressions.7.rst422
-rw-r--r--Help/manual/cmake-generators.7.rst5
-rw-r--r--Help/manual/cmake-gui.1.rst11
-rw-r--r--Help/manual/cmake-language.7.rst81
-rw-r--r--Help/manual/cmake-modules.7.rst106
-rw-r--r--Help/manual/cmake-policies.7.rst14
-rw-r--r--Help/manual/cmake-properties.7.rst31
-rw-r--r--Help/manual/cmake-qt.7.rst39
-rw-r--r--Help/manual/cmake-toolchains.7.rst129
-rw-r--r--Help/manual/cmake-variables.7.rst82
-rw-r--r--Help/manual/cmake.1.rst279
-rw-r--r--Help/manual/cpack.1.rst40
-rw-r--r--Help/manual/ctest.1.rst131
-rw-r--r--Help/module/CheckFortranSourceRuns.rst1
-rw-r--r--Help/module/CheckPIESupported.rst1
-rw-r--r--Help/module/FindFontconfig.rst1
-rw-r--r--Help/module/FindLibinput.rst1
-rw-r--r--Help/module/FindSQLite3.rst1
-rw-r--r--Help/policy/CMP0049.rst8
-rw-r--r--Help/policy/CMP0078.rst2
-rw-r--r--Help/policy/CMP0082.rst26
-rw-r--r--Help/policy/CMP0083.rst63
-rw-r--r--Help/policy/CMP0084.rst26
-rw-r--r--Help/policy/CMP0085.rst21
-rw-r--r--Help/policy/CMP0086.rst20
-rw-r--r--Help/policy/CMP0087.rst29
-rw-r--r--Help/policy/CMP0088.rst29
-rw-r--r--Help/prop_dir/BUILDSYSTEM_TARGETS.rst2
-rw-r--r--Help/prop_dir/COMPILE_OPTIONS.rst2
-rw-r--r--Help/prop_dir/EXCLUDE_FROM_ALL.rst6
-rw-r--r--Help/prop_dir/LINK_DIRECTORIES.rst2
-rw-r--r--Help/prop_dir/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_dir/SUBDIRECTORIES.rst2
-rw-r--r--Help/prop_dir/TESTS.rst2
-rw-r--r--Help/prop_gbl/CMAKE_ROLE.rst20
-rw-r--r--Help/prop_sf/COMPILE_OPTIONS.rst2
-rw-r--r--Help/prop_sf/INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/prop_sf/OBJECT_DEPENDS.rst2
-rw-r--r--Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst4
-rw-r--r--Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst38
-rw-r--r--Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst21
-rw-r--r--Help/prop_tgt/AUTOMOC.rst11
-rw-r--r--Help/prop_tgt/AUTOMOC_EXECUTABLE.rst15
-rw-r--r--Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst2
-rw-r--r--Help/prop_tgt/AUTORCC.rst9
-rw-r--r--Help/prop_tgt/AUTORCC_EXECUTABLE.rst15
-rw-r--r--Help/prop_tgt/AUTOUIC.rst9
-rw-r--r--Help/prop_tgt/AUTOUIC_EXECUTABLE.rst15
-rw-r--r--Help/prop_tgt/BUILD_RPATH.rst2
-rw-r--r--Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst24
-rw-r--r--Help/prop_tgt/COMPILE_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst12
-rw-r--r--Help/prop_tgt/EXCLUDE_FROM_ALL.rst15
-rw-r--r--Help/prop_tgt/GHS_INTEGRITY_APP.rst10
-rw-r--r--Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst13
-rw-r--r--Help/prop_tgt/IMPORTED_OBJECTS.rst2
-rw-r--r--Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst6
-rw-r--r--Help/prop_tgt/LANG_CLANG_TIDY.rst2
-rw-r--r--Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst2
-rw-r--r--Help/prop_tgt/LANG_CPPCHECK.rst6
-rw-r--r--Help/prop_tgt/LANG_CPPLINT.rst2
-rw-r--r--Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst2
-rw-r--r--Help/prop_tgt/LINK_DIRECTORIES.rst2
-rw-r--r--Help/prop_tgt/LINK_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst5
-rw-r--r--Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst2
-rw-r--r--Help/prop_tgt/VS_SDK_REFERENCES.rst2
-rw-r--r--Help/prop_tgt/WIN32_EXECUTABLE.rst11
-rw-r--r--Help/release/3.13.rst9
-rw-r--r--Help/release/3.14.rst393
-rw-r--r--Help/release/3.6.rst2
-rw-r--r--Help/release/index.rst1
-rw-r--r--Help/variable/CACHE.rst5
-rw-r--r--Help/variable/CMAKE_APPBUNDLE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_ARGC.rst6
-rw-r--r--Help/variable/CMAKE_ARGV0.rst4
-rw-r--r--Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst11
-rw-r--r--Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_RPATH.rst2
-rw-r--r--Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst7
-rw-r--r--Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst2
-rw-r--r--Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst10
-rw-r--r--Help/variable/CMAKE_FIND_ROOT_PATH.rst2
-rw-r--r--Help/variable/CMAKE_FRAMEWORK_PATH.rst2
-rw-r--r--Help/variable/CMAKE_GENERATOR_TOOLSET.rst4
-rw-r--r--Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst6
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst26
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst13
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst18
-rw-r--r--Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst13
-rw-r--r--Help/variable/CMAKE_HOME_DIRECTORY.rst7
-rw-r--r--Help/variable/CMAKE_IGNORE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_INCLUDE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_LANG_COMPILER_ID.rst3
-rw-r--r--Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst3
-rw-r--r--Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst3
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst5
-rw-r--r--Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst5
-rw-r--r--Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst7
-rw-r--r--Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst2
-rw-r--r--Help/variable/CMAKE_LIBRARY_PATH.rst2
-rw-r--r--Help/variable/CMAKE_MACOSX_BUNDLE.rst3
-rw-r--r--Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst33
-rw-r--r--Help/variable/CMAKE_MFC_FLAG.rst15
-rw-r--r--Help/variable/CMAKE_MODULE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst2
-rw-r--r--Help/variable/CMAKE_PREFIX_PATH.rst2
-rw-r--r--Help/variable/CMAKE_PROGRAM_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst2
-rw-r--r--Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst2
-rw-r--r--Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst8
-rw-r--r--Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst10
-rw-r--r--Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst25
-rw-r--r--Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst (renamed from Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst)4
-rw-r--r--Help/variable/CTEST_SCP_COMMAND.rst3
-rw-r--r--Help/variable/CTEST_SUBMIT_URL.rst5
-rw-r--r--Help/variable/CTEST_TRIGGER_SITE.rst3
-rw-r--r--Help/variable/ENV.rst8
-rw-r--r--Help/variable/GHS-MULTI.rst2
-rw-r--r--Help/variable/IOS.rst4
-rw-r--r--Help/variable/MSVC_VERSION.rst1
-rw-r--r--Help/variable/MSYS.rst4
-rw-r--r--Help/variable/PackageName_ROOT.rst2
-rw-r--r--Modules/AddFileDependencies.cmake19
-rw-r--r--Modules/AndroidTestUtilities.cmake2
-rw-r--r--Modules/BasicConfigVersion-AnyNewerVersion.cmake.in6
-rw-r--r--Modules/BasicConfigVersion-ExactVersion.cmake.in5
-rw-r--r--Modules/BasicConfigVersion-SameMajorVersion.cmake.in5
-rw-r--r--Modules/BasicConfigVersion-SameMinorVersion.cmake.in5
-rw-r--r--Modules/BundleUtilities.cmake81
-rw-r--r--Modules/CMakeASMCompiler.cmake.in1
-rw-r--r--Modules/CMakeAddFortranSubdirectory.cmake81
-rw-r--r--Modules/CMakeBackwardCompatibilityC.cmake4
-rw-r--r--Modules/CMakeBackwardCompatibilityCXX.cmake32
-rw-r--r--Modules/CMakeCCompiler.cmake.in2
-rw-r--r--Modules/CMakeCUDACompiler.cmake.in4
-rw-r--r--Modules/CMakeCXXCompiler.cmake.in2
-rw-r--r--Modules/CMakeCXXInformation.cmake7
-rw-r--r--Modules/CMakeCompilerABI.h8
-rw-r--r--Modules/CMakeCompilerIdDetection.cmake6
-rw-r--r--Modules/CMakeDependentOption.cmake43
-rw-r--r--Modules/CMakeDetermineASMCompiler.cmake6
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake7
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake5
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake7
-rw-r--r--Modules/CMakeDetermineCompilerABI.cmake47
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake143
-rw-r--r--Modules/CMakeDetermineSystem.cmake1
-rw-r--r--Modules/CMakeDetermineVSServicePack.cmake64
-rw-r--r--Modules/CMakeExpandImportedTargets.cmake73
-rw-r--r--Modules/CMakeFindBinUtils.cmake53
-rw-r--r--Modules/CMakeFindFrameworks.cmake19
-rw-r--r--Modules/CMakeFindPackageMode.cmake55
-rw-r--r--Modules/CMakeForceCompiler.cmake129
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in1
-rw-r--r--Modules/CMakeFortranCompilerABI.F8
-rw-r--r--Modules/CMakeFortranCompilerId.F.in16
-rw-r--r--Modules/CMakeFortranInformation.cmake6
-rw-r--r--Modules/CMakeGenericSystem.cmake2
-rw-r--r--Modules/CMakeGraphVizOptions.cmake239
-rw-r--r--Modules/CMakePackageConfigHelpers.cmake420
-rw-r--r--Modules/CMakeParseArguments.cmake17
-rw-r--r--Modules/CMakeParseImplicitIncludeInfo.cmake237
-rw-r--r--Modules/CMakePlatformId.h.in31
-rw-r--r--Modules/CMakePrintHelpers.cmake82
-rw-r--r--Modules/CMakePrintSystemInformation.cmake17
-rw-r--r--Modules/CMakePushCheckState.cmake97
-rw-r--r--Modules/CMakeTestCCompiler.cmake10
-rw-r--r--Modules/CMakeTestCXXCompiler.cmake10
-rw-r--r--Modules/CMakeTestCompilerCommon.cmake20
-rw-r--r--Modules/CMakeVerifyManifest.cmake33
-rw-r--r--Modules/CPack.background.png.inbin47076 -> 44108 bytes
-rw-r--r--Modules/CPack.cmake33
-rw-r--r--Modules/CPackComponent.cmake615
-rw-r--r--Modules/CPackIFW.cmake8
-rw-r--r--Modules/CPackIFWConfigureFile.cmake53
-rw-r--r--Modules/CTest.cmake22
-rw-r--r--Modules/CTestCoverageCollectGCOV.cmake127
-rw-r--r--Modules/CTestScriptMode.cmake15
-rw-r--r--Modules/CTestUseLaunchers.cmake53
-rw-r--r--Modules/CheckCCompilerFlag.cmake2
-rw-r--r--Modules/CheckCSourceCompiles.cmake31
-rw-r--r--Modules/CheckCSourceRuns.cmake36
-rw-r--r--Modules/CheckCXXCompilerFlag.cmake3
-rw-r--r--Modules/CheckCXXSourceCompiles.cmake31
-rw-r--r--Modules/CheckCXXSourceRuns.cmake43
-rw-r--r--Modules/CheckCXXSymbolExists.cmake73
-rw-r--r--Modules/CheckFortranCompilerFlag.cmake2
-rw-r--r--Modules/CheckFortranFunctionExists.cmake61
-rw-r--r--Modules/CheckFortranSourceCompiles.cmake57
-rw-r--r--Modules/CheckFortranSourceRuns.cmake175
-rw-r--r--Modules/CheckFunctionExists.cmake91
-rw-r--r--Modules/CheckIPOSupported.cmake2
-rw-r--r--Modules/CheckIncludeFile.cmake80
-rw-r--r--Modules/CheckIncludeFileCXX.cmake78
-rw-r--r--Modules/CheckIncludeFiles.cmake90
-rw-r--r--Modules/CheckLanguage.cmake59
-rw-r--r--Modules/CheckLibraryExists.cmake66
-rw-r--r--Modules/CheckPIESupported.cmake134
-rw-r--r--Modules/CheckPrototypeDefinition.cmake89
-rw-r--r--Modules/CheckStructHasMember.cmake79
-rw-r--r--Modules/CheckSymbolExists.cmake23
-rw-r--r--Modules/CheckTypeSize.cmake137
-rw-r--r--Modules/CheckVariableExists.cmake70
-rw-r--r--Modules/Compiler/Clang.cmake6
-rw-r--r--Modules/Compiler/Cray-CXX.cmake2
-rw-r--r--Modules/Compiler/CrayPrgEnv-C.cmake6
-rw-r--r--Modules/Compiler/CrayPrgEnv-CXX.cmake6
-rw-r--r--Modules/Compiler/CrayPrgEnv-Cray-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Fortran.cmake6
-rw-r--r--Modules/Compiler/CrayPrgEnv-GNU-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Intel-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-PGI-C.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake7
-rw-r--r--Modules/Compiler/CrayPrgEnv.cmake57
-rw-r--r--Modules/Compiler/Flang-Fortran.cmake3
-rw-r--r--Modules/Compiler/GHS-C.cmake20
-rw-r--r--Modules/Compiler/GHS-CXX.cmake24
-rw-r--r--Modules/Compiler/GHS-DetermineCompiler.cmake11
-rw-r--r--Modules/Compiler/GHS.cmake6
-rw-r--r--Modules/Compiler/GNU-Fortran.cmake3
-rw-r--r--Modules/Compiler/GNU.cmake7
-rw-r--r--Modules/Compiler/IAR-C.cmake13
-rw-r--r--Modules/Compiler/IAR-CXX.cmake21
-rw-r--r--Modules/Compiler/IAR-DetermineCompiler.cmake22
-rw-r--r--Modules/Compiler/IAR.cmake21
-rw-r--r--Modules/Compiler/Intel-Fortran.cmake3
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake1
-rw-r--r--Modules/Compiler/PGI-Fortran.cmake3
-rw-r--r--Modules/Compiler/QCC-ASM.cmake2
-rw-r--r--Modules/Compiler/QCC-C-FeatureTests.cmake1
-rw-r--r--Modules/Compiler/QCC-C.cmake3
-rw-r--r--Modules/Compiler/QCC-CXX-FeatureTests.cmake1
-rw-r--r--Modules/Compiler/QCC-CXX.cmake3
-rw-r--r--Modules/Compiler/SunPro-C.cmake4
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake4
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake4
-rw-r--r--Modules/Compiler/XL-Fortran.cmake3
-rw-r--r--Modules/Compiler/XL.cmake2
-rw-r--r--Modules/CompilerId/GHS_default.gpj.in8
-rw-r--r--Modules/CompilerId/GHS_lib.gpj.in3
-rw-r--r--Modules/CompilerId/Xcode-3.pbxproj.in4
-rw-r--r--Modules/Dart.cmake43
-rw-r--r--Modules/DartConfiguration.tcl.in12
-rw-r--r--Modules/DeployQt4.cmake12
-rw-r--r--Modules/Documentation.cmake15
-rw-r--r--Modules/ExternalProject.cmake142
-rw-r--r--Modules/FeatureSummary.cmake2
-rw-r--r--Modules/FetchContent.cmake291
-rw-r--r--Modules/FetchContent/CMakeLists.cmake.in2
-rw-r--r--Modules/FindALSA.cmake77
-rw-r--r--Modules/FindASPELL.cmake31
-rw-r--r--Modules/FindAVIFile.cmake35
-rw-r--r--Modules/FindArmadillo.cmake59
-rw-r--r--Modules/FindBISON.cmake197
-rw-r--r--Modules/FindBLAS.cmake259
-rw-r--r--Modules/FindBZip2.cmake71
-rw-r--r--Modules/FindBacktrace.cmake71
-rw-r--r--Modules/FindBoost.cmake510
-rw-r--r--Modules/FindBullet.cmake67
-rw-r--r--Modules/FindCABLE.cmake43
-rw-r--r--Modules/FindCUDA.cmake767
-rw-r--r--Modules/FindCURL.cmake134
-rw-r--r--Modules/FindCVS.cmake43
-rw-r--r--Modules/FindCoin3D.cmake33
-rw-r--r--Modules/FindCups.cmake33
-rw-r--r--Modules/FindCurses.cmake81
-rw-r--r--Modules/FindCxxTest.cmake273
-rw-r--r--Modules/FindCygwin.cmake11
-rw-r--r--Modules/FindDCMTK.cmake154
-rw-r--r--Modules/FindDart.cmake17
-rw-r--r--Modules/FindDevIL.cmake59
-rw-r--r--Modules/FindDoxygen.cmake19
-rw-r--r--Modules/FindEXPAT.cmake53
-rw-r--r--Modules/FindFLEX.cmake189
-rw-r--r--Modules/FindFLTK.cmake153
-rw-r--r--Modules/FindFLTK2.cmake47
-rw-r--r--Modules/FindFontconfig.cmake101
-rw-r--r--Modules/FindFreetype.cmake79
-rw-r--r--Modules/FindGCCXML.cmake27
-rw-r--r--Modules/FindGDAL.cmake86
-rw-r--r--Modules/FindGIF.cmake85
-rw-r--r--Modules/FindGLEW.cmake45
-rw-r--r--Modules/FindGLUT.cmake65
-rw-r--r--Modules/FindGSL.cmake109
-rw-r--r--Modules/FindGTK.cmake25
-rw-r--r--Modules/FindGTK2.cmake193
-rw-r--r--Modules/FindGTest.cmake143
-rw-r--r--Modules/FindGettext.cmake111
-rw-r--r--Modules/FindGit.cmake55
-rw-r--r--Modules/FindGnuTLS.cmake33
-rw-r--r--Modules/FindGnuplot.cmake39
-rw-r--r--Modules/FindHDF5.cmake251
-rw-r--r--Modules/FindHSPELL.cmake45
-rw-r--r--Modules/FindHTMLHelp.cmake27
-rw-r--r--Modules/FindHg.cmake79
-rw-r--r--Modules/FindICU.cmake183
-rw-r--r--Modules/FindIce.cmake285
-rw-r--r--Modules/FindIcotool.cmake29
-rw-r--r--Modules/FindImageMagick.cmake163
-rw-r--r--Modules/FindIntl.cmake55
-rw-r--r--Modules/FindJNI.cmake99
-rw-r--r--Modules/FindJPEG.cmake133
-rw-r--r--Modules/FindJasper.cmake29
-rw-r--r--Modules/FindJava.cmake147
-rw-r--r--Modules/FindKDE3.cmake271
-rw-r--r--Modules/FindKDE4.cmake47
-rw-r--r--Modules/FindLAPACK.cmake271
-rw-r--r--Modules/FindLATEX.cmake101
-rw-r--r--Modules/FindLTTngUST.cmake63
-rw-r--r--Modules/FindLibArchive.cmake29
-rw-r--r--Modules/FindLibLZMA.cmake73
-rw-r--r--Modules/FindLibXml2.cmake83
-rw-r--r--Modules/FindLibXslt.cmake47
-rw-r--r--Modules/FindLibinput.cmake82
-rw-r--r--Modules/FindLua.cmake69
-rw-r--r--Modules/FindLua50.cmake61
-rw-r--r--Modules/FindLua51.cmake63
-rw-r--r--Modules/FindMFC.cmake29
-rw-r--r--Modules/FindMPEG.cmake41
-rw-r--r--Modules/FindMPEG2.cmake41
-rw-r--r--Modules/FindMPI.cmake483
-rw-r--r--Modules/FindMatlab.cmake1082
-rw-r--r--Modules/FindMotif.cmake27
-rw-r--r--Modules/FindODBC.cmake4
-rw-r--r--Modules/FindOpenAL.cmake31
-rw-r--r--Modules/FindOpenCL.cmake59
-rw-r--r--Modules/FindOpenGL.cmake245
-rw-r--r--Modules/FindOpenMP.cmake145
-rw-r--r--Modules/FindOpenSSL.cmake95
-rw-r--r--Modules/FindOpenSceneGraph.cmake193
-rw-r--r--Modules/FindOpenThreads.cmake49
-rw-r--r--Modules/FindPHP4.cmake29
-rw-r--r--Modules/FindPNG.cmake87
-rw-r--r--Modules/FindPackageMessage.cmake59
-rw-r--r--Modules/FindPatch.cmake49
-rw-r--r--Modules/FindPerl.cmake27
-rw-r--r--Modules/FindPerlLibs.cmake83
-rw-r--r--Modules/FindPhysFS.cmake29
-rw-r--r--Modules/FindPike.cmake29
-rw-r--r--Modules/FindPkgConfig.cmake94
-rw-r--r--Modules/FindPostgreSQL.cmake76
-rw-r--r--Modules/FindProducer.cmake59
-rw-r--r--Modules/FindProtobuf.cmake237
-rw-r--r--Modules/FindPython.cmake30
-rw-r--r--Modules/FindPython/Support.cmake268
-rw-r--r--Modules/FindPython2.cmake30
-rw-r--r--Modules/FindPython3.cmake30
-rw-r--r--Modules/FindPythonInterp.cmake91
-rw-r--r--Modules/FindPythonLibs.cmake85
-rw-r--r--Modules/FindQt.cmake71
-rw-r--r--Modules/FindQt3.cmake63
-rw-r--r--Modules/FindQt4.cmake597
-rw-r--r--Modules/FindQuickTime.cmake29
-rw-r--r--Modules/FindRTI.cmake63
-rw-r--r--Modules/FindRuby.cmake63
-rw-r--r--Modules/FindSDL.cmake139
-rw-r--r--Modules/FindSDL_image.cmake69
-rw-r--r--Modules/FindSDL_mixer.cmake69
-rw-r--r--Modules/FindSDL_net.cmake67
-rw-r--r--Modules/FindSDL_sound.cmake157
-rw-r--r--Modules/FindSDL_ttf.cmake67
-rw-r--r--Modules/FindSQLite3.cmake66
-rw-r--r--Modules/FindSWIG.cmake47
-rw-r--r--Modules/FindSelfPackers.cmake27
-rw-r--r--Modules/FindSquish.cmake235
-rw-r--r--Modules/FindSubversion.cmake125
-rw-r--r--Modules/FindTCL.cmake85
-rw-r--r--Modules/FindTIFF.cmake75
-rw-r--r--Modules/FindTclStub.cmake85
-rw-r--r--Modules/FindTclsh.cmake35
-rw-r--r--Modules/FindThreads.cmake154
-rw-r--r--Modules/FindUnixCommands.cmake17
-rw-r--r--Modules/FindVulkan.cmake53
-rw-r--r--Modules/FindWget.cmake25
-rw-r--r--Modules/FindWish.cmake35
-rw-r--r--Modules/FindX11.cmake513
-rw-r--r--Modules/FindXMLRPC.cmake59
-rw-r--r--Modules/FindXalanC.cmake81
-rw-r--r--Modules/FindXercesC.cmake77
-rw-r--r--Modules/FindZLIB.cmake95
-rw-r--r--Modules/Findosg.cmake73
-rw-r--r--Modules/FindosgAnimation.cmake61
-rw-r--r--Modules/FindosgDB.cmake61
-rw-r--r--Modules/FindosgFX.cmake61
-rw-r--r--Modules/FindosgGA.cmake61
-rw-r--r--Modules/FindosgIntrospection.cmake63
-rw-r--r--Modules/FindosgManipulator.cmake63
-rw-r--r--Modules/FindosgParticle.cmake61
-rw-r--r--Modules/FindosgPresentation.cmake65
-rw-r--r--Modules/FindosgProducer.cmake61
-rw-r--r--Modules/FindosgQt.cmake61
-rw-r--r--Modules/FindosgShadow.cmake61
-rw-r--r--Modules/FindosgSim.cmake61
-rw-r--r--Modules/FindosgTerrain.cmake61
-rw-r--r--Modules/FindosgText.cmake61
-rw-r--r--Modules/FindosgUtil.cmake61
-rw-r--r--Modules/FindosgViewer.cmake61
-rw-r--r--Modules/FindosgVolume.cmake61
-rw-r--r--Modules/FindosgWidget.cmake63
-rw-r--r--Modules/Findosg_functions.cmake23
-rw-r--r--Modules/FindwxWidgets.cmake251
-rw-r--r--Modules/FindwxWindows.cmake159
-rw-r--r--Modules/GNUInstallDirs.cmake253
-rw-r--r--Modules/GenerateExportHeader.cmake367
-rw-r--r--Modules/GetPrerequisites.cmake365
-rw-r--r--Modules/GoogleTestAddTests.cmake1
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake109
-rw-r--r--Modules/Internal/CMakeCheckCompilerFlag.cmake158
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake9
-rw-r--r--Modules/MacroAddFileDependencies.cmake27
-rw-r--r--Modules/Platform/Android/abi-common.cmake4
-rw-r--r--Modules/Platform/CYGWIN-GNU.cmake3
-rw-r--r--Modules/Platform/Darwin-Initialize.cmake8
-rw-r--r--Modules/Platform/Darwin.cmake10
-rw-r--r--Modules/Platform/DragonFly.cmake4
-rw-r--r--Modules/Platform/FreeBSD.cmake3
-rw-r--r--Modules/Platform/Fuchsia.cmake3
-rw-r--r--Modules/Platform/GHS-MULTI-Initialize.cmake8
-rw-r--r--Modules/Platform/Haiku.cmake1
-rw-r--r--Modules/Platform/IRIX.cmake53
-rw-r--r--Modules/Platform/IRIX64.cmake73
-rw-r--r--Modules/Platform/Linux-Intel.cmake6
-rw-r--r--Modules/Platform/Linux-PGI.cmake3
-rw-r--r--Modules/Platform/Linux.cmake1
-rw-r--r--Modules/Platform/NetBSD.cmake2
-rw-r--r--Modules/Platform/OpenBSD.cmake4
-rw-r--r--Modules/Platform/SINIX.cmake3
-rw-r--r--Modules/Platform/SunOS-GNU.cmake1
-rw-r--r--Modules/Platform/UNIX_SV.cmake3
-rw-r--r--Modules/Platform/UnixPaths.cmake25
-rw-r--r--Modules/Platform/UnixWare.cmake3
-rw-r--r--Modules/Platform/Windows-GNU.cmake3
-rw-r--r--Modules/Platform/Windows-Intel-C.cmake2
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake2
-rw-r--r--Modules/Platform/Windows-MSVC.cmake9
-rw-r--r--Modules/Platform/Windows-NVIDIA-CUDA.cmake6
-rw-r--r--Modules/Platform/iOS-Determine-CXX.cmake1
-rw-r--r--Modules/Platform/iOS-Initialize.cmake9
-rw-r--r--Modules/Platform/iOS.cmake1
-rw-r--r--Modules/Platform/tvOS-Determine-CXX.cmake1
-rw-r--r--Modules/Platform/tvOS-Initialize.cmake7
-rw-r--r--Modules/Platform/tvOS.cmake1
-rw-r--r--Modules/Platform/watchOS-Determine-CXX.cmake1
-rw-r--r--Modules/Platform/watchOS-Initialize.cmake7
-rw-r--r--Modules/Platform/watchOS.cmake1
-rw-r--r--Modules/ProcessorCount.cmake93
-rw-r--r--Modules/Qt4ConfigDependentSettings.cmake16
-rw-r--r--Modules/Qt4Macros.cmake15
-rw-r--r--Modules/SelectLibraryConfigurations.cmake61
-rw-r--r--Modules/SquishTestScript.cmake31
-rw-r--r--Modules/TestBigEndian.cmake25
-rw-r--r--Modules/TestCXXAcceptsFlag.cmake35
-rw-r--r--Modules/TestForANSIForScope.cmake25
-rw-r--r--Modules/TestForANSIStreamHeaders.cmake25
-rw-r--r--Modules/TestForSSTREAM.cmake23
-rw-r--r--Modules/TestForSTDNamespace.cmake23
-rw-r--r--Modules/UseEcos.cmake57
-rw-r--r--Modules/UseJava.cmake1161
-rw-r--r--Modules/UseJavaClassFilelist.cmake23
-rw-r--r--Modules/UseJavaSymlinks.cmake19
-rw-r--r--Modules/UsePkgConfig.cmake37
-rw-r--r--Modules/UseQt4.cmake19
-rw-r--r--Modules/UseSWIG.cmake58
-rw-r--r--Modules/Use_wxWindows.cmake61
-rw-r--r--Modules/UsewxWidgets.cmake71
-rw-r--r--Modules/WriteBasicConfigVersionFile.cmake37
-rw-r--r--Modules/WriteCompilerDetectionHeader.cmake460
-rw-r--r--README.rst11
-rw-r--r--Source/CMakeLists.txt35
-rw-r--r--Source/CMakeVersion.cmake4
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx4
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx7
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx8
-rw-r--r--Source/CPack/IFW/cmCPackIFWRepository.cxx2
-rw-r--r--Source/CPack/OSXScriptLauncher.cxx3
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h12
-rw-r--r--Source/CPack/cmCPack7zGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx21
-rw-r--r--Source/CPack/cmCPackBundleGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx60
-rw-r--r--Source/CPack/cmCPackDragNDropGenerator.cxx13
-rw-r--r--Source/CPack/cmCPackExternalGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackFreeBSDGenerator.cxx69
-rw-r--r--Source/CPack/cmCPackGenerator.cxx28
-rw-r--r--Source/CPack/cmCPackNSISGenerator.cxx12
-rw-r--r--Source/CPack/cmCPackOSXX11Generator.cxx10
-rw-r--r--Source/CPack/cmCPackPKGGenerator.cxx7
-rw-r--r--Source/CPack/cmCPackPackageMakerGenerator.cxx28
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx8
-rw-r--r--Source/CPack/cmCPackSTGZGenerator.cxx9
-rw-r--r--Source/CPack/cmCPackTGZGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackTXZGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackTarBZip2Generator.cxx4
-rw-r--r--Source/CPack/cmCPackTarCompressGenerator.cxx4
-rw-r--r--Source/CPack/cmCPackZIPGenerator.cxx4
-rw-r--r--Source/CPack/cpack.cxx35
-rw-r--r--Source/CTest/cmCTestBZR.cxx4
-rw-r--r--Source/CTest/cmCTestBuildAndTestHandler.cxx52
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx19
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx38
-rw-r--r--Source/CTest/cmCTestCVS.cxx8
-rw-r--r--Source/CTest/cmCTestConfigureHandler.cxx4
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx17
-rw-r--r--Source/CTest/cmCTestGIT.cxx21
-rw-r--r--Source/CTest/cmCTestGenericHandler.cxx4
-rw-r--r--Source/CTest/cmCTestGlobalVC.cxx4
-rw-r--r--Source/CTest/cmCTestHG.cxx7
-rw-r--r--Source/CTest/cmCTestHandlerCommand.cxx17
-rw-r--r--Source/CTest/cmCTestLaunch.cxx15
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx24
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx343
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h1
-rw-r--r--Source/CTest/cmCTestP4.cxx12
-rw-r--r--Source/CTest/cmCTestRunScriptCommand.cxx3
-rw-r--r--Source/CTest/cmCTestRunTest.h6
-rw-r--r--Source/CTest/cmCTestSVN.cxx14
-rw-r--r--Source/CTest/cmCTestSVN.h2
-rw-r--r--Source/CTest/cmCTestScriptHandler.cxx43
-rw-r--r--Source/CTest/cmCTestScriptHandler.h5
-rw-r--r--Source/CTest/cmCTestStartCommand.cxx2
-rw-r--r--Source/CTest/cmCTestSubmitCommand.cxx78
-rw-r--r--Source/CTest/cmCTestSubmitCommand.h2
-rw-r--r--Source/CTest/cmCTestSubmitHandler.cxx918
-rw-r--r--Source/CTest/cmCTestSubmitHandler.h27
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx85
-rw-r--r--Source/CTest/cmCTestTestHandler.h5
-rw-r--r--Source/CTest/cmCTestUpdateHandler.cxx4
-rw-r--r--Source/CTest/cmCTestUploadCommand.cxx4
-rw-r--r--Source/CTest/cmCTestVC.cxx8
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.cxx2
-rw-r--r--Source/CTest/cmParseCoberturaCoverage.cxx17
-rw-r--r--Source/CTest/cmParseDelphiCoverage.cxx4
-rw-r--r--Source/CTest/cmParseGTMCoverage.cxx9
-rw-r--r--Source/CTest/cmParseJacocoCoverage.cxx6
-rw-r--r--Source/CTest/cmParseMumpsCoverage.cxx5
-rw-r--r--Source/CTest/cmProcess.cxx6
-rw-r--r--Source/Checks/cm_cxx14_check.cpp9
-rw-r--r--Source/Checks/cm_cxx17_check.cpp11
-rw-r--r--Source/Checks/cm_cxx_features.cmake4
-rw-r--r--Source/CursesDialog/ccmake.cxx24
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.h7
-rw-r--r--Source/CursesDialog/cmCursesDummyWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesFilePathWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesForm.h5
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesLongMessageForm.h5
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx37
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h10
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesPathWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.h5
-rw-r--r--Source/CursesDialog/cmCursesWidget.h5
-rw-r--r--Source/LexerParser/cmCommandArgumentLexer.cxx6
-rw-r--r--Source/LexerParser/cmCommandArgumentLexer.in.l6
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.cxx8
-rw-r--r--Source/LexerParser/cmDependsJavaLexer.in.l8
-rw-r--r--Source/LexerParser/cmDependsJavaParser.cxx2
-rw-r--r--Source/LexerParser/cmDependsJavaParser.y2
-rw-r--r--Source/LexerParser/cmExprLexer.cxx8
-rw-r--r--Source/LexerParser/cmExprLexer.in.l8
-rw-r--r--Source/LexerParser/cmFortranLexer.cxx6
-rw-r--r--Source/LexerParser/cmFortranLexer.in.l6
-rw-r--r--Source/LexerParser/cmListFileLexer.c4
-rw-r--r--Source/LexerParser/cmListFileLexer.in.l4
-rw-r--r--Source/QtDialog/AddCacheEntry.cxx16
-rw-r--r--Source/QtDialog/CMakeLists.txt11
-rw-r--r--Source/QtDialog/CMakeSetup.cxx79
-rw-r--r--Source/QtDialog/CMakeSetup128.pngbin10944 -> 7981 bytes
-rw-r--r--Source/QtDialog/CMakeSetup32.pngbin2097 -> 1632 bytes
-rw-r--r--Source/QtDialog/CMakeSetup64.pngbin4676 -> 3566 bytes
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx25
-rw-r--r--Source/QtDialog/CMakeSetupDialog.h8
-rw-r--r--Source/QtDialog/Delete16.pngbin731 -> 538 bytes
-rw-r--r--Source/QtDialog/FirstConfigure.cxx96
-rw-r--r--Source/QtDialog/FirstConfigure.h9
-rw-r--r--Source/QtDialog/Plus16.pngbin358 -> 207 bytes
-rw-r--r--Source/QtDialog/QCMake.cxx73
-rw-r--r--Source/QtDialog/QCMake.h17
-rw-r--r--Source/QtDialog/QCMakeCacheView.cxx8
-rw-r--r--Source/QtDialog/QCMakeWidgets.cxx5
-rw-r--r--Source/QtDialog/QCMakeWidgets.h2
-rw-r--r--Source/cmAddCustomCommandCommand.cxx8
-rw-r--r--Source/cmAddCustomTargetCommand.cxx8
-rw-r--r--Source/cmAddDependenciesCommand.cxx6
-rw-r--r--Source/cmAddLibraryCommand.cxx8
-rw-r--r--Source/cmAddSubDirectoryCommand.cxx6
-rw-r--r--Source/cmAlgorithms.h18
-rw-r--r--Source/cmArchiveWrite.cxx4
-rw-r--r--Source/cmArchiveWrite.h8
-rw-r--r--Source/cmAuxSourceDirectoryCommand.cxx1
-rw-r--r--Source/cmBase32.cxx8
-rw-r--r--Source/cmBreakCommand.cxx14
-rw-r--r--Source/cmBuildCommand.cxx4
-rw-r--r--Source/cmCLocaleEnvironmentScope.h6
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx24
-rw-r--r--Source/cmCMakeMinimumRequired.cxx6
-rw-r--r--Source/cmCMakePolicyCommand.cxx37
-rw-r--r--Source/cmCMakePolicyCommand.h1
-rw-r--r--Source/cmCPackPropertiesGenerator.h6
-rw-r--r--Source/cmCPluginAPI.cxx29
-rw-r--r--Source/cmCTest.cxx186
-rw-r--r--Source/cmCTest.h54
-rw-r--r--Source/cmCacheManager.cxx35
-rw-r--r--Source/cmCacheManager.h10
-rw-r--r--Source/cmCallVisualStudioMacro.cxx4
-rw-r--r--Source/cmCommand.h14
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx25
-rw-r--r--Source/cmCommandArgumentParserHelper.h8
-rw-r--r--Source/cmCommandArgumentsHelper.h8
-rw-r--r--Source/cmCommonTargetGenerator.cxx6
-rw-r--r--Source/cmComputeComponentGraph.cxx8
-rw-r--r--Source/cmComputeLinkDepends.cxx14
-rw-r--r--Source/cmComputeLinkDepends.h20
-rw-r--r--Source/cmComputeLinkInformation.cxx52
-rw-r--r--Source/cmComputeLinkInformation.h17
-rw-r--r--Source/cmComputeTargetDepends.cxx70
-rw-r--r--Source/cmComputeTargetDepends.h3
-rw-r--r--Source/cmConditionEvaluator.cxx49
-rw-r--r--Source/cmConditionEvaluator.h21
-rw-r--r--Source/cmConfigure.cmake.h.in5
-rw-r--r--Source/cmConfigureFileCommand.cxx4
-rw-r--r--Source/cmConnection.cxx4
-rw-r--r--Source/cmConnection.h7
-rw-r--r--Source/cmContinueCommand.cxx6
-rw-r--r--Source/cmConvertMSBuildXMLToJSON.py19
-rw-r--r--Source/cmCoreTryCompile.cxx156
-rw-r--r--Source/cmCryptoHash.h5
-rw-r--r--Source/cmCurl.cxx14
-rw-r--r--Source/cmCustomCommand.cxx30
-rw-r--r--Source/cmCustomCommand.h24
-rw-r--r--Source/cmCustomCommandGenerator.cxx4
-rw-r--r--Source/cmCustomCommandGenerator.h4
-rw-r--r--Source/cmDefinitions.h13
-rw-r--r--Source/cmDepends.cxx28
-rw-r--r--Source/cmDepends.h24
-rw-r--r--Source/cmDependsC.cxx32
-rw-r--r--Source/cmDependsC.h17
-rw-r--r--Source/cmDependsFortran.cxx80
-rw-r--r--Source/cmDependsFortran.h26
-rw-r--r--Source/cmDependsJava.cxx11
-rw-r--r--Source/cmDependsJava.h7
-rw-r--r--Source/cmDependsJavaParserHelper.cxx4
-rw-r--r--Source/cmDisallowedCommand.cxx6
-rw-r--r--Source/cmDocumentation.cxx140
-rw-r--r--Source/cmDocumentation.h17
-rw-r--r--Source/cmDocumentationEntry.h3
-rw-r--r--Source/cmDocumentationFormatter.cxx13
-rw-r--r--Source/cmDocumentationFormatter.h4
-rw-r--r--Source/cmDocumentationSection.h2
-rw-r--r--Source/cmDynamicLoader.cxx4
-rw-r--r--Source/cmDynamicLoader.h6
-rw-r--r--Source/cmELF.cxx2
-rw-r--r--Source/cmELF.h2
-rw-r--r--Source/cmExecProgramCommand.cxx8
-rw-r--r--Source/cmExecuteProcessCommand.cxx18
-rw-r--r--Source/cmExecutionStatus.h16
-rw-r--r--Source/cmExpandedCommandArgument.cxx11
-rw-r--r--Source/cmExpandedCommandArgument.h4
-rw-r--r--Source/cmExportBuildAndroidMKGenerator.cxx4
-rw-r--r--Source/cmExportBuildFileGenerator.cxx8
-rw-r--r--Source/cmExportCommand.cxx10
-rw-r--r--Source/cmExportFileGenerator.cxx23
-rw-r--r--Source/cmExportFileGenerator.h2
-rw-r--r--Source/cmExportInstallFileGenerator.cxx23
-rw-r--r--Source/cmExportSet.h5
-rw-r--r--Source/cmExprParserHelper.cxx4
-rw-r--r--Source/cmExternalMakefileProjectGenerator.cxx13
-rw-r--r--Source/cmExternalMakefileProjectGenerator.h5
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx7
-rw-r--r--Source/cmExtraCodeLiteGenerator.cxx21
-rw-r--r--Source/cmExtraCodeLiteGenerator.h2
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx123
-rw-r--r--Source/cmExtraKateGenerator.cxx10
-rw-r--r--Source/cmExtraSublimeTextGenerator.cxx11
-rw-r--r--Source/cmFLTKWrapUICommand.cxx2
-rw-r--r--Source/cmFileAPI.cxx800
-rw-r--r--Source/cmFileAPI.h204
-rw-r--r--Source/cmFileAPICMakeFiles.cxx114
-rw-r--r--Source/cmFileAPICMakeFiles.h15
-rw-r--r--Source/cmFileAPICache.cxx106
-rw-r--r--Source/cmFileAPICache.h15
-rw-r--r--Source/cmFileAPICodemodel.cxx1247
-rw-r--r--Source/cmFileAPICodemodel.h15
-rw-r--r--Source/cmFileCommand.cxx260
-rw-r--r--Source/cmFileCommand.h3
-rw-r--r--Source/cmFileLock.h10
-rw-r--r--Source/cmFileLockPool.cxx8
-rw-r--r--Source/cmFileLockPool.h10
-rw-r--r--Source/cmFileLockUnix.cxx5
-rw-r--r--Source/cmFileLockWin32.cxx1
-rw-r--r--Source/cmFileMonitor.cxx6
-rw-r--r--Source/cmFileMonitor.h4
-rw-r--r--Source/cmFilePathChecksum.cxx4
-rw-r--r--Source/cmFileTimeComparison.cxx27
-rw-r--r--Source/cmFileTimeComparison.h7
-rw-r--r--Source/cmFindBase.cxx4
-rw-r--r--Source/cmFindCommon.cxx14
-rw-r--r--Source/cmFindLibraryCommand.cxx7
-rw-r--r--Source/cmFindPackageCommand.cxx145
-rw-r--r--Source/cmFindPackageCommand.h6
-rw-r--r--Source/cmFindProgramCommand.cxx2
-rw-r--r--Source/cmForEachCommand.cxx8
-rw-r--r--Source/cmFortranParser.h24
-rw-r--r--Source/cmFortranParserImpl.cxx34
-rw-r--r--Source/cmFunctionBlocker.h2
-rw-r--r--Source/cmFunctionCommand.cxx5
-rw-r--r--Source/cmFunctionCommand.h4
-rw-r--r--Source/cmGeneratedFileStream.cxx20
-rw-r--r--Source/cmGeneratedFileStream.h13
-rw-r--r--Source/cmGeneratorExpression.cxx28
-rw-r--r--Source/cmGeneratorExpression.h38
-rw-r--r--Source/cmGeneratorExpressionContext.cxx14
-rw-r--r--Source/cmGeneratorExpressionContext.h6
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx35
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h7
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx14
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.h2
-rw-r--r--Source/cmGeneratorExpressionEvaluator.h12
-rw-r--r--Source/cmGeneratorExpressionLexer.cxx10
-rw-r--r--Source/cmGeneratorExpressionLexer.h4
-rw-r--r--Source/cmGeneratorExpressionNode.cxx193
-rw-r--r--Source/cmGeneratorExpressionNode.h2
-rw-r--r--Source/cmGeneratorExpressionParser.cxx4
-rw-r--r--Source/cmGeneratorExpressionParser.h3
-rw-r--r--Source/cmGeneratorTarget.cxx627
-rw-r--r--Source/cmGeneratorTarget.h93
-rw-r--r--Source/cmGetDirectoryPropertyCommand.cxx4
-rw-r--r--Source/cmGetFilenameComponentCommand.cxx14
-rw-r--r--Source/cmGetPropertyCommand.cxx3
-rw-r--r--Source/cmGetTargetPropertyCommand.cxx8
-rw-r--r--Source/cmGhsMultiGpj.cxx31
-rw-r--r--Source/cmGhsMultiGpj.h6
-rw-r--r--Source/cmGhsMultiTargetGenerator.cxx809
-rw-r--r--Source/cmGhsMultiTargetGenerator.h102
-rw-r--r--Source/cmGlobVerificationManager.cxx5
-rw-r--r--Source/cmGlobVerificationManager.h17
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.cxx3
-rw-r--r--Source/cmGlobalBorlandMakefileGenerator.h2
-rw-r--r--Source/cmGlobalCommonGenerator.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx311
-rw-r--r--Source/cmGlobalGenerator.h76
-rw-r--r--Source/cmGlobalGeneratorFactory.h28
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx523
-rw-r--r--Source/cmGlobalGhsMultiGenerator.h128
-rw-r--r--Source/cmGlobalJOMMakefileGenerator.cxx3
-rw-r--r--Source/cmGlobalJOMMakefileGenerator.h2
-rw-r--r--Source/cmGlobalMSYSMakefileGenerator.cxx1
-rw-r--r--Source/cmGlobalMinGWMakefileGenerator.cxx1
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx3
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.h2
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx84
-rw-r--r--Source/cmGlobalNinjaGenerator.h14
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx98
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h8
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx381
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h41
-rw-r--r--Source/cmGlobalVisualStudio11Generator.cxx68
-rw-r--r--Source/cmGlobalVisualStudio11Generator.h10
-rw-r--r--Source/cmGlobalVisualStudio12Generator.cxx62
-rw-r--r--Source/cmGlobalVisualStudio12Generator.h14
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx72
-rw-r--r--Source/cmGlobalVisualStudio14Generator.h14
-rw-r--r--Source/cmGlobalVisualStudio15Generator.cxx298
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx19
-rw-r--r--Source/cmGlobalVisualStudio71Generator.h5
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx72
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h22
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx20
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h13
-rw-r--r--Source/cmGlobalVisualStudio9Generator.cxx41
-rw-r--r--Source/cmGlobalVisualStudio9Generator.h11
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx155
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h31
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx515
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.h (renamed from Source/cmGlobalVisualStudio15Generator.h)29
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.cxx2
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.h2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx202
-rw-r--r--Source/cmGlobalXCodeGenerator.h12
-rw-r--r--Source/cmGraphAdjacencyList.h9
-rw-r--r--Source/cmGraphVizWriter.cxx44
-rw-r--r--Source/cmGraphVizWriter.h4
-rw-r--r--Source/cmIDEFlagTable.h13
-rw-r--r--Source/cmIDEOptions.cxx14
-rw-r--r--Source/cmIDEOptions.h12
-rw-r--r--Source/cmIfCommand.cxx17
-rw-r--r--Source/cmIfCommand.h13
-rw-r--r--Source/cmIncludeCommand.cxx15
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx1
-rw-r--r--Source/cmIncludeExternalMSProjectCommand.cxx5
-rw-r--r--Source/cmInstallCommand.cxx432
-rw-r--r--Source/cmInstallCommand.h22
-rw-r--r--Source/cmInstallCommandArguments.cxx21
-rw-r--r--Source/cmInstallCommandArguments.h5
-rw-r--r--Source/cmInstallDirectoryGenerator.cxx4
-rw-r--r--Source/cmInstallExportAndroidMKGenerator.cxx2
-rw-r--r--Source/cmInstallExportGenerator.cxx6
-rw-r--r--Source/cmInstallFilesGenerator.cxx4
-rw-r--r--Source/cmInstallGenerator.cxx13
-rw-r--r--Source/cmInstallGenerator.h9
-rw-r--r--Source/cmInstallScriptGenerator.cxx72
-rw-r--r--Source/cmInstallScriptGenerator.h14
-rw-r--r--Source/cmInstallSubdirectoryGenerator.cxx75
-rw-r--r--Source/cmInstallSubdirectoryGenerator.h41
-rw-r--r--Source/cmInstallTargetGenerator.cxx59
-rw-r--r--Source/cmInstallTargetGenerator.h16
-rw-r--r--Source/cmInstalledFile.cxx9
-rw-r--r--Source/cmInstalledFile.h2
-rw-r--r--Source/cmJsonObjects.cxx32
-rw-r--r--Source/cmLinkDirectoriesCommand.cxx6
-rw-r--r--Source/cmLinkItem.cxx24
-rw-r--r--Source/cmLinkItem.h53
-rw-r--r--Source/cmLinkLineComputer.cxx10
-rw-r--r--Source/cmLinkLineComputer.h5
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx16
-rw-r--r--Source/cmLinkLineDeviceComputer.h12
-rw-r--r--Source/cmLinkedTree.h3
-rw-r--r--Source/cmListCommand.cxx79
-rw-r--r--Source/cmListFileCache.cxx53
-rw-r--r--Source/cmListFileCache.h74
-rw-r--r--Source/cmLocalCommonGenerator.cxx11
-rw-r--r--Source/cmLocalCommonGenerator.h2
-rw-r--r--Source/cmLocalGenerator.cxx494
-rw-r--r--Source/cmLocalGenerator.h83
-rw-r--r--Source/cmLocalGhsMultiGenerator.cxx81
-rw-r--r--Source/cmLocalGhsMultiGenerator.h11
-rw-r--r--Source/cmLocalNinjaGenerator.cxx49
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx166
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h55
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx1
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx31
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx7
-rw-r--r--Source/cmLocalXCodeGenerator.cxx4
-rw-r--r--Source/cmLocale.h6
-rw-r--r--Source/cmMSVC60LinkLineComputer.h6
-rw-r--r--Source/cmMachO.cxx12
-rw-r--r--Source/cmMachO.h2
-rw-r--r--Source/cmMacroCommand.cxx7
-rw-r--r--Source/cmMacroCommand.h4
-rw-r--r--Source/cmMakefile.cxx361
-rw-r--r--Source/cmMakefile.h58
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx12
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx27
-rw-r--r--Source/cmMakefileTargetGenerator.cxx44
-rw-r--r--Source/cmMathCommand.cxx4
-rw-r--r--Source/cmMessageCommand.cxx22
-rw-r--r--Source/cmMessageType.h21
-rw-r--r--Source/cmMessenger.cxx106
-rw-r--r--Source/cmMessenger.h50
-rw-r--r--Source/cmNewLineStyle.cxx5
-rw-r--r--Source/cmNewLineStyle.h2
-rw-r--r--Source/cmNinjaLinkLineComputer.h5
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx50
-rw-r--r--Source/cmNinjaTargetGenerator.cxx63
-rw-r--r--Source/cmNinjaUtilityTargetGenerator.cxx7
-rw-r--r--Source/cmOSXBundleGenerator.cxx5
-rw-r--r--Source/cmOSXBundleGenerator.h5
-rw-r--r--Source/cmOptionCommand.cxx4
-rw-r--r--Source/cmOrderDirectories.cxx9
-rw-r--r--Source/cmOutputConverter.cxx117
-rw-r--r--Source/cmOutputConverter.h23
-rw-r--r--Source/cmOutputRequiredFilesCommand.cxx18
-rw-r--r--Source/cmParseArgumentsCommand.cxx21
-rw-r--r--Source/cmPathLabel.cxx6
-rw-r--r--Source/cmPathLabel.h2
-rw-r--r--Source/cmPipeConnection.cxx6
-rw-r--r--Source/cmPipeConnection.h2
-rw-r--r--Source/cmPolicies.cxx16
-rw-r--r--Source/cmPolicies.h28
-rw-r--r--Source/cmProcessOutput.cxx4
-rw-r--r--Source/cmProcessTools.cxx7
-rw-r--r--Source/cmProcessTools.h8
-rw-r--r--Source/cmProjectCommand.cxx55
-rw-r--r--Source/cmQTWrapCPPCommand.cxx2
-rw-r--r--Source/cmQTWrapUICommand.cxx2
-rw-r--r--Source/cmQtAutoGen.cxx36
-rw-r--r--Source/cmQtAutoGen.h3
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx288
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.h53
-rw-r--r--Source/cmQtAutoGenInitializer.cxx977
-rw-r--r--Source/cmQtAutoGenInitializer.h81
-rw-r--r--Source/cmQtAutoGenerator.cxx12
-rw-r--r--Source/cmQtAutoGenerator.h7
-rw-r--r--Source/cmQtAutoGeneratorMocUic.cxx84
-rw-r--r--Source/cmQtAutoGeneratorMocUic.h52
-rw-r--r--Source/cmQtAutoGeneratorRcc.cxx19
-rw-r--r--Source/cmQtAutoGeneratorRcc.h16
-rw-r--r--Source/cmRST.cxx13
-rw-r--r--Source/cmRST.h2
-rw-r--r--Source/cmRulePlaceholderExpander.cxx28
-rw-r--r--Source/cmRulePlaceholderExpander.h8
-rw-r--r--Source/cmScriptGenerator.cxx15
-rw-r--r--Source/cmScriptGenerator.h16
-rw-r--r--Source/cmSearchPath.cxx4
-rw-r--r--Source/cmServer.cxx30
-rw-r--r--Source/cmServer.h12
-rw-r--r--Source/cmServerConnection.cxx6
-rw-r--r--Source/cmServerProtocol.cxx46
-rw-r--r--Source/cmServerProtocol.h20
-rw-r--r--Source/cmSetCommand.cxx27
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.cxx16
-rw-r--r--Source/cmSiteNameCommand.cxx12
-rw-r--r--Source/cmSourceFile.cxx149
-rw-r--r--Source/cmSourceFile.h12
-rw-r--r--Source/cmSourceFileLocation.cxx20
-rw-r--r--Source/cmSourceFileLocation.h15
-rw-r--r--Source/cmSourceGroup.cxx6
-rw-r--r--Source/cmSourceGroup.h2
-rw-r--r--Source/cmSourceGroupCommand.cxx26
-rw-r--r--Source/cmState.cxx80
-rw-r--r--Source/cmState.h38
-rw-r--r--Source/cmStateDirectory.cxx26
-rw-r--r--Source/cmStateDirectory.h6
-rw-r--r--Source/cmStatePrivate.h3
-rw-r--r--Source/cmStateSnapshot.cxx11
-rw-r--r--Source/cmStateSnapshot.h1
-rw-r--r--Source/cmString.cxx152
-rw-r--r--Source/cmString.hxx815
-rw-r--r--Source/cmStringCommand.cxx7
-rw-r--r--Source/cmStringReplaceHelper.cxx17
-rw-r--r--Source/cmStringReplaceHelper.h11
-rw-r--r--Source/cmSystemTools.cxx265
-rw-r--r--Source/cmSystemTools.h73
-rw-r--r--Source/cmTarget.cxx124
-rw-r--r--Source/cmTarget.h21
-rw-r--r--Source/cmTargetCompileDefinitionsCommand.cxx4
-rw-r--r--Source/cmTargetCompileFeaturesCommand.cxx4
-rw-r--r--Source/cmTargetCompileOptionsCommand.cxx4
-rw-r--r--Source/cmTargetDepend.h6
-rw-r--r--Source/cmTargetIncludeDirectoriesCommand.cxx4
-rw-r--r--Source/cmTargetLinkDirectoriesCommand.cxx4
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx68
-rw-r--r--Source/cmTargetLinkOptionsCommand.cxx4
-rw-r--r--Source/cmTargetPropCommandBase.cxx25
-rw-r--r--Source/cmTargetPropertyComputer.cxx11
-rw-r--r--Source/cmTargetSourcesCommand.cxx8
-rw-r--r--Source/cmTest.cxx4
-rw-r--r--Source/cmTestGenerator.cxx62
-rw-r--r--Source/cmTestGenerator.h8
-rw-r--r--Source/cmTimestamp.h8
-rw-r--r--Source/cmTryCompileCommand.cxx3
-rw-r--r--Source/cmTryRunCommand.cxx16
-rw-r--r--Source/cmUVHandlePtr.h46
-rw-r--r--Source/cmUnexpectedCommand.h5
-rw-r--r--Source/cmUseMangledMesaCommand.cxx2
-rw-r--r--Source/cmUtilitySourceCommand.cxx2
-rw-r--r--Source/cmVS10CLFlagTable.h205
-rw-r--r--Source/cmVS10CSharpFlagTable.h121
-rw-r--r--Source/cmVS10CudaFlagTable.h54
-rw-r--r--Source/cmVS10CudaHostFlagTable.h35
-rw-r--r--Source/cmVS10LibFlagTable.h76
-rw-r--r--Source/cmVS10LinkFlagTable.h247
-rw-r--r--Source/cmVS10MASMFlagTable.h76
-rw-r--r--Source/cmVS10NASMFlagTable.h50
-rw-r--r--Source/cmVS10RCFlagTable.h7
-rw-r--r--Source/cmVS11CLFlagTable.h220
-rw-r--r--Source/cmVS11CSharpFlagTable.h121
-rw-r--r--Source/cmVS11LibFlagTable.h76
-rw-r--r--Source/cmVS11LinkFlagTable.h272
-rw-r--r--Source/cmVS11MASMFlagTable.h76
-rw-r--r--Source/cmVS11RCFlagTable.h7
-rw-r--r--Source/cmVS12CLFlagTable.h222
-rw-r--r--Source/cmVS12CSharpFlagTable.h121
-rw-r--r--Source/cmVS12LibFlagTable.h76
-rw-r--r--Source/cmVS12LinkFlagTable.h272
-rw-r--r--Source/cmVS12MASMFlagTable.h76
-rw-r--r--Source/cmVS12RCFlagTable.h7
-rw-r--r--Source/cmVS140CLFlagTable.h240
-rw-r--r--Source/cmVS140CSharpFlagTable.h121
-rw-r--r--Source/cmVS140LinkFlagTable.h285
-rw-r--r--Source/cmVS141CLFlagTable.h258
-rw-r--r--Source/cmVS141CSharpFlagTable.h126
-rw-r--r--Source/cmVS141LinkFlagTable.h287
-rw-r--r--Source/cmVS14LibFlagTable.h77
-rw-r--r--Source/cmVS14MASMFlagTable.h76
-rw-r--r--Source/cmVS14RCFlagTable.h7
-rw-r--r--Source/cmVSSetupHelper.cxx53
-rw-r--r--Source/cmVSSetupHelper.h9
-rw-r--r--Source/cmVariableRequiresCommand.cxx2
-rw-r--r--Source/cmVariableWatch.cxx8
-rw-r--r--Source/cmVariableWatch.h12
-rw-r--r--Source/cmVariableWatchCommand.cxx9
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx320
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h11
-rw-r--r--Source/cmVisualStudio10ToolsetOptions.cxx128
-rw-r--r--Source/cmVisualStudio10ToolsetOptions.h28
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx3
-rw-r--r--Source/cmVisualStudioSlnParser.cxx6
-rw-r--r--Source/cmWhileCommand.cxx8
-rw-r--r--Source/cmWriteFileCommand.cxx2
-rw-r--r--Source/cmXCodeScheme.cxx9
-rw-r--r--Source/cmXCodeScheme.h2
-rw-r--r--Source/cmXMLWriter.h5
-rw-r--r--Source/cm_codecvt.cxx4
-rw-r--r--Source/cm_static_string_view.hxx41
-rw-r--r--Source/cm_string_view.cxx301
-rw-r--r--Source/cm_string_view.hxx217
-rw-r--r--Source/cm_thread.hxx12
-rw-r--r--Source/cmake.cxx291
-rw-r--r--Source/cmake.h69
-rw-r--r--Source/cmakemain.cxx147
-rw-r--r--Source/cmcldeps.cxx2
-rw-r--r--Source/cmcmd.cxx136
-rwxr-xr-xSource/cmparseMSBuildXML.py341
-rw-r--r--Source/ctest.cxx9
-rw-r--r--Source/kwsys/CMakeLists.txt34
-rw-r--r--Source/kwsys/ProcessUNIX.c2
-rw-r--r--Source/kwsys/SystemInformation.cxx6
-rw-r--r--Source/kwsys/SystemTools.cxx277
-rw-r--r--Source/kwsys/SystemTools.hxx.in7
-rw-r--r--Source/kwsys/kwsysPlatformTests.cmake5
-rw-r--r--Source/kwsys/testCommandLineArguments.cxx35
-rw-r--r--Source/kwsys/testSystemTools.cxx46
-rw-r--r--Templates/MSBuild/FlagTables/v10_CL.json981
-rw-r--r--Templates/MSBuild/FlagTables/v10_CSharp.json574
-rw-r--r--Templates/MSBuild/FlagTables/v10_Cuda.json224
-rw-r--r--Templates/MSBuild/FlagTables/v10_CudaHost.json149
-rw-r--r--Templates/MSBuild/FlagTables/v10_LIB.json297
-rw-r--r--Templates/MSBuild/FlagTables/v10_Link.json1137
-rw-r--r--Templates/MSBuild/FlagTables/v10_MASM.json295
-rw-r--r--Templates/MSBuild/FlagTables/v10_NASM.json201
-rw-r--r--Templates/MSBuild/FlagTables/v10_RC.json69
-rw-r--r--Templates/MSBuild/FlagTables/v11_CL.json1063
-rw-r--r--Templates/MSBuild/FlagTables/v11_CSharp.json574
-rw-r--r--Templates/MSBuild/FlagTables/v11_LIB.json297
-rw-r--r--Templates/MSBuild/FlagTables/v11_Link.json1272
-rw-r--r--Templates/MSBuild/FlagTables/v11_MASM.json295
-rw-r--r--Templates/MSBuild/FlagTables/v11_RC.json69
-rw-r--r--Templates/MSBuild/FlagTables/v12_CL.json1077
-rw-r--r--Templates/MSBuild/FlagTables/v12_CSharp.json574
-rw-r--r--Templates/MSBuild/FlagTables/v12_LIB.json297
-rw-r--r--Templates/MSBuild/FlagTables/v12_Link.json1272
-rw-r--r--Templates/MSBuild/FlagTables/v12_MASM.json295
-rw-r--r--Templates/MSBuild/FlagTables/v12_RC.json69
-rw-r--r--Templates/MSBuild/FlagTables/v140_CL.json1184
-rw-r--r--Templates/MSBuild/FlagTables/v140_CSharp.json574
-rw-r--r--Templates/MSBuild/FlagTables/v140_Link.json1316
-rw-r--r--Templates/MSBuild/FlagTables/v141_CL.json1268
-rw-r--r--Templates/MSBuild/FlagTables/v141_CSharp.json574
-rw-r--r--Templates/MSBuild/FlagTables/v141_Link.json1323
-rw-r--r--Templates/MSBuild/FlagTables/v142_CL.json1212
-rw-r--r--Templates/MSBuild/FlagTables/v142_Link.json1323
-rw-r--r--Templates/MSBuild/FlagTables/v14_LIB.json304
-rw-r--r--Templates/MSBuild/FlagTables/v14_MASM.json295
-rw-r--r--Templates/MSBuild/FlagTables/v14_RC.json69
-rw-r--r--Templates/Windows/ApplicationIcon.pngbin3392 -> 2335 bytes
-rw-r--r--Templates/Windows/Logo.pngbin801 -> 488 bytes
-rw-r--r--Templates/Windows/SmallLogo.pngbin329 -> 167 bytes
-rw-r--r--Templates/Windows/SmallLogo44x44.pngbin554 -> 265 bytes
-rw-r--r--Templates/Windows/SplashScreen.pngbin2146 -> 909 bytes
-rw-r--r--Templates/Windows/StoreLogo.pngbin429 -> 227 bytes
-rw-r--r--Tests/CMakeCommands/target_link_libraries/CMakeLists.txt4
-rw-r--r--Tests/CMakeCommands/target_link_libraries/SubDirC/CMakeLists.txt9
-rw-r--r--Tests/CMakeCommands/target_link_libraries/SubDirC/SubDirC.c11
-rw-r--r--Tests/CMakeCommands/target_link_libraries/TopDir.c6
-rw-r--r--Tests/CMakeLib/CMakeLists.txt1
-rw-r--r--Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in6
-rw-r--r--Tests/CMakeLib/testString.cxx1347
-rw-r--r--Tests/CMakeLib/testSystemTools.cxx12
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx2
-rw-r--r--Tests/CMakeLists.txt311
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt2
-rw-r--r--Tests/CMakeTests/FileDownloadInput.pngbin358 -> 194 bytes
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in16
-rw-r--r--Tests/CMakeTests/FileUploadTest.cmake.in4
-rw-r--r--Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in72
-rw-r--r--Tests/CMakeTests/StringTest.cmake.in2
-rw-r--r--Tests/CMakeTests/StringTestScript.cmake25
-rw-r--r--Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in1
-rw-r--r--Tests/CTestConfig/script.cmake.in1
-rw-r--r--Tests/CTestCoverageCollectGCOV/test.cmake.in1
-rw-r--r--Tests/CTestTestBadExe/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestBadGenerator/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestCostSerial/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestCrash/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestCycle/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestDepends/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestFailure/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestFdSetSize/CTestConfig.cmake1
-rw-r--r--Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestParallel/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestResourceLock/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestScheduler/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestSkipReturnCode/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestStopTime/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestSubdir/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestTimeout/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestUpload/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestVerboseOutput/CTestConfig.cmake3
-rw-r--r--Tests/CTestTestZeroTimeout/CTestConfig.cmake3
-rw-r--r--Tests/CTestUpdateCommon.cmake1
-rw-r--r--Tests/CompileOptions/CMakeLists.txt17
-rw-r--r--Tests/CompileOptions/main.cpp15
-rw-r--r--Tests/CudaOnly/CMakeLists.txt11
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt50
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu69
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/main.cu7
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake14
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt1
-rw-r--r--Tests/ExternalProject/CMakeLists.txt18
-rw-r--r--Tests/ExternalProjectLocal/CMakeLists.txt130
-rw-r--r--Tests/ExternalProjectLocal/Step5/CMakeLists.txt71
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt17
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx32
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx40
-rw-r--r--Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in8
-rw-r--r--Tests/ExternalProjectLocal/Step5/tutorial.cxx33
-rw-r--r--Tests/ExternalProjectSourceSubdirNotCMake/CMakeLists.txt20
-rw-r--r--Tests/ExternalProjectSourceSubdirNotCMake/Example/subdir/Makefile2
-rw-r--r--Tests/FindBoost/Test/CMakeLists.txt3
-rw-r--r--Tests/FindBoost/Test/main.cxx17
-rw-r--r--Tests/FindCURL/Test/CMakeLists.txt2
-rw-r--r--Tests/FindFontconfig/CMakeLists.txt10
-rw-r--r--Tests/FindFontconfig/Test/CMakeLists.txt16
-rw-r--r--Tests/FindFontconfig/Test/main.c17
-rw-r--r--Tests/FindGDAL/CMakeLists.txt10
-rw-r--r--Tests/FindGDAL/Test/CMakeLists.txt16
-rw-r--r--Tests/FindGDAL/Test/main.c11
-rw-r--r--Tests/FindGIF/CMakeLists.txt10
-rw-r--r--Tests/FindGIF/Test/CMakeLists.txt16
-rw-r--r--Tests/FindGIF/Test/main.c35
-rw-r--r--Tests/FindGit/CMakeLists.txt10
-rw-r--r--Tests/FindGit/Test/CMakeLists.txt13
-rw-r--r--Tests/FindGit/Test/RunGit.cmake20
-rw-r--r--Tests/FindJPEG/Test/CMakeLists.txt2
-rw-r--r--Tests/FindJPEG/Test/main.c2
-rw-r--r--Tests/FindLibLZMA/CMakeLists.txt10
-rw-r--r--Tests/FindLibLZMA/Test/CMakeLists.txt14
-rw-r--r--Tests/FindLibLZMA/Test/main.c15
-rw-r--r--Tests/FindLibinput/CMakeLists.txt10
-rw-r--r--Tests/FindLibinput/Test/CMakeLists.txt14
-rw-r--r--Tests/FindLibinput/Test/main.c13
-rw-r--r--Tests/FindMatlab/basic_checks/CMakeLists.txt5
-rw-r--r--Tests/FindMatlab/cmake_matlab_unit_tests4.m28
-rw-r--r--Tests/FindMatlab/cmake_matlab_unit_tests5.m20
-rw-r--r--Tests/FindMatlab/components_checks/CMakeLists.txt4
-rw-r--r--Tests/FindMatlab/failure_reports/CMakeLists.txt5
-rw-r--r--Tests/FindMatlab/matlab_wrapper2.cpp22
-rw-r--r--Tests/FindMatlab/matlab_wrapper3.cpp29
-rw-r--r--Tests/FindMatlab/r2018a_check/CMakeLists.txt84
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt937
-rw-r--r--Tests/FindPackageTest/cmake/SetFoundResolvedConfig.cmake1
-rw-r--r--Tests/FindPostgreSQL/CMakeLists.txt10
-rw-r--r--Tests/FindPostgreSQL/Test/CMakeLists.txt16
-rw-r--r--Tests/FindPostgreSQL/Test/main.c15
-rw-r--r--Tests/FindPython/CMakeLists.txt151
-rw-r--r--Tests/FindPython/FindPythonScript.cmake1
-rw-r--r--Tests/FindPython/NumPy/CMakeLists.txt22
-rw-r--r--Tests/FindPython/NumPy/arraytest.c58
-rw-r--r--Tests/FindPython/NumPyOnly/CMakeLists.txt14
-rw-r--r--Tests/FindPython/Python/CMakeLists.txt12
-rw-r--r--Tests/FindPython/Python2/CMakeLists.txt12
-rw-r--r--Tests/FindPython/Python3/CMakeLists.txt12
-rw-r--r--Tests/FindSQLite3/CMakeLists.txt10
-rw-r--r--Tests/FindSQLite3/Test/CMakeLists.txt16
-rw-r--r--Tests/FindSQLite3/Test/main.c10
-rw-r--r--Tests/FindThreads/C-only/CMakeLists.txt1
-rw-r--r--Tests/FindThreads/CXX-only/CMakeLists.txt1
-rw-r--r--Tests/FindX11/CMakeLists.txt10
-rw-r--r--Tests/FindX11/Test/CMakeLists.txt89
-rw-r--r--Tests/FindX11/Test/main.c405
-rw-r--r--Tests/Fortran/CMakeLists.txt5
-rw-r--r--Tests/FortranOnly/CMakeLists.txt19
-rw-r--r--Tests/FortranOnly/testRC.rc0
-rw-r--r--Tests/GhsMulti/CMakeLists.txt4
-rw-r--r--Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt92
-rw-r--r--Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in32
-rw-r--r--Tests/GhsMulti/GhsMultiCompilerOptions/test.c4
-rw-r--r--Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt30
-rw-r--r--Tests/GhsMulti/GhsMultiCopyFile/test.c4
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt (renamed from Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt)8
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/main.c (renamed from Tests/GhsMultiDuplicateSourceFilenames/main.c)4
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c (renamed from Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c)1
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c4
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c (renamed from Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c)1
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c (renamed from Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c)1
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c (renamed from Tests/GhsMultiDuplicateSourceFilenames/test.c)1
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c4
-rw-r--r--Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt17
-rw-r--r--Tests/GhsMulti/GhsMultiExclude/exe1.c4
-rw-r--r--Tests/GhsMulti/GhsMultiExclude/lib1.c4
-rw-r--r--Tests/GhsMulti/GhsMultiExclude/verify.cmake54
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt19
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c5
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c4
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt (renamed from Tests/GhsMulti/ReturnNum/App/CMakeLists.txt)2
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c (renamed from Tests/GhsMulti/ReturnNum/App/Main.c)0
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt (renamed from Tests/GhsMulti/ReturnNum/CMakeLists.txt)3
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int (renamed from Tests/GhsMulti/ReturnNum/Int/AppDD.int)2
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt1
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt1
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c (renamed from Tests/GhsMulti/ReturnNum/Lib/HelperFun.c)0
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h (renamed from Tests/GhsMulti/ReturnNum/Lib/HelperFun.h)0
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt20
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c5
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c5
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c15
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int8
-rw-r--r--Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt8
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt92
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in43
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/exe1.c6
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/exe1.h6
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/func2.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/func3.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/func4.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/func5.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/func6.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTest/func7.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt9
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt12
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c6
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h6
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt7
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c4
-rw-r--r--Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c4
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt17
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c5
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c4
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt10
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c6
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/sub/lib2.c4
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt10
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c6
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c4
-rw-r--r--Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake58
-rw-r--r--Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt13
-rw-r--r--Tests/GhsMulti/GhsMultiObjectLibrary/exe.c8
-rw-r--r--Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c4
-rw-r--r--Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c4
-rw-r--r--Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h1
-rw-r--r--Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c4
-rw-r--r--Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt34
-rw-r--r--Tests/GhsMulti/GhsMultiPlatform/file1.c4
-rw-r--r--Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt42
-rw-r--r--Tests/GhsMulti/GhsMultiRenameInstall/exe.c4
-rw-r--r--Tests/GhsMulti/GhsMultiRenameInstall/exe1.c5
-rw-r--r--Tests/GhsMulti/GhsMultiRenameInstall/lib1.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt45
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule1
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/object.o1
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf0
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/s2.h6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/s4.h6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/s5.h6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/standard.h1
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test1.c6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test1.h6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test2a.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test3.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test3.h1
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test4.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test5.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test6.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/test7.c4
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c11
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h6
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt1
-rw-r--r--Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt1
-rw-r--r--Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt12
-rw-r--r--Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c4
-rw-r--r--Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt1
-rw-r--r--Tests/GhsMulti/ReturnNum/Int/Default.bsp35
-rw-r--r--Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt1
-rw-r--r--Tests/InterfaceLibrary/CMakeLists.txt2
-rw-r--r--Tests/InterfaceLibrary/excluded/CMakeLists.txt1
-rw-r--r--Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m3
-rw-r--r--Tests/MumpsCoverage/ZZCOVTST.cmcov63
-rw-r--r--Tests/MumpsCoverage/ZZCOVTST.mcov3
-rw-r--r--Tests/Qt4Autogen/CMakeLists.txt2
-rw-r--r--Tests/Qt5Autogen/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/AutogenCoreTest.cmake55
-rw-r--r--Tests/QtAutogen/AutogenGuiTest.cmake (renamed from Tests/QtAutogen/AutogenTest.cmake)8
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt71
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/a_mc.hpp.in9
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp28
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp25
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/b_mc.cpp.in9
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/b_mc.hpp9
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp28
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp25
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/config.hpp.in8
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/configure_content.cmake10
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/main.cpp15
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt (renamed from Tests/QtAutogen/MocDepends/CMakeLists.txt)52
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/object_invalid.hpp.in (renamed from Tests/QtAutogen/MocDepends/object_invalid.hpp.in)0
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/object_valid.hpp.in (renamed from Tests/QtAutogen/MocDepends/object_valid.hpp.in)0
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.cpp.in (renamed from Tests/QtAutogen/MocDepends/simpleLib.cpp.in)0
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.hpp.in (renamed from Tests/QtAutogen/MocDepends/simpleLib.hpp.in)0
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/testGenFile.cpp (renamed from Tests/QtAutogen/MocDepends/testGenFile.cpp)0
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.cpp (renamed from Tests/QtAutogen/MocDepends/testGenLib.cpp)0
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp (renamed from Tests/QtAutogen/MocDepends/testGenLib.hpp)0
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/testGenTarget.cpp (renamed from Tests/QtAutogen/MocDepends/testGenTarget.cpp)0
-rw-r--r--Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt54
-rw-r--r--Tests/QtAutogen/AutogenTargetDepends/object_invalid.hpp.in1
-rw-r--r--Tests/QtAutogen/AutogenTargetDepends/object_valid.hpp.in14
-rw-r--r--Tests/QtAutogen/AutogenTargetDepends/testATDFile.cpp (renamed from Tests/QtAutogen/MocDepends/testATDFile.cpp)0
-rw-r--r--Tests/QtAutogen/AutogenTargetDepends/testATDTarget.cpp (renamed from Tests/QtAutogen/MocDepends/testATDTarget.cpp)0
-rw-r--r--Tests/QtAutogen/Complex/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt123
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt28
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc5
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/item.cpp20
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/item.hpp15
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp15
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp6
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp6
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt5
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp6
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp6
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt5
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp6
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp6
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/GAT/view.ui24
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MacOsFW/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocCMP0071/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocMacroName/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocOnly/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/MocOnly/main.cpp6
-rw-r--r--Tests/QtAutogen/MocOptions/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocOsMacros/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/MocOsMacros/TestClass.cpp5
-rw-r--r--Tests/QtAutogen/MocOsMacros/TestClass.hpp5
-rw-r--r--Tests/QtAutogen/MocSkipSource/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/ObjectLibrary/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel1/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel2/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel3/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Parallel4/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/ParallelAUTO/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RccEmpty/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RccOnly/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RccSkipSource/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunMocBasic/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunRccDepends/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/SameName/CMakeLists.txt6
-rw-r--r--Tests/QtAutogen/SameName/main.cpp13
-rw-r--r--Tests/QtAutogen/SameName/object.h13
-rw-r--r--Tests/QtAutogen/SameName/object.h++13
-rw-r--r--Tests/QtAutogen/SameName/object.hpp13
-rw-r--r--Tests/QtAutogen/SameName/object.hxx13
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/Tests.cmake (renamed from Tests/QtAutogen/CommonTests.cmake)65
-rw-r--r--Tests/QtAutogen/UicInclude/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/UicInterface/CMakeLists.txt6
-rw-r--r--Tests/QtAutogen/UicNoGui/CMakeLists.txt16
-rw-r--r--Tests/QtAutogen/UicNoGui/MocOnly/CMakeLists.txt3
-rw-r--r--Tests/QtAutogen/UicNoGui/MocOnly/main.cpp15
-rw-r--r--Tests/QtAutogen/UicNoGui/NoQt/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/UicNoGui/NoQt/main.cpp4
-rw-r--r--Tests/QtAutogen/UicNoGui/main.cpp9
-rw-r--r--Tests/QtAutogen/UicOnly/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/UicSkipSource/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/Autogen/NoQt-stderr.txt4
-rw-r--r--Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt4
-rw-r--r--Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt12
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt4
-rw-r--r--Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt4
-rw-r--r--Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMakeLists.txt100
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/BuildAndTest/CMakeLists.txt10
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt.in4
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/FindDummyPackage.cmake8
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/Project.cmake10
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/Script.cmake6
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/sub/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CMakeRoleGlobalProperty/test.cmake.in7
-rw-r--r--Tests/RunCMake/CPack/CPackTestHelpers.cmake35
-rw-r--r--Tests/RunCMake/CPack/RPM/default_expected_stderr.txt2
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake54
-rw-r--r--Tests/RunCMake/CPack/tests/CUSTOM_BINARY_SPEC_FILE/RPM-COMPONENT-stderr.txt2
-rw-r--r--Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake5
-rw-r--r--Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt2
-rw-r--r--Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake35
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_bad-result.txt (renamed from Tests/RunCMake/list/FILTER-NotList-result.txt)0
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_bad-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_human-stdout.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_json-v1-check.cmake1
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py106
-rw-r--r--Tests/RunCMake/CTestCommandLine/show_only_json_check.py24
-rw-r--r--Tests/RunCMake/CTestCommandLine/show_only_json_check.pycbin0 -> 1829 bytes
-rw-r--r--Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-result.txt (renamed from Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-good-number-stderr.txt (renamed from Tests/RunCMake/CommandLine/BuildDir--build--parallel-good-number-trailing-stderr.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-good-number-trailing--target-stderr.txt (renamed from Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-number-trailing-stderr.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-result.txt (renamed from Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-good-number-stderr.txt (renamed from Tests/RunCMake/CommandLine/BuildDir--build-jobs-good-number-trailing-stderr.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-good-number-trailing--target-stderr.txt (renamed from Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-number-trailing-stderr.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-different-eol-result.txt (renamed from Tests/RunCMake/list/REVERSE-NotList-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-result.txt (renamed from Tests/RunCMake/list/SORT-NotList-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/Wdev-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/Werror_dev-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/crlf1
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/empty10
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/empty20
-rw-r--r--Tests/RunCMake/CommandLine/compare_files/lf1
-rw-r--r--Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt53
-rw-r--r--Tests/RunCMake/CommandLine/warn-uninitialized.cmake18
-rw-r--r--Tests/RunCMake/Cppcheck/C-bad-Build-result.txt2
-rw-r--r--Tests/RunCMake/Cppcheck/C-error-Build-result.txt1
-rw-r--r--Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/Cppcheck/C-error.cmake3
-rw-r--r--Tests/RunCMake/Cppcheck/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake6
-rw-r--r--Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadOption1-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadOption2-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadSeries1-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadSeries2-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/BadSeries3-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/Directory1-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/Directory2-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/Directory3-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/Directory4-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/Directory5-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/MissingData-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt4
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt8
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake20
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt1
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt7
-rw-r--r--Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake21
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/FetchContent/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt2
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailable.cmake20
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt4
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake12
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt1
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt1
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake3
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/FetchContent/UsesTerminalOverride-stdout.txt2
-rw-r--r--Tests/RunCMake/FetchContent/UsesTerminalOverride.cmake17
-rw-r--r--Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateful-check.cmake68
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateful-check.py258
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateful-prep.cmake73
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateful.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateless-check.cmake15
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateless-check.py26
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateless-prep.cmake5
-rw-r--r--Tests/RunCMake/FileAPI/ClientStateless.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake20
-rw-r--r--Tests/RunCMake/FileAPI/DuplicateStateless-check.py31
-rw-r--r--Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake10
-rw-r--r--Tests/RunCMake/FileAPI/DuplicateStateless.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/Empty-check.cmake8
-rw-r--r--Tests/RunCMake/FileAPI/Empty-check.py15
-rw-r--r--Tests/RunCMake/FileAPI/Empty-prep.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/Empty.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/EmptyClient-check.cmake9
-rw-r--r--Tests/RunCMake/FileAPI/EmptyClient-check.py20
-rw-r--r--Tests/RunCMake/FileAPI/EmptyClient-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/EmptyClient.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/MixedStateless-check.cmake16
-rw-r--r--Tests/RunCMake/FileAPI/MixedStateless-check.py27
-rw-r--r--Tests/RunCMake/FileAPI/MixedStateless-prep.cmake6
-rw-r--r--Tests/RunCMake/FileAPI/MixedStateless.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/Nothing-check.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/Nothing-prep.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/Nothing.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/RunCMakeTest.cmake58
-rw-r--r--Tests/RunCMake/FileAPI/SharedStateless-check.cmake15
-rw-r--r--Tests/RunCMake/FileAPI/SharedStateless-check.py22
-rw-r--r--Tests/RunCMake/FileAPI/SharedStateless-prep.cmake6
-rw-r--r--Tests/RunCMake/FileAPI/SharedStateless.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/Stale-check.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/Stale-prep.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/Stale.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/alias/CMakeLists.txt10
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake10
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2-check.py134
-rw-r--r--Tests/RunCMake/FileAPI/cache-v2.cmake14
-rw-r--r--Tests/RunCMake/FileAPI/check_index.py163
-rw-r--r--Tests/RunCMake/FileAPI/check_index.pycbin0 -> 8146 bytes
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake10
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py94
-rw-r--r--Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake8
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake12
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake12
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py5085
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2.cmake35
-rw-r--r--Tests/RunCMake/FileAPI/custom/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FileAPI/cxx/CMakeLists.txt15
-rw-r--r--Tests/RunCMake/FileAPI/dir/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt0
-rw-r--r--Tests/RunCMake/FileAPI/dir/dirtest.cmake0
-rw-r--r--Tests/RunCMake/FileAPI/empty.c0
-rw-r--r--Tests/RunCMake/FileAPI/empty.cxx0
-rw-r--r--Tests/RunCMake/FileAPI/imported/CMakeLists.txt24
-rw-r--r--Tests/RunCMake/FileAPI/include_test.cmake9
-rw-r--r--Tests/RunCMake/FileAPI/object/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/FileAPIDummyFile.cmake0
-rw-r--r--Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt12
-rw-r--r--Tests/RunCMake/FileAPIExternalSource/empty.c0
-rw-r--r--Tests/RunCMake/FindBoost/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt7
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Opt-FreeBSD-stderr.txt30
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Root-FreeBSD-stderr.txt30
-rw-r--r--Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/GNUInstallDirs/Usr-FreeBSD-stderr.txt30
-rw-r--r--Tests/RunCMake/GNUInstallDirs/UsrLocal-FreeBSD-stderr.txt30
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt33
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt6
-rw-r--r--Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake3
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake13
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt (renamed from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt)0
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake (renamed from Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake)0
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake2
-rw-r--r--Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt3
-rw-r--r--Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake19
-rw-r--r--Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake1
-rwxr-xr-xTests/RunCMake/GetPrerequisites/script3
-rwxr-xr-xTests/RunCMake/GetPrerequisites/script.bat3
-rwxr-xr-xTests/RunCMake/GetPrerequisites/script.sh3
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/Make/VerboseBuild-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt1
-rw-r--r--Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt1
-rw-r--r--Tests/RunCMake/Make/VerboseBuild.cmake8
-rw-r--r--Tests/RunCMake/Make/hello.c7
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake3
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake3
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake49
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt10
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake2
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-result.txt (renamed from Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt)0
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-result.txt (renamed from Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt)0
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-result.txt (renamed from Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt)0
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt34
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-result.txt (renamed from Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt)0
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt51
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in14
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-default-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-default-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/find_package.cmake2
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-default-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-default-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-invalid-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/function.cmake7
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-default-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-default-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-invalid-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include.cmake2
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake3
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-default-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-default-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt5
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/macro.cmake7
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/test.cmake.in21
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/try_compile-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt48
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/try_compile.cmake6
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt6
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt6
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt6
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt6
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-result.txt1
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt22
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt22
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake9
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt1
-rw-r--r--Tests/RunCMake/Ninja/VerboseBuild.cmake3
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake7
-rw-r--r--Tests/RunCMake/ObjectLibrary/exe2.c6
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake115
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt87
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/README25
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input44
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.input53
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.input79
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.input53
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.input82
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.input43
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input52
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input83
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input80
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.input50
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.input52
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input44
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input44
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.input14
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.input14
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.input38
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.input45
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input78
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.input72
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.input43
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input36
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input124
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.input76
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.input46
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input76
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input47
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input50
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input36
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input47
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input42
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input35
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.input70
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.input76
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.input60
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.input62
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input58
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input58
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.input37
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.input38
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.input35
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.input38
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input40
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_new-check.cmake22
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_old-check.cmake20
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CMP0083.cmake47
-rw-r--r--Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake18
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Genex1-result.txt1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Genex1-stderr.txt3
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Genex1.cmake9
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Genex2-result.txt1
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Genex2-stderr.txt3
-rw-r--r--Tests/RunCMake/PositionIndependentCode/Genex2.cmake9
-rw-r--r--Tests/RunCMake/PositionIndependentCode/PIE-pie_off-check.cmake7
-rw-r--r--Tests/RunCMake/PositionIndependentCode/PIE-pie_on-check.cmake7
-rw-r--r--Tests/RunCMake/PositionIndependentCode/PIE.cmake22
-rw-r--r--Tests/RunCMake/PositionIndependentCode/PIE_validator.cmake32
-rw-r--r--Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake64
-rw-r--r--Tests/RunCMake/README.rst11
-rw-r--r--Tests/RunCMake/RunCMake.cmake9
-rw-r--r--Tests/RunCMake/RunCTest.cmake8
-rw-r--r--Tests/RunCMake/RuntimePath/Relative.cmake69
-rw-r--r--Tests/RunCMake/RuntimePath/RelativeCheck.cmake4
-rw-r--r--Tests/RunCMake/RuntimePath/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/RuntimePath/main.c4
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt16
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt2
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt2
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt2
-rw-r--r--Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt4
-rw-r--r--Tests/RunCMake/TargetSources/OriginDebug-stderr.txt8
-rw-r--r--Tests/RunCMake/ToolchainFile/IncludeDirectories-toolchain.cmake1
-rw-r--r--Tests/RunCMake/ToolchainFile/IncludeDirectories.c5
-rw-r--r--Tests/RunCMake/ToolchainFile/IncludeDirectories.cmake2
-rw-r--r--Tests/RunCMake/ToolchainFile/IncludeDirectories/IncDir.h1
-rw-r--r--Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt15
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0078-common.cmake2
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake4
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake2
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake4
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake2
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt11
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake1
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0086-common.cmake11
-rw-r--r--Tests/RunCMake/UseSWIG/RunCMakeTest.cmake20
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake33
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupCMakeLists.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake64
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake14
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake64
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDefines.cmake18
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDeployFiles-check.cmake67
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDeployFiles.cmake27
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake36
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerCommand.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerCommandArguments-check.cmake36
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerCommandArguments.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerEnvironment-check.cmake36
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerEnvironment.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake36
-rw-r--r--Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake3
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake42
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake13
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject-check.cmake54
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject.cmake8
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/foo.cpp3
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/foo.cs3
-rw-r--r--Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/WriteBasicConfigVersionFile/All.cmake884
-rw-r--r--Tests/RunCMake/WriteBasicConfigVersionFile/ArchIndependent.cmake63
-rw-r--r--Tests/RunCMake/WriteBasicConfigVersionFile/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/XcodeProject/DeploymentTarget.cmake13
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake110
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeBundles.cmake23
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake10
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake6
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake6
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt4
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt0
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt4
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt4
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt7
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt4
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt7
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt4
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt7
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake3
-rw-r--r--Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/add_subdirectory/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt16
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake44
-rw-r--r--Tests/RunCMake/add_subdirectory/Missing-stderr.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_build/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_cmake_error/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_configure/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_coverage/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_fixtures/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in3
-rw-r--r--Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_start/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ctest_submit/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt3
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt3
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-http-stdout.txt5
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-https-stdout.txt5
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/PARTSDone-result.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt3
-rw-r--r--Tests/RunCMake/ctest_submit/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/ctest_test/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/ctest_upload/CTestConfig.cmake.in1
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-COPY_ON_ERROR.cmake11
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-SYMBOLIC-noexist.cmake4
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-SYMBOLIC.cmake4
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-noarg-result.txt1
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-noarg-stderr.txt4
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-noarg.cmake1
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt1
-rw-r--r--Tests/RunCMake/file/CREATE_LINK-noexist.cmake4
-rw-r--r--Tests/RunCMake/file/CREATE_LINK.cmake11
-rw-r--r--Tests/RunCMake/file/FileOpenFailRead-stderr.txt2
-rw-r--r--Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt12
-rw-r--r--Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt1
-rw-r--r--Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt6
-rw-r--r--Tests/RunCMake/file/READ_SYMLINK-noexist.cmake1
-rw-r--r--Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt1
-rw-r--r--Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt6
-rw-r--r--Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake2
-rw-r--r--Tests/RunCMake/file/READ_SYMLINK.cmake13
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/file/SIZE-error-does-not-exist-result.txt1
-rw-r--r--Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt6
-rw-r--r--Tests/RunCMake/file/SIZE-error-does-not-exist.cmake3
-rw-r--r--Tests/RunCMake/file/SIZE.cmake9
-rw-r--r--Tests/RunCMake/find_package/CMP0084-NEW-stderr.txt20
-rw-r--r--Tests/RunCMake/find_package/CMP0084-NEW.cmake7
-rw-r--r--Tests/RunCMake/find_package/CMP0084-OLD.cmake7
-rw-r--r--Tests/RunCMake/find_package/CMP0084-WARN-stderr.txt8
-rw-r--r--Tests/RunCMake/find_package/CMP0084-WARN.cmake6
-rw-r--r--Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake1
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/find_package/SetFoundResolved-stderr.txt10
-rw-r--r--Tests/RunCMake/find_package/SetFoundResolved.cmake17
-rw-r--r--Tests/RunCMake/get_filename_component/KnownComponents.cmake4
-rw-r--r--Tests/RunCMake/get_property/BadArgument-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/BadDirectory-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/BadScope-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/BadTarget-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/BadTest-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/GlobalName-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/MissingArgument-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/NoCache-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/NoProperty-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/NoSource-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/NoTarget-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/NoTest-stderr.txt2
-rw-r--r--Tests/RunCMake/get_property/VariableName-stderr.txt2
-rw-r--r--Tests/RunCMake/include_external_msproject/check_utils.cmake2
-rw-r--r--Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt2
-rw-r--r--Tests/RunCMake/include_guard/InvalidScope-stderr.txt2
-rw-r--r--Tests/RunCMake/install/CMP0087-NEW-check.cmake7
-rw-r--r--Tests/RunCMake/install/CMP0087-NEW.cmake3
-rw-r--r--Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/install/CMP0087-OLD-check.cmake8
-rw-r--r--Tests/RunCMake/install/CMP0087-OLD.cmake3
-rw-r--r--Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/install/CMP0087-WARN-stderr.txt5
-rw-r--r--Tests/RunCMake/install/CMP0087-WARN.cmake2
-rw-r--r--Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-result.txt1
-rw-r--r--Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-stderr.txt5
-rw-r--r--Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE.cmake1
-rw-r--r--Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt2
-rw-r--r--Tests/RunCMake/install/DIRECTORY-TYPE-Cache-all-check.cmake42
-rw-r--r--Tests/RunCMake/install/DIRECTORY-TYPE-Cache.cmake13
-rw-r--r--Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent-all-check.cmake24
-rw-r--r--Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent.cmake7
-rw-r--r--Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake42
-rw-r--r--Tests/RunCMake/install/DIRECTORY-TYPE.cmake13
-rw-r--r--Tests/RunCMake/install/FILES-DESTINATION-TYPE-result.txt1
-rw-r--r--Tests/RunCMake/install/FILES-DESTINATION-TYPE-stderr.txt5
-rw-r--r--Tests/RunCMake/install/FILES-DESTINATION-TYPE.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-TYPE-Cache-all-check.cmake29
-rw-r--r--Tests/RunCMake/install/FILES-TYPE-Cache.cmake13
-rw-r--r--Tests/RunCMake/install/FILES-TYPE-CacheDependent-all-check.cmake17
-rw-r--r--Tests/RunCMake/install/FILES-TYPE-CacheDependent.cmake7
-rw-r--r--Tests/RunCMake/install/FILES-TYPE-all-check.cmake29
-rw-r--r--Tests/RunCMake/install/FILES-TYPE.cmake13
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake50
-rw-r--r--Tests/RunCMake/install/TARGETS-Apple-Defaults-result.txt1
-rw-r--r--Tests/RunCMake/install/TARGETS-Apple-Defaults-stderr.txt12
-rw-r--r--Tests/RunCMake/install/TARGETS-Apple-Defaults.cmake8
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake49
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults-Cache.cmake19
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake49
-rw-r--r--Tests/RunCMake/install/TARGETS-Defaults.cmake19
-rw-r--r--Tests/RunCMake/install/TARGETS-ImportedGlobal-result.txt1
-rw-r--r--Tests/RunCMake/install/TARGETS-ImportedGlobal-stderr.txt4
-rw-r--r--Tests/RunCMake/install/TARGETS-ImportedGlobal.cmake3
-rw-r--r--Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt2
-rw-r--r--Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt2
-rw-r--r--Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt1
-rw-r--r--Tests/RunCMake/install/obj3.c7
-rw-r--r--Tests/RunCMake/install/obj3.h6
-rw-r--r--Tests/RunCMake/install/obj4.c7
-rw-r--r--Tests/RunCMake/install/obj4.h6
-rw-r--r--Tests/RunCMake/install/obj5.c7
-rw-r--r--Tests/RunCMake/install/obj5.h6
-rw-r--r--Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt2
-rw-r--r--Tests/RunCMake/list/FILTER-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/FILTER-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt1
-rw-r--r--Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake6
-rw-r--r--Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt2
-rw-r--r--Tests/RunCMake/list/REMOVE_AT-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/REVERSE-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/REVERSE-NotList.cmake4
-rw-r--r--Tests/RunCMake/list/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/list/SORT-NotList-stderr.txt4
-rw-r--r--Tests/RunCMake/list/SORT-NotList.cmake4
-rw-r--r--Tests/RunCMake/pseudo_cppcheck.c19
-rw-r--r--Tests/RunCMake/set/ExtraEnvValue-stderr.txt6
-rw-r--r--Tests/RunCMake/set/ExtraEnvValue.cmake1
-rw-r--r--Tests/RunCMake/set/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/set/UnknownCacheType-stderr.txt5
-rw-r--r--Tests/RunCMake/set/UnknownCacheType.cmake1
-rw-r--r--Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt14
-rw-r--r--Tests/RunCMake/string/AppendNoArgs-stderr.txt2
-rw-r--r--Tests/RunCMake/string/ConcatNoArgs-stderr.txt2
-rw-r--r--Tests/RunCMake/string/JoinNoArgs-stderr.txt2
-rw-r--r--Tests/RunCMake/string/JoinNoVar-stderr.txt2
-rw-r--r--Tests/RunCMake/string/PrependNoArgs-stderr.txt2
-rw-r--r--Tests/RunCMake/string/UuidBadNamespace-stderr.txt2
-rw-r--r--Tests/RunCMake/string/UuidBadType-stderr.txt2
-rw-r--r--Tests/RunCMake/string/UuidMissingNameValue-stderr.txt2
-rw-r--r--Tests/RunCMake/string/UuidMissingNamespace-stderr.txt2
-rw-r--r--Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt2
-rw-r--r--Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_definitions/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/target_compile_definitions/empty_keyword_args.cmake5
-rw-r--r--Tests/RunCMake/target_compile_features/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_compile_features/alias_target-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/empty_keyword_args.cmake5
-rw-r--r--Tests/RunCMake/target_compile_features/imported_target-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/invalid_args-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/no_target-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_features/utility_target-stderr.txt2
-rw-r--r--Tests/RunCMake/target_compile_options/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/target_compile_options/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/target_compile_options/empty_keyword_args.cmake5
-rw-r--r--Tests/RunCMake/target_include_directories/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/target_include_directories/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/target_include_directories/empty_keyword_args.cmake5
-rw-r--r--Tests/RunCMake/target_link_directories/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/target_link_directories/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/target_link_directories/empty_keyword_args.cmake5
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_link_libraries/empty_keyword_args.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/target_link_options/empty_keyword_args.cmake5
-rw-r--r--Tests/RunCMake/target_sources/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/target_sources/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/target_sources/empty_keyword_args.cmake5
-rw-r--r--Tests/RunCMake/try_compile/LinkOptions.cmake38
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/try_compile/lib.c4
-rw-r--r--Tests/RunCMake/try_compile/main.c8
-rw-r--r--Tests/RunCMake/try_run/LinkOptions.cmake42
-rw-r--r--Tests/RunCMake/try_run/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/try_run/lib.c4
-rw-r--r--Tests/RunCMake/try_run/main.c8
-rw-r--r--Tests/Server/cmakelib.py4
-rw-r--r--Tests/SubDirSpaces/CMakeLists.txt2
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt4
-rw-r--r--Tests/TryCompile/CMakeLists.txt29
-rw-r--r--Tests/TryCompile/check_a_b.c10
-rw-r--r--Tests/Tutorial/Complete/CMakeLists.txt116
-rw-r--r--Tests/Tutorial/Complete/Config.cmake.in4
-rw-r--r--Tests/Tutorial/Complete/License.txt (renamed from Tests/Tutorial/Step6/License.txt)2
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt68
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Complete/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Complete/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Consumer/CMakeLists.txt51
-rw-r--r--Tests/Tutorial/Consumer/Config.cmake.in14
-rw-r--r--Tests/Tutorial/Consumer/consumer.cxx11
-rw-r--r--Tests/Tutorial/Consumer/directions.txt6
-rw-r--r--Tests/Tutorial/MultiPackage/CMakeLists.txt109
-rw-r--r--Tests/Tutorial/MultiPackage/Config.cmake.in4
-rw-r--r--Tests/Tutorial/MultiPackage/License.txt2
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt68
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake7
-rw-r--r--Tests/Tutorial/MultiPackage/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/MultiPackage/directions.txt34
-rw-r--r--Tests/Tutorial/MultiPackage/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Readme.txt16
-rw-r--r--Tests/Tutorial/Step1/CMakeLists.txt19
-rw-r--r--Tests/Tutorial/Step1/directions.txt95
-rw-r--r--Tests/Tutorial/Step1/tutorial.cxx17
-rw-r--r--Tests/Tutorial/Step10/CMakeLists.txt77
-rw-r--r--Tests/Tutorial/Step10/License.txt2
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt61
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step10/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step10/directions.txt38
-rw-r--r--Tests/Tutorial/Step10/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step11/CMakeLists.txt77
-rw-r--r--Tests/Tutorial/Step11/License.txt2
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt60
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step11/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step11/directions.txt104
-rw-r--r--Tests/Tutorial/Step11/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step2/CMakeLists.txt34
-rw-r--r--Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx13
-rw-r--r--Tests/Tutorial/Step2/TutorialConfig.h.in1
-rw-r--r--Tests/Tutorial/Step2/directions.txt102
-rw-r--r--Tests/Tutorial/Step2/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step3/CMakeLists.txt74
-rw-r--r--Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt3
-rw-r--r--Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx13
-rw-r--r--Tests/Tutorial/Step3/directions.txt26
-rw-r--r--Tests/Tutorial/Step3/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step4/CMakeLists.txt72
-rw-r--r--Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt7
-rw-r--r--Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx23
-rw-r--r--Tests/Tutorial/Step4/TutorialConfig.h.in4
-rw-r--r--Tests/Tutorial/Step4/directions.txt72
-rw-r--r--Tests/Tutorial/Step4/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step5/CMakeLists.txt86
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt23
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx35
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx27
-rw-r--r--Tests/Tutorial/Step5/TutorialConfig.h.in4
-rw-r--r--Tests/Tutorial/Step5/directions.txt69
-rw-r--r--Tests/Tutorial/Step5/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step6/CMakeLists.txt94
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt32
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx35
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx31
-rw-r--r--Tests/Tutorial/Step6/directions.txt104
-rw-r--r--Tests/Tutorial/Step6/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step7/CMakeLists.txt98
-rw-r--r--Tests/Tutorial/Step7/CTestConfig.cmake1
-rw-r--r--Tests/Tutorial/Step7/License.txt2
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt33
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx35
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx18
-rw-r--r--Tests/Tutorial/Step7/directions.txt40
-rw-r--r--Tests/Tutorial/Step7/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step8/CMakeLists.txt82
-rw-r--r--Tests/Tutorial/Step8/License.txt2
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt29
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx42
-rw-r--r--Tests/Tutorial/Step8/TutorialConfig.h.in8
-rw-r--r--Tests/Tutorial/Step8/directions.txt38
-rw-r--r--Tests/Tutorial/Step8/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step9/CMakeLists.txt81
-rw-r--r--Tests/Tutorial/Step9/CTestConfig.cmake15
-rw-r--r--Tests/Tutorial/Step9/License.txt2
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt35
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx41
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step9/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step9/directions.txt166
-rw-r--r--Tests/Tutorial/Step9/tutorial.cxx33
-rw-r--r--Tests/Unset/CMakeLists.txt9
-rw-r--r--Tests/UseSWIG/CMakeLists.txt26
-rw-r--r--Tests/UseSWIG/ModuleName/CMakeLists.txt42
-rw-r--r--Tests/UseSWIG/ModuleName/example.i9
-rw-r--r--Tests/UseSWIG/ModuleName/runme.py52
-rw-r--r--Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt28
-rw-r--r--Tests/UseSWIG/SwigSrcFileExtension/my_add.i9
-rw-r--r--Tests/UseSWIG/SwigSrcFileExtension/my_sub.swg9
-rwxr-xr-xTests/UseSWIG/SwigSrcFileExtension/runme.py24
-rw-r--r--Tests/VSExternalInclude/CMakeLists.txt4
-rw-r--r--Tests/VSWinStorePhone/CMakeLists.txt11
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.pngbin3392 -> 2335 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.pngbin801 -> 488 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.pngbin329 -> 167 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.pngbin554 -> 265 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.pngbin2146 -> 909 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.pngbin429 -> 227 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.pngbin9930 -> 2953 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.pngbin9070 -> 2767 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.pngbin3674 -> 1397 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.pngbin4937 -> 893 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.pngbin3724 -> 516 bytes
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp4
-rw-r--r--Tests/VSWinStorePhone/WinRT/Batman.cpp14
-rw-r--r--Tests/VSWinStorePhone/WinRT/Batman.h12
-rw-r--r--Tests/VSWinStorePhone/WinRT/CMakeLists.txt13
-rw-r--r--Tests/VSXaml/Assets/Logo.scale-100.pngbin801 -> 488 bytes
-rw-r--r--Tests/VSXaml/Assets/SmallLogo.scale-100.pngbin329 -> 167 bytes
-rw-r--r--Tests/VSXaml/Assets/SplashScreen.scale-100.pngbin2146 -> 909 bytes
-rw-r--r--Tests/VSXaml/Assets/StoreLogo.scale-100.pngbin429 -> 227 bytes
-rw-r--r--Utilities/Doxygen/CMakeLists.txt2
-rw-r--r--Utilities/IWYU/mapping.imp12
-rw-r--r--Utilities/Release/linux64_release.cmake6
-rw-r--r--Utilities/Release/upload_release.cmake2
-rw-r--r--Utilities/Release/win32_release.cmake4
-rw-r--r--Utilities/Release/win64_release.cmake4
-rw-r--r--Utilities/Sphinx/CMakeLists.txt2
-rw-r--r--Utilities/Sphinx/cmake.py56
-rw-r--r--Utilities/Sphinx/colors.py29
-rw-r--r--Utilities/Sphinx/conf.py.in1
-rw-r--r--Utilities/Sphinx/static/cmake-logo-16.pngbin893 -> 692 bytes
-rw-r--r--Utilities/cmThirdParty.h.in1
-rw-r--r--Utilities/cm_xmlrpc.h13
-rw-r--r--Utilities/cmcurl/CMakeLists.txt3
-rw-r--r--Utilities/cmjsoncpp/src/lib_json/json_reader.cpp2
-rw-r--r--Utilities/cmliblzma/liblzma/simple/x86.c2
-rw-r--r--Utilities/cmlibuv/CMakeLists.txt41
-rw-r--r--Utilities/cmlibuv/include/pthread-barrier.h69
-rw-r--r--Utilities/cmlibuv/include/uv.h86
-rw-r--r--Utilities/cmlibuv/include/uv/aix.h (renamed from Utilities/cmlibuv/include/uv-aix.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/android-ifaddrs.h (renamed from Utilities/cmlibuv/include/android-ifaddrs.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/bsd.h (renamed from Utilities/cmlibuv/include/uv-bsd.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/darwin.h (renamed from Utilities/cmlibuv/include/uv-darwin.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/errno.h (renamed from Utilities/cmlibuv/include/uv-errno.h)6
-rw-r--r--Utilities/cmlibuv/include/uv/linux.h (renamed from Utilities/cmlibuv/include/uv-linux.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/os390.h (renamed from Utilities/cmlibuv/include/uv-os390.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/posix.h (renamed from Utilities/cmlibuv/include/uv-posix.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/stdint-msvc2008.h (renamed from Utilities/cmlibuv/include/stdint-msvc2008.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/sunos.h (renamed from Utilities/cmlibuv/include/uv-sunos.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/threadpool.h (renamed from Utilities/cmlibuv/include/uv-threadpool.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/tree.h (renamed from Utilities/cmlibuv/include/tree.h)0
-rw-r--r--Utilities/cmlibuv/include/uv/unix.h (renamed from Utilities/cmlibuv/include/uv-unix.h)47
-rw-r--r--Utilities/cmlibuv/include/uv/version.h (renamed from Utilities/cmlibuv/include/uv-version.h)4
-rw-r--r--Utilities/cmlibuv/include/uv/win.h (renamed from Utilities/cmlibuv/include/uv-win.h)59
-rw-r--r--Utilities/cmlibuv/src/fs-poll.c4
-rw-r--r--Utilities/cmlibuv/src/idna.c291
-rw-r--r--Utilities/cmlibuv/src/idna.h31
-rw-r--r--Utilities/cmlibuv/src/inet.c13
-rw-r--r--Utilities/cmlibuv/src/strscpy.c17
-rw-r--r--Utilities/cmlibuv/src/strscpy.h18
-rw-r--r--Utilities/cmlibuv/src/threadpool.c96
-rw-r--r--Utilities/cmlibuv/src/timer.c (renamed from Utilities/cmlibuv/src/unix/timer.c)21
-rw-r--r--Utilities/cmlibuv/src/unix/aix-common.c10
-rw-r--r--Utilities/cmlibuv/src/unix/aix.c63
-rw-r--r--Utilities/cmlibuv/src/unix/android-ifaddrs.c2
-rw-r--r--Utilities/cmlibuv/src/unix/bsd-ifaddrs.c23
-rw-r--r--Utilities/cmlibuv/src/unix/bsd-proctitle.c93
-rw-r--r--Utilities/cmlibuv/src/unix/cmake-bootstrap.c1
-rw-r--r--Utilities/cmlibuv/src/unix/core.c136
-rw-r--r--Utilities/cmlibuv/src/unix/cygwin.c2
-rw-r--r--Utilities/cmlibuv/src/unix/darwin-proctitle.c147
-rw-r--r--Utilities/cmlibuv/src/unix/freebsd.c79
-rw-r--r--Utilities/cmlibuv/src/unix/fs.c299
-rw-r--r--Utilities/cmlibuv/src/unix/fsevents.c72
-rw-r--r--Utilities/cmlibuv/src/unix/getaddrinfo.c21
-rw-r--r--Utilities/cmlibuv/src/unix/getnameinfo.c1
-rw-r--r--Utilities/cmlibuv/src/unix/ibmi.c3
-rw-r--r--Utilities/cmlibuv/src/unix/internal.h45
-rw-r--r--Utilities/cmlibuv/src/unix/kqueue.c83
-rw-r--r--Utilities/cmlibuv/src/unix/linux-core.c117
-rw-r--r--Utilities/cmlibuv/src/unix/linux-inotify.c8
-rw-r--r--Utilities/cmlibuv/src/unix/linux-syscalls.c133
-rw-r--r--Utilities/cmlibuv/src/unix/linux-syscalls.h34
-rw-r--r--Utilities/cmlibuv/src/unix/loop.c6
-rw-r--r--Utilities/cmlibuv/src/unix/netbsd.c71
-rw-r--r--Utilities/cmlibuv/src/unix/openbsd.c69
-rw-r--r--Utilities/cmlibuv/src/unix/os390-syscalls.c29
-rw-r--r--Utilities/cmlibuv/src/unix/os390-syscalls.h4
-rw-r--r--Utilities/cmlibuv/src/unix/os390.c38
-rw-r--r--Utilities/cmlibuv/src/unix/pipe.c31
-rw-r--r--Utilities/cmlibuv/src/unix/poll.c3
-rw-r--r--Utilities/cmlibuv/src/unix/process.c6
-rw-r--r--Utilities/cmlibuv/src/unix/proctitle.c4
-rw-r--r--Utilities/cmlibuv/src/unix/signal.c59
-rw-r--r--Utilities/cmlibuv/src/unix/stream.c262
-rw-r--r--Utilities/cmlibuv/src/unix/sunos.c15
-rw-r--r--Utilities/cmlibuv/src/unix/tcp.c21
-rw-r--r--Utilities/cmlibuv/src/unix/thread.c146
-rw-r--r--Utilities/cmlibuv/src/unix/tty.c45
-rw-r--r--Utilities/cmlibuv/src/unix/udp.c23
-rw-r--r--Utilities/cmlibuv/src/uv-common.c44
-rw-r--r--Utilities/cmlibuv/src/uv-common.h127
-rw-r--r--Utilities/cmlibuv/src/uv-data-getter-setters.c16
-rw-r--r--Utilities/cmlibuv/src/win/async.c10
-rw-r--r--Utilities/cmlibuv/src/win/atomicops-inl.h8
-rw-r--r--Utilities/cmlibuv/src/win/core.c58
-rw-r--r--Utilities/cmlibuv/src/win/dl.c11
-rw-r--r--Utilities/cmlibuv/src/win/error.c4
-rw-r--r--Utilities/cmlibuv/src/win/fs-event.c25
-rw-r--r--Utilities/cmlibuv/src/win/fs.c184
-rw-r--r--Utilities/cmlibuv/src/win/getaddrinfo.c40
-rw-r--r--Utilities/cmlibuv/src/win/getnameinfo.c50
-rw-r--r--Utilities/cmlibuv/src/win/handle-inl.h25
-rw-r--r--Utilities/cmlibuv/src/win/handle.c12
-rw-r--r--Utilities/cmlibuv/src/win/internal.h114
-rw-r--r--Utilities/cmlibuv/src/win/loop-watcher.c2
-rw-r--r--Utilities/cmlibuv/src/win/pipe.c1130
-rw-r--r--Utilities/cmlibuv/src/win/poll.c55
-rw-r--r--Utilities/cmlibuv/src/win/process-stdio.c59
-rw-r--r--Utilities/cmlibuv/src/win/process.c70
-rw-r--r--Utilities/cmlibuv/src/win/req.c25
-rw-r--r--Utilities/cmlibuv/src/win/signal.c50
-rw-r--r--Utilities/cmlibuv/src/win/stream.c36
-rw-r--r--Utilities/cmlibuv/src/win/tcp.c213
-rw-r--r--Utilities/cmlibuv/src/win/thread.c246
-rw-r--r--Utilities/cmlibuv/src/win/timer.c195
-rw-r--r--Utilities/cmlibuv/src/win/tty.c177
-rw-r--r--Utilities/cmlibuv/src/win/udp.c95
-rw-r--r--Utilities/cmlibuv/src/win/util.c298
-rw-r--r--Utilities/cmlibuv/src/win/winapi.c60
-rw-r--r--Utilities/cmlibuv/src/win/winapi.h80
-rw-r--r--Utilities/cmlibuv/src/win/winsock.c8
-rwxr-xr-xbootstrap12
2603 files changed, 81875 insertions, 31656 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 8d79b0c5d..520b1a9e3 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,5 +1,8 @@
---
Checks: "-*,\
+bugprone-*,\
+-bugprone-macro-parentheses,\
+-bugprone-misplaced-widening-cast,\
google-readability-casting,\
misc-*,\
-misc-incorrect-roundings,\
@@ -8,28 +11,28 @@ misc-*,\
-misc-static-assert,\
modernize-*,\
-modernize-deprecated-headers,\
--modernize-pass-by-value,\
-modernize-raw-string-literal,\
-modernize-return-braced-init-list,\
-modernize-use-auto,\
--modernize-use-default-member-init,\
--modernize-use-emplace,\
--modernize-use-equals-default,\
--modernize-use-equals-delete,\
-modernize-use-noexcept,\
-modernize-use-transparent-functors,\
-modernize-use-using,\
performance-*,\
-performance-inefficient-string-concatenation,\
+-performance-inefficient-vector-operation,\
readability-*,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-cast,\
+-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-named-parameter,\
-readability-redundant-declaration,\
--readability-redundant-member-init,\
--readability-simplify-boolean-expr,\
"
HeaderFilterRegex: 'Source/cm[^/]*\.(h|hxx|cxx)$'
+CheckOptions:
+ - key: modernize-use-default-member-init.UseAssignment
+ value: '1'
+ - key: modernize-use-equals-default.IgnoreMacros
+ value: '0'
...
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim
index 076b47fdb..7e029de4e 100644
--- a/Auxiliary/vim/syntax/cmake.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -733,7 +733,7 @@ syn keyword cmakeVariable contained
\ CTEST_CUSTOM_POST_TEST
\ CTEST_CUSTOM_PRE_MEMCHECK
\ CTEST_CUSTOM_PRE_TEST
- \ CTEST_CUSTOM_TEST_IGNORE
+ \ CTEST_CUSTOM_TESTS_IGNORE
\ CTEST_CUSTOM_WARNING_EXCEPTION
\ CTEST_CUSTOM_WARNING_MATCH
\ CTEST_CVS_CHECKOUT
@@ -873,8 +873,12 @@ syn keyword cmakeKWExternalProject contained
\ LOG_
\ LOG_BUILD
\ LOG_CONFIGURE
+ \ LOG_DIR
\ LOG_DOWNLOAD
\ LOG_INSTALL
+ \ LOG_MERGED_STDOUTERR
+ \ LOG_OUTPUT_ON_FAILURE
+ \ LOG_PATCH
\ LOG_TEST
\ LOG_UPDATE
\ MAKE_EXE
@@ -2208,6 +2212,8 @@ syn keyword cmakeGeneratorExpressions contained
\ DEBUG_MODE
\ EXPORT
\ FOO_EXTRA_THINGS
+ \ Fortran_COMPILER_ID
+ \ Fortran_COMPILER_VERSION
\ GENEX_EVAL
\ GNU
\ IF
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 998db15d3..bd130ec36 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.1 FATAL_ERROR)
+cmake_minimum_required(VERSION 3.1...3.12 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)
project(CMake)
@@ -117,6 +117,18 @@ option(CMake_BUILD_DEVELOPER_REFERENCE
"Build CMake Developer Reference" OFF)
mark_as_advanced(CMake_BUILD_DEVELOPER_REFERENCE)
+# option to build using interprocedural optimizations (IPO/LTO)
+if (NOT CMAKE_VERSION VERSION_LESS 3.12.2)
+ option(CMake_BUILD_LTO "Compile CMake with link-time optimization if supported" OFF)
+ if(CMake_BUILD_LTO)
+ include(CheckIPOSupported)
+ check_ipo_supported(RESULT HAVE_IPO)
+ if(HAVE_IPO)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+ endif()
+ endif()
+endif()
+
#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script
@@ -125,10 +137,6 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Options have dependencies.
include(CMakeDependentOption)
- # Optionally use system xmlrpc. We no longer build or use it by default.
- option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
- mark_as_advanced(CTEST_USE_XMLRPC)
-
# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
set(UTILITIES BZIP2 CURL EXPAT FORM JSONCPP LIBARCHIVE LIBLZMA LIBRHASH LIBUV ZLIB)
@@ -159,10 +167,8 @@ macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Optionally use system utility libraries.
option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
- CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
- "${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
- CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
- "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}" "NOT CTEST_USE_XMLRPC" ON)
+ option(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" "${CMAKE_USE_SYSTEM_LIBRARY_CURL}")
+ option(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" "${CMAKE_USE_SYSTEM_LIBRARY_EXPAT}")
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
"${CMAKE_USE_SYSTEM_LIBRARY_ZLIB}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE;NOT CMAKE_USE_SYSTEM_CURL" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_BZIP2 "Use system-installed bzip2"
@@ -200,7 +206,7 @@ endmacro()
macro(CMAKE_SETUP_TESTING)
if(BUILD_TESTING)
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
- foreach(util CURL EXPAT XMLRPC ZLIB)
+ foreach(util CURL EXPAT ZLIB)
if(CMAKE_USE_SYSTEM_${util})
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
endif()
@@ -326,6 +332,9 @@ macro (CMAKE_BUILD_UTILITIES)
set(KWSYS_USE_ConsoleBuf 1)
set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
set(KWSYS_INSTALL_DOC_DIR "${CMAKE_DOC_DIR}")
+ if(CMake_NO_CXX_STANDARD)
+ set(KWSYS_CXX_STANDARD "")
+ endif()
add_subdirectory(Source/kwsys)
set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
@@ -532,7 +541,7 @@ macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build jsoncpp library.
if(CMAKE_USE_SYSTEM_JSONCPP)
- find_package(JsonCpp)
+ find_package(JsonCpp 1.4.1)
if(NOT JsonCpp_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_JSONCPP is ON but a JsonCpp is not found!")
@@ -560,18 +569,6 @@ macro (CMAKE_BUILD_UTILITIES)
endif()
#---------------------------------------------------------------------
- # Build XMLRPC library for CMake and CTest.
- if(CTEST_USE_XMLRPC)
- find_package(XMLRPC QUIET REQUIRED libwww-client)
- if(NOT XMLRPC_FOUND)
- message(FATAL_ERROR
- "CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
- endif()
- set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
- set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
- endif()
-
- #---------------------------------------------------------------------
# Use curses?
if (UNIX)
if(NOT DEFINED BUILD_CursesDialog)
@@ -724,7 +721,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
# the build tree, which is both the build and the install RPATH.
if (UNIX)
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
- OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
+ OR CMAKE_USE_SYSTEM_EXPAT OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index 84f6abbbe..7e7111164 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -24,7 +24,8 @@ CMake uses `Kitware's GitLab Instance`_ to manage development and code review.
To contribute patches:
#. Fork the upstream `CMake Repository`_ into a personal account.
-#. Run `Utilities/SetupForDevelopment.sh`_ for local configuration.
+#. Run `Utilities/SetupForDevelopment.sh`_ for local git configuration.
+#. See `Building CMake`_ for building CMake locally.
#. See the `CMake Source Code Guide`_ for coding guidelines.
#. Base all new work on the upstream ``master`` branch.
Base work on the upstream ``release`` branch only if it fixes a
@@ -45,6 +46,7 @@ The merge request will enter the `CMake Review Process`_ for consideration.
.. _`Kitware's GitLab Instance`: https://gitlab.kitware.com
.. _`CMake Repository`: https://gitlab.kitware.com/cmake/cmake
.. _`Utilities/SetupForDevelopment.sh`: Utilities/SetupForDevelopment.sh
+.. _`Building CMake`: README.rst#building-cmake
.. _`CMake Source Code Guide`: Help/dev/source.rst
.. _`commit messages`: Help/dev/review.rst#commit-messages
.. _`CMake Review Process`: Help/dev/review.rst
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in
index 18e00783a..823ee3cb7 100644
--- a/CTestCustom.cmake.in
+++ b/CTestCustom.cmake.in
@@ -52,6 +52,7 @@ list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
"(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)"
"(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)"
"(Lexer|Parser).*warning.*variable.*was set but never used"
+ "LexerParser.*warning.*empty expression statement has no effect; remove unnecessary"
"PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c"
"[Qq]t([Cc]ore|[Gg]ui|[Ww]idgets).*warning.*conversion.*may alter its value"
"warning:.*is.*very unsafe.*consider using.*"
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index ec9b31bd9..5d0e14493 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -28,13 +28,6 @@ if(CMAKE_SYSTEM_NAME MATCHES "AIX")
endif()
endif()
-if(CMAKE_SYSTEM_NAME MATCHES "IRIX")
- if(NOT CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
- endif()
-endif()
-
if(CMAKE_SYSTEM MATCHES "OSF1-V")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
diff --git a/Copyright.txt b/Copyright.txt
index 743c63418..f2362144a 100644
--- a/Copyright.txt
+++ b/Copyright.txt
@@ -1,5 +1,5 @@
CMake - Cross Platform Makefile Generator
-Copyright 2000-2018 Kitware, Inc. and Contributors
+Copyright 2000-2019 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -39,6 +39,7 @@ The following individuals and institutions are among the Contributors:
* Alexander Neundorf <neundorf@kde.org>
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
* Alexey Sokolov <sokolov@google.com>
+* Alex Merry <alex.merry@kde.org>
* Alex Turbov <i.zaufi@gmail.com>
* Andreas Pakulat <apaku@gmx.de>
* Andreas Schneider <asn@cryptomilk.org>
@@ -62,13 +63,17 @@ The following individuals and institutions are among the Contributors:
* Ilya Lavrenov <ilya.lavrenov@itseez.com>
* Insight Software Consortium <insightsoftwareconsortium.org>
* Jan Woetzel
+* Julien Schueller
* Kelly Thompson <kgt@lanl.gov>
+* Laurent Montel <montel@kde.org>
* Konstantin Podsvirov <konstantin@podsvirov.pro>
* Mario Bensi <mbensi@ipsquad.net>
+* Martin Gräßlin <mgraesslin@kde.org>
* Mathieu Malaterre <mathieu.malaterre@gmail.com>
* Matthaeus G. Chajdas
* Matthias Kretz <kretz@kde.org>
* Matthias Maennich <matthias@maennich.net>
+* Michael Hirsch, Ph.D. <www.scivision.co>
* Michael Stürmer
* Miguel A. Figueroa-Villanueva
* Mike Jackson
diff --git a/Help/command/FIND_XXX.txt b/Help/command/FIND_XXX.txt
index 73dbd5774..dde4dbbbc 100644
--- a/Help/command/FIND_XXX.txt
+++ b/Help/command/FIND_XXX.txt
@@ -96,7 +96,7 @@ If ``NO_DEFAULT_PATH`` is not specified, the search process is as follows:
2. Search paths specified in cmake-specific cache variables.
These are intended to be used on the command line with a ``-DVAR=value``.
- The values are interpreted as :ref:`;-lists <CMake Language Lists>`.
+ The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed.
* |CMAKE_PREFIX_PATH_XXX|
diff --git a/Help/command/add_compile_definitions.rst b/Help/command/add_compile_definitions.rst
index 48815d44f..8225da783 100644
--- a/Help/command/add_compile_definitions.rst
+++ b/Help/command/add_compile_definitions.rst
@@ -1,9 +1,9 @@
add_compile_definitions
-----------------------
-Adds preprocessor definitions to the compilation of source files.
+Add preprocessor definitions to the compilation of source files.
-::
+.. code-block:: cmake
add_compile_definitions(<definition> ...)
diff --git a/Help/command/add_compile_options.rst b/Help/command/add_compile_options.rst
index 350a1c0bd..43805c3a9 100644
--- a/Help/command/add_compile_options.rst
+++ b/Help/command/add_compile_options.rst
@@ -1,21 +1,18 @@
add_compile_options
-------------------
-Adds options to the compilation of source files.
+Add options to the compilation of source files.
-::
+.. code-block:: cmake
add_compile_options(<option> ...)
-Adds options to the compiler command line for targets in the current
-directory and below that are added after this command is invoked.
-See documentation of the :prop_dir:`directory <COMPILE_OPTIONS>` and
-:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties.
+Adds options to the :prop_dir:`COMPILE_OPTIONS` directory property.
+These options are used when compiling targets from the current
+directory and below.
-This command can be used to add any options, but alternative commands
-exist to add preprocessor definitions (:command:`target_compile_definitions`
-and :command:`add_compile_definitions`) or include directories
-(:command:`target_include_directories` and :command:`include_directories`).
+Arguments
+^^^^^^^^^
Arguments to ``add_compile_options`` may use "generator expressions" with
the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
@@ -23,3 +20,29 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.txt
+
+Example
+^^^^^^^
+
+Since different compilers support different options, a typical use of
+this command is in a compiler-specific conditional clause:
+
+.. code-block:: cmake
+
+ if (MSVC)
+ # warning level 4 and all warnings as errors
+ add_compile_options(/W4 /WX)
+ else()
+ # lots of warnings and all warnings as errors
+ add_compile_options(-Wall -Wextra -pedantic -Werror)
+ endif()
+
+See Also
+^^^^^^^^
+
+This command can be used to add any options. However, for
+adding preprocessor definitions and include directories it is recommended
+to use the more specific commands :command:`add_compile_definitions`
+and :command:`include_directories`.
+
+The command :command:`target_compile_options` adds target-specific options.
diff --git a/Help/command/add_custom_command.rst b/Help/command/add_custom_command.rst
index 71fe49477..9bf0d8720 100644
--- a/Help/command/add_custom_command.rst
+++ b/Help/command/add_custom_command.rst
@@ -8,7 +8,9 @@ There are two main signatures for ``add_custom_command``.
Generating Files
^^^^^^^^^^^^^^^^
-The first signature is for adding a custom command to produce an output::
+The first signature is for adding a custom command to produce an output:
+
+.. code-block:: cmake
add_custom_command(OUTPUT output1 [output2 ...]
COMMAND command1 [ARGS] [args1...]
@@ -200,7 +202,7 @@ before or after building the target. The command becomes part of the
target and will only execute when the target itself is built. If the
target is already built, the command will not execute.
-::
+.. code-block:: cmake
add_custom_command(TARGET <target>
PRE_BUILD | PRE_LINK | POST_BUILD
diff --git a/Help/command/add_custom_target.rst b/Help/command/add_custom_target.rst
index a6b2f7773..c63dd230d 100644
--- a/Help/command/add_custom_target.rst
+++ b/Help/command/add_custom_target.rst
@@ -3,7 +3,7 @@ add_custom_target
Add a target with no output so it will always be built.
-::
+.. code-block:: cmake
add_custom_target(Name [ALL] [command1 [args1...]]
[COMMAND command2 [args2...] ...]
diff --git a/Help/command/add_definitions.rst b/Help/command/add_definitions.rst
index 1da15a61f..39a43f4f4 100644
--- a/Help/command/add_definitions.rst
+++ b/Help/command/add_definitions.rst
@@ -1,9 +1,9 @@
add_definitions
---------------
-Adds -D define flags to the compilation of source files.
+Add -D define flags to the compilation of source files.
-::
+.. code-block:: cmake
add_definitions(-DFOO -DBAR ...)
diff --git a/Help/command/add_dependencies.rst b/Help/command/add_dependencies.rst
index 7a6614328..de219a508 100644
--- a/Help/command/add_dependencies.rst
+++ b/Help/command/add_dependencies.rst
@@ -3,11 +3,11 @@ add_dependencies
Add a dependency between top-level targets.
-::
+.. code-block:: cmake
add_dependencies(<target> [<target-dependency>]...)
-Make a top-level ``<target>`` depend on other top-level targets to
+Makes a top-level ``<target>`` depend on other top-level targets to
ensure that they build before ``<target>`` does. A top-level target
is one created by one of the :command:`add_executable`,
:command:`add_library`, or :command:`add_custom_target` commands
diff --git a/Help/command/add_executable.rst b/Help/command/add_executable.rst
index c7a30d7f4..0a7d7e151 100644
--- a/Help/command/add_executable.rst
+++ b/Help/command/add_executable.rst
@@ -3,7 +3,7 @@ add_executable
Add an executable to the project using the specified source files.
-::
+.. code-block:: cmake
add_executable(<name> [WIN32] [MACOSX_BUNDLE]
[EXCLUDE_FROM_ALL]
@@ -47,7 +47,7 @@ within IDE.
--------------------------------------------------------------------------
-::
+.. code-block:: cmake
add_executable(<name> IMPORTED [GLOBAL])
@@ -67,7 +67,7 @@ properties for more information.
--------------------------------------------------------------------------
-::
+.. code-block:: cmake
add_executable(<name> ALIAS <target>)
diff --git a/Help/command/add_library.rst b/Help/command/add_library.rst
index c4c512c0e..ec6cb9d9a 100644
--- a/Help/command/add_library.rst
+++ b/Help/command/add_library.rst
@@ -10,7 +10,7 @@ Add a library to the project using the specified source files.
Normal Libraries
^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
@@ -67,7 +67,7 @@ within IDE.
Imported Libraries
^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> <SHARED|STATIC|MODULE|OBJECT|UNKNOWN> IMPORTED
[GLOBAL])
@@ -92,7 +92,7 @@ for more information.
Object Libraries
^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> OBJECT <src>...)
@@ -121,7 +121,7 @@ consider adding at least one real source file to any target that references
Alias Libraries
^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> ALIAS <target>)
@@ -141,7 +141,7 @@ installed or exported.
Interface Libraries
^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
add_library(<name> INTERFACE [IMPORTED [GLOBAL]])
diff --git a/Help/command/add_link_options.rst b/Help/command/add_link_options.rst
index e5fb87829..1b02beebe 100644
--- a/Help/command/add_link_options.rst
+++ b/Help/command/add_link_options.rst
@@ -1,9 +1,9 @@
add_link_options
----------------
-Adds options to the link of shared library, module and executable targets.
+Add options to the link of shared library, module and executable targets.
-::
+.. code-block:: cmake
add_link_options(<option> ...)
diff --git a/Help/command/add_subdirectory.rst b/Help/command/add_subdirectory.rst
index 012ded451..8dba986ba 100644
--- a/Help/command/add_subdirectory.rst
+++ b/Help/command/add_subdirectory.rst
@@ -3,12 +3,11 @@ add_subdirectory
Add a subdirectory to the build.
-::
+.. code-block:: cmake
- add_subdirectory(source_dir [binary_dir]
- [EXCLUDE_FROM_ALL])
+ add_subdirectory(source_dir [binary_dir] [EXCLUDE_FROM_ALL])
-Add a subdirectory to the build. The source_dir specifies the
+Adds a subdirectory to the build. The source_dir specifies the
directory in which the source CMakeLists.txt and code files are
located. If it is a relative path it will be evaluated with respect
to the current directory (the typical usage), but it may also be an
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst
index d8a96e9b9..a8c257d8b 100644
--- a/Help/command/add_test.rst
+++ b/Help/command/add_test.rst
@@ -3,13 +3,13 @@ add_test
Add a test to the project to be run by :manual:`ctest(1)`.
-::
+.. code-block:: cmake
add_test(NAME <name> COMMAND <command> [<arg>...]
[CONFIGURATIONS <config>...]
[WORKING_DIRECTORY <dir>])
-Add a test called ``<name>``. The test name may not contain spaces,
+Adds a test called ``<name>``. The test name may not contain spaces,
quotes, or other characters special in CMake syntax. The options are:
``COMMAND``
@@ -39,7 +39,9 @@ The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator
expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
-Example usage::
+Example usage:
+
+.. code-block:: cmake
add_test(NAME mytest
COMMAND testDriver --config $<CONFIGURATION>
@@ -57,7 +59,7 @@ file produced by target ``myexe``.
---------------------------------------------------------------------
-::
+.. code-block:: cmake
add_test(<name> <command> [<arg>...])
diff --git a/Help/command/aux_source_directory.rst b/Help/command/aux_source_directory.rst
index dcd1cdfc3..e0af66591 100644
--- a/Help/command/aux_source_directory.rst
+++ b/Help/command/aux_source_directory.rst
@@ -3,7 +3,7 @@ aux_source_directory
Find all source files in a directory.
-::
+.. code-block:: cmake
aux_source_directory(<dir> <variable>)
diff --git a/Help/command/break.rst b/Help/command/break.rst
index fc2cd3c7b..4875a2bf2 100644
--- a/Help/command/break.rst
+++ b/Help/command/break.rst
@@ -3,10 +3,10 @@ break
Break from an enclosing foreach or while loop.
-::
+.. code-block:: cmake
break()
-Breaks from an enclosing foreach loop or while loop
+Breaks from an enclosing :command:`foreach` or :command:`while` loop.
See also the :command:`continue` command.
diff --git a/Help/command/build_name.rst b/Help/command/build_name.rst
index f717db1dd..2a1fbae62 100644
--- a/Help/command/build_name.rst
+++ b/Help/command/build_name.rst
@@ -1,7 +1,7 @@
build_name
----------
-Disallowed. See CMake Policy :policy:`CMP0036`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0036`.
Use ``${CMAKE_SYSTEM}`` and ``${CMAKE_CXX_COMPILER}`` instead.
diff --git a/Help/command/cmake_host_system_information.rst b/Help/command/cmake_host_system_information.rst
index 2dee93ad5..2e9563aab 100644
--- a/Help/command/cmake_host_system_information.rst
+++ b/Help/command/cmake_host_system_information.rst
@@ -3,7 +3,7 @@ cmake_host_system_information
Query host system specific information.
-::
+.. code-block:: cmake
cmake_host_system_information(RESULT <variable> QUERY <key> ...)
diff --git a/Help/command/cmake_minimum_required.rst b/Help/command/cmake_minimum_required.rst
index 2f1ab6012..e6ebcf0db 100644
--- a/Help/command/cmake_minimum_required.rst
+++ b/Help/command/cmake_minimum_required.rst
@@ -1,11 +1,15 @@
cmake_minimum_required
----------------------
-Set the minimum required version of cmake for a project and
-update `Policy Settings`_ to match the version given::
+Require a minimum version of cmake.
+
+.. code-block:: cmake
cmake_minimum_required(VERSION <min>[...<max>] [FATAL_ERROR])
+Sets the minimum required version of cmake for a project.
+Also updates the policy settings as explained below.
+
``<min>`` and the optional ``<max>`` are each CMake versions of the form
``major.minor[.patch[.tweak]]``, and the ``...`` is literal.
@@ -47,13 +51,17 @@ as of a given CMake version and tells newer CMake versions to warn
about their new policies.
When a ``<min>`` version higher than 2.4 is specified the command
-implicitly invokes::
+implicitly invokes
+
+.. code-block:: cmake
cmake_policy(VERSION <min>[...<max>])
which sets CMake policies based on the range of versions specified.
When a ``<min>`` version 2.4 or lower is given the command implicitly
-invokes::
+invokes
+
+.. code-block:: cmake
cmake_policy(VERSION 2.4[...<max>])
diff --git a/Help/command/cmake_parse_arguments.rst b/Help/command/cmake_parse_arguments.rst
index efbef549e..c8327e286 100644
--- a/Help/command/cmake_parse_arguments.rst
+++ b/Help/command/cmake_parse_arguments.rst
@@ -1,26 +1,28 @@
cmake_parse_arguments
---------------------
-``cmake_parse_arguments`` is intended to be used in macros or functions for
-parsing the arguments given to that macro or function. It processes the
-arguments and defines a set of variables which hold the values of the
-respective options.
+Parse function or macro arguments.
-::
+.. code-block:: cmake
cmake_parse_arguments(<prefix> <options> <one_value_keywords>
- <multi_value_keywords> args...)
+ <multi_value_keywords> <args>...)
- cmake_parse_arguments(PARSE_ARGV N <prefix> <options> <one_value_keywords>
- <multi_value_keywords>)
+ cmake_parse_arguments(PARSE_ARGV <N> <prefix> <options>
+ <one_value_keywords> <multi_value_keywords>)
+
+This command is for use in macros or functions.
+It processes the arguments given to that macro or function,
+and defines a set of variables which hold the values of the
+respective options.
-The first signature reads processes arguments passed in the ``args...``.
+The first signature reads processes arguments passed in the ``<args>...``.
This may be used in either a :command:`macro` or a :command:`function`.
The ``PARSE_ARGV`` signature is only for use in a :command:`function`
body. In this case the arguments that are parsed come from the
``ARGV#`` variables of the calling function. The parsing starts with
-the Nth argument, where ``N`` is an unsigned integer. This allows for
+the ``<N>``-th argument, where ``<N>`` is an unsigned integer. This allows for
the values to have special characters like ``;`` in them.
The ``<options>`` argument contains all options for the respective macro,
diff --git a/Help/command/cmake_policy.rst b/Help/command/cmake_policy.rst
index c3f7cfb96..a80f98244 100644
--- a/Help/command/cmake_policy.rst
+++ b/Help/command/cmake_policy.rst
@@ -22,7 +22,9 @@ Setting Policies by CMake Version
The ``cmake_policy`` command is used to set policies to ``OLD`` or ``NEW``
behavior. While setting policies individually is supported, we
-encourage projects to set policies based on CMake versions::
+encourage projects to set policies based on CMake versions:
+
+.. code-block:: cmake
cmake_policy(VERSION <min>[...<max>])
@@ -50,7 +52,7 @@ command implicitly calls ``cmake_policy(VERSION)`` too.
Setting Policies Explicitly
^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
cmake_policy(SET CMP<NNNN> NEW)
cmake_policy(SET CMP<NNNN> OLD)
@@ -66,7 +68,7 @@ policy state to ``NEW``.
Checking Policy Settings
^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
cmake_policy(GET CMP<NNNN> <variable>)
@@ -85,7 +87,9 @@ scripts loaded by :command:`include` and :command:`find_package` commands
except when invoked with the ``NO_POLICY_SCOPE`` option
(see also policy :policy:`CMP0011`).
The ``cmake_policy`` command provides an interface to manage custom
-entries on the policy stack::
+entries on the policy stack:
+
+.. code-block:: cmake
cmake_policy(PUSH)
cmake_policy(POP)
diff --git a/Help/command/configure_file.rst b/Help/command/configure_file.rst
index e08c57347..29e85bd16 100644
--- a/Help/command/configure_file.rst
+++ b/Help/command/configure_file.rst
@@ -3,7 +3,7 @@ configure_file
Copy a file to another location and modify its contents.
-::
+.. code-block:: cmake
configure_file(<input> <output>
[COPYONLY] [ESCAPE_QUOTES] [@ONLY]
@@ -13,15 +13,21 @@ Copies an ``<input>`` file to an ``<output>`` file and substitutes
variable values referenced as ``@VAR@`` or ``${VAR}`` in the input
file content. Each variable reference will be replaced with the
current value of the variable, or the empty string if the variable
-is not defined. Furthermore, input lines of the form::
+is not defined. Furthermore, input lines of the form
+
+.. code-block:: c
#cmakedefine VAR ...
-will be replaced with either::
+will be replaced with either
+
+.. code-block:: c
#define VAR ...
-or::
+or
+
+.. code-block:: c
/* #undef VAR */
@@ -33,12 +39,16 @@ either ``#define VAR 1`` or ``#define VAR 0`` similarly.
The result lines (with the exception of the ``#undef`` comments) can be
indented using spaces and/or tabs between the ``#`` character
and the ``cmakedefine`` or ``cmakedefine01`` words. This whitespace
-indentation will be preserved in the output lines::
+indentation will be preserved in the output lines:
+
+.. code-block:: c
# cmakedefine VAR
# cmakedefine01 VAR
-will be replaced, if ``VAR`` is defined, with::
+will be replaced, if ``VAR`` is defined, with
+
+.. code-block:: c
# define VAR
# define VAR 1
diff --git a/Help/command/continue.rst b/Help/command/continue.rst
index 1c7d6730c..31c7089a1 100644
--- a/Help/command/continue.rst
+++ b/Help/command/continue.rst
@@ -3,10 +3,12 @@ continue
Continue to the top of enclosing foreach or while loop.
-::
+.. code-block:: cmake
continue()
The ``continue`` command allows a cmake script to abort the rest of a block
in a :command:`foreach` or :command:`while` loop, and start at the top of
-the next iteration. See also the :command:`break` command.
+the next iteration.
+
+See also the :command:`break` command.
diff --git a/Help/command/create_test_sourcelist.rst b/Help/command/create_test_sourcelist.rst
index dde6812e1..77e37c50f 100644
--- a/Help/command/create_test_sourcelist.rst
+++ b/Help/command/create_test_sourcelist.rst
@@ -3,7 +3,7 @@ create_test_sourcelist
Create a test driver and source list for building test programs.
-::
+.. code-block:: cmake
create_test_sourcelist(sourceListName driverName
test1 test2 test3
diff --git a/Help/command/ctest_build.rst b/Help/command/ctest_build.rst
index 55bb4a317..66e1844e9 100644
--- a/Help/command/ctest_build.rst
+++ b/Help/command/ctest_build.rst
@@ -50,9 +50,7 @@ The options are:
for an example.
``PROJECT_NAME <project-name>``
- Set the name of the project to build. This should correspond
- to the top-level call to the :command:`project` command.
- If not specified the ``CTEST_PROJECT_NAME`` variable will be checked.
+ Ignored. This was once used but is no longer needed.
``TARGET <target-name>``
Specify the name of a target to build. If not specified the
diff --git a/Help/command/ctest_submit.rst b/Help/command/ctest_submit.rst
index 2ba6bef3d..fba03fd58 100644
--- a/Help/command/ctest_submit.rst
+++ b/Help/command/ctest_submit.rst
@@ -6,6 +6,7 @@ Perform the :ref:`CTest Submit Step` as a :ref:`Dashboard Client`.
::
ctest_submit([PARTS <part>...] [FILES <file>...]
+ [SUBMIT_URL <url>]
[HTTPHEADER <header>]
[RETRY_COUNT <count>]
[RETRY_DELAY <delay>]
@@ -33,11 +34,16 @@ The options are:
ExtraFiles = Files listed by CTEST_EXTRA_SUBMIT_FILES
Upload = Files prepared for upload by ctest_upload(), in Upload.xml
Submit = nothing
+ Done = Build is complete, in Done.xml
``FILES <file>...``
Specify an explicit list of specific files to be submitted.
Each individual file must exist at the time of the call.
+``SUBMIT_URL <url>``
+ The ``http`` or ``https`` URL of the dashboard server to send the submission
+ to. If not given, the :variable:`CTEST_SUBMIT_URL` variable is used.
+
``HTTPHEADER <HTTP-header>``
Specify HTTP header to be included in the request to CDash during submission.
This suboption can be repeated several times.
@@ -67,6 +73,7 @@ Submit to CDash Upload API
::
ctest_submit(CDASH_UPLOAD <file> [CDASH_UPLOAD_TYPE <type>]
+ [SUBMIT_URL <url>]
[HTTPHEADER <header>]
[RETRY_COUNT <count>]
[RETRY_DELAY <delay>]
@@ -79,5 +86,5 @@ with a content hash of the file. If CDash does not already have the file,
then it is uploaded. Along with the file, a CDash type string is specified
to tell CDash which handler to use to process the data.
-This signature accepts the ``HTTPHEADER``, ``RETRY_COUNT``, ``RETRY_DELAY``,
-``RETURN_VALUE`` and ``QUIET`` options as described above.
+This signature accepts the ``SUBMIT_URL``, ``HTTPHEADER``, ``RETRY_COUNT``,
+``RETRY_DELAY``, ``RETURN_VALUE`` and ``QUIET`` options as described above.
diff --git a/Help/command/define_property.rst b/Help/command/define_property.rst
index da2631c09..8f7439bbe 100644
--- a/Help/command/define_property.rst
+++ b/Help/command/define_property.rst
@@ -3,7 +3,7 @@ define_property
Define and document custom properties.
-::
+.. code-block:: cmake
define_property(<GLOBAL | DIRECTORY | TARGET | SOURCE |
TEST | VARIABLE | CACHED_VARIABLE>
@@ -11,7 +11,7 @@ Define and document custom properties.
BRIEF_DOCS <brief-doc> [docs...]
FULL_DOCS <full-doc> [docs...])
-Define one property in a scope for use with the :command:`set_property` and
+Defines one property in a scope for use with the :command:`set_property` and
:command:`get_property` commands. This is primarily useful to associate
documentation with property names that may be retrieved with the
:command:`get_property` command. The first argument determines the kind of
diff --git a/Help/command/else.rst b/Help/command/else.rst
index 0e5a19810..a98fcd88e 100644
--- a/Help/command/else.rst
+++ b/Help/command/else.rst
@@ -3,8 +3,8 @@ else
Starts the else portion of an if block.
-::
+.. code-block:: cmake
- else(expression)
+ else([<condition>])
See the :command:`if` command.
diff --git a/Help/command/elseif.rst b/Help/command/elseif.rst
index 9a8dfed1d..6bf8646fb 100644
--- a/Help/command/elseif.rst
+++ b/Help/command/elseif.rst
@@ -1,10 +1,11 @@
elseif
------
-Starts the elseif portion of an if block.
+Starts an elseif portion of an if block.
-::
+.. code-block:: cmake
- elseif(expression)
+ elseif(<condition>)
-See the :command:`if` command.
+See the :command:`if` command, especially for the syntax and logic
+of the ``<condition>``.
diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst
index 61dfc0351..fb49b4432 100644
--- a/Help/command/enable_language.rst
+++ b/Help/command/enable_language.rst
@@ -3,12 +3,12 @@ enable_language
Enable a language (CXX/C/Fortran/etc)
-::
+.. code-block:: cmake
enable_language(<lang> [OPTIONAL] )
-This command enables support for the named language in CMake. This is
-the same as the project command but does not create any of the extra
+Enables support for the named language in CMake. This is
+the same as the :command:`project` command but does not create any of the extra
variables that are created by the project command. Example languages
are ``CXX``, ``C``, ``CUDA``, ``Fortran``, and ``ASM``.
diff --git a/Help/command/enable_testing.rst b/Help/command/enable_testing.rst
index 1e3e2799c..e2028d21b 100644
--- a/Help/command/enable_testing.rst
+++ b/Help/command/enable_testing.rst
@@ -3,7 +3,7 @@ enable_testing
Enable testing for current directory and below.
-::
+.. code-block:: cmake
enable_testing()
diff --git a/Help/command/endforeach.rst b/Help/command/endforeach.rst
index 9af972bee..fd923d56a 100644
--- a/Help/command/endforeach.rst
+++ b/Help/command/endforeach.rst
@@ -3,8 +3,12 @@ endforeach
Ends a list of commands in a foreach block.
-::
+.. code-block:: cmake
- endforeach(expression)
+ endforeach([<loop_var>])
See the :command:`foreach` command.
+
+The optional ``<loop_var>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the ``<loop_var>`` argument of
+the opening ``foreach`` clause.
diff --git a/Help/command/endfunction.rst b/Help/command/endfunction.rst
index 6cc196cde..e27129d8a 100644
--- a/Help/command/endfunction.rst
+++ b/Help/command/endfunction.rst
@@ -3,8 +3,12 @@ endfunction
Ends a list of commands in a function block.
-::
+.. code-block:: cmake
- endfunction(expression)
+ endfunction([<name>])
See the :command:`function` command.
+
+The optional ``<name>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the ``<name>`` argument
+of the opening ``function`` command.
diff --git a/Help/command/endif.rst b/Help/command/endif.rst
index a0163bf33..fc4f03822 100644
--- a/Help/command/endif.rst
+++ b/Help/command/endif.rst
@@ -3,8 +3,12 @@ endif
Ends a list of commands in an if block.
-::
+.. code-block:: cmake
- endif(expression)
+ endif([<condition>])
See the :command:`if` command.
+
+The optional ``<condition>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the argument of the opening
+``if`` clause.
diff --git a/Help/command/endmacro.rst b/Help/command/endmacro.rst
index 47327a783..4290ba748 100644
--- a/Help/command/endmacro.rst
+++ b/Help/command/endmacro.rst
@@ -3,8 +3,12 @@ endmacro
Ends a list of commands in a macro block.
-::
+.. code-block:: cmake
- endmacro(expression)
+ endmacro([<name>])
See the :command:`macro` command.
+
+The optional ``<name>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the ``<name>`` argument
+of the opening ``macro`` command.
diff --git a/Help/command/endwhile.rst b/Help/command/endwhile.rst
index 798c20e71..5ef585bdc 100644
--- a/Help/command/endwhile.rst
+++ b/Help/command/endwhile.rst
@@ -3,8 +3,12 @@ endwhile
Ends a list of commands in a while block.
-::
+.. code-block:: cmake
- endwhile(expression)
+ endwhile([<condition>])
See the :command:`while` command.
+
+The optional ``<condition>`` argument is supported for backward compatibility
+only. If used it must be a verbatim repeat of the argument of the opening
+``while`` clause.
diff --git a/Help/command/exec_program.rst b/Help/command/exec_program.rst
index 6dfdad394..bc9b06916 100644
--- a/Help/command/exec_program.rst
+++ b/Help/command/exec_program.rst
@@ -1,7 +1,9 @@
exec_program
------------
-Deprecated. Use the :command:`execute_process` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`execute_process` command instead.
Run an executable program during the processing of the CMakeList.txt
file.
diff --git a/Help/command/execute_process.rst b/Help/command/execute_process.rst
index 716f45790..3a56dce97 100644
--- a/Help/command/execute_process.rst
+++ b/Help/command/execute_process.rst
@@ -5,8 +5,8 @@ Execute one or more child processes.
.. code-block:: cmake
- execute_process(COMMAND <cmd1> [args1...]]
- [COMMAND <cmd2> [args2...] [...]]
+ execute_process(COMMAND <cmd1> [<arguments>]
+ [COMMAND <cmd2> [<arguments>]]...
[WORKING_DIRECTORY <directory>]
[TIMEOUT <seconds>]
[RESULT_VARIABLE <variable>]
@@ -56,7 +56,7 @@ Options:
``RESULTS_VARIABLE <variable>``
The variable will be set to contain the result of all processes as a
- :ref:`;-list <CMake Language Lists>`, in order of the given ``COMMAND``
+ :ref:`semicolon-separated list <CMake Language Lists>`, in order of the given ``COMMAND``
arguments. Each entry will be an integer return code from the
corresponding child or a string describing an error condition.
diff --git a/Help/command/export.rst b/Help/command/export.rst
index 8c4932848..b255ee84e 100644
--- a/Help/command/export.rst
+++ b/Help/command/export.rst
@@ -3,11 +3,11 @@ export
Export targets from the build tree for use by outside projects.
-::
+.. code-block:: cmake
export(EXPORT <export-name> [NAMESPACE <namespace>] [FILE <filename>])
-Create a file ``<filename>`` that may be included by outside projects to
+Creates a file ``<filename>`` that may be included by outside projects to
import targets from the current project's build tree. This is useful
during cross-compiling to build utility executables that can run on
the host platform in one project and then import them into another
@@ -25,7 +25,7 @@ export targets from an installation tree.
The properties set on the generated IMPORTED targets will have the
same values as the final values of the input TARGETS.
-::
+.. code-block:: cmake
export(TARGETS [target1 [target2 [...]]] [NAMESPACE <namespace>]
[APPEND] FILE <filename> [EXPORT_LINK_INTERFACE_LIBRARIES])
@@ -49,7 +49,7 @@ unspecified.
transitive usage requirements of other targets that link to the
object libraries in their implementation.
-::
+.. code-block:: cmake
export(PACKAGE <PackageName>)
@@ -65,7 +65,7 @@ wide installations, it is not desirable to write the user package
registry. If the :variable:`CMAKE_EXPORT_NO_PACKAGE_REGISTRY` variable
is enabled, the ``export(PACKAGE)`` command will do nothing.
-::
+.. code-block:: cmake
export(TARGETS [target1 [target2 [...]]] [ANDROID_MK <filename>])
diff --git a/Help/command/export_library_dependencies.rst b/Help/command/export_library_dependencies.rst
index 2cb437e77..9753abf54 100644
--- a/Help/command/export_library_dependencies.rst
+++ b/Help/command/export_library_dependencies.rst
@@ -1,7 +1,7 @@
export_library_dependencies
---------------------------
-Disallowed. See CMake Policy :policy:`CMP0033`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0033`.
Use :command:`install(EXPORT)` or :command:`export` command.
diff --git a/Help/command/file.rst b/Help/command/file.rst
index d4a60062d..465e56743 100644
--- a/Help/command/file.rst
+++ b/Help/command/file.rst
@@ -25,6 +25,9 @@ Synopsis
file({`REMOVE`_ | `REMOVE_RECURSE`_ } [<files>...])
file(`MAKE_DIRECTORY`_ [<dir>...])
file({`COPY`_ | `INSTALL`_} <file>... DESTINATION <dir> [...])
+ file(`SIZE`_ <filename> <out-var>)
+ file(`READ_SYMLINK`_ <linkname> <out-var>)
+ file(`CREATE_LINK`_ <original> <linkname> [...])
`Path Conversion`_
file(`RELATIVE_PATH`_ <out-var> <directory> <file>)
@@ -42,7 +45,7 @@ Reading
.. _READ:
-::
+.. code-block:: cmake
file(READ <filename> <variable>
[OFFSET <offset>] [LIMIT <max-in>] [HEX])
@@ -54,7 +57,7 @@ be converted to a hexadecimal representation (useful for binary data).
.. _STRINGS:
-::
+.. code-block:: cmake
file(STRINGS <filename> <variable> [<options>...])
@@ -105,7 +108,7 @@ from the input file.
.. _HASH:
-::
+.. code-block:: cmake
file(<HASH> <filename> <variable>)
@@ -116,7 +119,7 @@ command.
.. _TIMESTAMP:
-::
+.. code-block:: cmake
file(TIMESTAMP <filename> <variable> [<format>] [UTC])
@@ -133,7 +136,7 @@ Writing
.. _WRITE:
.. _APPEND:
-::
+.. code-block:: cmake
file(WRITE <filename> <content>...)
file(APPEND <filename> <content>...)
@@ -150,7 +153,7 @@ to update the file only when its content changes.
.. _TOUCH:
.. _TOUCH_NOCREATE:
-::
+.. code-block:: cmake
file(TOUCH [<files>...])
file(TOUCH_NOCREATE [<files>...])
@@ -167,7 +170,7 @@ modified.
.. _GENERATE:
-::
+.. code-block:: cmake
file(GENERATE OUTPUT output-file
<INPUT input-file|CONTENT content>
@@ -217,7 +220,7 @@ Filesystem
.. _GLOB:
.. _GLOB_RECURSE:
-::
+.. code-block:: cmake
file(GLOB <variable>
[LIST_DIRECTORIES true|false] [RELATIVE <path>] [CONFIGURE_DEPENDS]
@@ -272,7 +275,7 @@ Examples of recursive globbing include::
.. _RENAME:
-::
+.. code-block:: cmake
file(RENAME <oldname> <newname>)
@@ -282,7 +285,7 @@ Move a file or directory within a filesystem from ``<oldname>`` to
.. _REMOVE:
.. _REMOVE_RECURSE:
-::
+.. code-block:: cmake
file(REMOVE [<files>...])
file(REMOVE_RECURSE [<files>...])
@@ -293,7 +296,7 @@ given file does not exist.
.. _MAKE_DIRECTORY:
-::
+.. code-block:: cmake
file(MAKE_DIRECTORY [<directories>...])
@@ -302,7 +305,7 @@ Create the given directories and their parents as needed.
.. _COPY:
.. _INSTALL:
-::
+.. code-block:: cmake
file(<COPY|INSTALL> <files>... DESTINATION <dir>
[FILE_PERMISSIONS <permissions>...]
@@ -333,12 +336,67 @@ and ``NO_SOURCE_PERMISSIONS`` is default.
Installation scripts generated by the :command:`install` command
use this signature (with some undocumented options for internal use).
+.. _SIZE:
+
+.. code-block:: cmake
+
+ file(SIZE <filename> <variable>)
+
+Determine the file size of the ``<filename>`` and put the result in
+``<variable>`` variable. Requires that ``<filename>`` is a valid path
+pointing to a file and is readable.
+
+.. _READ_SYMLINK:
+
+.. code-block:: cmake
+
+ file(READ_SYMLINK <linkname> <variable>)
+
+This subcommand queries the symlink ``<linkname>`` and stores the path it
+points to in the result ``<variable>``. If ``<linkname>`` does not exist or
+is not a symlink, CMake issues a fatal error.
+
+Note that this command returns the raw symlink path and does not resolve
+a relative path. The following is an example of how to ensure that an
+absolute path is obtained:
+
+.. code-block:: cmake
+
+ set(linkname "/path/to/foo.sym")
+ file(READ_SYMLINK "${linkname}" result)
+ if(NOT IS_ABSOLUTE "${result}")
+ get_filename_component(dir "${linkname}" DIRECTORY)
+ set(result "${dir}/${result}")
+ endif()
+
+.. _CREATE_LINK:
+
+.. code-block:: cmake
+
+ file(CREATE_LINK <original> <linkname>
+ [RESULT <result>] [COPY_ON_ERROR] [SYMBOLIC])
+
+Create a link ``<linkname>`` that points to ``<original>``.
+It will be a hard link by default, but providing the ``SYMBOLIC`` option
+results in a symbolic link instead. Hard links require that ``original``
+exists and is a file, not a directory. If ``<linkname>`` already exists,
+it will be overwritten.
+
+The ``<result>`` variable, if specified, receives the status of the operation.
+It is set to ``0`` upon success or an error message otherwise. If ``RESULT``
+is not specified and the operation fails, a fatal error is emitted.
+
+Specifying ``COPY_ON_ERROR`` enables copying the file as a fallback if
+creating the link fails. It can be useful for handling situations such as
+``<original>`` and ``<linkname>`` being on different drives or mount points,
+which would make them unable to support a hard link.
+
Path Conversion
^^^^^^^^^^^^^^^
.. _RELATIVE_PATH:
-::
+.. code-block:: cmake
file(RELATIVE_PATH <variable> <directory> <file>)
@@ -348,7 +406,7 @@ store it in the ``<variable>``.
.. _TO_CMAKE_PATH:
.. _TO_NATIVE_PATH:
-::
+.. code-block:: cmake
file(TO_CMAKE_PATH "<path>" <variable>)
file(TO_NATIVE_PATH "<path>" <variable>)
@@ -370,7 +428,7 @@ Transfer
.. _DOWNLOAD:
.. _UPLOAD:
-::
+.. code-block:: cmake
file(DOWNLOAD <url> <file> [<options>...])
file(UPLOAD <file> <url> [<options>...])
@@ -460,7 +518,7 @@ Locking
.. _LOCK:
-::
+.. code-block:: cmake
file(LOCK <path> [DIRECTORY] [RELEASE]
[GUARD <FUNCTION|FILE|PROCESS>]
diff --git a/Help/command/find_package.rst b/Help/command/find_package.rst
index 3ad571cdb..54d5f68fe 100644
--- a/Help/command/find_package.rst
+++ b/Help/command/find_package.rst
@@ -12,7 +12,7 @@ Find an external project, and load its settings.
Basic Signature and Module Mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
find_package(<PackageName> [version] [EXACT] [QUIET] [MODULE]
[REQUIRED] [[COMPONENTS] [components...]]
@@ -23,9 +23,9 @@ Finds and loads settings from an external project. ``<PackageName>_FOUND``
will be set to indicate whether the package was found. When the
package is found package-specific information is provided through
variables and :ref:`Imported Targets` documented by the package itself. The
-``QUIET`` option disables messages if the package cannot be found. The
-``REQUIRED`` option stops processing with an error message if the package
-cannot be found.
+``QUIET`` option disables informational messages, including those indicating
+that the package cannot be found if it is not ``REQUIRED``. The ``REQUIRED``
+option stops processing with an error message if the package cannot be found.
A package-specific list of required components may be listed after the
``COMPONENTS`` option (or after the ``REQUIRED`` option if present).
@@ -51,8 +51,9 @@ mode and "Config" mode. The above signature selects Module mode.
If no module is found the command falls back to Config mode, described
below. This fall back is disabled if the ``MODULE`` option is given.
-In Module mode, CMake searches for a file called ``Find<PackageName>.cmake``
-in the :variable:`CMAKE_MODULE_PATH` followed by the CMake installation.
+In Module mode, CMake searches for a file called ``Find<PackageName>.cmake``.
+The file is first searched in the :variable:`CMAKE_MODULE_PATH`,
+then among the :ref:`Find Modules` provided by the CMake installation.
If the file is found, it is read and processed by CMake. It is responsible
for finding the package, checking the version, and producing any needed
messages. Some find-modules provide limited or no support for versioning;
@@ -67,7 +68,9 @@ full command signature and details of the search process. Project
maintainers wishing to provide a package to be found by this command
are encouraged to read on.
-The complete Config mode command signature is::
+The complete Config mode command signature is
+
+.. code-block:: cmake
find_package(<PackageName> [version] [EXACT] [QUIET]
[REQUIRED] [[COMPONENTS] [components...]]
@@ -202,7 +205,9 @@ is set no attempt is made to choose a highest or closest version number.
To control the order in which ``find_package`` checks for compatibility use
the two variables :variable:`CMAKE_FIND_PACKAGE_SORT_ORDER` and
:variable:`CMAKE_FIND_PACKAGE_SORT_DIRECTION`.
-For instance in order to select the highest version one can set::
+For instance in order to select the highest version one can set
+
+.. code-block:: cmake
SET(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
SET(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
@@ -286,7 +291,7 @@ enabled.
2. Search paths specified in cmake-specific cache variables. These
are intended to be used on the command line with a ``-DVAR=value``.
- The values are interpreted as :ref:`;-lists <CMake Language Lists>`.
+ The values are interpreted as :ref:`semicolon-separated lists <CMake Language Lists>`.
This can be skipped if ``NO_CMAKE_PATH`` is passed::
CMAKE_PREFIX_PATH
@@ -349,6 +354,11 @@ enabled.
.. include:: FIND_XXX_ROOT.txt
.. include:: FIND_XXX_ORDER.txt
+By default the value stored in the result variable will be the path at
+which the file is found. The :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS`
+variable may be set to ``TRUE`` before calling ``find_package`` in order
+to resolve symbolic links and store the real path to the file.
+
Every non-REQUIRED ``find_package`` call can be disabled by setting the
:variable:`CMAKE_DISABLE_FIND_PACKAGE_<PackageName>` variable to ``TRUE``.
diff --git a/Help/command/fltk_wrap_ui.rst b/Help/command/fltk_wrap_ui.rst
index 041e5a7e3..66752729d 100644
--- a/Help/command/fltk_wrap_ui.rst
+++ b/Help/command/fltk_wrap_ui.rst
@@ -3,7 +3,7 @@ fltk_wrap_ui
Create FLTK user interfaces Wrappers.
-::
+.. code-block:: cmake
fltk_wrap_ui(resultingLibraryName source1
source2 ... sourceN )
diff --git a/Help/command/foreach.rst b/Help/command/foreach.rst
index 106ba7318..ae2afb290 100644
--- a/Help/command/foreach.rst
+++ b/Help/command/foreach.rst
@@ -3,45 +3,82 @@ foreach
Evaluate a group of commands for each value in a list.
-::
+.. code-block:: cmake
- foreach(loop_var arg1 arg2 ...)
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endforeach(loop_var)
+ foreach(<loop_var> <items>)
+ <commands>
+ endforeach()
-All commands between foreach and the matching endforeach are recorded
-without being invoked. Once the endforeach is evaluated, the recorded
-list of commands is invoked once for each argument listed in the
-original foreach command. Before each iteration of the loop
-``${loop_var}`` will be set as a variable with the current value in the
-list.
+where ``<items>`` is a list of items that are separated by
+semicolon or whitespace.
+All commands between ``foreach`` and the matching ``endforeach`` are recorded
+without being invoked. Once the ``endforeach`` is evaluated, the recorded
+list of commands is invoked once for each item in ``<items>``.
+At the beginning of each iteration the variable ``loop_var`` will be set
+to the value of the current item.
-::
+The commands :command:`break` and :command:`continue` provide means to
+escape from the normal control flow.
- foreach(loop_var RANGE total)
- foreach(loop_var RANGE start stop [step])
+Per legacy, the :command:`endforeach` command admits
+an optional ``<loop_var>`` argument.
+If used, it must be a verbatim
+repeat of the argument of the opening
+``foreach`` command.
-Foreach can also iterate over a generated range of numbers. There are
-three types of this iteration:
+.. code-block:: cmake
-* When specifying single number, the range will have elements [0, ... to
- "total"] (inclusive).
+ foreach(<loop_var> RANGE <stop>)
-* When specifying two numbers, the range will have elements from the
- first number to the second number (inclusive).
+In this variant, ``foreach`` iterates over the numbers
+0, 1, ... up to (and including) the nonnegative integer ``<stop>``.
-* The third optional number is the increment used to iterate from the
- first number to the second number (inclusive).
+.. code-block:: cmake
-::
+ foreach(<loop_var> RANGE <start> <stop> [<step>])
+
+In this variant, ``foreach`` iterates over the numbers from
+``<start>`` up to at most ``<stop>`` in steps of ``<step>``.
+If ``<step>`` is not specified, then the step size is 1.
+The three arguments ``<start>`` ``<stop>`` ``<step>`` must
+all be nonnegative integers, and ``<stop>`` must not be
+smaller than ``<start>``; otherwise you enter the danger zone
+of undocumented behavior that may change in future releases.
+
+.. code-block:: cmake
+
+ foreach(loop_var IN [LISTS [<lists>]] [ITEMS [<items>]])
- foreach(loop_var IN [LISTS [list1 [...]]]
- [ITEMS [item1 [...]]])
+In this variant, ``<lists>`` is a whitespace or semicolon
+separated list of list-valued variables. The ``foreach``
+command iterates over each item in each given list.
+The ``<items>`` following the ``ITEMS`` keyword are processed
+as in the first variant of the ``foreach`` command.
+The forms ``LISTS A`` and ``ITEMS ${A}`` are
+equivalent.
+
+The following example shows how the ``LISTS`` option is
+processed:
+
+.. code-block:: cmake
+
+ set(A 0;1)
+ set(B 2 3)
+ set(C "4 5")
+ set(D 6;7 8)
+ set(E "")
+ foreach(X IN LISTS A B C D E)
+ message(STATUS "X=${X}")
+ endforeach()
+
+yields
+::
-Iterates over a precise list of items. The ``LISTS`` option names
-list-valued variables to be traversed, including empty elements (an
-empty string is a zero-length list). (Note macro
-arguments are not variables.) The ``ITEMS`` option ends argument
-parsing and includes all arguments following it in the iteration.
+ -- X=0
+ -- X=1
+ -- X=2
+ -- X=3
+ -- X=4 5
+ -- X=6
+ -- X=7
+ -- X=8
diff --git a/Help/command/function.rst b/Help/command/function.rst
index 7ffdfee65..53ba75481 100644
--- a/Help/command/function.rst
+++ b/Help/command/function.rst
@@ -1,36 +1,70 @@
function
--------
-Start recording a function for later invocation as a command::
-
- function(<name> [arg1 [arg2 [arg3 ...]]])
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endfunction(<name>)
-
-Define a function named ``<name>`` that takes arguments named ``arg1``,
-``arg2``, ``arg3``, (...).
-Commands listed after function, but before the matching
-:command:`endfunction()`, are not invoked until the function is invoked.
-When it is invoked, the commands recorded in the function are first
-modified by replacing formal parameters (``${arg1}``) with the arguments
-passed, and then invoked as normal commands.
-In addition to referencing the formal parameters you can reference the
-``ARGC`` variable which will be set to the number of arguments passed
-into the function as well as ``ARGV0``, ``ARGV1``, ``ARGV2``, ... which
-will have the actual values of the arguments passed in.
-This facilitates creating functions with optional arguments.
-Additionally ``ARGV`` holds the list of all arguments given to the
-function and ``ARGN`` holds the list of arguments past the last expected
-argument.
-Referencing to ``ARGV#`` arguments beyond ``ARGC`` have undefined
-behavior. Checking that ``ARGC`` is greater than ``#`` is the only way
-to ensure that ``ARGV#`` was passed to the function as an extra
-argument.
+Start recording a function for later invocation as a command.
+
+.. code-block:: cmake
+
+ function(<name> [<arg1> ...])
+ <commands>
+ endfunction()
+
+Defines a function named ``<name>`` that takes arguments named
+``<arg1>``, ... The ``<commands>`` in the function definition
+are recorded; they are not executed until the function is invoked.
+
+Per legacy, the :command:`endfunction` command admits an optional
+``<name>`` argument. If used, it must be a verbatim repeat of the
+argument of the opening ``function`` command.
A function opens a new scope: see :command:`set(var PARENT_SCOPE)` for
details.
See the :command:`cmake_policy()` command documentation for the behavior
of policies inside functions.
+
+See the :command:`macro()` command documentation for differences
+between CMake functions and macros.
+
+Invocation
+^^^^^^^^^^
+
+The function invocation is case-insensitive. A function defined as
+
+.. code-block:: cmake
+
+ function(foo)
+ <commands>
+ endfunction()
+
+can be invoked through any of
+
+.. code-block:: cmake
+
+ foo()
+ Foo()
+ FOO()
+
+and so on. However, it is strongly recommended to stay with the
+case chosen in the function definition. Typically functions use
+all-lowercase names.
+
+Arguments
+^^^^^^^^^
+
+When the function is invoked, the recorded ``<commands>`` are first
+modified by replacing formal parameters (``${arg1}``, ...) with the
+arguments passed, and then invoked as normal commands.
+
+In addition to referencing the formal parameters you can reference the
+``ARGC`` variable which will be set to the number of arguments passed
+into the function as well as ``ARGV0``, ``ARGV1``, ``ARGV2``, ... which
+will have the actual values of the arguments passed in. This facilitates
+creating functions with optional arguments.
+
+Furthermore, ``ARGV`` holds the list of all arguments given to the
+function and ``ARGN`` holds the list of arguments past the last expected
+argument. Referencing to ``ARGV#`` arguments beyond ``ARGC`` have
+undefined behavior. Checking that ``ARGC`` is greater than ``#`` is
+the only way to ensure that ``ARGV#`` was passed to the function as an
+extra argument.
diff --git a/Help/command/get_cmake_property.rst b/Help/command/get_cmake_property.rst
index 497ab4eeb..58bf7412b 100644
--- a/Help/command/get_cmake_property.rst
+++ b/Help/command/get_cmake_property.rst
@@ -3,14 +3,14 @@ get_cmake_property
Get a global property of the CMake instance.
-::
+.. code-block:: cmake
- get_cmake_property(VAR property)
+ get_cmake_property(<var> <property>)
-Get a global property from the CMake instance. The value of the property is
-stored in the variable ``VAR``. If the property is not found, ``VAR``
-will be set to "NOTFOUND". See the :manual:`cmake-properties(7)` manual
-for available properties.
+Gets a global property from the CMake instance. The value of
+the ``<property>`` is stored in the variable ``<var>``.
+If the property is not found, ``<var>`` will be set to ``"NOTFOUND"``.
+See the :manual:`cmake-properties(7)` manual for available properties.
See also the :command:`get_property` command ``GLOBAL`` option.
diff --git a/Help/command/get_directory_property.rst b/Help/command/get_directory_property.rst
index bf8349cb1..218efa9d3 100644
--- a/Help/command/get_directory_property.rst
+++ b/Help/command/get_directory_property.rst
@@ -3,11 +3,11 @@ get_directory_property
Get a property of ``DIRECTORY`` scope.
-::
+.. code-block:: cmake
get_directory_property(<variable> [DIRECTORY <dir>] <prop-name>)
-Store a property of directory scope in the named ``<variable>``.
+Stores a property of directory scope in the named ``<variable>``.
The ``DIRECTORY`` argument specifies another directory from which
to retrieve the property value instead of the current directory.
The specified directory must have already been traversed by CMake.
@@ -18,7 +18,7 @@ if the property is not found for the nominated directory scope,
the search will chain to a parent scope as described for the
:command:`define_property` command.
-::
+.. code-block:: cmake
get_directory_property(<variable> [DIRECTORY <dir>]
DEFINITION <var-name>)
diff --git a/Help/command/get_filename_component.rst b/Help/command/get_filename_component.rst
index f11c0fce6..9bbf87714 100644
--- a/Help/command/get_filename_component.rst
+++ b/Help/command/get_filename_component.rst
@@ -3,13 +3,11 @@ get_filename_component
Get a specific component of a full filename.
-------------------------------------------------------------------------------
+.. code-block:: cmake
-::
-
- get_filename_component(<VAR> <FileName> <COMP> [CACHE])
+ get_filename_component(<var> <FileName> <mode> [CACHE])
-Set ``<VAR>`` to a component of ``<FileName>``, where ``<COMP>`` is one of:
+Sets ``<var>`` to a component of ``<FileName>``, where ``<mode>`` is one of:
::
@@ -17,22 +15,19 @@ Set ``<VAR>`` to a component of ``<FileName>``, where ``<COMP>`` is one of:
NAME = File name without directory
EXT = File name longest extension (.b.c from d/a.b.c)
NAME_WE = File name without directory or longest extension
+ LAST_EXT = File name last extension (.c from d/a.b.c)
+ NAME_WLE = File name without directory or last extension
PATH = Legacy alias for DIRECTORY (use for CMake <= 2.8.11)
Paths are returned with forward slashes and have no trailing slashes.
-The longest file extension is always considered. If the optional
-``CACHE`` argument is specified, the result variable is added to the
-cache.
+If the optional ``CACHE`` argument is specified, the result variable is
+added to the cache.
-------------------------------------------------------------------------------
+.. code-block:: cmake
-::
+ get_filename_component(<var> <FileName> <mode> [BASE_DIR <dir>] [CACHE])
- get_filename_component(<VAR> <FileName>
- <COMP> [BASE_DIR <BASE_DIR>]
- [CACHE])
-
-Set ``<VAR>`` to the absolute path of ``<FileName>``, where ``<COMP>`` is one
+Sets ``<var>`` to the absolute path of ``<FileName>``, where ``<mode>`` is one
of:
::
@@ -41,7 +36,7 @@ of:
REALPATH = Full path to existing file with symlinks resolved
If the provided ``<FileName>`` is a relative path, it is evaluated relative
-to the given base directory ``<BASE_DIR>``. If no base directory is
+to the given base directory ``<dir>``. If no base directory is
provided, the default base directory will be
:variable:`CMAKE_CURRENT_SOURCE_DIR`.
@@ -49,16 +44,12 @@ Paths are returned with forward slashes and have no trailing slashes. If the
optional ``CACHE`` argument is specified, the result variable is added to the
cache.
-------------------------------------------------------------------------------
-
-::
+.. code-block:: cmake
- get_filename_component(<VAR> <FileName>
- PROGRAM [PROGRAM_ARGS <ARG_VAR>]
- [CACHE])
+ get_filename_component(<var> <FileName> PROGRAM [PROGRAM_ARGS <arg_var>] [CACHE])
The program in ``<FileName>`` will be found in the system search path or
left as a full path. If ``PROGRAM_ARGS`` is present with ``PROGRAM``, then
any command-line arguments present in the ``<FileName>`` string are split
-from the program name and stored in ``<ARG_VAR>``. This is used to
+from the program name and stored in ``<arg_var>``. This is used to
separate a program name from its arguments in a command line string.
diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst
index 8b85f7d6f..c0f9b460a 100644
--- a/Help/command/get_property.rst
+++ b/Help/command/get_property.rst
@@ -3,32 +3,33 @@ get_property
Get a property.
-::
+.. code-block:: cmake
get_property(<variable>
<GLOBAL |
- DIRECTORY [dir] |
+ DIRECTORY [<dir>] |
TARGET <target> |
SOURCE <source> |
INSTALL <file> |
TEST <test> |
CACHE <entry> |
- VARIABLE>
+ VARIABLE >
PROPERTY <name>
[SET | DEFINED | BRIEF_DOCS | FULL_DOCS])
-Get one property from one object in a scope. The first argument
-specifies the variable in which to store the result. The second
-argument determines the scope from which to get the property. It must
-be one of the following:
+Gets one property from one object in a scope.
+
+The first argument specifies the variable in which to store the result.
+The second argument determines the scope from which to get the property.
+It must be one of the following:
``GLOBAL``
Scope is unique and does not accept a name.
``DIRECTORY``
Scope defaults to the current directory but another
- directory (already processed by CMake) may be named by full or
- relative path.
+ directory (already processed by CMake) may be named by the
+ full or relative path ``<dir>``.
``TARGET``
Scope must name one existing target.
@@ -58,6 +59,7 @@ value indicating whether the property has been set. If the ``DEFINED``
option is given the variable is set to a boolean value indicating
whether the property has been defined such as with the
:command:`define_property` command.
+
If ``BRIEF_DOCS`` or ``FULL_DOCS`` is given then the variable is set to a
string containing documentation for the requested property. If
documentation is requested for a property that has not been defined
diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst
index 51fbd33a6..decec1916 100644
--- a/Help/command/get_source_file_property.rst
+++ b/Help/command/get_source_file_property.rst
@@ -3,11 +3,11 @@ get_source_file_property
Get a property for a source file.
-::
+.. code-block:: cmake
get_source_file_property(VAR file property)
-Get a property from a source file. The value of the property is
+Gets a property from a source file. The value of the property is
stored in the variable ``VAR``. If the source property is not found, the
behavior depends on whether it has been defined to be an ``INHERITED`` property
or not (see :command:`define_property`). Non-inherited properties will set
diff --git a/Help/command/get_target_property.rst b/Help/command/get_target_property.rst
index 98e9db30a..43276811d 100644
--- a/Help/command/get_target_property.rst
+++ b/Help/command/get_target_property.rst
@@ -3,7 +3,7 @@ get_target_property
Get a property from a target.
-::
+.. code-block:: cmake
get_target_property(VAR target property)
@@ -23,3 +23,5 @@ target so far created. The targets do not need to be in the current
``CMakeLists.txt`` file.
See also the more general :command:`get_property` command.
+
+See :ref:`Target Properties` for the list of properties known to CMake.
diff --git a/Help/command/get_test_property.rst b/Help/command/get_test_property.rst
index 555c3b26d..e02b9bc77 100644
--- a/Help/command/get_test_property.rst
+++ b/Help/command/get_test_property.rst
@@ -3,7 +3,7 @@ get_test_property
Get a property of the test.
-::
+.. code-block:: cmake
get_test_property(test property VAR)
diff --git a/Help/command/if.rst b/Help/command/if.rst
index 5294ce8e3..a48a0faac 100644
--- a/Help/command/if.rst
+++ b/Help/command/if.rst
@@ -3,41 +3,49 @@ if
Conditionally execute a group of commands.
+Synopsis
+^^^^^^^^
+
.. code-block:: cmake
- if(expression)
- # then section.
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- #...
- elseif(expression2)
- # elseif section.
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- #...
- else(expression)
- # else section.
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- #...
- endif(expression)
-
-Evaluates the given expression. If the result is true, the commands
-in the THEN section are invoked. Otherwise, the commands in the else
-section are invoked. The elseif and else sections are optional. You
-may have multiple elseif clauses. Note that the expression in the
-else and endif clause is optional. Long expressions can be used and
-there is a traditional order of precedence. Parenthetical expressions
-are evaluated first followed by unary tests such as ``EXISTS``,
-``COMMAND``, and ``DEFINED``. Then any binary tests such as
+ if(<condition>)
+ <commands>
+ elseif(<condition>) # optional block, can be repeated
+ <commands>
+ else() # optional block
+ <commands>
+ endif()
+
+Evaluates the ``condition`` argument of the ``if`` clause according to the
+`Condition syntax`_ described below. If the result is true, then the
+``commands`` in the ``if`` block are executed.
+Otherwise, optional ``elseif`` blocks are processed in the same way.
+Finally, if no ``condition`` is true, ``commands`` in the optional ``else``
+block are executed.
+
+Per legacy, the :command:`else` and :command:`endif` commands admit
+an optional ``<condition>`` argument.
+If used, it must be a verbatim
+repeat of the argument of the opening
+``if`` command.
+
+Condition Syntax
+^^^^^^^^^^^^^^^^
+
+The following syntax applies to the ``condition`` argument of
+the ``if``, ``elseif`` and :command:`while` clauses.
+
+Compound conditions are evaluated in the following order of precedence:
+Innermost parentheses are evaluated first. Next come unary tests such
+as ``EXISTS``, ``COMMAND``, and ``DEFINED``. Then binary tests such as
``EQUAL``, ``LESS``, ``LESS_EQUAL``, ``GREATER``, ``GREATER_EQUAL``,
``STREQUAL``, ``STRLESS``, ``STRLESS_EQUAL``, ``STRGREATER``,
``STRGREATER_EQUAL``, ``VERSION_EQUAL``, ``VERSION_LESS``,
``VERSION_LESS_EQUAL``, ``VERSION_GREATER``, ``VERSION_GREATER_EQUAL``,
-and ``MATCHES`` will be evaluated. Then boolean ``NOT`` operators and
-finally boolean ``AND`` and then ``OR`` operators will be evaluated.
+and ``MATCHES``. Then the boolean operators in the order ``NOT``, ``AND``,
+and finally ``OR``.
-Possible expressions are:
+Possible conditions are:
``if(<constant>)``
True if the constant is ``1``, ``ON``, ``YES``, ``TRUE``, ``Y``,
@@ -52,14 +60,14 @@ Possible expressions are:
True if given a variable that is defined to a value that is not a false
constant. False otherwise. (Note macro arguments are not variables.)
-``if(NOT <expression>)``
- True if the expression is not true.
+``if(NOT <condition>)``
+ True if the condition is not true.
-``if(<expr1> AND <expr2>)``
- True if both expressions would be considered true individually.
+``if(<cond1> AND <cond2>)``
+ True if both conditions would be considered true individually.
-``if(<expr1> OR <expr2>)``
- True if either expression would be considered true individually.
+``if(<cond1> OR <cond2>)``
+ True if either condition would be considered true individually.
``if(COMMAND command-name)``
True if the given name is a command, macro or function that can be
@@ -103,7 +111,7 @@ Possible expressions are:
``if(<variable|string> MATCHES regex)``
True if the given string or variable's value matches the given regular
- expression. See :ref:`Regex Specification` for regex format.
+ condition. See :ref:`Regex Specification` for regex format.
``()`` groups are captured in :variable:`CMAKE_MATCH_<n>` variables.
``if(<variable|string> LESS <variable|string>)``
@@ -179,42 +187,51 @@ Possible expressions are:
``if(<variable|string> IN_LIST <variable>)``
True if the given element is contained in the named list variable.
-``if(DEFINED <variable>)``
- True if the given variable is defined. It does not matter if the
- variable is true or false just if it has been set. (Note macro
- arguments are not variables.)
+``if(DEFINED <name>|CACHE{<name>}|ENV{<name>})``
+ True if a variable, cache variable or environment variable
+ with given ``<name>`` is defined. The value of the variable
+ does not matter. Note that macro arguments are not variables.
-``if((expression) AND (expression OR (expression)))``
- The expressions inside the parenthesis are evaluated first and then
- the remaining expression is evaluated as in the previous examples.
+``if((condition) AND (condition OR (condition)))``
+ The conditions inside the parenthesis are evaluated first and then
+ the remaining condition is evaluated as in the previous examples.
Where there are nested parenthesis the innermost are evaluated as part
- of evaluating the expression that contains them.
+ of evaluating the condition that contains them.
+
+Variable Expansion
+^^^^^^^^^^^^^^^^^^
The if command was written very early in CMake's history, predating
the ``${}`` variable evaluation syntax, and for convenience evaluates
variables named by its arguments as shown in the above signatures.
Note that normal variable evaluation with ``${}`` applies before the if
-command even receives the arguments. Therefore code like::
+command even receives the arguments. Therefore code like
+
+.. code-block:: cmake
set(var1 OFF)
set(var2 "var1")
if(${var2})
-appears to the if command as::
+appears to the if command as
- if(var1)
+.. code-block:: cmake
+
+ if(var1)
and is evaluated according to the ``if(<variable>)`` case documented
above. The result is ``OFF`` which is false. However, if we remove the
-``${}`` from the example then the command sees::
+``${}`` from the example then the command sees
+
+.. code-block:: cmake
- if(var2)
+ if(var2)
which is true because ``var2`` is defined to "var1" which is not a false
constant.
Automatic evaluation applies in the other cases whenever the
-above-documented signature accepts ``<variable|string>``:
+above-documented condition syntax accepts ``<variable|string>``:
* The left hand argument to ``MATCHES`` is first checked to see if it is
a defined variable, if so the variable's value is used, otherwise the
@@ -252,3 +269,8 @@ specified in a :ref:`Quoted Argument` or a :ref:`Bracket Argument`.
A quoted or bracketed variable or keyword will be interpreted as a
string and not dereferenced or interpreted.
See policy :policy:`CMP0054`.
+
+There is no automatic evaluation for environment or cache
+:ref:`Variable References`. Their values must be referenced as
+``$ENV{<name>}`` or ``$CACHE{<name>}`` wherever the above-documented
+condition syntax accepts ``<variable|string>``.
diff --git a/Help/command/include.rst b/Help/command/include.rst
index eeca4c6e3..80968da7b 100644
--- a/Help/command/include.rst
+++ b/Help/command/include.rst
@@ -3,16 +3,16 @@ include
Load and run CMake code from a file or module.
-::
+.. code-block:: cmake
- include(<file|module> [OPTIONAL] [RESULT_VARIABLE <VAR>]
+ include(<file|module> [OPTIONAL] [RESULT_VARIABLE <var>]
[NO_POLICY_SCOPE])
-Load and run CMake code from the file given. Variable reads and
+Loads and runs CMake code from the file given. Variable reads and
writes access the scope of the caller (dynamic scoping). If ``OPTIONAL``
is present, then no error is raised if the file does not exist. If
-``RESULT_VARIABLE`` is given the variable will be set to the full filename
-which has been included or NOTFOUND if it failed.
+``RESULT_VARIABLE`` is given the variable ``<var>`` will be set to the
+full filename which has been included or ``NOTFOUND`` if it failed.
If a module is specified instead of a file, the file with name
``<modulename>.cmake`` is searched first in :variable:`CMAKE_MODULE_PATH`,
diff --git a/Help/command/include_directories.rst b/Help/command/include_directories.rst
index e797b5df1..fe281c3c8 100644
--- a/Help/command/include_directories.rst
+++ b/Help/command/include_directories.rst
@@ -3,7 +3,7 @@ include_directories
Add include directories to the build.
-::
+.. code-block:: cmake
include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...])
diff --git a/Help/command/include_external_msproject.rst b/Help/command/include_external_msproject.rst
index 335282a30..375baf2f9 100644
--- a/Help/command/include_external_msproject.rst
+++ b/Help/command/include_external_msproject.rst
@@ -3,7 +3,7 @@ include_external_msproject
Include an external Microsoft project file in a workspace.
-::
+.. code-block:: cmake
include_external_msproject(projectname location
[TYPE projectTypeGUID]
diff --git a/Help/command/include_guard.rst b/Help/command/include_guard.rst
index 62cce2215..877aa86d9 100644
--- a/Help/command/include_guard.rst
+++ b/Help/command/include_guard.rst
@@ -3,7 +3,7 @@ include_guard
Provides an include guard for the file currently being processed by CMake.
-::
+.. code-block:: cmake
include_guard([DIRECTORY|GLOBAL])
diff --git a/Help/command/include_regular_expression.rst b/Help/command/include_regular_expression.rst
index ab5a56325..dde837892 100644
--- a/Help/command/include_regular_expression.rst
+++ b/Help/command/include_regular_expression.rst
@@ -3,11 +3,11 @@ include_regular_expression
Set the regular expression used for dependency checking.
-::
+.. code-block:: cmake
include_regular_expression(regex_match [regex_complain])
-Set the regular expressions used in dependency checking. Only files
+Sets the regular expressions used in dependency checking. Only files
matching ``regex_match`` will be traced as dependencies. Only files
matching ``regex_complain`` will generate warnings if they cannot be found
(standard header paths are not searched). The defaults are:
diff --git a/Help/command/install.rst b/Help/command/install.rst
index 98074d0b6..6910d6df0 100644
--- a/Help/command/install.rst
+++ b/Help/command/install.rst
@@ -9,11 +9,11 @@ Synopsis
.. parsed-literal::
install(`TARGETS`_ <target>... [...])
- install({`FILES`_ | `PROGRAMS`_} <file>... DESTINATION <dir> [...])
- install(`DIRECTORY`_ <dir>... DESTINATION <dir> [...])
+ install({`FILES`_ | `PROGRAMS`_} <file>... [...])
+ install(`DIRECTORY`_ <dir>... [...])
install(`SCRIPT`_ <file> [...])
install(`CODE`_ <code> [...])
- install(`EXPORT`_ <export-name> DESTINATION <dir> [...])
+ install(`EXPORT`_ <export-name> [...])
Introduction
^^^^^^^^^^^^
@@ -101,7 +101,7 @@ Installing Targets
.. _TARGETS:
-::
+.. code-block:: cmake
install(TARGETS targets... [EXPORT <export-name>]
[[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE|
@@ -172,6 +172,54 @@ installation properties apply to all target types. If only one is given then
only targets of that type will be installed (which can be used to install
just a DLL or just an import library.)
+For regular executables, static libraries and shared libraries, the
+``DESTINATION`` argument is not required. For these target types, when
+``DESTINATION`` is omitted, a default destination will be taken from the
+appropriate variable from :module:`GNUInstallDirs`, or set to a built-in
+default value if that variable is not defined. The same is true for the
+public and private headers associated with the installed targets through the
+:prop_tgt:`PUBLIC_HEADER` and :prop_tgt:`PRIVATE_HEADER` target properties.
+A destination must always be provided for module libraries, Apple bundles and
+frameworks. A destination can be omitted for interface and object libraries,
+but they are handled differently (see the discussion of this topic toward the
+end of this section).
+
+The following table shows the target types with their associated variables and
+built-in defaults that apply when no destination is given:
+
+================== =============================== ======================
+ Target Type GNUInstallDirs Variable Built-In Default
+================== =============================== ======================
+``RUNTIME`` ``${CMAKE_INSTALL_BINDIR}`` ``bin``
+``LIBRARY`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``ARCHIVE`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``PRIVATE_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+``PUBLIC_HEADER`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+================== =============================== ======================
+
+Projects wishing to follow the common practice of installing headers into a
+project-specific subdirectory will need to provide a destination rather than
+rely on the above.
+
+To make packages compliant with distribution filesystem layout policies, if
+projects must specify a ``DESTINATION``, it is recommended that they use a
+path that begins with the appropriate :module:`GNUInstallDirs` variable.
+This allows package maintainers to control the install destination by setting
+the appropriate cache variables. The following example shows a static library
+being installed to the default destination provided by
+:module:`GNUInstallDirs`, but with its headers installed to a project-specific
+subdirectory that follows the above recommendation:
+
+.. code-block:: cmake
+
+ add_library(mylib STATIC ...)
+ set_target_properties(mylib PROPERTIES PUBLIC_HEADER mylib.h)
+ include(GNUInstallDirs)
+ install(TARGETS mylib
+ PUBLIC_HEADER
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/myproj
+ )
+
In addition to the common options listed above, each target can accept
the following additional arguments:
@@ -195,11 +243,9 @@ the following additional arguments:
install(TARGETS mylib
LIBRARY
- DESTINATION lib
COMPONENT Libraries
NAMELINK_COMPONENT Development
PUBLIC_HEADER
- DESTINATION include
COMPONENT Development
)
@@ -295,7 +341,7 @@ targets from other directories are up-to-date. You can use
to ensure that such out-of-directory targets are built before the
subdirectory-specific install rules are run.
-The install destination given to the target install ``DESTINATION`` may
+An install destination given as a ``DESTINATION`` argument may
use "generator expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
@@ -305,9 +351,10 @@ Installing Files
.. _FILES:
.. _PROGRAMS:
-::
+.. code-block:: cmake
- install(<FILES|PROGRAMS> files... DESTINATION <dir>
+ install(<FILES|PROGRAMS> files...
+ TYPE <type> | DESTINATION <dir>
[PERMISSIONS permissions...]
[CONFIGURATIONS [Debug|Release|...]]
[COMPONENT <component>]
@@ -331,7 +378,58 @@ The list of ``files...`` given to ``FILES`` or ``PROGRAMS`` may use
However, if any item begins in a generator expression it must evaluate
to a full path.
-The install destination given to the files install ``DESTINATION`` may
+Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both.
+A ``TYPE`` argument specifies the generic file type of the files being
+installed. A destination will then be set automatically by taking the
+corresponding variable from :module:`GNUInstallDirs`, or by using a
+built-in default if that variable is not defined. See the table below for
+the supported file types and their corresponding variables and built-in
+defaults. Projects can provide a ``DESTINATION`` argument instead of a
+file type if they wish to explicitly define the install destination.
+
+======================= ================================== =========================
+ ``TYPE`` Argument GNUInstallDirs Variable Built-In Default
+======================= ================================== =========================
+``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin``
+``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin``
+``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc``
+``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com``
+``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var``
+``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``<LOCALSTATE dir>/run``
+``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ``<DATAROOT dir>``
+``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``<DATAROOT dir>/info``
+``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``<DATAROOT dir>/locale``
+``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``<DATAROOT dir>/man``
+``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``<DATAROOT dir>/doc``
+======================= ================================== =========================
+
+Projects wishing to follow the common practice of installing headers into a
+project-specific subdirectory will need to provide a destination rather than
+rely on the above.
+
+Note that some of the types' built-in defaults use the ``DATAROOT`` directory as
+a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with
+``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in
+default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use
+``DATA`` instead.
+
+To make packages compliant with distribution filesystem layout policies, if
+projects must specify a ``DESTINATION``, it is recommended that they use a
+path that begins with the appropriate :module:`GNUInstallDirs` variable.
+This allows package maintainers to control the install destination by setting
+the appropriate cache variables. The following example shows how to follow
+this advice while installing headers to a project-specific subdirectory:
+
+.. code-block:: cmake
+
+ include(GNUInstallDirs)
+ install(FILES mylib.h
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/myproj
+ )
+
+An install destination given as a ``DESTINATION`` argument may
use "generator expressions" with the syntax ``$<...>``. See the
:manual:`cmake-generator-expressions(7)` manual for available expressions.
@@ -340,9 +438,10 @@ Installing Directories
.. _DIRECTORY:
-::
+.. code-block:: cmake
- install(DIRECTORY dirs... DESTINATION <dir>
+ install(DIRECTORY dirs...
+ TYPE <type> | DESTINATION <dir>
[FILE_PERMISSIONS permissions...]
[DIRECTORY_PERMISSIONS permissions...]
[USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER]
@@ -413,8 +512,48 @@ will install the ``icons`` directory to ``share/myproj/icons`` and the
file permissions, the scripts will be given specific permissions, and any
``CVS`` directories will be excluded.
-The list of ``dirs...`` given to ``DIRECTORY`` and the install destination
-given to the directory install ``DESTINATION`` may use "generator expressions"
+Either a ``TYPE`` or a ``DESTINATION`` must be provided, but not both.
+A ``TYPE`` argument specifies the generic file type of the files within the
+listed directories being installed. A destination will then be set
+automatically by taking the corresponding variable from
+:module:`GNUInstallDirs`, or by using a built-in default if that variable
+is not defined. See the table below for the supported file types and their
+corresponding variables and built-in defaults. Projects can provide a
+``DESTINATION`` argument instead of a file type if they wish to explicitly
+define the install destination.
+
+======================= ================================== =========================
+ ``TYPE`` Argument GNUInstallDirs Variable Built-In Default
+======================= ================================== =========================
+``BIN`` ``${CMAKE_INSTALL_BINDIR}`` ``bin``
+``SBIN`` ``${CMAKE_INSTALL_SBINDIR}`` ``sbin``
+``LIB`` ``${CMAKE_INSTALL_LIBDIR}`` ``lib``
+``INCLUDE`` ``${CMAKE_INSTALL_INCLUDEDIR}`` ``include``
+``SYSCONF`` ``${CMAKE_INSTALL_SYSCONFDIR}`` ``etc``
+``SHAREDSTATE`` ``${CMAKE_INSTALL_SHARESTATEDIR}`` ``com``
+``LOCALSTATE`` ``${CMAKE_INSTALL_LOCALSTATEDIR}`` ``var``
+``RUNSTATE`` ``${CMAKE_INSTALL_RUNSTATEDIR}`` ``<LOCALSTATE dir>/run``
+``DATA`` ``${CMAKE_INSTALL_DATADIR}`` ``<DATAROOT dir>``
+``INFO`` ``${CMAKE_INSTALL_INFODIR}`` ``<DATAROOT dir>/info``
+``LOCALE`` ``${CMAKE_INSTALL_LOCALEDIR}`` ``<DATAROOT dir>/locale``
+``MAN`` ``${CMAKE_INSTALL_MANDIR}`` ``<DATAROOT dir>/man``
+``DOC`` ``${CMAKE_INSTALL_DOCDIR}`` ``<DATAROOT dir>/doc``
+======================= ================================== =========================
+
+Note that some of the types' built-in defaults use the ``DATAROOT`` directory as
+a prefix. The ``DATAROOT`` prefix is calculated similarly to the types, with
+``CMAKE_INSTALL_DATAROOTDIR`` as the variable and ``share`` as the built-in
+default. You cannot use ``DATAROOT`` as a ``TYPE`` parameter; please use
+``DATA`` instead.
+
+To make packages compliant with distribution filesystem layout policies, if
+projects must specify a ``DESTINATION``, it is recommended that they use a
+path that begins with the appropriate :module:`GNUInstallDirs` variable.
+This allows package maintainers to control the install destination by setting
+the appropriate cache variables.
+
+The list of ``dirs...`` given to ``DIRECTORY`` and an install destination
+given as a ``DESTINATION`` argument may use "generator expressions"
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
manual for available expressions.
@@ -424,7 +563,7 @@ Custom Installation Logic
.. _CODE:
.. _SCRIPT:
-::
+.. code-block:: cmake
install([[SCRIPT <file>] [CODE <code>]]
[COMPONENT <component>] [EXCLUDE_FROM_ALL] [...])
@@ -442,12 +581,17 @@ example, the code
will print a message during installation.
+``<file>`` or ``<code>`` may use "generator expressions" with the syntax
+``$<...>`` (in the case of ``<file>``, this refers to their use in the file
+name, not the file's contents). See the
+:manual:`cmake-generator-expressions(7)` manual for available expressions.
+
Installing Exports
^^^^^^^^^^^^^^^^^^
.. _EXPORT:
-::
+.. code-block:: cmake
install(EXPORT <export-name> DESTINATION <dir>
[NAMESPACE <namespace>] [[FILE <name>.cmake]|
diff --git a/Help/command/install_files.rst b/Help/command/install_files.rst
index 1850be6e1..f5fb46d22 100644
--- a/Help/command/install_files.rst
+++ b/Help/command/install_files.rst
@@ -1,7 +1,9 @@
install_files
-------------
-Deprecated. Use the :command:`install(FILES)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`install(FILES)` command instead.
This command has been superceded by the :command:`install` command. It is
provided for compatibility with older CMake code. The ``FILES`` form is
diff --git a/Help/command/install_programs.rst b/Help/command/install_programs.rst
index 79aa486a3..fab64820d 100644
--- a/Help/command/install_programs.rst
+++ b/Help/command/install_programs.rst
@@ -1,7 +1,9 @@
install_programs
----------------
-Deprecated. Use the :command:`install(PROGRAMS)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`install(PROGRAMS)` command instead.
This command has been superceded by the :command:`install` command. It is
provided for compatibility with older CMake code. The ``FILES`` form is
diff --git a/Help/command/install_targets.rst b/Help/command/install_targets.rst
index 49ca69694..c9efdce67 100644
--- a/Help/command/install_targets.rst
+++ b/Help/command/install_targets.rst
@@ -1,7 +1,9 @@
install_targets
---------------
-Deprecated. Use the :command:`install(TARGETS)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`install(TARGETS)` command instead.
This command has been superceded by the :command:`install` command. It is
provided for compatibility with older CMake code.
diff --git a/Help/command/link_directories.rst b/Help/command/link_directories.rst
index 1dce9a05a..9cb8faa74 100644
--- a/Help/command/link_directories.rst
+++ b/Help/command/link_directories.rst
@@ -3,11 +3,11 @@ link_directories
Add directories in which the linker will look for libraries.
-::
+.. code-block:: cmake
link_directories([AFTER|BEFORE] directory1 [directory2 ...])
-Add the paths in which the linker should search for libraries.
+Adds the paths in which the linker should search for libraries.
Relative paths given to this command are interpreted as relative to
the current source directory, see :policy:`CMP0015`.
diff --git a/Help/command/link_libraries.rst b/Help/command/link_libraries.rst
index fd5dc3723..8665cb789 100644
--- a/Help/command/link_libraries.rst
+++ b/Help/command/link_libraries.rst
@@ -3,7 +3,7 @@ link_libraries
Link libraries to all targets added later.
-::
+.. code-block:: cmake
link_libraries([item1 [item2 [...]]]
[[debug|optimized|general] <item>] ...)
diff --git a/Help/command/list.rst b/Help/command/list.rst
index 2357a9b8d..bfcdf34cd 100644
--- a/Help/command/list.rst
+++ b/Help/command/list.rst
@@ -64,7 +64,7 @@ Reading
.. _LENGTH:
-::
+.. code-block:: cmake
list(LENGTH <list> <output variable>)
@@ -72,7 +72,7 @@ Returns the list's length.
.. _GET:
-::
+.. code-block:: cmake
list(GET <list> <element index> [<element index> ...] <output variable>)
@@ -80,7 +80,7 @@ Returns the list of elements specified by indices from the list.
.. _JOIN:
-::
+.. code-block:: cmake
list(JOIN <list> <glue> <output variable>)
@@ -90,7 +90,7 @@ from :command:`string` command.
.. _SUBLIST:
-::
+.. code-block:: cmake
list(SUBLIST <list> <begin> <length> <output variable>)
@@ -104,7 +104,7 @@ Search
.. _FIND:
-::
+.. code-block:: cmake
list(FIND <list> <value> <output variable>)
@@ -116,7 +116,7 @@ Modification
.. _APPEND:
-::
+.. code-block:: cmake
list(APPEND <list> [<element> ...])
@@ -124,7 +124,7 @@ Appends elements to the list.
.. _FILTER:
-::
+.. code-block:: cmake
list(FILTER <list> <INCLUDE|EXCLUDE> REGEX <regular_expression>)
@@ -136,7 +136,7 @@ For more information on regular expressions see also the
.. _INSERT:
-::
+.. code-block:: cmake
list(INSERT <list> <element_index> <element> [<element> ...])
@@ -144,7 +144,7 @@ Inserts elements to the list to the specified location.
.. _REMOVE_ITEM:
-::
+.. code-block:: cmake
list(REMOVE_ITEM <list> <value> [<value> ...])
@@ -152,7 +152,7 @@ Removes the given items from the list.
.. _REMOVE_AT:
-::
+.. code-block:: cmake
list(REMOVE_AT <list> <index> [<index> ...])
@@ -160,7 +160,7 @@ Removes items at given indices from the list.
.. _REMOVE_DUPLICATES:
-::
+.. code-block:: cmake
list(REMOVE_DUPLICATES <list>)
@@ -168,7 +168,7 @@ Removes duplicated items in the list.
.. _TRANSFORM:
-::
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> [<SELECTOR>]
[OUTPUT_VARIABLE <output variable>])
@@ -190,30 +190,40 @@ The actions have exactly the same semantics as sub-commands of
The ``<ACTION>`` may be one of:
``APPEND``, ``PREPEND``: Append, prepend specified value to each element of
-the list. ::
+the list.
+
+.. code-block:: cmake
list(TRANSFORM <list> <APPEND|PREPEND> <value> ...)
``TOUPPER``, ``TOLOWER``: Convert each element of the list to upper, lower
-characters. ::
+characters.
+
+.. code-block:: cmake
list(TRANSFORM <list> <TOLOWER|TOUPPER> ...)
``STRIP``: Remove leading and trailing spaces from each element of the
-list. ::
+list.
+
+.. code-block:: cmake
list(TRANSFORM <list> STRIP ...)
``GENEX_STRIP``: Strip any
:manual:`generator expressions <cmake-generator-expressions(7)>` from each
-element of the list. ::
+element of the list.
+
+.. code-block:: cmake
list(TRANSFORM <list> GENEX_STRIP ...)
``REPLACE``: Match the regular expression as many times as possible and
substitute the replacement expression for the match for each element
of the list
-(Same semantic as ``REGEX REPLACE`` from :command:`string` command). ::
+(Same semantic as ``REGEX REPLACE`` from :command:`string` command).
+
+.. code-block:: cmake
list(TRANSFORM <list> REPLACE <regular_expression>
<replace_expression> ...)
@@ -223,17 +233,23 @@ type of selector can be specified at a time.
The ``<SELECTOR>`` may be one of:
-``AT``: Specify a list of indexes. ::
+``AT``: Specify a list of indexes.
+
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> AT <index> [<index> ...] ...)
``FOR``: Specify a range with, optionally, an increment used to iterate over
-the range. ::
+the range.
+
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> FOR <start> <stop> [<step>] ...)
``REGEX``: Specify a regular expression. Only elements matching the regular
-expression will be transformed. ::
+expression will be transformed.
+
+.. code-block:: cmake
list(TRANSFORM <list> <ACTION> REGEX <regular_expression> ...)
@@ -243,7 +259,7 @@ Ordering
.. _REVERSE:
-::
+.. code-block:: cmake
list(REVERSE <list>)
@@ -251,7 +267,7 @@ Reverses the contents of the list in-place.
.. _SORT:
-::
+.. code-block:: cmake
list(SORT <list> [COMPARE <compare>] [CASE <case>] [ORDER <order>])
diff --git a/Help/command/load_cache.rst b/Help/command/load_cache.rst
index f1134472d..33625c463 100644
--- a/Help/command/load_cache.rst
+++ b/Help/command/load_cache.rst
@@ -3,21 +3,20 @@ load_cache
Load in the values from another project's CMake cache.
-::
+.. code-block:: cmake
- load_cache(pathToCacheFile READ_WITH_PREFIX
- prefix entry1...)
+ load_cache(pathToCacheFile READ_WITH_PREFIX prefix entry1...)
-Read the cache and store the requested entries in variables with their
+Reads the cache and store the requested entries in variables with their
name prefixed with the given prefix. This only reads the values, and
does not create entries in the local project's cache.
-::
+.. code-block:: cmake
load_cache(pathToCacheFile [EXCLUDE entry1...]
[INCLUDE_INTERNALS entry1...])
-Load in the values from another cache and store them in the local
+Loads in the values from another cache and store them in the local
project's cache as internal entries. This is useful for a project
that depends on another project built in a different tree. ``EXCLUDE``
option can be used to provide a list of entries to be excluded.
diff --git a/Help/command/load_command.rst b/Help/command/load_command.rst
index a1576e8b5..dc235994c 100644
--- a/Help/command/load_command.rst
+++ b/Help/command/load_command.rst
@@ -1,7 +1,7 @@
load_command
------------
-Disallowed. See CMake Policy :policy:`CMP0031`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0031`.
Load a command into a running CMake.
diff --git a/Help/command/macro.rst b/Help/command/macro.rst
index 6bee69c73..05e5d79ac 100644
--- a/Help/command/macro.rst
+++ b/Help/command/macro.rst
@@ -1,27 +1,66 @@
macro
-----
-Start recording a macro for later invocation as a command::
-
- macro(<name> [arg1 [arg2 [arg3 ...]]])
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endmacro(<name>)
-
-Define a macro named ``<name>`` that takes arguments named ``arg1``,
-``arg2``, ``arg3``, (...).
-Commands listed after macro, but before the matching
-:command:`endmacro()`, are not invoked until the macro is invoked.
-When it is invoked, the commands recorded in the macro are first
-modified by replacing formal parameters (``${arg1}``) with the arguments
-passed, and then invoked as normal commands.
+Start recording a macro for later invocation as a command
+
+.. code-block:: cmake
+
+ macro(<name> [<arg1> ...])
+ <commands>
+ endmacro()
+
+Defines a macro named ``<name>`` that takes arguments named
+``<arg1>``, ... Commands listed after macro, but before the
+matching :command:`endmacro()`, are not executed until the macro
+is invoked.
+
+Per legacy, the :command:`endmacro` command admits an optional
+``<name>`` argument. If used, it must be a verbatim repeat of the
+argument of the opening ``macro`` command.
+
+See the :command:`cmake_policy()` command documentation for the behavior
+of policies inside macros.
+
+See the :ref:`Macro vs Function` section below for differences
+between CMake macros and :command:`functions <function>`.
+
+Invocation
+^^^^^^^^^^
+
+The macro invocation is case-insensitive. A macro defined as
+
+.. code-block:: cmake
+
+ macro(foo)
+ <commands>
+ endmacro()
+
+can be invoked through any of
+
+.. code-block:: cmake
+
+ foo()
+ Foo()
+ FOO()
+
+and so on. However, it is strongly recommended to stay with the
+case chosen in the macro definition. Typically macros use
+all-lowercase names.
+
+Arguments
+^^^^^^^^^
+
+When a macro is invoked, the commands recorded in the macro are
+first modified by replacing formal parameters (``${arg1}``, ...)
+with the arguments passed, and then invoked as normal commands.
+
In addition to referencing the formal parameters you can reference the
values ``${ARGC}`` which will be set to the number of arguments passed
into the function as well as ``${ARGV0}``, ``${ARGV1}``, ``${ARGV2}``,
... which will have the actual values of the arguments passed in.
This facilitates creating macros with optional arguments.
-Additionally ``${ARGV}`` holds the list of all arguments given to the
+
+Furthermore, ``${ARGV}`` holds the list of all arguments given to the
macro and ``${ARGN}`` holds the list of arguments past the last expected
argument.
Referencing to ``${ARGV#}`` arguments beyond ``${ARGC}`` have undefined
@@ -29,48 +68,73 @@ behavior. Checking that ``${ARGC}`` is greater than ``#`` is the only
way to ensure that ``${ARGV#}`` was passed to the function as an extra
argument.
-See the :command:`cmake_policy()` command documentation for the behavior
-of policies inside macros.
+.. _`Macro vs Function`:
+
+Macro vs Function
+^^^^^^^^^^^^^^^^^
-Macro Argument Caveats
-^^^^^^^^^^^^^^^^^^^^^^
+The ``macro`` command is very similar to the :command:`function` command.
+Nonetheless, there are a few important differences.
-Note that the parameters to a macro and values such as ``ARGN`` are
-not variables in the usual CMake sense. They are string
-replacements much like the C preprocessor would do with a macro.
-Therefore you will NOT be able to use commands like::
+In a function, ``ARGN``, ``ARGC``, ``ARGV`` and ``ARGV0``, ``ARGV1``, ...
+are true variables in the usual CMake sense. In a macro, they are not,
+they are string replacements much like the C preprocessor would do
+with a macro. This has a number of consequences, as explained in
+the :ref:`Argument Caveats` section below.
+
+Another difference between macros and functions is the control flow.
+A function is executed by transferring control from the calling
+statement to the function body. A macro is executed as if the macro
+body were pasted in place of the calling statement. This has the
+consequence that a :command:`return()` in a macro body does not
+just terminate execution of the macro; rather, control is returned
+from the scope of the macro call. To avoid confusion, it is recommended
+to avoid :command:`return()` in macros altogether.
+
+.. _`Argument Caveats`:
+
+Argument Caveats
+^^^^^^^^^^^^^^^^
+
+Since ``ARGN``, ``ARGC``, ``ARGV``, ``ARGV0`` etc. are not variables,
+you will NOT be able to use commands like
+
+.. code-block:: cmake
if(ARGV1) # ARGV1 is not a variable
if(DEFINED ARGV2) # ARGV2 is not a variable
if(ARGC GREATER 2) # ARGC is not a variable
foreach(loop_var IN LISTS ARGN) # ARGN is not a variable
-In the first case, you can use ``if(${ARGV1})``.
-In the second and third case, the proper way to check if an optional
-variable was passed to the macro is to use ``if(${ARGC} GREATER 2)``.
-In the last case, you can use ``foreach(loop_var ${ARGN})`` but this
-will skip empty arguments.
-If you need to include them, you can use::
+In the first case, you can use ``if(${ARGV1})``. In the second and
+third case, the proper way to check if an optional variable was
+passed to the macro is to use ``if(${ARGC} GREATER 2)``. In the
+last case, you can use ``foreach(loop_var ${ARGN})`` but this will
+skip empty arguments. If you need to include them, you can use
+
+.. code-block:: cmake
set(list_var "${ARGN}")
foreach(loop_var IN LISTS list_var)
Note that if you have a variable with the same name in the scope from
which the macro is called, using unreferenced names will use the
-existing variable instead of the arguments. For example::
+existing variable instead of the arguments. For example:
+
+.. code-block:: cmake
- macro(_BAR)
+ macro(bar)
foreach(arg IN LISTS ARGN)
- [...]
+ <commands>
endforeach()
endmacro()
- function(_FOO)
- _bar(x y z)
+ function(foo)
+ bar(x y z)
endfunction()
- _foo(a b c)
+ foo(a b c)
-Will loop over ``a;b;c`` and not over ``x;y;z`` as one might be expecting.
+Will loop over ``a;b;c`` and not over ``x;y;z`` as one might have expected.
If you want true CMake variables and/or better CMake scope control you
should look at the function command.
diff --git a/Help/command/make_directory.rst b/Help/command/make_directory.rst
index 27ecf5194..8469b0a96 100644
--- a/Help/command/make_directory.rst
+++ b/Help/command/make_directory.rst
@@ -1,7 +1,9 @@
make_directory
--------------
-Deprecated. Use the :command:`file(MAKE_DIRECTORY)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`file(MAKE_DIRECTORY)` command instead.
::
diff --git a/Help/command/mark_as_advanced.rst b/Help/command/mark_as_advanced.rst
index c3f94fc48..5712fb420 100644
--- a/Help/command/mark_as_advanced.rst
+++ b/Help/command/mark_as_advanced.rst
@@ -3,17 +3,22 @@ mark_as_advanced
Mark cmake cached variables as advanced.
-::
+.. code-block:: cmake
- mark_as_advanced([CLEAR|FORCE] VAR [VAR2 ...])
+ mark_as_advanced([CLEAR|FORCE] <var1> ...)
-Mark the named cached variables as advanced. An advanced variable
-will not be displayed in any of the cmake GUIs unless the show
-advanced option is on. If ``CLEAR`` is the first argument advanced
-variables are changed back to unadvanced. If ``FORCE`` is the first
-argument, then the variable is made advanced. If neither ``FORCE`` nor
-``CLEAR`` is specified, new values will be marked as advanced, but if the
-variable already has an advanced/non-advanced state, it will not be
-changed.
+Sets the advanced/non-advanced state of the named
+cached variables.
-It does nothing in script mode.
+An advanced variable will not be displayed in any
+of the cmake GUIs unless the ``show advanced`` option is on.
+In script mode, the advanced/non-advanced state has no effect.
+
+If the keyword ``CLEAR`` is given
+then advanced variables are changed back to unadvanced.
+If the keyword ``FORCE`` is given
+then the variables are made advanced.
+If neither ``FORCE`` nor ``CLEAR`` is specified,
+new values will be marked as advanced, but if a
+variable already has an advanced/non-advanced state,
+it will not be changed.
diff --git a/Help/command/math.rst b/Help/command/math.rst
index 63af931d8..4fa55f66c 100644
--- a/Help/command/math.rst
+++ b/Help/command/math.rst
@@ -1,30 +1,36 @@
math
----
-Mathematical expressions.
+Evaluate a mathematical expression.
-::
+.. code-block:: cmake
- math(EXPR <output-variable> <math-expression> [OUTPUT_FORMAT <format>])
+ math(EXPR <variable> "<expression>" [OUTPUT_FORMAT <format>])
-``EXPR`` evaluates mathematical expression and returns result in the
-output variable. Example mathematical expression is ``5 * (10 + 13)``.
+Evaluates a mathematical ``<expression>`` and sets ``<variable>`` to the
+resulting value.
+
+The mathematical expression must be given as a string (i.e. enclosed in
+double quotation marks). An example is ``"5 * (10 + 13)"``.
Supported operators are ``+``, ``-``, ``*``, ``/``, ``%``, ``|``, ``&``,
-``^``, ``~``, ``<<``, ``>>``, and ``(...)``. They have the same meaning
-as they do in C code.
+``^``, ``~``, ``<<``, ``>>``, and ``(...)``; they have the same meaning
+as in C code.
+
+Hexadecimal numbers are recognized when prefixed with "0x", as in C code.
-Numeric constants are evaluated in decimal or hexadecimal representation.
+The result is formatted according to the option ``OUTPUT_FORMAT``,
+where ``<format>`` is one of
-The result is formatted according to the option "OUTPUT_FORMAT" ,
-where ``<format>`` is one of:
-::
+``HEXADECIMAL``
+ Hexadecimal notation as in C code, i. e. starting with "0x".
+``DECIMAL``
+ Decimal notation. Which is also used if no ``OUTPUT_FORMAT`` option
+ is specified.
- HEXADECIMAL = Result in output variable will be formatted in C code
- Hexadecimal notation.
- DECIMAL = Result in output variable will be formatted in decimal notation.
+For example
-For example::
+.. code-block:: cmake
- math(EXPR value "100 * 0xA" DECIMAL) results in value is set to "1000"
- math(EXPR value "100 * 0xA" HEXADECIMAL) results in value is set to "0x3e8"
+ math(EXPR value "100 * 0xA" OUTPUT_FORMAT DECIMAL) # value is set to "1000"
+ math(EXPR value "100 * 0xA" OUTPUT_FORMAT HEXADECIMAL) # value is set to "0x3e8"
diff --git a/Help/command/message.rst b/Help/command/message.rst
index 04c62fdff..2b4b1aa0d 100644
--- a/Help/command/message.rst
+++ b/Help/command/message.rst
@@ -3,7 +3,7 @@ message
Display a message to the user.
-::
+.. code-block:: cmake
message([<mode>] "message to display" ...)
diff --git a/Help/command/option.rst b/Help/command/option.rst
index 4fabb8747..8956307c5 100644
--- a/Help/command/option.rst
+++ b/Help/command/option.rst
@@ -1,17 +1,16 @@
option
------
-Provides an option that the user can optionally select.
+Provide an option that the user can optionally select.
-::
+.. code-block:: cmake
- option(<option_variable> "help string describing option"
- [initial value])
+ option(<variable> "<help_text>" [value])
-Provide an option for the user to select as ``ON`` or ``OFF``. If no
-initial value is provided, ``OFF`` is used. If the option is already
-set as a normal variable then the command does nothing
-(see policy :policy:`CMP0077`).
+Provides an option for the user to select as ``ON`` or ``OFF``.
+If no initial ``<value>`` is provided, ``OFF`` is used.
+If ``<variable>`` is already set as a normal variable
+then the command does nothing (see policy :policy:`CMP0077`).
If you have options that depend on the values of other options, see
the module help for :module:`CMakeDependentOption`.
diff --git a/Help/command/output_required_files.rst b/Help/command/output_required_files.rst
index 5e1355763..8bc6a730e 100644
--- a/Help/command/output_required_files.rst
+++ b/Help/command/output_required_files.rst
@@ -1,7 +1,7 @@
output_required_files
---------------------
-Disallowed. See CMake Policy :policy:`CMP0032`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0032`.
Approximate C preprocessor dependency scanning.
diff --git a/Help/command/project.rst b/Help/command/project.rst
index bd8b4ef5c..688e56c3f 100644
--- a/Help/command/project.rst
+++ b/Help/command/project.rst
@@ -1,90 +1,119 @@
project
-------
-Sets project details such as name, version, etc. and enables languages.
+Set the name of the project.
+
+Synopsis
+^^^^^^^^
.. code-block:: cmake
- project(<PROJECT-NAME> [LANGUAGES] [<language-name>...])
+ project(<PROJECT-NAME> [<language-name>...])
project(<PROJECT-NAME>
[VERSION <major>[.<minor>[.<patch>[.<tweak>]]]]
[DESCRIPTION <project-description-string>]
[HOMEPAGE_URL <url-string>]
[LANGUAGES <language-name>...])
-Sets the name of the project and stores the name in the
-:variable:`PROJECT_NAME` variable. Additionally this sets variables
+Sets the name of the project, and stores it in the variable
+:variable:`PROJECT_NAME`. When called from the top-level
+``CMakeLists.txt`` also stores the project name in the
+variable :variable:`CMAKE_PROJECT_NAME`.
+
+Also sets the variables
* :variable:`PROJECT_SOURCE_DIR`,
:variable:`<PROJECT-NAME>_SOURCE_DIR`
* :variable:`PROJECT_BINARY_DIR`,
:variable:`<PROJECT-NAME>_BINARY_DIR`
-If ``VERSION`` is specified, given components must be non-negative integers.
-If ``VERSION`` is not specified, the default version is the empty string.
-The ``VERSION`` option may not be used unless policy :policy:`CMP0048` is
-set to ``NEW``.
-
-The :command:`project()` command stores the version number and its components
-in variables
-
-* :variable:`PROJECT_VERSION`,
- :variable:`<PROJECT-NAME>_VERSION`
-* :variable:`PROJECT_VERSION_MAJOR`,
- :variable:`<PROJECT-NAME>_VERSION_MAJOR`
-* :variable:`PROJECT_VERSION_MINOR`,
- :variable:`<PROJECT-NAME>_VERSION_MINOR`
-* :variable:`PROJECT_VERSION_PATCH`,
- :variable:`<PROJECT-NAME>_VERSION_PATCH`
-* :variable:`PROJECT_VERSION_TWEAK`,
- :variable:`<PROJECT-NAME>_VERSION_TWEAK`
-
-Variables corresponding to unspecified versions are set to the empty string
-(if policy :policy:`CMP0048` is set to ``NEW``).
-
-If the optional ``DESCRIPTION`` is given, then :variable:`PROJECT_DESCRIPTION`
-and :variable:`<PROJECT-NAME>_DESCRIPTION` will be set to its argument.
-These variables will be cleared if ``DESCRIPTION`` is not given.
-The description is expected to be a relatively short string, usually no more
-than a few words.
-
-The optional ``HOMEPAGE_URL`` sets the analogous variables
-:variable:`PROJECT_HOMEPAGE_URL` and :variable:`<PROJECT-NAME>_HOMEPAGE_URL`.
-When this option is given, the URL provided should be the canonical home for
-the project.
-These variables will be cleared if ``HOMEPAGE_URL`` is not given.
-
-Note that the description and homepage URL may be used as defaults for
-things like packaging meta-data, documentation, etc.
-
-Optionally you can specify which languages your project supports.
-Example languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``,
-``Fortran``, and ``ASM``.
-By default ``C`` and ``CXX`` are enabled if no language options are
-given. Specify language ``NONE``, or use the ``LANGUAGES`` keyword
-and list no languages, to skip enabling any languages.
-
-If enabling ``ASM``, list it last so that CMake can check whether
-compilers for other languages like ``C`` work for assembly too.
-
-If a variable exists called :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE`,
+Further variables are set by the optional arguments described in the following.
+If any of these arguments is not used, then the corresponding variables are
+set to the empty string.
+
+If the variable :variable:`CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE` exists,
the file pointed to by that variable will be included as the last step of the
project command.
+Options
+^^^^^^^
+
+The options are:
+
+``VERSION <version>``
+ Optional; may not be used unless policy :policy:`CMP0048` is
+ set to ``NEW``.
+
+ Takes a ``<version>`` argument composed of non-negative integer components,
+ i.e. ``<major>[.<minor>[.<patch>[.<tweak>]]]``,
+ and sets the variables
+
+ * :variable:`PROJECT_VERSION`,
+ :variable:`<PROJECT-NAME>_VERSION`
+ * :variable:`PROJECT_VERSION_MAJOR`,
+ :variable:`<PROJECT-NAME>_VERSION_MAJOR`
+ * :variable:`PROJECT_VERSION_MINOR`,
+ :variable:`<PROJECT-NAME>_VERSION_MINOR`
+ * :variable:`PROJECT_VERSION_PATCH`,
+ :variable:`<PROJECT-NAME>_VERSION_PATCH`
+ * :variable:`PROJECT_VERSION_TWEAK`,
+ :variable:`<PROJECT-NAME>_VERSION_TWEAK`.
+
+ When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ then the version is also stored in the variable :variable:`CMAKE_PROJECT_VERSION`.
+
+``DESCRIPTION <project-description-string>``
+ Optional.
+ Sets the variables
+
+ * :variable:`PROJECT_DESCRIPTION`, :variable:`<PROJECT-NAME>_DESCRIPTION`
+
+ to ``<project-description-string>``.
+ It is recommended that this description is a relatively short string,
+ usually no more than a few words.
+
+ When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ then the description is also stored in the variable :variable:`CMAKE_PROJECT_DESCRIPTION`.
+
+``HOMEPAGE_URL <url-string>``
+ Optional.
+ Sets the variables
+
+ * :variable:`PROJECT_HOMEPAGE_URL`, :variable:`<PROJECT-NAME>_HOMEPAGE_URL`
+
+ to ``<url-string>``, which should be the canonical home URL for the project.
+
+ When the :command:`project()` command is called from the top-level ``CMakeLists.txt``,
+ then the URL also is stored in the variable :variable:`CMAKE_PROJECT_HOMEPAGE_URL`.
+
+``LANGUAGES <language-name>...``
+ Optional.
+ Can also be specified without ``LANGUAGES`` keyword per the first, short signature.
+
+ Selects which programming languages are needed to build the project.
+ Supported languages include ``C``, ``CXX`` (i.e. C++), ``CUDA``, ``Fortran``, and ``ASM``.
+ By default ``C`` and ``CXX`` are enabled if no language options are given.
+ Specify language ``NONE``, or use the ``LANGUAGES`` keyword and list no languages,
+ to skip enabling any languages.
+
+ If enabling ``ASM``, list it last so that CMake can check whether
+ compilers for other languages like ``C`` work for assembly too.
+
+The variables set through the ``VERSION``, ``DESCRIPTION`` and ``HOMEPAGE_URL``
+options are intended for use as default values in package metadata and documentation.
+
+Usage
+^^^^^
+
The top-level ``CMakeLists.txt`` file for a project must contain a
literal, direct call to the :command:`project` command; loading one
through the :command:`include` command is not sufficient. If no such
call exists CMake will implicitly add one to the top that enables the
-default languages (``C`` and ``CXX``). The name of the project set in
-the top level ``CMakeLists.txt`` file is available from the
-:variable:`CMAKE_PROJECT_NAME` variable, its description from
-:variable:`CMAKE_PROJECT_DESCRIPTION`, its homepage URL from
-:variable:`CMAKE_PROJECT_HOMEPAGE_URL` and its version from
-:variable:`CMAKE_PROJECT_VERSION`.
+default languages (``C`` and ``CXX``).
.. note::
Call the :command:`cmake_minimum_required` command at the beginning
of the top-level ``CMakeLists.txt`` file even before calling the
- ``project()`` command. It is important to establish version and
+ :command:`project()` command. It is important to establish version and
policy settings before invoking other commands whose behavior they
may affect. See also policy :policy:`CMP0000`.
diff --git a/Help/command/qt_wrap_cpp.rst b/Help/command/qt_wrap_cpp.rst
index 3843bf5e9..ce11c2d09 100644
--- a/Help/command/qt_wrap_cpp.rst
+++ b/Help/command/qt_wrap_cpp.rst
@@ -1,12 +1,23 @@
qt_wrap_cpp
-----------
-Create Qt Wrappers.
+.. deprecated:: 3.14
-::
+ This command was originally added to support Qt 3 before the
+ :command:`add_custom_command()` command was sufficiently mature. The
+ :module:`FindQt4` module provides the ``qt4_wrap_cpp()`` macro, which
+ should be used instead for Qt 4 projects. For projects using Qt 5 or
+ later, use the equivalent macro provided by Qt itself (e.g. Qt 5 provides
+ ``qt5_wrap_cpp()``).
- qt_wrap_cpp(resultingLibraryName DestName
- SourceLists ...)
+Manually create Qt Wrappers.
-Produce moc files for all the .h files listed in the SourceLists. The
+.. code-block:: cmake
+
+ qt_wrap_cpp(resultingLibraryName DestName SourceLists ...)
+
+Produces moc files for all the .h files listed in the SourceLists. The
moc files will be added to the library using the ``DestName`` source list.
+
+Consider updating the project to use the :prop_tgt:`AUTOMOC` target property
+instead for a more automated way of invoking the ``moc`` tool.
diff --git a/Help/command/qt_wrap_ui.rst b/Help/command/qt_wrap_ui.rst
index f731ed9a8..efbbc5472 100644
--- a/Help/command/qt_wrap_ui.rst
+++ b/Help/command/qt_wrap_ui.rst
@@ -1,14 +1,26 @@
qt_wrap_ui
----------
-Create Qt user interfaces Wrappers.
+.. deprecated:: 3.14
-::
+ This command was originally added to support Qt 3 before the
+ :command:`add_custom_command()` command was sufficiently mature. The
+ :module:`FindQt4` module provides the ``qt4_wrap_ui()`` macro, which
+ should be used instead for Qt 4 projects. For projects using Qt 5 or
+ later, use the equivalent macro provided by Qt itself (e.g. Qt 5 provides
+ ``qt5_wrap_ui()``).
+
+Manually create Qt user interfaces Wrappers.
+
+.. code-block:: cmake
qt_wrap_ui(resultingLibraryName HeadersDestName
SourcesDestName SourceLists ...)
-Produce .h and .cxx files for all the .ui files listed in the
+Produces .h and .cxx files for all the .ui files listed in the
``SourceLists``. The .h files will be added to the library using the
``HeadersDestNamesource`` list. The .cxx files will be added to the
library using the ``SourcesDestNamesource`` list.
+
+Consider updating the project to use the :prop_tgt:`AUTOUIC` target property
+instead for a more automated way of invoking the ``uic`` tool.
diff --git a/Help/command/remove.rst b/Help/command/remove.rst
index 462827796..543d01671 100644
--- a/Help/command/remove.rst
+++ b/Help/command/remove.rst
@@ -1,7 +1,9 @@
remove
------
-Deprecated. Use the :command:`list(REMOVE_ITEM)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`list(REMOVE_ITEM)` command instead.
::
diff --git a/Help/command/remove_definitions.rst b/Help/command/remove_definitions.rst
index ea189181c..faad16dcb 100644
--- a/Help/command/remove_definitions.rst
+++ b/Help/command/remove_definitions.rst
@@ -1,9 +1,9 @@
remove_definitions
------------------
-Removes -D define flags added by :command:`add_definitions`.
+Remove -D define flags added by :command:`add_definitions`.
-::
+.. code-block:: cmake
remove_definitions(-DFOO -DBAR ...)
diff --git a/Help/command/return.rst b/Help/command/return.rst
index e49fb3c8d..830992c25 100644
--- a/Help/command/return.rst
+++ b/Help/command/return.rst
@@ -3,7 +3,7 @@ return
Return from a file, directory or function.
-::
+.. code-block:: cmake
return()
@@ -14,5 +14,6 @@ and control is returned to the including file. If it is encountered in a
file which is not included by another file, e.g. a ``CMakeLists.txt``,
control is returned to the parent directory if there is one. If return is
called in a function, control is returned to the caller of the function.
-Note that a macro is not a function and does not handle return like a
-function does.
+
+Note that a :command:`macro <macro>`, unlike a :command:`function <function>`,
+is expanded in place and therefore cannot handle ``return()``.
diff --git a/Help/command/separate_arguments.rst b/Help/command/separate_arguments.rst
index 47982a503..fbca859f2 100644
--- a/Help/command/separate_arguments.rst
+++ b/Help/command/separate_arguments.rst
@@ -1,33 +1,43 @@
separate_arguments
------------------
-Parse space-separated arguments into a semicolon-separated list.
+Parse command-line arguments into a semicolon-separated list.
-::
+.. code-block:: cmake
- separate_arguments(<var> <NATIVE|UNIX|WINDOWS>_COMMAND "<args>")
+ separate_arguments(<variable> <mode> <args>)
-Parses a UNIX- or Windows-style command-line string "<args>" and
-stores a semicolon-separated list of the arguments in ``<var>``. The
-entire command line must be given in one "<args>" argument.
+Parses a space-separated string ``<args>`` into a list of items,
+and stores this list in semicolon-separated standard form in ``<variable>``.
-The ``UNIX_COMMAND`` mode separates arguments by unquoted whitespace. It
-recognizes both single-quote and double-quote pairs. A backslash
-escapes the next literal character (``\"`` is ``"``); there are no special
-escapes (``\n`` is just ``n``).
+This function is intended for parsing command-line arguments.
+The entire command line must be passed as one string in the
+argument ``<args>``.
-The ``WINDOWS_COMMAND`` mode parses a Windows command-line using the same
-syntax the runtime library uses to construct argv at startup. It
-separates arguments by whitespace that is not double-quoted.
-Backslashes are literal unless they precede double-quotes. See the
-MSDN article `Parsing C Command-Line Arguments`_ for details.
+The exact parsing rules depend on the operating system.
+They are specified by the ``<mode>`` argument which must
+be one of the following keywords:
-The ``NATIVE_COMMAND`` mode parses a Windows command-line if the host
-system is Windows, and a UNIX command-line otherwise.
+``UNIX_COMMAND``
+ Arguments are separated by by unquoted whitespace.
+ Both single-quote and double-quote pairs are respected.
+ A backslash escapes the next literal character (``\"`` is ``"``);
+ there are no special escapes (``\n`` is just ``n``).
+
+``WINDOWS_COMMAND``
+ A Windows command-line is parsed using the same
+ syntax the runtime library uses to construct argv at startup. It
+ separates arguments by whitespace that is not double-quoted.
+ Backslashes are literal unless they precede double-quotes. See the
+ MSDN article `Parsing C Command-Line Arguments`_ for details.
+
+``NATIVE_COMMAND``
+ Proceeds as in ``WINDOWS_COMMAND`` mode if the host system is Windows.
+ Otherwise proceeds as in ``UNIX_COMMAND`` mode.
.. _`Parsing C Command-Line Arguments`: https://msdn.microsoft.com/library/a1y7w461.aspx
-::
+.. code-block:: cmake
separate_arguments(<var>)
diff --git a/Help/command/set.rst b/Help/command/set.rst
index b24ebefeb..c0e02e246 100644
--- a/Help/command/set.rst
+++ b/Help/command/set.rst
@@ -8,18 +8,18 @@ and cache entries.
Signatures of this command that specify a ``<value>...`` placeholder
expect zero or more arguments. Multiple arguments will be joined as
-a :ref:`;-list <CMake Language Lists>` to form the actual variable
+a :ref:`semicolon-separated list <CMake Language Lists>` to form the actual variable
value to be set. Zero arguments will cause normal variables to be
unset. See the :command:`unset` command to unset variables explicitly.
Set Normal Variable
^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
set(<variable> <value>... [PARENT_SCOPE])
-Set the given ``<variable>`` in the current function or directory scope.
+Sets the given ``<variable>`` in the current function or directory scope.
If the ``PARENT_SCOPE`` option is given the variable will be set in
the scope above the current scope. Each new directory or function
@@ -32,11 +32,11 @@ undefined and if it had a value, it is still that value).
Set Cache Entry
^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
set(<variable> <value>... CACHE <type> <docstring> [FORCE])
-Set the given cache ``<variable>`` (cache entry). Since cache entries
+Sets the given cache ``<variable>`` (cache entry). Since cache entries
are meant to provide user-settable values this does not overwrite
existing cache entries by default. Use the ``FORCE`` option to
overwrite existing entries.
@@ -84,8 +84,21 @@ current working directory and convert it to an absolute path.
Set Environment Variable
^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- set(ENV{<variable>} <value>...)
+ set(ENV{<variable>} [<value>])
-Set the current process environment ``<variable>`` to the given value.
+Sets an :manual:`Environment Variable <cmake-env-variables(7)>`
+to the given value.
+Subsequent calls of ``$ENV{<variable>}`` will return this new value.
+
+This command affects only the current CMake process, not the process
+from which CMake was called, nor the system environment at large,
+nor the environment of subsequent build or test processes.
+
+If no argument is given after ``ENV{<variable>}`` or if ``<value>`` is
+an empty string, then this command will clear any existing value of the
+environment variable.
+
+Arguments after ``<value>`` are ignored. If extra arguments are found,
+then an author warning is issued.
diff --git a/Help/command/set_directory_properties.rst b/Help/command/set_directory_properties.rst
index 42e7fd783..f02a8e6c7 100644
--- a/Help/command/set_directory_properties.rst
+++ b/Help/command/set_directory_properties.rst
@@ -1,11 +1,15 @@
set_directory_properties
------------------------
-Set properties of the current directory and subdirectories in key-value pairs.
+Set properties of the current directory and subdirectories.
-::
+.. code-block:: cmake
- set_directory_properties(PROPERTIES prop1 value1 prop2 value2)
+ set_directory_properties(PROPERTIES prop1 value1 [prop2 value2] ...)
+
+Sets properties of the current directory and its subdirectories in key-value pairs.
+
+See also the :command:`set_property(DIRECTORY)` command.
See :ref:`Directory Properties` for the list of properties known to CMake
and their individual documentation for the behavior of each property.
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index c89e1ced3..2624b4bc8 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -3,37 +3,40 @@ set_property
Set a named property in a given scope.
-::
-
- set_property(<GLOBAL |
- DIRECTORY [dir] |
- TARGET [target1 [target2 ...]] |
- SOURCE [src1 [src2 ...]] |
- INSTALL [file1 [file2 ...]] |
- TEST [test1 [test2 ...]] |
- CACHE [entry1 [entry2 ...]]>
+.. code-block:: cmake
+
+ set_property(<GLOBAL |
+ DIRECTORY [<dir>] |
+ TARGET [<target1> ...] |
+ SOURCE [<src1> ...] |
+ INSTALL [<file1> ...] |
+ TEST [<test1> ...] |
+ CACHE [<entry1> ...] >
[APPEND] [APPEND_STRING]
- PROPERTY <name> [value1 [value2 ...]])
+ PROPERTY <name> [value1 ...])
-Set one property on zero or more objects of a scope. The first
-argument determines the scope in which the property is set. It must
-be one of the following:
+Sets one property on zero or more objects of a scope.
+
+The first argument determines the scope in which the property is set.
+It must be one of the following:
``GLOBAL``
Scope is unique and does not accept a name.
``DIRECTORY``
- Scope defaults to the current directory but another
- directory (already processed by CMake) may be named by full or
- relative path.
+ Scope defaults to the current directory but another directory
+ (already processed by CMake) may be named by full or relative path.
+ See also the :command:`set_directory_properties` command.
``TARGET``
Scope may name zero or more existing targets.
+ See also the :command:`set_target_properties` command.
``SOURCE``
Scope may name zero or more source files. Note that source
file properties are visible only to targets added in the same
directory (CMakeLists.txt).
+ See also the :command:`set_source_files_properties` command.
``INSTALL``
Scope may name zero or more installed file paths.
@@ -53,6 +56,7 @@ be one of the following:
``TEST``
Scope may name zero or more existing tests.
+ See also the :command:`set_tests_properties` command.
``CACHE``
Scope must name zero or more cache existing entries.
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index b4904e8d0..91f995ce5 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -3,13 +3,17 @@ set_source_files_properties
Source files can have properties that affect how they are built.
-::
+.. code-block:: cmake
set_source_files_properties([file1 [file2 [...]]]
PROPERTIES prop1 value1
[prop2 value2 [...]])
-Set properties associated with source files using a key/value paired
-list. See :ref:`Source File Properties` for the list of properties known
+Sets properties associated with source files using a key/value paired
+list.
+
+See also the :command:`set_property(SOURCE)` command.
+
+See :ref:`Source File Properties` for the list of properties known
to CMake. Source file properties are visible only to targets added
in the same directory (CMakeLists.txt).
diff --git a/Help/command/set_target_properties.rst b/Help/command/set_target_properties.rst
index 7db952d6d..597be231a 100644
--- a/Help/command/set_target_properties.rst
+++ b/Help/command/set_target_properties.rst
@@ -3,13 +3,13 @@ set_target_properties
Targets can have properties that affect how they are built.
-::
+.. code-block:: cmake
set_target_properties(target1 target2 ...
PROPERTIES prop1 value1
prop2 value2 ...)
-Set properties on targets. The syntax for the command is to list all
+Sets properties on targets. The syntax for the command is to list all
the targets you want to change, and then provide the values you want to
set next. You can use any prop value pair you want and extract it
later with the :command:`get_property` or :command:`get_target_property`
diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst
index 3efb1653e..9bc94ae38 100644
--- a/Help/command/set_tests_properties.rst
+++ b/Help/command/set_tests_properties.rst
@@ -3,12 +3,15 @@ set_tests_properties
Set a property of the tests.
-::
+.. code-block:: cmake
set_tests_properties(test1 [test2...] PROPERTIES prop1 value1 prop2 value2)
-Set a property for the tests. If the test is not found, CMake
+Sets a property for the tests. If the test is not found, CMake
will report an error.
:manual:`Generator expressions <cmake-generator-expressions(7)>` will be
-expanded the same as supported by the test's :command:`add_test` call. See
-:ref:`Test Properties` for the list of properties known to CMake.
+expanded the same as supported by the test's :command:`add_test` call.
+
+See also the :command:`set_property(TEST)` command.
+
+See :ref:`Test Properties` for the list of properties known to CMake.
diff --git a/Help/command/site_name.rst b/Help/command/site_name.rst
index e17c1ee68..1bcaeada0 100644
--- a/Help/command/site_name.rst
+++ b/Help/command/site_name.rst
@@ -3,6 +3,6 @@ site_name
Set the given variable to the name of the computer.
-::
+.. code-block:: cmake
site_name(variable)
diff --git a/Help/command/source_group.rst b/Help/command/source_group.rst
index 938ca40f2..6623c9837 100644
--- a/Help/command/source_group.rst
+++ b/Help/command/source_group.rst
@@ -4,7 +4,7 @@ source_group
Define a grouping for source files in IDE project generation.
There are two different signatures to create source groups.
-::
+.. code-block:: cmake
source_group(<name> [FILES <src>...] [REGULAR_EXPRESSION <regex>])
source_group(TREE <root> [PREFIX <prefix>] [FILES <src>...])
diff --git a/Help/command/string.rst b/Help/command/string.rst
index cc18069f4..893fb4324 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -48,7 +48,7 @@ Search and Replace
.. _FIND:
-::
+.. code-block:: cmake
string(FIND <string> <substring> <output variable> [REVERSE])
@@ -59,7 +59,7 @@ substring. If the substring is not found, a position of -1 is returned.
.. _REPLACE:
-::
+.. code-block:: cmake
string(REPLACE <match_string>
<replace_string> <output variable>
@@ -73,7 +73,7 @@ Regular Expressions
.. _`REGEX MATCH`:
-::
+.. code-block:: cmake
string(REGEX MATCH <regular_expression>
<output variable> <input> [<input>...])
@@ -83,7 +83,7 @@ All ``<input>`` arguments are concatenated before matching.
.. _`REGEX MATCHALL`:
-::
+.. code-block:: cmake
string(REGEX MATCHALL <regular_expression>
<output variable> <input> [<input>...])
@@ -94,7 +94,7 @@ All ``<input>`` arguments are concatenated before matching.
.. _`REGEX REPLACE`:
-::
+.. code-block:: cmake
string(REGEX REPLACE <regular_expression>
<replace_expression> <output variable>
@@ -177,7 +177,7 @@ Manipulation
.. _APPEND:
-::
+.. code-block:: cmake
string(APPEND <string variable> [<input>...])
@@ -185,7 +185,7 @@ Append all the input arguments to the string.
.. _PREPEND:
-::
+.. code-block:: cmake
string(PREPEND <string variable> [<input>...])
@@ -193,7 +193,7 @@ Prepend all the input arguments to the string.
.. _CONCAT:
-::
+.. code-block:: cmake
string(CONCAT <output variable> [<input>...])
@@ -202,7 +202,7 @@ the result in the named output variable.
.. _JOIN:
-::
+.. code-block:: cmake
string(JOIN <glue> <output variable> [<input>...])
@@ -215,7 +215,7 @@ special characters like ``;`` in them.
.. _TOLOWER:
-::
+.. code-block:: cmake
string(TOLOWER <string1> <output variable>)
@@ -223,7 +223,7 @@ Convert string to lower characters.
.. _TOUPPER:
-::
+.. code-block:: cmake
string(TOUPPER <string1> <output variable>)
@@ -231,7 +231,7 @@ Convert string to upper characters.
.. _LENGTH:
-::
+.. code-block:: cmake
string(LENGTH <string> <output variable>)
@@ -239,7 +239,7 @@ Store in an output variable a given string's length.
.. _SUBSTRING:
-::
+.. code-block:: cmake
string(SUBSTRING <string> <begin> <length> <output variable>)
@@ -253,7 +253,7 @@ If string is shorter than length then end of string is used instead.
.. _STRIP:
-::
+.. code-block:: cmake
string(STRIP <string> <output variable>)
@@ -262,7 +262,7 @@ trailing spaces removed.
.. _GENEX_STRIP:
-::
+.. code-block:: cmake
string(GENEX_STRIP <input string> <output variable>)
@@ -274,7 +274,7 @@ Comparison
.. _COMPARE:
-::
+.. code-block:: cmake
string(COMPARE LESS <string1> <string2> <output variable>)
string(COMPARE GREATER <string1> <string2> <output variable>)
@@ -292,7 +292,7 @@ Hashing
.. _`HASH`:
-::
+.. code-block:: cmake
string(<HASH> <output variable> <input>)
@@ -325,7 +325,7 @@ Generation
.. _ASCII:
-::
+.. code-block:: cmake
string(ASCII <number> [<number> ...] <output variable>)
@@ -333,7 +333,7 @@ Convert all numbers into corresponding ASCII characters.
.. _CONFIGURE:
-::
+.. code-block:: cmake
string(CONFIGURE <string1> <output variable>
[@ONLY] [ESCAPE_QUOTES])
@@ -342,7 +342,7 @@ Transform a string like :command:`configure_file` transforms a file.
.. _MAKE_C_IDENTIFIER:
-::
+.. code-block:: cmake
string(MAKE_C_IDENTIFIER <input string> <output variable>)
@@ -353,7 +353,7 @@ the result.
.. _RANDOM:
-::
+.. code-block:: cmake
string(RANDOM [LENGTH <length>] [ALPHABET <alphabet>]
[RANDOM_SEED <seed>] <output variable>)
@@ -366,7 +366,7 @@ random number generator.
.. _TIMESTAMP:
-::
+.. code-block:: cmake
string(TIMESTAMP <output variable> [<format string>] [UTC])
@@ -421,7 +421,7 @@ If no explicit ``<format string>`` is given it will default to:
.. _UUID:
-::
+.. code-block:: cmake
string(UUID <output variable> NAMESPACE <namespace> NAME <name>
TYPE <MD5|SHA1> [UPPER])
diff --git a/Help/command/subdir_depends.rst b/Help/command/subdir_depends.rst
index 5676c8f40..0c1b3c1ce 100644
--- a/Help/command/subdir_depends.rst
+++ b/Help/command/subdir_depends.rst
@@ -1,7 +1,7 @@
subdir_depends
--------------
-Disallowed. See CMake Policy :policy:`CMP0029`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0029`.
Does nothing.
diff --git a/Help/command/subdirs.rst b/Help/command/subdirs.rst
index 43b87d4d7..530951bd1 100644
--- a/Help/command/subdirs.rst
+++ b/Help/command/subdirs.rst
@@ -1,7 +1,9 @@
subdirs
-------
-Deprecated. Use the :command:`add_subdirectory` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`add_subdirectory` command instead.
Add a list of subdirectories to the build.
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index a74011797..9e9c69093 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -3,13 +3,13 @@ target_compile_definitions
Add compile definitions to a target.
-::
+.. code-block:: cmake
target_compile_definitions(<target>
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify compile definitions to use when compiling a given ``<target>``. The
+Specifies compile definitions to use when compiling a given ``<target>``. The
named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
diff --git a/Help/command/target_compile_features.rst b/Help/command/target_compile_features.rst
index bf413bf1b..9271cd56c 100644
--- a/Help/command/target_compile_features.rst
+++ b/Help/command/target_compile_features.rst
@@ -3,11 +3,11 @@ target_compile_features
Add expected compiler features to a target.
-::
+.. code-block:: cmake
target_compile_features(<target> <PRIVATE|PUBLIC|INTERFACE> <feature> [...])
-Specify compiler features required when compiling a given target. If the
+Specifies compiler features required when compiling a given target. If the
feature is not listed in the :variable:`CMAKE_C_COMPILE_FEATURES` variable
or :variable:`CMAKE_CXX_COMPILE_FEATURES` variable,
then an error will be reported by CMake. If the use of the feature requires
diff --git a/Help/command/target_compile_options.rst b/Help/command/target_compile_options.rst
index 88b7f1542..47e7d86f8 100644
--- a/Help/command/target_compile_options.rst
+++ b/Help/command/target_compile_options.rst
@@ -3,28 +3,24 @@ target_compile_options
Add compile options to a target.
-::
+.. code-block:: cmake
target_compile_options(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify compile options to use when compiling a given target. The
-named ``<target>`` must have been created by a command such as
-:command:`add_executable` or :command:`add_library` and must not be an
-:ref:`ALIAS target <Alias Targets>`.
+Adds options to the :prop_tgt:`COMPILE_OPTIONS` or
+:prop_tgt:`INTERFACE_COMPILE_OPTIONS` target properties. These options
+are used when compiling the given ``<target>``, which must have been
+created by a command such as :command:`add_executable` or
+:command:`add_library` and must not be an :ref:`ALIAS target <Alias Targets>`.
+
+Arguments
+^^^^^^^^^
If ``BEFORE`` is specified, the content will be prepended to the property
instead of being appended.
-This command can be used to add any options, but
-alternative commands exist to add preprocessor definitions
-(:command:`target_compile_definitions` and :command:`add_compile_definitions`)
-or include directories (:command:`target_include_directories` and
-:command:`include_directories`). See documentation of the
-:prop_dir:`directory <COMPILE_OPTIONS>` and
-:prop_tgt:`target <COMPILE_OPTIONS>` ``COMPILE_OPTIONS`` properties.
-
The ``INTERFACE``, ``PUBLIC`` and ``PRIVATE`` keywords are required to
specify the scope of the following arguments. ``PRIVATE`` and ``PUBLIC``
items will populate the :prop_tgt:`COMPILE_OPTIONS` property of
@@ -40,3 +36,13 @@ manual for available expressions. See the :manual:`cmake-buildsystem(7)`
manual for more on defining buildsystem properties.
.. include:: OPTIONS_SHELL.txt
+
+See Also
+^^^^^^^^
+
+This command can be used to add any options. However, for adding
+preprocessor definitions and include directories it is recommended
+to use the more specific commands :command:`target_compile_definitions`
+and :command:`target_include_directories`.
+
+For directory-wide settings, there is the command :command:`add_compile_options`.
diff --git a/Help/command/target_include_directories.rst b/Help/command/target_include_directories.rst
index e71be64eb..660e15c9b 100644
--- a/Help/command/target_include_directories.rst
+++ b/Help/command/target_include_directories.rst
@@ -3,13 +3,13 @@ target_include_directories
Add include directories to a target.
-::
+.. code-block:: cmake
target_include_directories(<target> [SYSTEM] [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify include directories to use when compiling a given target.
+Specifies include directories to use when compiling a given target.
The named ``<target>`` must have been created by a command such
as :command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
diff --git a/Help/command/target_link_directories.rst b/Help/command/target_link_directories.rst
index b46aac07d..76da94dc1 100644
--- a/Help/command/target_link_directories.rst
+++ b/Help/command/target_link_directories.rst
@@ -3,13 +3,13 @@ target_link_directories
Add link directories to a target.
-::
+.. code-block:: cmake
target_link_directories(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify the paths in which the linker should search for libraries when
+Specifies the paths in which the linker should search for libraries when
linking a given target. Each item can be an absolute or relative path,
with the latter being interpreted as relative to the current source
directory. These items will be added to the link command.
diff --git a/Help/command/target_link_libraries.rst b/Help/command/target_link_libraries.rst
index 58f312e1a..c5e4f9fcf 100644
--- a/Help/command/target_link_libraries.rst
+++ b/Help/command/target_link_libraries.rst
@@ -14,7 +14,9 @@ Overview
^^^^^^^^
This command has several signatures as detailed in subsections below.
-All of them have the general form::
+All of them have the general form
+
+.. code-block:: cmake
target_link_libraries(<target> ... <item>... ...)
@@ -92,7 +94,7 @@ Each ``<item>`` may be:
* **A generator expression**: A ``$<...>`` :manual:`generator expression
<cmake-generator-expressions(7)>` may evaluate to any of the above
- items or to a :ref:`;-list <CMake Language Lists>` of them.
+ items or to a :ref:`semicolon-separated list <CMake Language Lists>` of them.
If the ``...`` contains any ``;`` characters, e.g. after evaluation
of a ``${list}`` variable, be sure to use an explicitly quoted
argument ``"$<...>"`` so that this command receives it as a
@@ -128,7 +130,7 @@ buildsystem properties.
Libraries for a Target and/or its Dependents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target>
<PRIVATE|PUBLIC|INTERFACE> <item>...
@@ -145,7 +147,7 @@ used for linking ``<target>``.
Libraries for both a Target and its Dependents
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target> <item>...)
@@ -163,7 +165,7 @@ exclusively by this signature private.
Libraries for a Target and/or its Dependents (Legacy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target>
<LINK_PRIVATE|LINK_PUBLIC> <lib>...
@@ -185,7 +187,7 @@ made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy
Libraries for Dependents Only (Legacy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
target_link_libraries(<target> LINK_INTERFACE_LIBRARIES <item>...)
diff --git a/Help/command/target_link_options.rst b/Help/command/target_link_options.rst
index 0b45a8b2c..285455a81 100644
--- a/Help/command/target_link_options.rst
+++ b/Help/command/target_link_options.rst
@@ -3,13 +3,13 @@ target_link_options
Add link options to a target.
-::
+.. code-block:: cmake
target_link_options(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify link options to use when linking a given target. The
+Specifies link options to use when linking a given target. The
named ``<target>`` must have been created by a command such as
:command:`add_executable` or :command:`add_library` and must not be an
:ref:`ALIAS target <Alias Targets>`.
diff --git a/Help/command/target_sources.rst b/Help/command/target_sources.rst
index 5dd8d86cc..27e737bf0 100644
--- a/Help/command/target_sources.rst
+++ b/Help/command/target_sources.rst
@@ -3,13 +3,13 @@ target_sources
Add sources to a target.
-::
+.. code-block:: cmake
target_sources(<target>
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
-Specify sources to use when compiling a given target. Relative
+Specifies sources to use when compiling a given target. Relative
source file paths are interpreted as being relative to the current
source directory (i.e. :variable:`CMAKE_CURRENT_SOURCE_DIR`). The
named ``<target>`` must have been created by a command such as
diff --git a/Help/command/try_compile.rst b/Help/command/try_compile.rst
index 66ea3d7f2..ca8fc77fa 100644
--- a/Help/command/try_compile.rst
+++ b/Help/command/try_compile.rst
@@ -10,14 +10,14 @@ Try building some code.
Try Compiling Whole Projects
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- try_compile(RESULT_VAR <bindir> <srcdir>
+ try_compile(<resultVar> <bindir> <srcdir>
<projectName> [<targetName>] [CMAKE_FLAGS <flags>...]
[OUTPUT_VARIABLE <var>])
Try building a project. The success or failure of the ``try_compile``,
-i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``RESULT_VAR``.
+i.e. ``TRUE`` or ``FALSE`` respectively, is returned in ``<resultVar>``.
In this form, ``<srcdir>`` should contain a complete CMake project with a
``CMakeLists.txt`` file and all sources. The ``<bindir>`` and ``<srcdir>``
@@ -28,11 +28,12 @@ below for the meaning of other options.
Try Compiling Source Files
^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- try_compile(RESULT_VAR <bindir> <srcfile|SOURCES srcfile...>
+ try_compile(<resultVar> <bindir> <srcfile|SOURCES srcfile...>
[CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
+ [LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
[OUTPUT_VARIABLE <var>]
[COPY_FILE <fileName> [COPY_FILE_ERROR <var>]]
@@ -41,18 +42,27 @@ Try Compiling Source Files
[<LANG>_EXTENSIONS <bool>]
)
-Try building an executable from one or more source files. The success or
-failure of the ``try_compile``, i.e. ``TRUE`` or ``FALSE`` respectively, is
-returned in ``RESULT_VAR``.
+Try building an executable or static library from one or more source files
+(which one is determined by the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE`
+variable). The success or failure of the ``try_compile``, i.e. ``TRUE`` or
+``FALSE`` respectively, is returned in ``<resultVar>``.
-In this form the user need only supply one or more source files that include a
-definition for ``main``. CMake will create a ``CMakeLists.txt`` file to build
-the source(s) as an executable that looks something like this::
+In this form, one or more source files must be provided. If
+:variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is unset or is set to ``EXECUTABLE``,
+the sources must include a definition for ``main`` and CMake will create a
+``CMakeLists.txt`` file to build the source(s) as an executable.
+If :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` is set to ``STATIC_LIBRARY``,
+a static library will be built instead and no definition for ``main`` is
+required. For an executable, the generated ``CMakeLists.txt`` file would
+contain something like the following:
+
+.. code-block:: cmake
add_definitions(<expanded COMPILE_DEFINITIONS from caller>)
include_directories(${INCLUDE_DIRECTORIES})
link_directories(${LINK_DIRECTORIES})
add_executable(cmTryCompileExec <srcfile>...)
+ target_link_options(cmTryCompileExec PRIVATE <LINK_OPTIONS from caller>)
target_link_libraries(cmTryCompileExec ${LINK_LIBRARIES})
The options are:
@@ -65,11 +75,11 @@ The options are:
are used.
``COMPILE_DEFINITIONS <defs>...``
- Specify ``-Ddefinition`` arguments to pass to ``add_definitions``
+ Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions`
in the generated test project.
``COPY_FILE <fileName>``
- Copy the linked executable to the given ``<fileName>``.
+ Copy the built executable or static library to the given ``<fileName>``.
``COPY_FILE_ERROR <var>``
Use after ``COPY_FILE`` to capture into variable ``<var>`` any error
@@ -83,8 +93,13 @@ The options are:
If this option is specified, any ``-DLINK_LIBRARIES=...`` value
given to the ``CMAKE_FLAGS`` option will be ignored.
+``LINK_OPTIONS <options>...``
+ Specify link step options to pass to :command:`target_link_options` or to
+ set the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property in the generated
+ project, depending on the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable.
+
``OUTPUT_VARIABLE <var>``
- Store the output from the build process the given variable.
+ Store the output from the build process in the given variable.
``<LANG>_STANDARD <std>``
Specify the :prop_tgt:`C_STANDARD`, :prop_tgt:`CXX_STANDARD`,
@@ -105,7 +120,7 @@ passed to ``cmake`` to avoid this clean. However, multiple sequential
``try_compile`` operations reuse this single output directory. If you use
``--debug-trycompile``, you can only debug one ``try_compile`` call at a time.
The recommended procedure is to protect all ``try_compile`` calls in your
-project by ``if(NOT DEFINED RESULT_VAR)`` logic, configure with cmake
+project by ``if(NOT DEFINED <resultVar>)`` logic, configure with cmake
all the way through once, then delete the cache entry associated with
the try_compile call of interest, and then re-run cmake again with
``--debug-trycompile``.
@@ -125,7 +140,13 @@ default values:
If :policy:`CMP0056` is set to ``NEW``, then
:variable:`CMAKE_EXE_LINKER_FLAGS` is passed in as well.
-The current setting of :policy:`CMP0065` is set in the generated project.
+If :policy:`CMP0083` is set to ``NEW``, then in order to obtain correct
+behavior at link time, the ``check_pie_supported()`` command from the
+:module:`CheckPIESupported` module must be called before using the
+:command:`try_compile` command.
+
+The current settings of :policy:`CMP0065` and :policy:`CMP0083` are propagated
+through to the generated test project.
Set the :variable:`CMAKE_TRY_COMPILE_CONFIGURATION` variable to choose
a build configuration.
@@ -135,7 +156,9 @@ the type of target used for the source file signature.
Set the :variable:`CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify
variables that must be propagated into the test project. This variable is
-meant for use only in toolchain files.
+meant for use only in toolchain files and is only honored by the
+``try_compile()`` command for the source files form, not when given a whole
+project.
If :policy:`CMP0067` is set to ``NEW``, or any of the ``<LANG>_STANDARD``,
``<LANG>_STANDARD_REQUIRED``, or ``<LANG>_EXTENSIONS`` options are used,
@@ -153,3 +176,6 @@ then the language standard variables are honored:
Their values are used to set the corresponding target properties in
the generated project (unless overridden by an explicit option).
+
+For the :generator:`Green Hills MULTI` generator the GHS toolset and target
+system customization cache variables are also propagated into the test project.
diff --git a/Help/command/try_run.rst b/Help/command/try_run.rst
index e3bd57d50..d401ebe92 100644
--- a/Help/command/try_run.rst
+++ b/Help/command/try_run.rst
@@ -10,11 +10,12 @@ Try compiling and then running some code.
Try Compiling and Running Source Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-::
+.. code-block:: cmake
- try_run(RUN_RESULT_VAR COMPILE_RESULT_VAR
- bindir srcfile [CMAKE_FLAGS <flags>...]
+ try_run(<runResultVar> <compileResultVar>
+ <bindir> <srcfile> [CMAKE_FLAGS <flags>...]
[COMPILE_DEFINITIONS <defs>...]
+ [LINK_OPTIONS <options>...]
[LINK_LIBRARIES <libs>...]
[COMPILE_OUTPUT_VARIABLE <var>]
[RUN_OUTPUT_VARIABLE <var>]
@@ -22,9 +23,9 @@ Try Compiling and Running Source Files
[ARGS <args>...])
Try compiling a ``<srcfile>``. Returns ``TRUE`` or ``FALSE`` for success
-or failure in ``COMPILE_RESULT_VAR``. If the compile succeeded, runs the
-executable and returns its exit code in ``RUN_RESULT_VAR``. If the
-executable was built, but failed to run, then ``RUN_RESULT_VAR`` will be
+or failure in ``<compileResultVar>``. If the compile succeeded, runs the
+executable and returns its exit code in ``<runResultVar>``. If the
+executable was built, but failed to run, then ``<runResultVar>`` will be
set to ``FAILED_TO_RUN``. See the :command:`try_compile` command for
information on how the test project is constructed to build the source file.
@@ -38,7 +39,7 @@ The options are:
are used.
``COMPILE_DEFINITIONS <defs>...``
- Specify ``-Ddefinition`` arguments to pass to ``add_definitions``
+ Specify ``-Ddefinition`` arguments to pass to :command:`add_definitions`
in the generated test project.
``COMPILE_OUTPUT_VARIABLE <var>``
@@ -52,6 +53,10 @@ The options are:
If this option is specified, any ``-DLINK_LIBRARIES=...`` value
given to the ``CMAKE_FLAGS`` option will be ignored.
+``LINK_OPTIONS <options>...``
+ Specify link step options to pass to :command:`target_link_options` in the
+ generated project.
+
``OUTPUT_VARIABLE <var>``
Report the compile build output and the output from running the executable
in the given variable. This option exists for legacy reasons. Prefer
@@ -80,10 +85,10 @@ presetting them in some CMake script file to the values the executable
would have produced if it had been run on its actual target platform.
These cache entries are:
-``<RUN_RESULT_VAR>``
+``<runResultVar>``
Exit code if the executable were to be run on the target platform.
-``<RUN_RESULT_VAR>__TRYRUN_OUTPUT``
+``<runResultVar>__TRYRUN_OUTPUT``
Output from stdout and stderr if the executable were to be run on
the target platform. This is created only if the
``RUN_OUTPUT_VARIABLE`` or ``OUTPUT_VARIABLE`` option was used.
diff --git a/Help/command/unset.rst b/Help/command/unset.rst
index c19dd318a..75210521e 100644
--- a/Help/command/unset.rst
+++ b/Help/command/unset.rst
@@ -3,7 +3,10 @@ unset
Unset a variable, cache variable, or environment variable.
-::
+Unset Normal Variable or Cache Entry
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
unset(<variable> [CACHE | PARENT_SCOPE])
@@ -22,11 +25,17 @@ If ``PARENT_SCOPE`` is present then the variable is removed from the scope
above the current scope. See the same option in the :command:`set` command
for further details.
-``<variable>`` can be an environment variable such as:
+Unset Environment Variable
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: cmake
-::
+ unset(ENV{<variable>})
- unset(ENV{LD_LIBRARY_PATH})
+Removes ``<variable>`` from the currently available
+:manual:`Environment Variables <cmake-env-variables(7)>`.
+Subsequent calls of ``$ENV{<variable>}`` will return the empty string.
-in which case the variable will be removed from the current
-environment.
+This command affects only the current CMake process, not the process
+from which CMake was called, nor the system environment at large,
+nor the environment of subsequent build or test processes.
diff --git a/Help/command/use_mangled_mesa.rst b/Help/command/use_mangled_mesa.rst
index 6f4d7aca6..4d9e12b3e 100644
--- a/Help/command/use_mangled_mesa.rst
+++ b/Help/command/use_mangled_mesa.rst
@@ -1,7 +1,7 @@
use_mangled_mesa
----------------
-Disallowed. See CMake Policy :policy:`CMP0030`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0030`.
Copy mesa headers for use in combination with system GL.
diff --git a/Help/command/utility_source.rst b/Help/command/utility_source.rst
index ee34492c3..94d6a4e64 100644
--- a/Help/command/utility_source.rst
+++ b/Help/command/utility_source.rst
@@ -1,7 +1,7 @@
utility_source
--------------
-Disallowed. See CMake Policy :policy:`CMP0034`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0034`.
Specify the source tree of a third-party utility.
diff --git a/Help/command/variable_requires.rst b/Help/command/variable_requires.rst
index 9cf9f3ffd..b4742a523 100644
--- a/Help/command/variable_requires.rst
+++ b/Help/command/variable_requires.rst
@@ -1,7 +1,7 @@
variable_requires
-----------------
-Disallowed. See CMake Policy :policy:`CMP0035`.
+Disallowed since version 3.0. See CMake Policy :policy:`CMP0035`.
Use the :command:`if` command instead.
diff --git a/Help/command/variable_watch.rst b/Help/command/variable_watch.rst
index a2df058eb..ce69bcfcd 100644
--- a/Help/command/variable_watch.rst
+++ b/Help/command/variable_watch.rst
@@ -3,11 +3,13 @@ variable_watch
Watch the CMake variable for change.
-::
+.. code-block:: cmake
- variable_watch(<variable name> [<command to execute>])
+ variable_watch(<variable> [<command>])
-If the specified variable changes, the message will be printed about
-the variable being changed. If the command is specified, the command
-will be executed. The command will receive the following arguments:
-COMMAND(<variable> <access> <value> <current list file> <stack>)
+If the specified ``<variable>`` changes, a message will be printed
+to inform about the change.
+
+Additionally, if ``<command>`` is given, this command will be executed.
+The command will receive the following arguments:
+``COMMAND(<variable> <access> <value> <current_list_file> <stack>)``
diff --git a/Help/command/while.rst b/Help/command/while.rst
index 7509da309..a4957c1db 100644
--- a/Help/command/while.rst
+++ b/Help/command/while.rst
@@ -3,15 +3,23 @@ while
Evaluate a group of commands while a condition is true
-::
+.. code-block:: cmake
- while(condition)
- COMMAND1(ARGS ...)
- COMMAND2(ARGS ...)
- ...
- endwhile(condition)
+ while(<condition>)
+ <commands>
+ endwhile()
All commands between while and the matching :command:`endwhile` are recorded
without being invoked. Once the :command:`endwhile` is evaluated, the
-recorded list of commands is invoked as long as the condition is true. The
-condition is evaluated using the same logic as the :command:`if` command.
+recorded list of commands is invoked as long as the ``<condition>`` is true.
+
+The ``<condition>`` has the same syntax and is evaluated using the same logic
+as described at length for the :command:`if` command.
+
+The commands :command:`break` and :command:`continue` provide means to
+escape from the normal control flow.
+
+Per legacy, the :command:`endwhile` command admits
+an optional ``<condition>`` argument.
+If used, it must be a verbatim repeat of the argument of the opening
+``while`` command.
diff --git a/Help/command/write_file.rst b/Help/command/write_file.rst
index 40e755763..4d476bd5a 100644
--- a/Help/command/write_file.rst
+++ b/Help/command/write_file.rst
@@ -1,7 +1,9 @@
write_file
----------
-Deprecated. Use the :command:`file(WRITE)` command instead.
+.. deprecated:: 3.0
+
+ Use the :command:`file(WRITE)` command instead.
::
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst
index fdde6544b..23f051530 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -15,9 +15,9 @@ better deb package when Debian specific tools ``dpkg-xxx`` are usable on
the build system.
The CPack DEB generator has specific features which are controlled by the
-specifics :code:`CPACK_DEBIAN_XXX` variables.
+specifics ``CPACK_DEBIAN_XXX`` variables.
-:code:`CPACK_DEBIAN_<COMPONENT>_XXXX` variables may be used in order to have
+``CPACK_DEBIAN_<COMPONENT>_XXXX`` variables may be used in order to have
**component** specific values. Note however that ``<COMPONENT>`` refers to
the **grouping name** written in upper case. It may be either a component name
or a component GROUP name.
@@ -133,8 +133,8 @@ List of CPack DEB generator specific variables:
The Debian package architecture
* Mandatory : YES
- * Default : Output of :code:`dpkg --print-architecture` (or :code:`i386`
- if :code:`dpkg` is not found)
+ * Default : Output of ``dpkg --print-architecture`` (or ``i386``
+ if ``dpkg`` is not found)
.. variable:: CPACK_DEBIAN_PACKAGE_DEPENDS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS
@@ -176,7 +176,7 @@ List of CPack DEB generator specific variables:
The Debian package maintainer
* Mandatory : YES
- * Default : :code:`CPACK_PACKAGE_CONTACT`
+ * Default : ``CPACK_PACKAGE_CONTACT``
.. variable:: CPACK_DEBIAN_PACKAGE_DESCRIPTION
CPACK_COMPONENT_<COMPONENT>_DESCRIPTION
@@ -205,18 +205,18 @@ List of CPack DEB generator specific variables:
The archive format used for creating the Debian package.
* Mandatory : YES
- * Default : "paxr"
+ * Default : "gnutar"
- Possible values are:
+ Possible value is:
- - paxr
- gnutar
.. note::
- Default pax archive format is the most portable format and generates
- packages that do not treat sparse files specially.
- GNU tar format on the other hand supports longer filenames.
+ This variable previously defaulted to the ``paxr`` value, but ``dpkg``
+ has never supported that tar format. For backwards compatibility the
+ ``paxr`` value will be mapped to ``gnutar`` and a deprecation message
+ will be emitted.
.. variable:: CPACK_DEBIAN_COMPRESSION_TYPE
@@ -260,7 +260,7 @@ List of CPack DEB generator specific variables:
.. variable:: CPACK_DEBIAN_PACKAGE_SHLIBDEPS
CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS
- May be set to ON in order to use :code:`dpkg-shlibdeps` to generate
+ May be set to ON in order to use ``dpkg-shlibdeps`` to generate
better package dependency list.
* Mandatory : NO
@@ -272,7 +272,7 @@ List of CPack DEB generator specific variables:
.. note::
You may need set :variable:`CMAKE_INSTALL_RPATH` to an appropriate value
- if you use this feature, because if you don't :code:`dpkg-shlibdeps`
+ if you use this feature, because if you don't ``dpkg-shlibdeps``
may fail to find your own shared libs.
See https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
@@ -289,7 +289,7 @@ List of CPack DEB generator specific variables:
Sets the `Pre-Depends` field of the Debian package.
Like :variable:`Depends <CPACK_DEBIAN_PACKAGE_DEPENDS>`, except that it
- also forces :code:`dpkg` to complete installation of the packages named
+ also forces ``dpkg`` to complete installation of the packages named
before even starting the installation of the package which declares the
pre-dependency.
@@ -324,7 +324,7 @@ List of CPack DEB generator specific variables:
Sets the `Breaks` field of the Debian package.
When a binary package (P) declares that it breaks other packages (B),
- :code:`dpkg` will not allow the package (P) which declares `Breaks` be
+ ``dpkg`` will not allow the package (P) which declares `Breaks` be
**unpacked** unless the packages that will be broken (B) are deconfigured
first.
As long as the package (P) is configured, the previously deconfigured
@@ -344,7 +344,7 @@ List of CPack DEB generator specific variables:
Sets the `Conflicts` field of the Debian package.
When one binary package declares a conflict with another using a `Conflicts`
- field, :code:`dpkg` will not allow them to be unpacked on the system at
+ field, ``dpkg`` will not allow them to be unpacked on the system at
the same time.
* Mandatory : NO
diff --git a/Help/cpack_gen/freebsd.rst b/Help/cpack_gen/freebsd.rst
index b22ea9a81..a8dd32050 100644
--- a/Help/cpack_gen/freebsd.rst
+++ b/Help/cpack_gen/freebsd.rst
@@ -20,7 +20,7 @@ The CPack FreeBSD generator should work on any host with libpkg installed. The
packages it produces are specific to the host architecture and ABI.
The CPack FreeBSD generator sets package-metadata through
-:code:`CPACK_FREEBSD_XXX` variables. The CPack FreeBSD generator, unlike the
+``CPACK_FREEBSD_XXX`` variables. The CPack FreeBSD generator, unlike the
CPack Deb generator, does not specially support componentized packages; a
single package is created from all the software artifacts created through
CMake.
diff --git a/Help/cpack_gen/nuget.rst b/Help/cpack_gen/nuget.rst
index c8c481f8e..f8aa6266b 100644
--- a/Help/cpack_gen/nuget.rst
+++ b/Help/cpack_gen/nuget.rst
@@ -18,7 +18,7 @@ The CPack NuGet generator may be used to create NuGet packages using
it uses the ``CPACK_XXX`` variables used by :module:`CPack`.
The CPack NuGet generator has specific features which are controlled by the
-specifics :code:`CPACK_NUGET_XXX` variables. In the "one per group" mode
+specifics ``CPACK_NUGET_XXX`` variables. In the "one per group" mode
(see :variable:`CPACK_COMPONENTS_GROUPING`), ``<compName>`` placeholder
in the variables below would contain a group name (uppercased and turned into
a "C" identifier).
diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst
index 5c543ffce..65009db84 100644
--- a/Help/cpack_gen/rpm.rst
+++ b/Help/cpack_gen/rpm.rst
@@ -11,9 +11,9 @@ The CPack RPM generator is a :module:`CPack` generator thus it uses the
``CPACK_XXX`` variables used by :module:`CPack`.
The CPack RPM generator has specific features which are controlled by the specifics
-:code:`CPACK_RPM_XXX` variables.
+``CPACK_RPM_XXX`` variables.
-:code:`CPACK_RPM_<COMPONENT>_XXXX` variables may be used in order to have
+``CPACK_RPM_<COMPONENT>_XXXX`` variables may be used in order to have
**component** specific values. Note however that ``<COMPONENT>`` refers to the
**grouping name** written in upper case. It may be either a component name or
a component GROUP name. Usually those variables correspond to RPM spec file
diff --git a/Help/dev/README.rst b/Help/dev/README.rst
index ce62abc4b..84da4f1d3 100644
--- a/Help/dev/README.rst
+++ b/Help/dev/README.rst
@@ -36,8 +36,10 @@ Developer Documentation
CMake developer documentation is provided by the following documents:
* The `CMake Source Code Guide`_.
+* The `CMake Documentation Guide`_.
.. _`CMake Source Code Guide`: source.rst
+.. _`CMake Documentation Guide`: documentation.rst
Maintainer Documentation
========================
diff --git a/Help/dev/documentation.rst b/Help/dev/documentation.rst
new file mode 100644
index 000000000..c302790aa
--- /dev/null
+++ b/Help/dev/documentation.rst
@@ -0,0 +1,530 @@
+CMake Documentation Guide
+*************************
+
+The following is a guide to the CMake documentation source for developers.
+See documentation on `CMake Development`_ for more information.
+
+.. _`CMake Development`: README.rst
+
+Help
+====
+
+The ``Help`` directory contains CMake help manual source files.
+They are written using the `reStructuredText`_ markup syntax and
+processed by `Sphinx`_ to generate the CMake help manuals.
+
+.. _`reStructuredText`: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
+.. _`Sphinx`: http://sphinx-doc.org
+
+Markup Constructs
+-----------------
+
+In addition to using Sphinx to generate the CMake help manuals, we
+also use a C++-implemented document processor to print documents for
+the ``--help-*`` command-line help options. It supports a subset of
+reStructuredText markup. When authoring or modifying documents,
+please verify that the command-line help looks good in addition to the
+Sphinx-generated html and man pages.
+
+The command-line help processor supports the following constructs
+defined by reStructuredText, Sphinx, and a CMake extension to Sphinx.
+
+..
+ Note: This list must be kept consistent with the cmRST implementation.
+
+CMake Domain directives
+ Directives defined in the `CMake Domain`_ for defining CMake
+ documentation objects are printed in command-line help output as
+ if the lines were normal paragraph text with interpretation.
+
+CMake Domain interpreted text roles
+ Interpreted text roles defined in the `CMake Domain`_ for
+ cross-referencing CMake documentation objects are replaced by their
+ link text in command-line help output. Other roles are printed
+ literally and not processed.
+
+``code-block`` directive
+ Add a literal code block without interpretation. The command-line
+ help processor prints the block content without the leading directive
+ line and with common indentation replaced by one space.
+
+``include`` directive
+ Include another document source file. The command-line help
+ processor prints the included document inline with the referencing
+ document.
+
+literal block after ``::``
+ A paragraph ending in ``::`` followed by a blank line treats
+ the following indented block as literal text without interpretation.
+ The command-line help processor prints the ``::`` literally and
+ prints the block content with common indentation replaced by one
+ space.
+
+``note`` directive
+ Call out a side note. The command-line help processor prints the
+ block content as if the lines were normal paragraph text with
+ interpretation.
+
+``parsed-literal`` directive
+ Add a literal block with markup interpretation. The command-line
+ help processor prints the block content without the leading
+ directive line and with common indentation replaced by one space.
+
+``productionlist`` directive
+ Render context-free grammar productions. The command-line help
+ processor prints the block content as if the lines were normal
+ paragraph text with interpretation.
+
+``replace`` directive
+ Define a ``|substitution|`` replacement.
+ The command-line help processor requires a substitution replacement
+ to be defined before it is referenced.
+
+``|substitution|`` reference
+ Reference a substitution replacement previously defined by
+ the ``replace`` directive. The command-line help processor
+ performs the substitution and replaces all newlines in the
+ replacement text with spaces.
+
+``toctree`` directive
+ Include other document sources in the Table-of-Contents
+ document tree. The command-line help processor prints
+ the referenced documents inline as part of the referencing
+ document.
+
+Inline markup constructs not listed above are printed literally in the
+command-line help output. We prefer to use inline markup constructs that
+look correct in source form, so avoid use of \\-escapes in favor of inline
+literals when possible.
+
+Explicit markup blocks not matching directives listed above are removed from
+command-line help output. Do not use them, except for plain ``..`` comments
+that are removed by Sphinx too.
+
+Note that nested indentation of blocks is not recognized by the
+command-line help processor. Therefore:
+
+* Explicit markup blocks are recognized only when not indented
+ inside other blocks.
+
+* Literal blocks after paragraphs ending in ``::`` but not
+ at the top indentation level may consume all indented lines
+ following them.
+
+Try to avoid these cases in practice.
+
+CMake Domain
+------------
+
+CMake adds a `Sphinx Domain`_ called ``cmake``, also called the
+"CMake Domain". It defines several "object" types for CMake
+documentation:
+
+``command``
+ A CMake language command.
+
+``generator``
+ A CMake native build system generator.
+ See the `cmake(1)`_ command-line tool's ``-G`` option.
+
+``manual``
+ A CMake manual page, like the `cmake(1)`_ manual.
+
+``module``
+ A CMake module.
+ See the `cmake-modules(7)`_ manual
+ and the `include()`_ command.
+
+``policy``
+ A CMake policy.
+ See the `cmake-policies(7)`_ manual
+ and the `cmake_policy()`_ command.
+
+``prop_cache, prop_dir, prop_gbl, prop_sf, prop_inst, prop_test, prop_tgt``
+ A CMake cache, directory, global, source file, installed file, test,
+ or target property, respectively. See the `cmake-properties(7)`_
+ manual and the `set_property()`_ command.
+
+``variable``
+ A CMake language variable.
+ See the `cmake-variables(7)`_ manual
+ and the `set()`_ command.
+
+Documentation objects in the CMake Domain come from two sources.
+First, the CMake extension to Sphinx transforms every document named
+with the form ``Help/<type>/<file-name>.rst`` to a domain object with
+type ``<type>``. The object name is extracted from the document title,
+which is expected to be of the form::
+
+ <object-name>
+ -------------
+
+and to appear at or near the top of the ``.rst`` file before any other
+lines starting in a letter, digit, or ``<``. If no such title appears
+literally in the ``.rst`` file, the object name is the ``<file-name>``.
+If a title does appear, it is expected that ``<file-name>`` is equal
+to ``<object-name>`` with any ``<`` and ``>`` characters removed.
+
+Second, the CMake Domain provides directives to define objects inside
+other documents:
+
+.. code-block:: rst
+
+ .. command:: <command-name>
+
+ This indented block documents <command-name>.
+
+ .. variable:: <variable-name>
+
+ This indented block documents <variable-name>.
+
+Object types for which no directive is available must be defined using
+the first approach above.
+
+.. _`Sphinx Domain`: http://sphinx-doc.org/domains.html
+.. _`cmake(1)`: https://cmake.org/cmake/help/latest/manual/cmake.1.html
+.. _`cmake-modules(7)`: https://cmake.org/cmake/help/latest/manual/cmake-modules.7.html
+.. _`cmake-policies(7)`: https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html
+.. _`cmake-properties(7)`: https://cmake.org/cmake/help/latest/manual/cmake-properties.7.html
+.. _`cmake-variables(7)`: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
+.. _`cmake_policy()`: https://cmake.org/cmake/help/latest/command/cmake_policy.html
+.. _`include()`: https://cmake.org/cmake/help/latest/command/include.html
+.. _`set()`: https://cmake.org/cmake/help/latest/command/set.html
+.. _`set_property()`: https://cmake.org/cmake/help/latest/command/set_property.html
+
+Cross-References
+----------------
+
+Sphinx uses reStructuredText interpreted text roles to provide
+cross-reference syntax. The `CMake Domain`_ provides for each
+domain object type a role of the same name to cross-reference it.
+CMake Domain roles are inline markup of the forms::
+
+ :type:`name`
+ :type:`text <name>`
+
+where ``type`` is the domain object type and ``name`` is the
+domain object name. In the first form the link text will be
+``name`` (or ``name()`` if the type is ``command``) and in
+the second form the link text will be the explicit ``text``.
+For example, the code:
+
+.. code-block:: rst
+
+ * The :command:`list` command.
+ * The :command:`list(APPEND)` sub-command.
+ * The :command:`list() command <list>`.
+ * The :command:`list(APPEND) sub-command <list>`.
+ * The :variable:`CMAKE_VERSION` variable.
+ * The :prop_tgt:`OUTPUT_NAME_<CONFIG>` target property.
+
+produces:
+
+* The `list()`_ command.
+* The `list(APPEND)`_ sub-command.
+* The `list() command`_.
+* The `list(APPEND) sub-command`_.
+* The `CMAKE_VERSION`_ variable.
+* The `OUTPUT_NAME_<CONFIG>`_ target property.
+
+Note that CMake Domain roles differ from Sphinx and reStructuredText
+convention in that the form ``a<b>``, without a space preceding ``<``,
+is interpreted as a name instead of link text with an explicit target.
+This is necessary because we use ``<placeholders>`` frequently in
+object names like ``OUTPUT_NAME_<CONFIG>``. The form ``a <b>``,
+with a space preceding ``<``, is still interpreted as a link text
+with an explicit target.
+
+.. _`list()`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`list(APPEND)`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`list(APPEND) sub-command`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`list() command`: https://cmake.org/cmake/help/latest/command/list.html
+.. _`CMAKE_VERSION`: https://cmake.org/cmake/help/latest/variable/CMAKE_VERSION.html
+.. _`OUTPUT_NAME_<CONFIG>`: https://cmake.org/cmake/help/latest/prop_tgt/OUTPUT_NAME_CONFIG.html
+
+Style
+-----
+
+Style: Section Headers
+^^^^^^^^^^^^^^^^^^^^^^
+
+When marking section titles, make the section decoration line as long as
+the title text. Use only a line below the title, not above. For
+example:
+
+.. code-block:: rst
+
+ Title Text
+ ----------
+
+Capitalize the first letter of each non-minor word in the title.
+
+The section header underline character hierarchy is
+
+* ``#``: Manual group (part) in the master document
+* ``*``: Manual (chapter) title
+* ``=``: Section within a manual
+* ``-``: Subsection or `CMake Domain`_ object document title
+* ``^``: Subsubsection or `CMake Domain`_ object document section
+* ``"``: Paragraph or `CMake Domain`_ object document subsection
+
+Style: Whitespace
+^^^^^^^^^^^^^^^^^
+
+Use two spaces for indentation. Use two spaces between sentences in
+prose.
+
+Style: Line Length
+^^^^^^^^^^^^^^^^^^
+
+Prefer to restrict the width of lines to 75-80 columns. This is not a
+hard restriction, but writing new paragraphs wrapped at 75 columns
+allows space for adding minor content without significant re-wrapping of
+content.
+
+Style: Prose
+^^^^^^^^^^^^
+
+Use American English spellings in prose.
+
+Style: Starting Literal Blocks
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Prefer to mark the start of literal blocks with ``::`` at the end of
+the preceding paragraph. In cases where the following block gets
+a ``code-block`` marker, put a single ``:`` at the end of the preceding
+paragraph.
+
+Style: CMake Command Signatures
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Command signatures should be marked up as plain literal blocks, not as
+cmake ``code-blocks``.
+
+Signatures are separated from preceding content by a section header.
+That is, use:
+
+.. code-block:: rst
+
+ ... preceding paragraph.
+
+ Normal Libraries
+ ^^^^^^^^^^^^^^^^
+
+ ::
+
+ add_library(<lib> ...)
+
+ This signature is used for ...
+
+Signatures of commands should wrap optional parts with square brackets,
+and should mark list of optional arguments with an ellipsis (``...``).
+Elements of the signature which are specified by the user should be
+specified with angle brackets, and may be referred to in prose using
+``inline-literal`` syntax.
+
+Style: Boolean Constants
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Use "``OFF``" and "``ON``" for boolean values which can be modified by
+the user, such as ``POSITION_INDEPENDENT_CODE``. Such properties
+may be "enabled" and "disabled". Use "``True``" and "``False``" for
+inherent values which can't be modified after being set, such as the
+``IMPORTED`` property of a build target.
+
+Style: Inline Literals
+^^^^^^^^^^^^^^^^^^^^^^
+
+Mark up references to keywords in signatures, file names, and other
+technical terms with ``inline-literal`` syntax, for example:
+
+.. code-block:: rst
+
+ If ``WIN32`` is used with :command:`add_executable`, the
+ :prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
+ creates the file ``<name>.exe`` on Windows.
+
+Style: Cross-References
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Mark up linkable references as links, including repeats.
+An alternative, which is used by wikipedia
+(`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
+is to link to a reference only once per article. That style is not used
+in CMake documentation.
+
+Style: Referencing CMake Concepts
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If referring to a concept which corresponds to a property, and that
+concept is described in a high-level manual, prefer to link to the
+manual section instead of the property. For example:
+
+.. code-block:: rst
+
+ This command creates an :ref:`Imported Target <Imported Targets>`.
+
+instead of:
+
+.. code-block:: rst
+
+ This command creates an :prop_tgt:`IMPORTED` target.
+
+The latter should be used only when referring specifically to the
+property.
+
+References to manual sections are not automatically created by creating
+a section, but code such as:
+
+.. code-block:: rst
+
+ .. _`Imported Targets`:
+
+creates a suitable anchor. Use an anchor name which matches the name
+of the corresponding section. Refer to the anchor using a
+cross-reference with specified text.
+
+Imported Targets need the ``IMPORTED`` term marked up with care in
+particular because the term may refer to a command keyword, a target
+property, or a concept.
+
+Where a property, command or variable is related conceptually to others,
+by for example, being related to the buildsystem description, generator
+expressions or Qt, each relevant property, command or variable should
+link to the primary manual, which provides high-level information. Only
+particular information relating to the command should be in the
+documentation of the command.
+
+Style: Referencing CMake Domain Objects
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When referring to `CMake Domain`_ objects such as properties, variables,
+commands etc, prefer to link to the target object and follow that with
+the type of object it is. For example:
+
+.. code-block:: rst
+
+ Set the :prop_tgt:`AUTOMOC` target property to ``ON``.
+
+Instead of
+
+.. code-block:: rst
+
+ Set the target property :prop_tgt:`AUTOMOC` to ``ON``.
+
+The ``policy`` directive is an exception, and the type us usually
+referred to before the link:
+
+.. code-block:: rst
+
+ If policy :policy:`CMP0022` is set to ``NEW`` the behavior is ...
+
+However, markup self-references with ``inline-literal`` syntax.
+For example, within the ``add_executable`` command documentation, use
+
+.. code-block:: rst
+
+ ``add_executable``
+
+not
+
+.. code-block:: rst
+
+ :command:`add_executable`
+
+which is used elsewhere.
+
+Modules
+=======
+
+The ``Modules`` directory contains CMake-language ``.cmake`` module files.
+
+Module Documentation
+--------------------
+
+To document CMake module ``Modules/<module-name>.cmake``, modify
+``Help/manual/cmake-modules.7.rst`` to reference the module in the
+``toctree`` directive, in sorted order, as::
+
+ /module/<module-name>
+
+Then add the module document file ``Help/module/<module-name>.rst``
+containing just the line::
+
+ .. cmake-module:: ../../Modules/<module-name>.cmake
+
+The ``cmake-module`` directive will scan the module file to extract
+reStructuredText markup from comment blocks that start in ``.rst:``.
+At the top of ``Modules/<module-name>.cmake``, begin with the following
+license notice:
+
+::
+
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
+
+After this notice, add a *BLANK* line. Then, add documentation using
+a `Bracket Comment`_ of the form:
+
+::
+
+ #[=======================================================================[.rst:
+ <module-name>
+ -------------
+
+ <reStructuredText documentation of module>
+ #]=======================================================================]
+
+Any number of ``=`` may be used in the opening and closing brackets
+as long as they match. Content on the line containing the closing
+bracket is excluded if and only if the line starts in ``#``.
+
+Additional such ``.rst:`` comments may appear anywhere in the module file.
+All such comments must start with ``#`` in the first column.
+
+For example, a ``Findxxx.cmake`` module may contain:
+
+::
+
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
+
+ #[=======================================================================[.rst:
+ FindXxx
+ -------
+
+ This is a cool module.
+ This module does really cool stuff.
+ It can do even more than you think.
+
+ It even needs two paragraphs to tell you about it.
+ And it defines the following variables:
+
+ ``VAR_COOL``
+ this is great isn't it?
+ ``VAR_REALLY_COOL``
+ cool right?
+ #]=======================================================================]
+
+ <code>
+
+ #[=======================================================================[.rst:
+ .. command:: xxx_do_something
+
+ This command does something for Xxx::
+
+ xxx_do_something(some arguments)
+ #]=======================================================================]
+ macro(xxx_do_something)
+ <code>
+ endmacro()
+
+Test the documentation formatting by running
+``cmake --help-module <module-name>``, and also by enabling the
+``SPHINX_HTML`` and ``SPHINX_MAN`` options to build the documentation.
+Edit the comments until generated documentation looks satisfactory. To
+have a .cmake file in this directory NOT show up in the modules
+documentation, simply leave out the ``Help/module/<module-name>.rst``
+file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
+
+.. _`Bracket Comment`: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-comment
diff --git a/Help/dev/review.rst b/Help/dev/review.rst
index a524115a5..1d664c4b8 100644
--- a/Help/dev/review.rst
+++ b/Help/dev/review.rst
@@ -238,12 +238,10 @@ Referencing Commits in Commit Messages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The preferred form for references to other commits is
-``commit <commit> (<subject>, <date>)``, where:
+``commit <shorthash> (<subject>, <date>)``, where:
-* ``<commit>``:
- If available, a tag-relative name of the commit produced by
- ``git describe --contains <commit-ish>``. Otherwise, the first
- 8-10 characters of the commit ``<hash>``.
+* ``<shorthash>``:
+ The abbreviated hash of the commit.
* ``<subject>``:
The first line of the commit message.
@@ -252,6 +250,17 @@ The preferred form for references to other commits is
The author date of the commit, in its original time zone, formatted as
``CCYY-MM-DD``. ``git-log(1)`` shows the original time zone by default.
+This may be generated with
+``git show -s --date=short --pretty="format:%h (%s, %ad)" <commit>``.
+
+If the commit is a fix for the mentioned commit, consider using a ``Fixes:``
+trailer in the commit message with the specified format. This trailer should
+not be word-wrapped. Note that if there is also an issue for what is being
+fixed, it is preferrable to link to the issue instead.
+
+If relevant, add the first release tag of CMake containing the commit after
+the ``<date>``, i.e., ``commit <shorthash> (<subject>, <date>, <tag>)``.
+
Alternatively, the full commit ``<hash>`` may be used.
Revising Commit Messages
@@ -323,6 +332,14 @@ branch (e.g. ``master``) branch followed by a sequence of merges each
integrating changes from an open MR that has been staged for integration
testing. Each time the target integration branch is updated the stage
is rebuilt automatically by merging the staged MR topics again.
+The branch is stored in the upstream repository by special refs:
+
+* ``refs/stage/master/head``: The current topic stage branch.
+ This is used by continuous builds that report to CDash.
+* ``refs/stage/master/nightly/latest``: Topic stage as of 1am UTC each night.
+ This is used by most nightly builds that report to CDash.
+* ``refs/stage/master/nightly/<yyyy>/<mm>/<dd>``: Topic stage as of 1am UTC
+ on the date specified. This is used for historical reference.
`CMake GitLab Project Developers`_ may stage a MR for integration testing
by adding a comment with a command among the `comment trailing lines`_::
diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 57de81885..47baff42d 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -30,23 +30,6 @@ building on older toolchains some constructs need to be handled with care:
The ``std::auto_ptr`` template is deprecated in C++11. Use ``std::unique_ptr``.
-* Use ``CM_DISABLE_COPY(Class)`` to mark classes as non-copyable.
-
- The ``CM_DISABLE_COPY`` macro should be used in the private section of a
- class to make sure that attempts to copy or assign an instance of the class
- lead to compiler errors even if the compiler does not support *deleted*
- functions. As a guideline, all polymorphic classes should be made
- non-copyable in order to avoid slicing. Classes that are composed of or
- derived from non-copyable classes must also be made non-copyable explicitly
- with ``CM_DISABLE_COPY``.
-
-* Use ``size_t`` instead of ``std::size_t``.
-
- Various implementations have differing implementation of ``size_t``.
- When assigning the result of ``.size()`` on a container for example,
- the result should be assigned to ``size_t`` not to ``std::size_t``,
- ``unsigned int`` or similar types.
-
Source Tree Layout
==================
@@ -56,7 +39,7 @@ The CMake source tree is organized as follows.
Shell and editor integration files.
* ``Help/``:
- Documentation.
+ Documentation. See the `CMake Documentation Guide`_.
* ``Help/dev/``:
Developer documentation.
@@ -92,4 +75,5 @@ The CMake source tree is organized as follows.
* ``Utilities/Release/``:
Scripts used to package CMake itself for distribution on ``cmake.org``.
+.. _`CMake Documentation Guide`: documentation.rst
.. _`Tests/README.rst`: ../../Tests/README.rst
diff --git a/Help/envvar/ASM_DIALECT.rst b/Help/envvar/ASM_DIALECT.rst
index ec48f7145..cabb95971 100644
--- a/Help/envvar/ASM_DIALECT.rst
+++ b/Help/envvar/ASM_DIALECT.rst
@@ -1,6 +1,8 @@
ASM<DIALECT>
------------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling a specific dialect of assembly language
files. ``ASM<DIALECT>`` can be ``ASM``, ``ASM_NASM``, ``ASM_MASM`` or
``ASM-ATT``. Will only be used by CMake on the first configuration to determine
diff --git a/Help/envvar/ASM_DIALECTFLAGS.rst b/Help/envvar/ASM_DIALECTFLAGS.rst
index 4ed02fe22..90cbbdb39 100644
--- a/Help/envvar/ASM_DIALECTFLAGS.rst
+++ b/Help/envvar/ASM_DIALECTFLAGS.rst
@@ -1,6 +1,8 @@
ASM<DIALECT>FLAGS
-----------------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling a specific dialect of an
assembly language. ``ASM<DIALECT>FLAGS`` can be ``ASMFLAGS``, ``ASM_NASMFLAGS``,
``ASM_MASMFLAGS`` or ``ASM-ATTFLAGS``. Will only be used by CMake on the
diff --git a/Help/envvar/CC.rst b/Help/envvar/CC.rst
index 7e68110a1..ef120593e 100644
--- a/Help/envvar/CC.rst
+++ b/Help/envvar/CC.rst
@@ -1,6 +1,8 @@
CC
--
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``C`` language files. Will only be used by
CMake on the first configuration to determine ``C`` compiler, after which the
value for ``CC`` is stored in the cache as
diff --git a/Help/envvar/CFLAGS.rst b/Help/envvar/CFLAGS.rst
index 60b2cd36a..fda9ccc48 100644
--- a/Help/envvar/CFLAGS.rst
+++ b/Help/envvar/CFLAGS.rst
@@ -1,6 +1,8 @@
CFLAGS
------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``C`` files. Will only be
used by CMake on the first configuration to determine ``CC`` default compilation
flags, after which the value for ``CFLAGS`` is stored in the cache
diff --git a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
index 198dc513f..199ca3e4b 100644
--- a/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CMAKE_BUILD_PARALLEL_LEVEL.rst
@@ -1,6 +1,8 @@
CMAKE_BUILD_PARALLEL_LEVEL
--------------------------
+.. include:: ENV_VAR.txt
+
Specifies the maximum number of concurrent processes to use when building
using the ``cmake --build`` command line
:ref:`Build Tool Mode <Build Tool Mode>`.
diff --git a/Help/envvar/CMAKE_CONFIG_TYPE.rst b/Help/envvar/CMAKE_CONFIG_TYPE.rst
index 1306b47da..168593d50 100644
--- a/Help/envvar/CMAKE_CONFIG_TYPE.rst
+++ b/Help/envvar/CMAKE_CONFIG_TYPE.rst
@@ -1,5 +1,7 @@
CMAKE_CONFIG_TYPE
-----------------
+.. include:: ENV_VAR.txt
+
The default build configuration for :ref:`Build Tool Mode` and
``ctest`` build handler when there is no explicit configuration given.
diff --git a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
index 54d5f9e02..77ead4d55 100644
--- a/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
+++ b/Help/envvar/CMAKE_MSVCIDE_RUN_PATH.rst
@@ -1,6 +1,8 @@
CMAKE_MSVCIDE_RUN_PATH
----------------------
+.. include:: ENV_VAR.txt
+
Extra PATH locations for custom commands when using
:generator:`Visual Studio 9 2008` (or above) generators.
diff --git a/Help/envvar/CMAKE_NO_VERBOSE.rst b/Help/envvar/CMAKE_NO_VERBOSE.rst
new file mode 100644
index 000000000..149efbd6f
--- /dev/null
+++ b/Help/envvar/CMAKE_NO_VERBOSE.rst
@@ -0,0 +1,8 @@
+CMAKE_NO_VERBOSE
+----------------
+
+Disables verbose output from CMake when :envvar:`VERBOSE` environment variable
+is set.
+
+Only your build tool of choice will still print verbose output when you start
+to actually build your project.
diff --git a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
index 5fd6e5223..ef7d5470b 100644
--- a/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
+++ b/Help/envvar/CMAKE_OSX_ARCHITECTURES.rst
@@ -1,6 +1,8 @@
CMAKE_OSX_ARCHITECTURES
-----------------------
+.. include:: ENV_VAR.txt
+
Target specific architectures for macOS.
The ``CMAKE_OSX_ARCHITECTURES`` environment variable sets the default value for
diff --git a/Help/envvar/CSFLAGS.rst b/Help/envvar/CSFLAGS.rst
index 251ddc577..404bb5930 100644
--- a/Help/envvar/CSFLAGS.rst
+++ b/Help/envvar/CSFLAGS.rst
@@ -1,6 +1,8 @@
CSFLAGS
-------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``CSharp`` language files. Will only be
used by CMake on the first configuration to determine ``CSharp`` default
compilation flags, after which the value for ``CSFLAGS`` is stored in the cache
diff --git a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
index 25ed14f1b..b769d51d8 100644
--- a/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
+++ b/Help/envvar/CTEST_INTERACTIVE_DEBUG_MODE.rst
@@ -1,5 +1,7 @@
CTEST_INTERACTIVE_DEBUG_MODE
----------------------------
+.. include:: ENV_VAR.txt
+
Environment variable that will exist and be set to ``1`` when a test executed
by CTest is run in interactive mode.
diff --git a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
index 1fcf42bcf..bf860cb40 100644
--- a/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
+++ b/Help/envvar/CTEST_OUTPUT_ON_FAILURE.rst
@@ -1,6 +1,8 @@
CTEST_OUTPUT_ON_FAILURE
-----------------------
+.. include:: ENV_VAR.txt
+
Boolean environment variable that controls if the output should be logged for
failed tests. Set the value to 1, True, or ON to enable output on failure.
See :manual:`ctest(1)` for more information on controlling output of failed
diff --git a/Help/envvar/CTEST_PARALLEL_LEVEL.rst b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
index c767a01ae..fd4936e37 100644
--- a/Help/envvar/CTEST_PARALLEL_LEVEL.rst
+++ b/Help/envvar/CTEST_PARALLEL_LEVEL.rst
@@ -1,5 +1,7 @@
CTEST_PARALLEL_LEVEL
--------------------
+.. include:: ENV_VAR.txt
+
Specify the number of tests for CTest to run in parallel. See :manual:`ctest(1)`
for more information on parallel test execution.
diff --git a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
index a8e15bc2f..de23e1191 100644
--- a/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
+++ b/Help/envvar/CTEST_PROGRESS_OUTPUT.rst
@@ -1,6 +1,8 @@
CTEST_PROGRESS_OUTPUT
---------------------
+.. include:: ENV_VAR.txt
+
Boolean environment variable that affects how :manual:`ctest <ctest(1)>`
command output reports overall progress. When set to 1, TRUE, ON or anything
else that evaluates to boolean true, progress is reported by repeatedly
diff --git a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
index 8d8eea5f8..79dbb79f3 100644
--- a/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
+++ b/Help/envvar/CTEST_USE_LAUNCHERS_DEFAULT.rst
@@ -1,4 +1,6 @@
CTEST_USE_LAUNCHERS_DEFAULT
---------------------------
+.. include:: ENV_VAR.txt
+
Initializes the :variable:`CTEST_USE_LAUNCHERS` variable if not already defined.
diff --git a/Help/envvar/CUDACXX.rst b/Help/envvar/CUDACXX.rst
index 8a5fd4be3..10c0f9dd7 100644
--- a/Help/envvar/CUDACXX.rst
+++ b/Help/envvar/CUDACXX.rst
@@ -1,6 +1,8 @@
CUDACXX
-------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``CUDA`` language files. Will only be used by
CMake on the first configuration to determine ``CUDA`` compiler, after which the
value for ``CUDA`` is stored in the cache as
diff --git a/Help/envvar/CUDAFLAGS.rst b/Help/envvar/CUDAFLAGS.rst
index 3dff49fb6..4456d6bf8 100644
--- a/Help/envvar/CUDAFLAGS.rst
+++ b/Help/envvar/CUDAFLAGS.rst
@@ -1,6 +1,8 @@
CUDAFLAGS
---------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``CUDA`` files. Will only be
used by CMake on the first configuration to determine ``CUDA`` default
compilation flags, after which the value for ``CUDAFLAGS`` is stored in the
diff --git a/Help/envvar/CUDAHOSTCXX.rst b/Help/envvar/CUDAHOSTCXX.rst
index bb786ca83..b9f65bd1e 100644
--- a/Help/envvar/CUDAHOSTCXX.rst
+++ b/Help/envvar/CUDAHOSTCXX.rst
@@ -1,6 +1,8 @@
CUDAHOSTCXX
-----------
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling host code when compiling ``CUDA``
language files. Will only be used by CMake on the first configuration to
determine ``CUDA`` host compiler, after which the value for ``CUDAHOSTCXX`` is
diff --git a/Help/envvar/CXX.rst b/Help/envvar/CXX.rst
index 3b1e445b4..d6553501a 100644
--- a/Help/envvar/CXX.rst
+++ b/Help/envvar/CXX.rst
@@ -1,6 +1,8 @@
CXX
---
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``CXX`` language files. Will only be used by
CMake on the first configuration to determine ``CXX`` compiler, after which the
value for ``CXX`` is stored in the cache as
diff --git a/Help/envvar/CXXFLAGS.rst b/Help/envvar/CXXFLAGS.rst
index 8b58abd06..d7296dca0 100644
--- a/Help/envvar/CXXFLAGS.rst
+++ b/Help/envvar/CXXFLAGS.rst
@@ -1,6 +1,8 @@
CXXFLAGS
--------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``CXX`` (C++) files. Will
only be used by CMake on the first configuration to determine ``CXX`` default
compilation flags, after which the value for ``CXXFLAGS`` is stored in the cache
diff --git a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
index fab1c0c33..2b303a4e9 100644
--- a/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
+++ b/Help/envvar/DASHBOARD_TEST_FROM_CTEST.rst
@@ -1,5 +1,7 @@
DASHBOARD_TEST_FROM_CTEST
-------------------------
+.. include:: ENV_VAR.txt
+
Environment variable that will exist when a test executed by CTest is run
in non-interactive mode. The value will be equal to :variable:`CMAKE_VERSION`.
diff --git a/Help/envvar/DESTDIR.rst b/Help/envvar/DESTDIR.rst
index 87f1115c4..d2144ae7c 100644
--- a/Help/envvar/DESTDIR.rst
+++ b/Help/envvar/DESTDIR.rst
@@ -1,6 +1,8 @@
DESTDIR
-------
+.. include:: ENV_VAR.txt
+
On UNIX one can use the ``DESTDIR`` mechanism in order to relocate the
whole installation. ``DESTDIR`` means DESTination DIRectory. It is
commonly used by makefile users in order to install software at
diff --git a/Help/envvar/ENV_VAR.txt b/Help/envvar/ENV_VAR.txt
new file mode 100644
index 000000000..e1e70cd99
--- /dev/null
+++ b/Help/envvar/ENV_VAR.txt
@@ -0,0 +1,3 @@
+This is a CMake :ref:`Environment Variable <CMake Language
+Environment Variables>`. Its initial value is taken from
+the calling process environment.
diff --git a/Help/envvar/FC.rst b/Help/envvar/FC.rst
index 7d293fdd4..d6cabbc90 100644
--- a/Help/envvar/FC.rst
+++ b/Help/envvar/FC.rst
@@ -1,6 +1,8 @@
FC
--
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``Fortran`` language files. Will only be used
by CMake on the first configuration to determine ``Fortran`` compiler, after
which the value for ``Fortran`` is stored in the cache as
diff --git a/Help/envvar/FFLAGS.rst b/Help/envvar/FFLAGS.rst
index 19d61690c..02d3c3461 100644
--- a/Help/envvar/FFLAGS.rst
+++ b/Help/envvar/FFLAGS.rst
@@ -1,6 +1,8 @@
FFLAGS
------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``Fortran`` files. Will only
be used by CMake on the first configuration to determine ``Fortran`` default
compilation flags, after which the value for ``FFLAGS`` is stored in the cache
diff --git a/Help/envvar/LDFLAGS.rst b/Help/envvar/LDFLAGS.rst
index 52da99c1b..816d6ef77 100644
--- a/Help/envvar/LDFLAGS.rst
+++ b/Help/envvar/LDFLAGS.rst
@@ -1,6 +1,8 @@
LDFLAGS
-------
+.. include:: ENV_VAR.txt
+
Will only be used by CMake on the first configuration to determine the default
linker flags, after which the value for ``LDFLAGS`` is stored in the cache
as :variable:`CMAKE_EXE_LINKER_FLAGS_INIT`,
diff --git a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
index 9dafa3234..662bd03ec 100644
--- a/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
+++ b/Help/envvar/MACOSX_DEPLOYMENT_TARGET.rst
@@ -1,6 +1,8 @@
MACOSX_DEPLOYMENT_TARGET
------------------------
+.. include:: ENV_VAR.txt
+
Specify the minimum version of macOS on which the target binaries are
to be deployed.
diff --git a/Help/envvar/PackageName_ROOT.rst b/Help/envvar/PackageName_ROOT.rst
index e01009bc7..ecec63bd0 100644
--- a/Help/envvar/PackageName_ROOT.rst
+++ b/Help/envvar/PackageName_ROOT.rst
@@ -1,6 +1,8 @@
<PackageName>_ROOT
------------------
+.. include:: ENV_VAR.txt
+
Calls to :command:`find_package(<PackageName>)` will search in prefixes
specified by the ``<PackageName>_ROOT`` environment variable, where
``<PackageName>`` is the name given to the ``find_package`` call
diff --git a/Help/envvar/RC.rst b/Help/envvar/RC.rst
index 6c2db1984..557520e8f 100644
--- a/Help/envvar/RC.rst
+++ b/Help/envvar/RC.rst
@@ -1,6 +1,8 @@
RC
--
+.. include:: ENV_VAR.txt
+
Preferred executable for compiling ``resource`` files. Will only be used by CMake
on the first configuration to determine ``resource`` compiler, after which the
value for ``RC`` is stored in the cache as
diff --git a/Help/envvar/RCFLAGS.rst b/Help/envvar/RCFLAGS.rst
index 4f2f31c03..45419fed1 100644
--- a/Help/envvar/RCFLAGS.rst
+++ b/Help/envvar/RCFLAGS.rst
@@ -1,6 +1,8 @@
RCFLAGS
-------
+.. include:: ENV_VAR.txt
+
Default compilation flags to be used when compiling ``resource`` files. Will
only be used by CMake on the first configuration to determine ``resource``
default compilation flags, after which the value for ``RCFLAGS`` is stored in
diff --git a/Help/envvar/VERBOSE.rst b/Help/envvar/VERBOSE.rst
new file mode 100644
index 000000000..2d775a5be
--- /dev/null
+++ b/Help/envvar/VERBOSE.rst
@@ -0,0 +1,10 @@
+VERBOSE
+-------
+
+Activates verbose output from CMake and your build tools of choice when
+you start to actually build your project.
+
+Note that any given value is ignored. It's just checked for existence.
+
+See also :ref:`Build Tool Mode <Build Tool Mode>` and
+:envvar:`CMAKE_NO_VERBOSE` environment variable
diff --git a/Help/generator/Green Hills MULTI.rst b/Help/generator/Green Hills MULTI.rst
index 1b4960d89..e474682b6 100644
--- a/Help/generator/Green Hills MULTI.rst
+++ b/Help/generator/Green Hills MULTI.rst
@@ -3,49 +3,64 @@ Green Hills MULTI
Generates Green Hills MULTI project files (experimental, work-in-progress).
+The buildsystem has predetermined build-configuration settings that can be controlled
+via the :variable:`CMAKE_BUILD_TYPE` variable.
+
Customizations that are used to pick toolset and target system:
The ``-A <arch>`` can be supplied for setting the target architecture.
``<arch>`` usually is one of "arm", "ppc", "86", etcetera. If the target architecture
is not specified then the default architecture of "arm" will be used.
-The ``-T <toolset>`` can be supplied for setting the toolset to be used.
-All toolsets are expected to be located at ``GHS_TOOLSET_ROOT``.
-If the toolset is not specified then the latest toolset will be used.
+The ``-T <toolset>`` option can be used to set the directory location of the toolset.
+Both absolute and relative paths are valid. Relative paths use ``GHS_TOOLSET_ROOT``
+as the root. If the toolset is not specified then the latest toolset found in
+``GHS_TOOLSET_ROOT`` will be used.
+
+Cache variables that are used for toolset and target system customization:
* ``GHS_TARGET_PLATFORM``
-Default to ``integrity``.
-Usual values are ``integrity``, ``threadx``, ``uvelosity``,
-``velosity``, ``vxworks``, ``standalone``.
+ | Defaults to ``integrity``.
+ | Usual values are ``integrity``, ``threadx``, ``uvelosity``, ``velosity``,
+ ``vxworks``, ``standalone``.
* ``GHS_PRIMARY_TARGET``
-Sets ``primaryTarget`` field in project file.
-Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
+ | Sets ``primaryTarget`` entry in project file.
+ | Defaults to ``<arch>_<GHS_TARGET_PLATFORM>.tgt``.
* ``GHS_TOOLSET_ROOT``
-Default to ``C:/ghs``. Root path for ``toolset``.
+ | Root path for ``toolset`` searches.
+ | Defaults to ``C:/ghs``.
* ``GHS_OS_ROOT``
-Default to ``C:/ghs``. Root path for RTOS searches.
+ | Root path for RTOS searches.
+ | Defaults to ``C:/ghs``.
* ``GHS_OS_DIR``
-Default to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
-a specific RTOS is to be used.
+ | Sets ``-os_dir`` entry in project file.
+ | Defaults to latest platform OS installation at ``GHS_OS_ROOT``. Set this value if
+ a specific RTOS is to be used.
* ``GHS_BSP_NAME``
-Defaults to ``sim<arch>`` if not set by user.
+ | Sets ``-bsp`` entry in project file.
+ | Defaults to ``sim<arch>`` for ``integrity`` platforms.
Customizations are available through the following cache variables:
* ``GHS_CUSTOMIZATION``
* ``GHS_GPJ_MACROS``
+The following properties are available:
+
+* :prop_tgt:`GHS_INTEGRITY_APP`
+* :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE`
+
.. note::
This generator is deemed experimental as of CMake |release|
and is still a work in progress. Future versions of CMake
diff --git a/Help/generator/VS_TOOLSET_HOST_ARCH.txt b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
index 5d13e7741..4eb900f81 100644
--- a/Help/generator/VS_TOOLSET_HOST_ARCH.txt
+++ b/Help/generator/VS_TOOLSET_HOST_ARCH.txt
@@ -1,6 +1,7 @@
For each toolset that comes with this version of Visual Studio, there are
variants that are themselves compiled for 32-bit (x86) and 64-bit (x64) hosts
-(independent of the architecture they target). By default Visual Studio
-chooses the 32-bit variant even on a 64-bit host. One may request use of the
-64-bit host tools by adding a ``host=x64`` option to the toolset specification.
+(independent of the architecture they target).
+|VS_TOOLSET_HOST_ARCH_DEFAULT|
+One may explicitly request use of either the 32-bit or 64-bit host tools
+by adding either ``host=x86`` or ``host=x64`` to the toolset specification.
See the :variable:`CMAKE_GENERATOR_TOOLSET` variable for details.
diff --git a/Help/generator/Visual Studio 10 2010.rst b/Help/generator/Visual Studio 10 2010.rst
index 0446b8c1a..4bf9a8f15 100644
--- a/Help/generator/Visual Studio 10 2010.rst
+++ b/Help/generator/Visual Studio 10 2010.rst
@@ -15,6 +15,8 @@ projects (Database, Website, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
+The default target platform name (architecture) is ``Win32``.
+
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
diff --git a/Help/generator/Visual Studio 11 2012.rst b/Help/generator/Visual Studio 11 2012.rst
index 8fddbb301..5d89a6e7c 100644
--- a/Help/generator/Visual Studio 11 2012.rst
+++ b/Help/generator/Visual Studio 11 2012.rst
@@ -15,6 +15,8 @@ projects (JavaScript, Database, Website, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
+The default target platform name (architecture) is ``Win32``.
+
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
diff --git a/Help/generator/Visual Studio 12 2013.rst b/Help/generator/Visual Studio 12 2013.rst
index 8b4c16295..fb8e021bc 100644
--- a/Help/generator/Visual Studio 12 2013.rst
+++ b/Help/generator/Visual Studio 12 2013.rst
@@ -15,6 +15,8 @@ projects (JavaScript, Powershell, Python, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
+The default target platform name (architecture) is ``Win32``.
+
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
@@ -40,4 +42,7 @@ The ``v120`` toolset that comes with Visual Studio 12 2013 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 14 2015.rst b/Help/generator/Visual Studio 14 2015.rst
index 917d8e5c4..7383f7a6f 100644
--- a/Help/generator/Visual Studio 14 2015.rst
+++ b/Help/generator/Visual Studio 14 2015.rst
@@ -12,6 +12,8 @@ projects (JavaScript, Powershell, Python, etc.) are not supported.
Platform Selection
^^^^^^^^^^^^^^^^^^
+The default target platform name (architecture) is ``Win32``.
+
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
@@ -37,4 +39,7 @@ The ``v140`` toolset that comes with Visual Studio 14 2015 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 15 2017.rst b/Help/generator/Visual Studio 15 2017.rst
index 42a3bb6b3..7e6f0fb20 100644
--- a/Help/generator/Visual Studio 15 2017.rst
+++ b/Help/generator/Visual Studio 15 2017.rst
@@ -28,6 +28,8 @@ by default.
Platform Selection
^^^^^^^^^^^^^^^^^^
+The default target platform name (architecture) is ``Win32``.
+
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
@@ -54,4 +56,7 @@ The ``v141`` toolset that comes with Visual Studio 15 2017 is selected by
default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 32-bit variant even on a 64-bit host.
+
.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 16 2019.rst b/Help/generator/Visual Studio 16 2019.rst
new file mode 100644
index 000000000..b456554b9
--- /dev/null
+++ b/Help/generator/Visual Studio 16 2019.rst
@@ -0,0 +1,53 @@
+Visual Studio 16 2019
+---------------------
+
+Generates Visual Studio 16 (VS 2019) project files.
+
+Project Types
+^^^^^^^^^^^^^
+
+Only Visual C++ and C# projects may be generated. Other types of
+projects (JavaScript, Powershell, Python, etc.) are not supported.
+
+Instance Selection
+^^^^^^^^^^^^^^^^^^
+
+VS 2019 supports multiple installations on the same machine.
+The :variable:`CMAKE_GENERATOR_INSTANCE` variable may be set as a
+cache entry containing the absolute path to a Visual Studio instance.
+If the value is not specified explicitly by the user or a toolchain file,
+CMake queries the Visual Studio Installer to locate VS instances, chooses
+one, and sets the variable as a cache entry to hold the value persistently.
+
+When CMake first chooses an instance, if the ``VS160COMNTOOLS`` environment
+variable is set and points to the ``Common7/Tools`` directory within
+one of the instances, that instance will be used. Otherwise, if more
+than one instance is installed we do not define which one is chosen
+by default.
+
+Platform Selection
+^^^^^^^^^^^^^^^^^^
+
+The default target platform name (architecture) is that of the host.
+
+The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
+via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
+name (architecture). For example:
+
+* ``cmake -G "Visual Studio 16 2019" -A Win32``
+* ``cmake -G "Visual Studio 16 2019" -A x64``
+* ``cmake -G "Visual Studio 16 2019" -A ARM``
+* ``cmake -G "Visual Studio 16 2019" -A ARM64``
+
+Toolset Selection
+^^^^^^^^^^^^^^^^^
+
+The ``v142`` toolset that comes with Visual Studio 16 2019 is selected by
+default. The :variable:`CMAKE_GENERATOR_TOOLSET` option may be set, perhaps
+via the :manual:`cmake(1)` ``-T`` option, to specify another toolset.
+
+.. |VS_TOOLSET_HOST_ARCH_DEFAULT| replace::
+ By default this generator uses the 64-bit variant on x64 hosts and
+ the 32-bit variant otherwise.
+
+.. include:: VS_TOOLSET_HOST_ARCH.txt
diff --git a/Help/generator/Visual Studio 9 2008.rst b/Help/generator/Visual Studio 9 2008.rst
index a29033f01..a09d047ae 100644
--- a/Help/generator/Visual Studio 9 2008.rst
+++ b/Help/generator/Visual Studio 9 2008.rst
@@ -6,6 +6,8 @@ Generates Visual Studio 9 2008 project files.
Platform Selection
^^^^^^^^^^^^^^^^^^
+The default target platform name (architecture) is ``Win32``.
+
The :variable:`CMAKE_GENERATOR_PLATFORM` variable may be set, perhaps
via the :manual:`cmake(1)` ``-A`` option, to specify a target platform
name (architecture). For example:
diff --git a/Help/generator/Xcode.rst b/Help/generator/Xcode.rst
index 968c26a70..71430c7aa 100644
--- a/Help/generator/Xcode.rst
+++ b/Help/generator/Xcode.rst
@@ -3,7 +3,9 @@ Xcode
Generate Xcode project files.
-This supports Xcode 3.0 and above.
+This supports Xcode 3.0 and above. Support for Xcode versions prior
+to Xcode 5 is deprecated and will be dropped in a future version of
+CMake.
Toolset Selection
^^^^^^^^^^^^^^^^^
diff --git a/Help/index.rst b/Help/index.rst
index fe1b73c26..a94893972 100644
--- a/Help/index.rst
+++ b/Help/index.rst
@@ -30,6 +30,7 @@ Reference Manuals
/manual/cmake-compile-features.7
/manual/cmake-developer.7
/manual/cmake-env-variables.7
+ /manual/cmake-file-api.7
/manual/cmake-generator-expressions.7
/manual/cmake-generators.7
/manual/cmake-language.7
diff --git a/Help/manual/ccmake.1.rst b/Help/manual/ccmake.1.rst
index cc3ceec1b..954847150 100644
--- a/Help/manual/ccmake.1.rst
+++ b/Help/manual/ccmake.1.rst
@@ -13,7 +13,7 @@ Synopsis
Description
===========
-The "ccmake" executable is the CMake curses interface. Project
+The **ccmake** executable is the CMake curses interface. Project
configuration settings may be specified interactively through this
GUI. Brief instructions are provided at the bottom of the terminal
when the program is running.
diff --git a/Help/manual/cmake-buildsystem.7.rst b/Help/manual/cmake-buildsystem.7.rst
index 4fc484b2d..a1328f230 100644
--- a/Help/manual/cmake-buildsystem.7.rst
+++ b/Help/manual/cmake-buildsystem.7.rst
@@ -978,6 +978,7 @@ are:
* Built-in properties matching ``COMPATIBLE_INTERFACE_*``
* ``EXPORT_NAME``
* ``IMPORTED``
+* ``MANUALLY_ADDED_DEPENDENCIES``
* ``NAME``
* Properties matching ``IMPORTED_LIBNAME_*``
* Properties matching ``MAP_IMPORTED_CONFIG_*``
diff --git a/Help/manual/cmake-commands.7.rst b/Help/manual/cmake-commands.7.rst
index 0cc5fca83..a3bc46519 100644
--- a/Help/manual/cmake-commands.7.rst
+++ b/Help/manual/cmake-commands.7.rst
@@ -22,8 +22,8 @@ These commands are always available.
/command/cmake_policy
/command/configure_file
/command/continue
- /command/elseif
/command/else
+ /command/elseif
/command/endforeach
/command/endfunction
/command/endif
@@ -53,9 +53,9 @@ These commands are always available.
/command/option
/command/return
/command/separate_arguments
+ /command/set
/command/set_directory_properties
/command/set_property
- /command/set
/command/site_name
/command/string
/command/unset
@@ -100,8 +100,6 @@ These commands are available only in CMake projects.
/command/link_libraries
/command/load_cache
/command/project
- /command/qt_wrap_cpp
- /command/qt_wrap_ui
/command/remove_definitions
/command/set_source_files_properties
/command/set_target_properties
@@ -145,8 +143,10 @@ These commands are available only in CTest scripts.
Deprecated Commands
===================
-These commands are available only for compatibility with older
-versions of CMake. Do not use them in new code.
+These commands are deprecated and are only made available to maintain
+backward compatibility. The documentation of each command states the
+CMake version in which it was deprecated. Do not use these commands
+in new code.
.. toctree::
:maxdepth: 1
@@ -160,6 +160,8 @@ versions of CMake. Do not use them in new code.
/command/load_command
/command/make_directory
/command/output_required_files
+ /command/qt_wrap_cpp
+ /command/qt_wrap_ui
/command/remove
/command/subdir_depends
/command/subdirs
diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index f05c4b129..85ed935e6 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -10,576 +10,20 @@ cmake-developer(7)
Introduction
============
-This manual is intended for reference by developers modifying the CMake
-source tree itself, and by those authoring externally-maintained modules.
-
-Adding Compile Features
-=======================
-
-CMake reports an error if a compiler whose features are known does not report
-support for a particular requested feature. A compiler is considered to have
-known features if it reports support for at least one feature.
-
-When adding a new compile feature to CMake, it is therefore necessary to list
-support for the feature for all CompilerIds which already have one or more
-feature supported, if the new feature is available for any version of the
-compiler.
-
-When adding the first supported feature to a particular CompilerId, it is
-necessary to list support for all features known to cmake (See
-:variable:`CMAKE_C_COMPILE_FEATURES` and
-:variable:`CMAKE_CXX_COMPILE_FEATURES` as appropriate), where available for
-the compiler. Ensure that the ``CMAKE_<LANG>_STANDARD_DEFAULT`` is set to
-the computed internal variable ``CMAKE_<LANG>_STANDARD_COMPUTED_DEFAULT``
-for compiler versions which should be supported.
-
-It is sensible to record the features for the most recent version of a
-particular CompilerId first, and then work backwards. It is sensible to
-try to create a continuous range of versions of feature releases of the
-compiler. Gaps in the range indicate incorrect features recorded for
-intermediate releases.
-
-Generally, features are made available for a particular version if the
-compiler vendor documents availability of the feature with that
-version. Note that sometimes partially implemented features appear to
-be functional in previous releases (such as ``cxx_constexpr`` in GNU 4.6,
-though availability is documented in GNU 4.7), and sometimes compiler vendors
-document availability of features, though supporting infrastructure is
-not available (such as ``__has_feature(cxx_generic_lambdas)`` indicating
-non-availability in Clang 3.4, though it is documented as available, and
-fixed in Clang 3.5). Similar cases for other compilers and versions
-need to be investigated when extending CMake to support them.
-
-When a vendor releases a new version of a known compiler which supports
-a previously unsupported feature, and there are already known features for
-that compiler, the feature should be listed as supported in CMake for
-that version of the compiler as soon as reasonably possible.
-
-Standard-specific/compiler-specific variables such
-``CMAKE_CXX98_COMPILE_FEATURES`` are deliberately not documented. They
-only exist for the compiler-specific implementation of adding the ``-std``
-compile flag for compilers which need that.
-
-Help
-====
-
-The ``Help`` directory contains CMake help manual source files.
-They are written using the `reStructuredText`_ markup syntax and
-processed by `Sphinx`_ to generate the CMake help manuals.
-
-.. _`reStructuredText`: http://docutils.sourceforge.net/docs/ref/rst/introduction.html
-.. _`Sphinx`: http://sphinx-doc.org
-
-Markup Constructs
------------------
-
-In addition to using Sphinx to generate the CMake help manuals, we
-also use a C++-implemented document processor to print documents for
-the ``--help-*`` command-line help options. It supports a subset of
-reStructuredText markup. When authoring or modifying documents,
-please verify that the command-line help looks good in addition to the
-Sphinx-generated html and man pages.
-
-The command-line help processor supports the following constructs
-defined by reStructuredText, Sphinx, and a CMake extension to Sphinx.
-
-..
- Note: This list must be kept consistent with the cmRST implementation.
-
-CMake Domain directives
- Directives defined in the `CMake Domain`_ for defining CMake
- documentation objects are printed in command-line help output as
- if the lines were normal paragraph text with interpretation.
-
-CMake Domain interpreted text roles
- Interpreted text roles defined in the `CMake Domain`_ for
- cross-referencing CMake documentation objects are replaced by their
- link text in command-line help output. Other roles are printed
- literally and not processed.
-
-``code-block`` directive
- Add a literal code block without interpretation. The command-line
- help processor prints the block content without the leading directive
- line and with common indentation replaced by one space.
-
-``include`` directive
- Include another document source file. The command-line help
- processor prints the included document inline with the referencing
- document.
-
-literal block after ``::``
- A paragraph ending in ``::`` followed by a blank line treats
- the following indented block as literal text without interpretation.
- The command-line help processor prints the ``::`` literally and
- prints the block content with common indentation replaced by one
- space.
-
-``note`` directive
- Call out a side note. The command-line help processor prints the
- block content as if the lines were normal paragraph text with
- interpretation.
-
-``parsed-literal`` directive
- Add a literal block with markup interpretation. The command-line
- help processor prints the block content without the leading
- directive line and with common indentation replaced by one space.
-
-``productionlist`` directive
- Render context-free grammar productions. The command-line help
- processor prints the block content as if the lines were normal
- paragraph text with interpretation.
-
-``replace`` directive
- Define a ``|substitution|`` replacement.
- The command-line help processor requires a substitution replacement
- to be defined before it is referenced.
-
-``|substitution|`` reference
- Reference a substitution replacement previously defined by
- the ``replace`` directive. The command-line help processor
- performs the substitution and replaces all newlines in the
- replacement text with spaces.
-
-``toctree`` directive
- Include other document sources in the Table-of-Contents
- document tree. The command-line help processor prints
- the referenced documents inline as part of the referencing
- document.
-
-Inline markup constructs not listed above are printed literally in the
-command-line help output. We prefer to use inline markup constructs that
-look correct in source form, so avoid use of \\-escapes in favor of inline
-literals when possible.
-
-Explicit markup blocks not matching directives listed above are removed from
-command-line help output. Do not use them, except for plain ``..`` comments
-that are removed by Sphinx too.
+This manual is intended for reference by developers working with
+:manual:`cmake-language(7)` code, whether writing their own modules,
+authoring their own build systems, or working on CMake itself.
-Note that nested indentation of blocks is not recognized by the
-command-line help processor. Therefore:
-
-* Explicit markup blocks are recognized only when not indented
- inside other blocks.
-
-* Literal blocks after paragraphs ending in ``::`` but not
- at the top indentation level may consume all indented lines
- following them.
-
-Try to avoid these cases in practice.
-
-CMake Domain
-------------
-
-CMake adds a `Sphinx Domain`_ called ``cmake``, also called the
-"CMake Domain". It defines several "object" types for CMake
-documentation:
-
-``command``
- A CMake language command.
-
-``generator``
- A CMake native build system generator.
- See the :manual:`cmake(1)` command-line tool's ``-G`` option.
-
-``manual``
- A CMake manual page, like this :manual:`cmake-developer(7)` manual.
-
-``module``
- A CMake module.
- See the :manual:`cmake-modules(7)` manual
- and the :command:`include` command.
-
-``policy``
- A CMake policy.
- See the :manual:`cmake-policies(7)` manual
- and the :command:`cmake_policy` command.
-
-``prop_cache, prop_dir, prop_gbl, prop_sf, prop_inst, prop_test, prop_tgt``
- A CMake cache, directory, global, source file, installed file, test,
- or target property, respectively. See the :manual:`cmake-properties(7)`
- manual and the :command:`set_property` command.
-
-``variable``
- A CMake language variable.
- See the :manual:`cmake-variables(7)` manual
- and the :command:`set` command.
-
-Documentation objects in the CMake Domain come from two sources.
-First, the CMake extension to Sphinx transforms every document named
-with the form ``Help/<type>/<file-name>.rst`` to a domain object with
-type ``<type>``. The object name is extracted from the document title,
-which is expected to be of the form::
-
- <object-name>
- -------------
-
-and to appear at or near the top of the ``.rst`` file before any other
-lines starting in a letter, digit, or ``<``. If no such title appears
-literally in the ``.rst`` file, the object name is the ``<file-name>``.
-If a title does appear, it is expected that ``<file-name>`` is equal
-to ``<object-name>`` with any ``<`` and ``>`` characters removed.
-
-Second, the CMake Domain provides directives to define objects inside
-other documents:
-
-.. code-block:: rst
-
- .. command:: <command-name>
-
- This indented block documents <command-name>.
-
- .. variable:: <variable-name>
-
- This indented block documents <variable-name>.
-
-Object types for which no directive is available must be defined using
-the first approach above.
-
-.. _`Sphinx Domain`: http://sphinx-doc.org/domains.html
-
-Cross-References
-----------------
-
-Sphinx uses reStructuredText interpreted text roles to provide
-cross-reference syntax. The `CMake Domain`_ provides for each
-domain object type a role of the same name to cross-reference it.
-CMake Domain roles are inline markup of the forms::
-
- :type:`name`
- :type:`text <name>`
-
-where ``type`` is the domain object type and ``name`` is the
-domain object name. In the first form the link text will be
-``name`` (or ``name()`` if the type is ``command``) and in
-the second form the link text will be the explicit ``text``.
-For example, the code:
-
-.. code-block:: rst
-
- * The :command:`list` command.
- * The :command:`list(APPEND)` sub-command.
- * The :command:`list() command <list>`.
- * The :command:`list(APPEND) sub-command <list>`.
- * The :variable:`CMAKE_VERSION` variable.
- * The :prop_tgt:`OUTPUT_NAME_<CONFIG>` target property.
-
-produces:
-
-* The :command:`list` command.
-* The :command:`list(APPEND)` sub-command.
-* The :command:`list() command <list>`.
-* The :command:`list(APPEND) sub-command <list>`.
-* The :variable:`CMAKE_VERSION` variable.
-* The :prop_tgt:`OUTPUT_NAME_<CONFIG>` target property.
-
-Note that CMake Domain roles differ from Sphinx and reStructuredText
-convention in that the form ``a<b>``, without a space preceding ``<``,
-is interpreted as a name instead of link text with an explicit target.
-This is necessary because we use ``<placeholders>`` frequently in
-object names like ``OUTPUT_NAME_<CONFIG>``. The form ``a <b>``,
-with a space preceding ``<``, is still interpreted as a link text
-with an explicit target.
-
-Style
------
-
-Style: Section Headers
-^^^^^^^^^^^^^^^^^^^^^^
-
-When marking section titles, make the section decoration line as long as
-the title text. Use only a line below the title, not above. For
-example:
-
-.. code-block:: rst
-
- Title Text
- ----------
-
-Capitalize the first letter of each non-minor word in the title.
-
-The section header underline character hierarchy is
-
-* ``#``: Manual group (part) in the master document
-* ``*``: Manual (chapter) title
-* ``=``: Section within a manual
-* ``-``: Subsection or `CMake Domain`_ object document title
-* ``^``: Subsubsection or `CMake Domain`_ object document section
-* ``"``: Paragraph or `CMake Domain`_ object document subsection
-
-Style: Whitespace
-^^^^^^^^^^^^^^^^^
-
-Use two spaces for indentation. Use two spaces between sentences in
-prose.
-
-Style: Line Length
-^^^^^^^^^^^^^^^^^^
-
-Prefer to restrict the width of lines to 75-80 columns. This is not a
-hard restriction, but writing new paragraphs wrapped at 75 columns
-allows space for adding minor content without significant re-wrapping of
-content.
-
-Style: Prose
-^^^^^^^^^^^^
-
-Use American English spellings in prose.
-
-Style: Starting Literal Blocks
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Prefer to mark the start of literal blocks with ``::`` at the end of
-the preceding paragraph. In cases where the following block gets
-a ``code-block`` marker, put a single ``:`` at the end of the preceding
-paragraph.
-
-Style: CMake Command Signatures
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-Command signatures should be marked up as plain literal blocks, not as
-cmake ``code-blocks``.
-
-Signatures are separated from preceding content by a section header.
-That is, use:
-
-.. code-block:: rst
-
- ... preceding paragraph.
-
- Normal Libraries
- ^^^^^^^^^^^^^^^^
-
- ::
-
- add_library(<lib> ...)
-
- This signature is used for ...
-
-Signatures of commands should wrap optional parts with square brackets,
-and should mark list of optional arguments with an ellipsis (``...``).
-Elements of the signature which are specified by the user should be
-specified with angle brackets, and may be referred to in prose using
-``inline-literal`` syntax.
-
-Style: Boolean Constants
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-Use "``OFF``" and "``ON``" for boolean values which can be modified by
-the user, such as :prop_tgt:`POSITION_INDEPENDENT_CODE`. Such properties
-may be "enabled" and "disabled". Use "``True``" and "``False``" for
-inherent values which can't be modified after being set, such as the
-:prop_tgt:`IMPORTED` property of a build target.
-
-Style: Inline Literals
-^^^^^^^^^^^^^^^^^^^^^^
-
-Mark up references to keywords in signatures, file names, and other
-technical terms with ``inline-literal`` syntax, for example:
-
-.. code-block:: rst
-
- If ``WIN32`` is used with :command:`add_executable`, the
- :prop_tgt:`WIN32_EXECUTABLE` target property is enabled. That command
- creates the file ``<name>.exe`` on Windows.
-
-Style: Cross-References
-^^^^^^^^^^^^^^^^^^^^^^^
-
-Mark up linkable references as links, including repeats.
-An alternative, which is used by wikipedia
-(`<http://en.wikipedia.org/wiki/WP:REPEATLINK>`_),
-is to link to a reference only once per article. That style is not used
-in CMake documentation.
-
-Style: Referencing CMake Concepts
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-If referring to a concept which corresponds to a property, and that
-concept is described in a high-level manual, prefer to link to the
-manual section instead of the property. For example:
-
-.. code-block:: rst
-
- This command creates an :ref:`Imported Target <Imported Targets>`.
-
-instead of:
-
-.. code-block:: rst
-
- This command creates an :prop_tgt:`IMPORTED` target.
-
-The latter should be used only when referring specifically to the
-property.
-
-References to manual sections are not automatically created by creating
-a section, but code such as:
-
-.. code-block:: rst
-
- .. _`Imported Targets`:
-
-creates a suitable anchor. Use an anchor name which matches the name
-of the corresponding section. Refer to the anchor using a
-cross-reference with specified text.
-
-Imported Targets need the ``IMPORTED`` term marked up with care in
-particular because the term may refer to a command keyword
-(``IMPORTED``), a target property (:prop_tgt:`IMPORTED`), or a
-concept (:ref:`Imported Targets`).
-
-Where a property, command or variable is related conceptually to others,
-by for example, being related to the buildsystem description, generator
-expressions or Qt, each relevant property, command or variable should
-link to the primary manual, which provides high-level information. Only
-particular information relating to the command should be in the
-documentation of the command.
-
-Style: Referencing CMake Domain Objects
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-When referring to `CMake Domain`_ objects such as properties, variables,
-commands etc, prefer to link to the target object and follow that with
-the type of object it is. For example:
-
-.. code-block:: rst
-
- Set the :prop_tgt:`AUTOMOC` target property to ``ON``.
-
-Instead of
-
-.. code-block:: rst
-
- Set the target property :prop_tgt:`AUTOMOC` to ``ON``.
-
-The ``policy`` directive is an exception, and the type us usually
-referred to before the link:
-
-.. code-block:: rst
-
- If policy :prop_tgt:`CMP0022` is set to ``NEW`` the behavior is ...
-
-However, markup self-references with ``inline-literal`` syntax.
-For example, within the :command:`add_executable` command
-documentation, use
-
-.. code-block:: rst
-
- ``add_executable``
-
-not
-
-.. code-block:: rst
-
- :command:`add_executable`
-
-which is used elsewhere.
-
-Modules
-=======
-
-The ``Modules`` directory contains CMake-language ``.cmake`` module files.
-
-Module Documentation
---------------------
-
-To document CMake module ``Modules/<module-name>.cmake``, modify
-``Help/manual/cmake-modules.7.rst`` to reference the module in the
-``toctree`` directive, in sorted order, as::
-
- /module/<module-name>
-
-Then add the module document file ``Help/module/<module-name>.rst``
-containing just the line::
-
- .. cmake-module:: ../../Modules/<module-name>.cmake
-
-The ``cmake-module`` directive will scan the module file to extract
-reStructuredText markup from comment blocks that start in ``.rst:``.
-At the top of ``Modules/<module-name>.cmake``, begin with the following
-license notice:
-
-.. code-block:: cmake
-
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
-
-After this notice, add a *BLANK* line. Then, add documentation using
-a :ref:`Line Comment` block of the form:
-
-.. code-block:: cmake
-
- #.rst:
- # <module-name>
- # -------------
- #
- # <reStructuredText documentation of module>
-
-or a :ref:`Bracket Comment` of the form:
-
-::
-
- #[[.rst:
- <module-name>
- -------------
-
- <reStructuredText documentation of module>
- #]]
-
-Any number of ``=`` may be used in the opening and closing brackets
-as long as they match. Content on the line containing the closing
-bracket is excluded if and only if the line starts in ``#``.
-
-Additional such ``.rst:`` comments may appear anywhere in the module file.
-All such comments must start with ``#`` in the first column.
-
-For example, a ``Modules/Findxxx.cmake`` module may contain:
-
-::
-
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
-
- #.rst:
- # FindXxx
- # -------
- #
- # This is a cool module.
- # This module does really cool stuff.
- # It can do even more than you think.
- #
- # It even needs two paragraphs to tell you about it.
- # And it defines the following variables:
- #
- # * VAR_COOL: this is great isn't it?
- # * VAR_REALLY_COOL: cool right?
-
- <code>
-
- #[========================================[.rst:
- .. command:: xxx_do_something
-
- This command does something for Xxx::
-
- xxx_do_something(some arguments)
- #]========================================]
- macro(xxx_do_something)
- <code>
- endmacro()
-
-Test the documentation formatting by running
-``cmake --help-module <module-name>``, and also by enabling the
-``SPHINX_HTML`` and ``SPHINX_MAN`` options to build the documentation.
-Edit the comments until generated documentation looks satisfactory. To
-have a .cmake file in this directory NOT show up in the modules
-documentation, simply leave out the ``Help/module/<module-name>.rst``
-file and the ``Help/manual/cmake-modules.7.rst`` toctree entry.
+See https://cmake.org/get-involved/ to get involved in development of
+CMake upstream. It includes links to contribution instructions, which
+in turn link to developer guides for CMake itself.
.. _`Find Modules`:
Find Modules
-------------
+============
-A "find module" is a ``Modules/Find<PackageName>.cmake`` file to be loaded
+A "find module" is a ``Find<PackageName>.cmake`` file to be loaded
by the :command:`find_package` command when invoked for ``<PackageName>``.
The primary task of a find module is to determine whether a package
@@ -638,16 +82,11 @@ and required is up to the find module, but should be documented.
For internal implementation, it is a generally accepted convention that
variables starting with underscore are for temporary use only.
-Like all modules, find modules should be properly documented. To add a
-module to the CMake documentation, follow the steps in the `Module
-Documentation`_ section above.
-
-
.. _`CMake Developer Standard Variable Names`:
Standard Variable Names
-^^^^^^^^^^^^^^^^^^^^^^^
+-----------------------
For a ``FindXxx.cmake`` module that takes the approach of setting
variables (either instead of or in addition to creating imported
@@ -754,54 +193,81 @@ Make sure you comment them as deprecated, so that no-one starts using
them.
-
A Sample Find Module
-^^^^^^^^^^^^^^^^^^^^
+--------------------
-We will describe how to create a simple find module for a library
-``Foo``.
+We will describe how to create a simple find module for a library ``Foo``.
-The first thing that is needed is a license notice.
+The top of the module should begin with a license notice, followed by
+a blank line, and then followed by a :ref:`Bracket Comment`. The comment
+should begin with ``.rst:`` to indicate that the rest of its content is
+reStructuredText-format documentation. For example:
-.. code-block:: cmake
+::
- # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- # file Copyright.txt or https://cmake.org/licensing for details.
+ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ # file Copyright.txt or https://cmake.org/licensing for details.
-Next we need module documentation. CMake's documentation system requires you
-to follow the license notice with a blank line and then with a documentation
-marker and the name of the module. You should follow this with a simple
-statement of what the module does.
+ #[=======================================================================[.rst:
+ FindFoo
+ -------
-.. code-block:: cmake
+ Finds the Foo library.
- #.rst:
- # FindFoo
- # -------
- #
- # Finds the Foo library
- #
+ Imported Targets
+ ^^^^^^^^^^^^^^^^
-More description may be required for some packages. If there are
-caveats or other details users of the module should be aware of, you can
-add further paragraphs below this. Then you need to document what
-variables and imported targets are set by the module, such as
+ This module provides the following imported targets, if found:
-.. code-block:: cmake
+ ``Foo::Foo``
+ The Foo library
+
+ Result Variables
+ ^^^^^^^^^^^^^^^^
+
+ This will define the following variables:
+
+ ``Foo_FOUND``
+ True if the system has the Foo library.
+ ``Foo_VERSION``
+ The version of the Foo library which was found.
+ ``Foo_INCLUDE_DIRS``
+ Include directories needed to use Foo.
+ ``Foo_LIBRARIES``
+ Libraries needed to link to Foo.
+
+ Cache Variables
+ ^^^^^^^^^^^^^^^
+
+ The following cache variables may also be set:
+
+ ``Foo_INCLUDE_DIR``
+ The directory containing ``foo.h``.
+ ``Foo_LIBRARY``
+ The path to the Foo library.
+
+ #]=======================================================================]
+
+The module documentation consists of:
+
+* An underlined heading specifying the module name.
+
+* A simple description of what the module finds.
+ More description may be required for some packages. If there are
+ caveats or other details users of the module should be aware of,
+ specify them here.
+
+* A section listing imported targets provided by the module, if any.
+
+* A section listing result variables provided by the module.
- # This will define the following variables::
- #
- # Foo_FOUND - True if the system has the Foo library
- # Foo_VERSION - The version of the Foo library which was found
- #
- # and the following imported targets::
- #
- # Foo::Foo - The Foo library
+* Optionally a section listing cache variables used by the module, if any.
-If the package provides any macros, they should be listed here, but can
-be documented where they are defined. See the `Module
-Documentation`_ section above for more details.
+If the package provides any macros or functions, they should be listed in
+an additional section, but can be documented by additional ``.rst:``
+comment blocks immediately above where those macros or functions are defined.
+The find module implementation may begin below the documentation block.
Now the actual libraries and so on have to be found. The code here will
obviously vary from module to module (dealing with that, after all, is the
point of find modules), but there tends to be a common pattern for libraries.
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 31aa723fe..c43341276 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -7,6 +7,14 @@ cmake-env-variables(7)
.. contents::
+This page lists environment variables that have special
+meaning to CMake.
+
+For general information on environment variables, see the
+:ref:`Environment Variables <CMake Language Environment Variables>`
+section in the cmake-language manual.
+
+
Environment Variables that Control the Build
============================================
@@ -16,11 +24,13 @@ Environment Variables that Control the Build
/envvar/CMAKE_BUILD_PARALLEL_LEVEL
/envvar/CMAKE_CONFIG_TYPE
/envvar/CMAKE_MSVCIDE_RUN_PATH
+ /envvar/CMAKE_NO_VERBOSE
/envvar/CMAKE_OSX_ARCHITECTURES
/envvar/DESTDIR
/envvar/LDFLAGS
/envvar/MACOSX_DEPLOYMENT_TARGET
/envvar/PackageName_ROOT
+ /envvar/VERBOSE
Environment Variables for Languages
===================================
diff --git a/Help/manual/cmake-file-api.7.rst b/Help/manual/cmake-file-api.7.rst
new file mode 100644
index 000000000..f3e02088a
--- /dev/null
+++ b/Help/manual/cmake-file-api.7.rst
@@ -0,0 +1,1111 @@
+.. cmake-manual-description: CMake File-Based API
+
+cmake-file-api(7)
+*****************
+
+.. only:: html
+
+ .. contents::
+
+Introduction
+============
+
+CMake provides a file-based API that clients may use to get semantic
+information about the buildsystems CMake generates. Clients may use
+the API by writing query files to a specific location in a build tree
+to request zero or more `Object Kinds`_. When CMake generates the
+buildsystem in that build tree it will read the query files and write
+reply files for the client to read.
+
+The file-based API uses a ``<build>/.cmake/api/`` directory at the top
+of a build tree. The API is versioned to support changes to the layout
+of files within the API directory. API file layout versioning is
+orthogonal to the versioning of `Object Kinds`_ used in replies.
+This version of CMake supports only one API version, `API v1`_.
+
+API v1
+======
+
+API v1 is housed in the ``<build>/.cmake/api/v1/`` directory.
+It has the following subdirectories:
+
+``query/``
+ Holds query files written by clients.
+ These may be `v1 Shared Stateless Query Files`_,
+ `v1 Client Stateless Query Files`_, or `v1 Client Stateful Query Files`_.
+
+``reply/``
+ Holds reply files written by CMake whenever it runs to generate a build
+ system. These are indexed by a `v1 Reply Index File`_ file that may
+ reference additional `v1 Reply Files`_. CMake owns all reply files.
+ Clients must never remove them.
+
+ Clients may look for and read a reply index file at any time.
+ Clients may optionally create the ``reply/`` directory at any time
+ and monitor it for the appearance of a new reply index file.
+
+v1 Shared Stateless Query Files
+-------------------------------
+
+Shared stateless query files allow clients to share requests for
+major versions of the `Object Kinds`_ and get all requested versions
+recognized by the CMake that runs.
+
+Clients may create shared requests by creating empty files in the
+``v1/query/`` directory. The form is::
+
+ <build>/.cmake/api/v1/query/<kind>-v<major>
+
+where ``<kind>`` is one of the `Object Kinds`_, ``-v`` is literal,
+and ``<major>`` is the major version number.
+
+Files of this form are stateless shared queries not owned by any specific
+client. Once created they should not be removed without external client
+coordination or human intervention.
+
+v1 Client Stateless Query Files
+-------------------------------
+
+Client stateless query files allow clients to create owned requests for
+major versions of the `Object Kinds`_ and get all requested versions
+recognized by the CMake that runs.
+
+Clients may create owned requests by creating empty files in
+client-specific query subdirectories. The form is::
+
+ <build>/.cmake/api/v1/query/client-<client>/<kind>-v<major>
+
+where ``client-`` is literal, ``<client>`` is a string uniquely
+identifying the client, ``<kind>`` is one of the `Object Kinds`_,
+``-v`` is literal, and ``<major>`` is the major version number.
+Each client must choose a unique ``<client>`` identifier via its
+own means.
+
+Files of this form are stateless queries owned by the client ``<client>``.
+The owning client may remove them at any time.
+
+v1 Client Stateful Query Files
+------------------------------
+
+Stateful query files allow clients to request a list of versions of
+each of the `Object Kinds`_ and get only the most recent version
+recognized by the CMake that runs.
+
+Clients may create owned stateful queries by creating ``query.json``
+files in client-specific query subdirectories. The form is::
+
+ <build>/.cmake/api/v1/query/client-<client>/query.json
+
+where ``client-`` is literal, ``<client>`` is a string uniquely
+identifying the client, and ``query.json`` is literal. Each client
+must choose a unique ``<client>`` identifier via its own means.
+
+``query.json`` files are stateful queries owned by the client ``<client>``.
+The owning client may update or remove them at any time. When a
+given client installation is updated it may then update the stateful
+query it writes to build trees to request newer object versions.
+This can be used to avoid asking CMake to generate multiple object
+versions unnecessarily.
+
+A ``query.json`` file must contain a JSON object:
+
+.. code-block:: json
+
+ {
+ "requests": [
+ { "kind": "<kind>" , "version": 1 },
+ { "kind": "<kind>" , "version": { "major": 1, "minor": 2 } },
+ { "kind": "<kind>" , "version": [2, 1] },
+ { "kind": "<kind>" , "version": [2, { "major": 1, "minor": 2 }] },
+ { "kind": "<kind>" , "version": 1, "client": {} },
+ { "kind": "..." }
+ ],
+ "client": {}
+ }
+
+The members are:
+
+``requests``
+ A JSON array containing zero or more requests. Each request is
+ a JSON object with members:
+
+ ``kind``
+ Specifies one of the `Object Kinds`_ to be included in the reply.
+
+ ``version``
+ Indicates the version(s) of the object kind that the client
+ understands. Versions have major and minor components following
+ semantic version conventions. The value must be
+
+ * a JSON integer specifying a (non-negative) major version number, or
+ * a JSON object containing ``major`` and (optionally) ``minor``
+ members specifying non-negative integer version components, or
+ * a JSON array whose elements are each one of the above.
+
+ ``client``
+ Optional member reserved for use by the client. This value is
+ preserved in the reply written for the client in the
+ `v1 Reply Index File`_ but is otherwise ignored. Clients may use
+ this to pass custom information with a request through to its reply.
+
+ For each requested object kind CMake will choose the *first* version
+ that it recognizes for that kind among those listed in the request.
+ The response will use the selected *major* version with the highest
+ *minor* version known to the running CMake for that major version.
+ Therefore clients should list all supported major versions in
+ preferred order along with the minimal minor version required
+ for each major version.
+
+``client``
+ Optional member reserved for use by the client. This value is
+ preserved in the reply written for the client in the
+ `v1 Reply Index File`_ but is otherwise ignored. Clients may use
+ this to pass custom information with a query through to its reply.
+
+Other ``query.json`` top-level members are reserved for future use.
+If present they are ignored for forward compatibility.
+
+v1 Reply Index File
+-------------------
+
+CMake writes an ``index-*.json`` file to the ``v1/reply/`` directory
+whenever it runs to generate a build system. Clients must read the
+reply index file first and may read other `v1 Reply Files`_ only by
+following references. The form of the reply index file name is::
+
+ <build>/.cmake/api/v1/reply/index-<unspecified>.json
+
+where ``index-`` is literal and ``<unspecified>`` is an unspecified
+name selected by CMake. Whenever a new index file is generated it
+is given a new name and any old one is deleted. During the short
+time between these steps there may be multiple index files present;
+the one with the largest name in lexicographic order is the current
+index file.
+
+The reply index file contains a JSON object:
+
+.. code-block:: json
+
+ {
+ "cmake": {
+ "version": {
+ "major": 3, "minor": 14, "patch": 0, "suffix": "",
+ "string": "3.14.0", "isDirty": false
+ },
+ "paths": {
+ "cmake": "/prefix/bin/cmake",
+ "ctest": "/prefix/bin/ctest",
+ "cpack": "/prefix/bin/cpack",
+ "root": "/prefix/share/cmake-3.14"
+ },
+ "generator": {
+ "name": "Unix Makefiles"
+ }
+ },
+ "objects": [
+ { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ { "...": "..." }
+ ],
+ "reply": {
+ "<kind>-v<major>": { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ "<unknown>": { "error": "unknown query file" },
+ "...": {},
+ "client-<client>": {
+ "<kind>-v<major>": { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ "<unknown>": { "error": "unknown query file" },
+ "...": {},
+ "query.json": {
+ "requests": [ {}, {}, {} ],
+ "responses": [
+ { "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "jsonFile": "<file>" },
+ { "error": "unknown query file" },
+ { "...": {} }
+ ],
+ "client": {}
+ }
+ }
+ }
+ }
+
+The members are:
+
+``cmake``
+ A JSON object containing information about the instance of CMake that
+ generated the reply. It contains members:
+
+ ``version``
+ A JSON object specifying the version of CMake with members:
+
+ ``major``, ``minor``, ``patch``
+ Integer values specifying the major, minor, and patch version components.
+ ``suffix``
+ A string specifying the version suffix, if any, e.g. ``g0abc3``.
+ ``string``
+ A string specifying the full version in the format
+ ``<major>.<minor>.<patch>[-<suffix>]``.
+ ``isDirty``
+ A boolean indicating whether the version was built from a version
+ controlled source tree with local modifications.
+
+ ``paths``
+ A JSON object specifying paths to things that come with CMake.
+ It has members for ``cmake``, ``ctest``, and ``cpack`` whose values
+ are JSON strings specifying the absolute path to each tool,
+ represented with forward slashes. It also has a ``root`` member for
+ the absolute path to the directory containing CMake resources like the
+ ``Modules/`` directory (see :variable:`CMAKE_ROOT`).
+
+ ``generator``
+ A JSON object describing the CMake generator used for the build.
+ It has members:
+
+ ``name``
+ A string specifying the name of the generator.
+ ``platform``
+ If the generator supports :variable:`CMAKE_GENERATOR_PLATFORM`,
+ this is a string specifying the generator platform name.
+
+``objects``
+ A JSON array listing all versions of all `Object Kinds`_ generated
+ as part of the reply. Each array entry is a
+ `v1 Reply File Reference`_.
+
+``reply``
+ A JSON object mirroring the content of the ``query/`` directory
+ that CMake loaded to produce the reply. The members are of the form
+
+ ``<kind>-v<major>``
+ A member of this form appears for each of the
+ `v1 Shared Stateless Query Files`_ that CMake recognized as a
+ request for object kind ``<kind>`` with major version ``<major>``.
+ The value is a `v1 Reply File Reference`_ to the corresponding
+ reply file for that object kind and version.
+
+ ``<unknown>``
+ A member of this form appears for each of the
+ `v1 Shared Stateless Query Files`_ that CMake did not recognize.
+ The value is a JSON object with a single ``error`` member
+ containing a string with an error message indicating that the
+ query file is unknown.
+
+ ``client-<client>``
+ A member of this form appears for each client-owned directory
+ holding `v1 Client Stateless Query Files`_.
+ The value is a JSON object mirroring the content of the
+ ``query/client-<client>/`` directory. The members are of the form:
+
+ ``<kind>-v<major>``
+ A member of this form appears for each of the
+ `v1 Client Stateless Query Files`_ that CMake recognized as a
+ request for object kind ``<kind>`` with major version ``<major>``.
+ The value is a `v1 Reply File Reference`_ to the corresponding
+ reply file for that object kind and version.
+
+ ``<unknown>``
+ A member of this form appears for each of the
+ `v1 Client Stateless Query Files`_ that CMake did not recognize.
+ The value is a JSON object with a single ``error`` member
+ containing a string with an error message indicating that the
+ query file is unknown.
+
+ ``query.json``
+ This member appears for clients using
+ `v1 Client Stateful Query Files`_.
+ If the ``query.json`` file failed to read or parse as a JSON object,
+ this member is a JSON object with a single ``error`` member
+ containing a string with an error message. Otherwise, this member
+ is a JSON object mirroring the content of the ``query.json`` file.
+ The members are:
+
+ ``client``
+ A copy of the ``query.json`` file ``client`` member, if it exists.
+
+ ``requests``
+ A copy of the ``query.json`` file ``requests`` member, if it exists.
+
+ ``responses``
+ If the ``query.json`` file ``requests`` member is missing or invalid,
+ this member is a JSON object with a single ``error`` member
+ containing a string with an error message. Otherwise, this member
+ contains a JSON array with a response for each entry of the
+ ``requests`` array, in the same order. Each response is
+
+ * a JSON object with a single ``error`` member containing a string
+ with an error message, or
+ * a `v1 Reply File Reference`_ to the corresponding reply file for
+ the requested object kind and selected version.
+
+After reading the reply index file, clients may read the other
+`v1 Reply Files`_ it references.
+
+v1 Reply File Reference
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The reply index file represents each reference to another reply file
+using a JSON object with members:
+
+``kind``
+ A string specifying one of the `Object Kinds`_.
+``version``
+ A JSON object with members ``major`` and ``minor`` specifying
+ integer version components of the object kind.
+``jsonFile``
+ A JSON string specifying a path relative to the reply index file
+ to another JSON file containing the object.
+
+v1 Reply Files
+--------------
+
+Reply files containing specific `Object Kinds`_ are written by CMake.
+The names of these files are unspecified and must not be interpreted
+by clients. Clients must first read the `v1 Reply Index File`_ and
+and follow references to the names of the desired response objects.
+
+Reply files (including the index file) will never be replaced by
+files of the same name but different content. This allows a client
+to read the files concurrently with a running CMake that may generate
+a new reply. However, after generating a new reply CMake will attempt
+to remove reply files from previous runs that it did not just write.
+If a client attempts to read a reply file referenced by the index but
+finds the file missing, that means a concurrent CMake has generated
+a new reply. The client may simply start again by reading the new
+reply index file.
+
+Object Kinds
+============
+
+The CMake file-based API reports semantic information about the build
+system using the following kinds of JSON objects. Each kind of object
+is versioned independently using semantic versioning with major and
+minor components. Every kind of object has the form:
+
+.. code-block:: json
+
+ {
+ "kind": "<kind>",
+ "version": { "major": 1, "minor": 0 },
+ "...": {}
+ }
+
+The ``kind`` member is a string specifying the object kind name.
+The ``version`` member is a JSON object with ``major`` and ``minor``
+members specifying integer components of the object kind's version.
+Additional top-level members are specific to each object kind.
+
+Object Kind "codemodel"
+-----------------------
+
+The ``codemodel`` object kind describes the build system structure as
+modeled by CMake.
+
+There is only one ``codemodel`` object major version, version 2.
+Version 1 does not exist to avoid confusion with that from
+:manual:`cmake-server(7)` mode.
+
+"codemodel" version 2
+^^^^^^^^^^^^^^^^^^^^^
+
+``codemodel`` object version 2 is a JSON object:
+
+.. code-block:: json
+
+ {
+ "kind": "codemodel",
+ "version": { "major": 2, "minor": 0 },
+ "paths": {
+ "source": "/path/to/top-level-source-dir",
+ "build": "/path/to/top-level-build-dir"
+ },
+ "configurations": [
+ {
+ "name": "Debug",
+ "directories": [
+ {
+ "source": ".",
+ "build": ".",
+ "childIndexes": [ 1 ],
+ "projectIndex": 0,
+ "targetIndexes": [ 0 ],
+ "hasInstallRule": true,
+ "minimumCMakeVersion": {
+ "string": "3.14"
+ }
+ },
+ {
+ "source": "sub",
+ "build": "sub",
+ "parentIndex": 0,
+ "projectIndex": 0,
+ "targetIndexes": [ 1 ],
+ "minimumCMakeVersion": {
+ "string": "3.14"
+ }
+ }
+ ],
+ "projects": [
+ {
+ "name": "MyProject",
+ "directoryIndexes": [ 0, 1 ],
+ "targetIndexes": [ 0, 1 ]
+ }
+ ],
+ "targets": [
+ {
+ "name": "MyExecutable",
+ "directoryIndex": 0,
+ "projectIndex": 0,
+ "jsonFile": "<file>"
+ },
+ {
+ "name": "MyLibrary",
+ "directoryIndex": 1,
+ "projectIndex": 0,
+ "jsonFile": "<file>"
+ }
+ ]
+ }
+ ]
+ }
+
+The members specific to ``codemodel`` objects are:
+
+``paths``
+ A JSON object containing members:
+
+ ``source``
+ A string specifying the absolute path to the top-level source directory,
+ represented with forward slashes.
+
+ ``build``
+ A string specifying the absolute path to the top-level build directory,
+ represented with forward slashes.
+
+``configurations``
+ A JSON array of entries corresponding to available build configurations.
+ On single-configuration generators there is one entry for the value
+ of the :variable:`CMAKE_BUILD_TYPE` variable. For multi-configuration
+ generators there is an entry for each configuration listed in the
+ :variable:`CMAKE_CONFIGURATION_TYPES` variable.
+ Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the name of the configuration, e.g. ``Debug``.
+
+ ``directories``
+ A JSON array of entries each corresponding to a build system directory
+ whose source directory contains a ``CMakeLists.txt`` file. The first
+ entry corresponds to the top-level directory. Each entry is a
+ JSON object containing members:
+
+ ``source``
+ A string specifying the path to the source directory, represented
+ with forward slashes. If the directory is inside the top-level
+ source directory then the path is specified relative to that
+ directory (with ``.`` for the top-level source directory itself).
+ Otherwise the path is absolute.
+
+ ``build``
+ A string specifying the path to the build directory, represented
+ with forward slashes. If the directory is inside the top-level
+ build directory then the path is specified relative to that
+ directory (with ``.`` for the top-level build directory itself).
+ Otherwise the path is absolute.
+
+ ``parentIndex``
+ Optional member that is present when the directory is not top-level.
+ The value is an unsigned integer 0-based index of another entry in
+ the main ``directories`` array that corresponds to the parent
+ directory that added this directory as a subdirectory.
+
+ ``childIndexes``
+ Optional member that is present when the directory has subdirectories.
+ The value is a JSON array of entries corresponding to child directories
+ created by the :command:`add_subdirectory` or :command:`subdirs`
+ command. Each entry is an unsigned integer 0-based index of another
+ entry in the main ``directories`` array.
+
+ ``projectIndex``
+ An unsigned integer 0-based index into the main ``projects`` array
+ indicating the build system project to which the this directory belongs.
+
+ ``targetIndexes``
+ Optional member that is present when the directory itself has targets,
+ excluding those belonging to subdirectories. The value is a JSON
+ array of entries corresponding to the targets. Each entry is an
+ unsigned integer 0-based index into the main ``targets`` array.
+
+ ``minimumCMakeVersion``
+ Optional member present when a minimum required version of CMake is
+ known for the directory. This is the ``<min>`` version given to the
+ most local call to the :command:`cmake_minimum_required(VERSION)`
+ command in the directory itself or one of its ancestors.
+ The value is a JSON object with one member:
+
+ ``string``
+ A string specifying the minimum required version in the format::
+
+ <major>.<minor>[.<patch>[.<tweak>]][<suffix>]
+
+ Each component is an unsigned integer and the suffix may be an
+ arbitrary string.
+
+ ``hasInstallRule``
+ Optional member that is present with boolean value ``true`` when
+ the directory or one of its subdirectories contains any
+ :command:`install` rules, i.e. whether a ``make install``
+ or equivalent rule is available.
+
+ ``projects``
+ A JSON array of entries corresponding to the top-level project
+ and sub-projects defined in the build system. Each (sub-)project
+ corresponds to a source directory whose ``CMakeLists.txt`` file
+ calls the :command:`project` command with a project name different
+ from its parent directory. The first entry corresponds to the
+ top-level project.
+
+ Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the name given to the :command:`project` command.
+
+ ``parentIndex``
+ Optional member that is present when the project is not top-level.
+ The value is an unsigned integer 0-based index of another entry in
+ the main ``projects`` array that corresponds to the parent project
+ that added this project as a sub-project.
+
+ ``childIndexes``
+ Optional member that is present when the project has sub-projects.
+ The value is a JSON array of entries corresponding to the sub-projects.
+ Each entry is an unsigned integer 0-based index of another
+ entry in the main ``projects`` array.
+
+ ``directoryIndexes``
+ A JSON array of entries corresponding to build system directories
+ that are part of the project. The first entry corresponds to the
+ top-level directory of the project. Each entry is an unsigned
+ integer 0-based index into the main ``directories`` array.
+
+ ``targetIndexes``
+ Optional member that is present when the project itself has targets,
+ excluding those belonging to sub-projects. The value is a JSON
+ array of entries corresponding to the targets. Each entry is an
+ unsigned integer 0-based index into the main ``targets`` array.
+
+ ``targets``
+ A JSON array of entries corresponding to the build system targets.
+ Such targets are created by calls to :command:`add_executable`,
+ :command:`add_library`, and :command:`add_custom_target`, excluding
+ imported targets and interface libraries (which do not generate any
+ build rules). Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the target name.
+
+ ``id``
+ A string uniquely identifying the target. This matches the ``id``
+ field in the file referenced by ``jsonFile``.
+
+ ``directoryIndex``
+ An unsigned integer 0-based index into the main ``directories`` array
+ indicating the build system directory in which the target is defined.
+
+ ``projectIndex``
+ An unsigned integer 0-based index into the main ``projects`` array
+ indicating the build system project in which the target is defined.
+
+ ``jsonFile``
+ A JSON string specifying a path relative to the codemodel file
+ to another JSON file containing a
+ `"codemodel" version 2 "target" object`_.
+
+"codemodel" version 2 "target" object
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+A codemodel "target" object is referenced by a `"codemodel" version 2`_
+object's ``targets`` array. Each "target" object is a JSON object
+with members:
+
+``name``
+ A string specifying the logical name of the target.
+
+``id``
+ A string uniquely identifying the target. The format is unspecified
+ and should not be interpreted by clients.
+
+``type``
+ A string specifying the type of the target. The value is one of
+ ``EXECUTABLE``, ``STATIC_LIBRARY``, ``SHARED_LIBRARY``,
+ ``MODULE_LIBRARY``, ``OBJECT_LIBRARY``, or ``UTILITY``.
+
+``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the command in the source code that created the target is available.
+ The value is an unsigned integer 0-based index into the
+ ``backtraceGraph`` member's ``nodes`` array.
+
+``folder``
+ Optional member that is present when the :prop_tgt:`FOLDER` target
+ property is set. The value is a JSON object with one member:
+
+ ``name``
+ A string specifying the name of the target folder.
+
+``paths``
+ A JSON object containing members:
+
+ ``source``
+ A string specifying the path to the target's source directory,
+ represented with forward slashes. If the directory is inside the
+ top-level source directory then the path is specified relative to
+ that directory (with ``.`` for the top-level source directory itself).
+ Otherwise the path is absolute.
+
+ ``build``
+ A string specifying the path to the target's build directory,
+ represented with forward slashes. If the directory is inside the
+ top-level build directory then the path is specified relative to
+ that directory (with ``.`` for the top-level build directory itself).
+ Otherwise the path is absolute.
+
+``nameOnDisk``
+ Optional member that is present for executable and library targets
+ that are linked or archived into a single primary artifact.
+ The value is a string specifying the file name of that artifact on disk.
+
+``artifacts``
+ Optional member that is present for executable and library targets
+ that produce artifacts on disk meant for consumption by dependents.
+ The value is a JSON array of entries corresponding to the artifacts.
+ Each entry is a JSON object containing one member:
+
+ ``path``
+ A string specifying the path to the file on disk, represented with
+ forward slashes. If the file is inside the top-level build directory
+ then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+``isGeneratorProvided``
+ Optional member that is present with boolean value ``true`` if the
+ target is provided by CMake's build system generator rather than by
+ a command in the source code.
+
+``install``
+ Optional member that is present when the target has an :command:`install`
+ rule. The value is a JSON object with members:
+
+ ``prefix``
+ A JSON object specifying the installation prefix. It has one member:
+
+ ``path``
+ A string specifying the value of :variable:`CMAKE_INSTALL_PREFIX`.
+
+ ``destinations``
+ A JSON array of entries specifying an install destination path.
+ Each entry is a JSON object with members:
+
+ ``path``
+ A string specifying the install destination path. The path may
+ be absolute or relative to the install prefix.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`install` command invocation that specified this
+ destination is available. The value is an unsigned integer 0-based
+ index into the ``backtraceGraph`` member's ``nodes`` array.
+
+``link``
+ Optional member that is present for executables and shared library
+ targets that link into a runtime binary. The value is a JSON object
+ with members describing the link step:
+
+ ``language``
+ A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``)
+ of the toolchain is used to invoke the linker.
+
+ ``commandFragments``
+ Optional member that is present when fragments of the link command
+ line invocation are available. The value is a JSON array of entries
+ specifying ordered fragments. Each entry is a JSON object with members:
+
+ ``fragment``
+ A string specifying a fragment of the link command line invocation.
+ The value is encoded in the build system's native shell format.
+
+ ``role``
+ A string specifying the role of the fragment's content:
+
+ * ``flags``: link flags.
+ * ``libraries``: link library file paths or flags.
+ * ``libraryPath``: library search path flags.
+ * ``frameworkPath``: macOS framework search path flags.
+
+ ``lto``
+ Optional member that is present with boolean value ``true``
+ when link-time optimization (a.k.a. interprocedural optimization
+ or link-time code generation) is enabled.
+
+ ``sysroot``
+ Optional member that is present when the :variable:`CMAKE_SYSROOT_LINK`
+ or :variable:`CMAKE_SYSROOT` variable is defined. The value is a
+ JSON object with one member:
+
+ ``path``
+ A string specifying the absolute path to the sysroot, represented
+ with forward slashes.
+
+``archive``
+ Optional member that is present for static library targets. The value
+ is a JSON object with members describing the archive step:
+
+ ``commandFragments``
+ Optional member that is present when fragments of the archiver command
+ line invocation are available. The value is a JSON array of entries
+ specifying the fragments. Each entry is a JSON object with members:
+
+ ``fragment``
+ A string specifying a fragment of the archiver command line invocation.
+ The value is encoded in the build system's native shell format.
+
+ ``role``
+ A string specifying the role of the fragment's content:
+
+ * ``flags``: archiver flags.
+
+ ``lto``
+ Optional member that is present with boolean value ``true``
+ when link-time optimization (a.k.a. interprocedural optimization
+ or link-time code generation) is enabled.
+
+``dependencies``
+ Optional member that is present when the target depends on other targets.
+ The value is a JSON array of entries corresponding to the dependencies.
+ Each entry is a JSON object with members:
+
+ ``id``
+ A string uniquely identifying the target on which this target depends.
+ This matches the main ``id`` member of the other target.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`add_dependencies`, :command:`target_link_libraries`,
+ or other command invocation that created this dependency is
+ available. The value is an unsigned integer 0-based index into
+ the ``backtraceGraph`` member's ``nodes`` array.
+
+``sources``
+ A JSON array of entries corresponding to the target's source files.
+ Each entry is a JSON object with members:
+
+ ``path``
+ A string specifying the path to the source file on disk, represented
+ with forward slashes. If the file is inside the top-level source
+ directory then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+ ``compileGroupIndex``
+ Optional member that is present when the source is compiled.
+ The value is an unsigned integer 0-based index into the
+ ``compileGroups`` array.
+
+ ``sourceGroupIndex``
+ Optional member that is present when the source is part of a source
+ group either via the :command:`source_group` command or by default.
+ The value is an unsigned integer 0-based index into the
+ ``sourceGroups`` array.
+
+ ``isGenerated``
+ Optional member that is present with boolean value ``true`` if
+ the source is :prop_sf:`GENERATED`.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_sources`, :command:`add_executable`,
+ :command:`add_library`, :command:`add_custom_target`, or other
+ command invocation that added this source to the target is
+ available. The value is an unsigned integer 0-based index into
+ the ``backtraceGraph`` member's ``nodes`` array.
+
+``sourceGroups``
+ Optional member that is present when sources are grouped together by
+ the :command:`source_group` command or by default. The value is a
+ JSON array of entries corresponding to the groups. Each entry is
+ a JSON object with members:
+
+ ``name``
+ A string specifying the name of the source group.
+
+ ``sourceIndexes``
+ A JSON array listing the sources belonging to the group.
+ Each entry is an unsigned integer 0-based index into the
+ main ``sources`` array for the target.
+
+``compileGroups``
+ Optional member that is present when the target has sources that compile.
+ The value is a JSON array of entries corresponding to groups of sources
+ that all compile with the same settings. Each entry is a JSON object
+ with members:
+
+ ``sourceIndexes``
+ A JSON array listing the sources belonging to the group.
+ Each entry is an unsigned integer 0-based index into the
+ main ``sources`` array for the target.
+
+ ``language``
+ A string specifying the language (e.g. ``C``, ``CXX``, ``Fortran``)
+ of the toolchain is used to compile the source file.
+
+ ``compileCommandFragments``
+ Optional member that is present when fragments of the compiler command
+ line invocation are available. The value is a JSON array of entries
+ specifying ordered fragments. Each entry is a JSON object with
+ one member:
+
+ ``fragment``
+ A string specifying a fragment of the compile command line invocation.
+ The value is encoded in the build system's native shell format.
+
+ ``includes``
+ Optional member that is present when there are include directories.
+ The value is a JSON array with an entry for each directory. Each
+ entry is a JSON object with members:
+
+ ``path``
+ A string specifying the path to the include directory,
+ represented with forward slashes.
+
+ ``isSystem``
+ Optional member that is present with boolean value ``true`` if
+ the include directory is marked as a system include directory.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_include_directories` or other command invocation
+ that added this include directory is available. The value is
+ an unsigned integer 0-based index into the ``backtraceGraph``
+ member's ``nodes`` array.
+
+ ``defines``
+ Optional member that is present when there are preprocessor definitions.
+ The value is a JSON array with an entry for each definition. Each
+ entry is a JSON object with members:
+
+ ``define``
+ A string specifying the preprocessor definition in the format
+ ``<name>[=<value>]``, e.g. ``DEF`` or ``DEF=1``.
+
+ ``backtrace``
+ Optional member that is present when a CMake language backtrace to
+ the :command:`target_compile_definitions` or other command invocation
+ that added this preprocessor definition is available. The value is
+ an unsigned integer 0-based index into the ``backtraceGraph``
+ member's ``nodes`` array.
+
+ ``sysroot``
+ Optional member that is present when the
+ :variable:`CMAKE_SYSROOT_COMPILE` or :variable:`CMAKE_SYSROOT`
+ variable is defined. The value is a JSON object with one member:
+
+ ``path``
+ A string specifying the absolute path to the sysroot, represented
+ with forward slashes.
+
+``backtraceGraph``
+ A JSON object describing the graph of backtraces whose nodes are
+ referenced from ``backtrace`` members elsewhere. The members are:
+
+ ``nodes``
+ A JSON array listing nodes in the backtrace graph. Each entry
+ is a JSON object with members:
+
+ ``file``
+ An unsigned integer 0-based index into the backtrace ``files`` array.
+
+ ``line``
+ An optional member present when the node represents a line within
+ the file. The value is an unsigned integer 1-based line number.
+
+ ``command``
+ An optional member present when the node represents a command
+ invocation within the file. The value is an unsigned integer
+ 0-based index into the backtrace ``commands`` array.
+
+ ``parent``
+ An optional member present when the node is not the bottom of
+ the call stack. The value is an unsigned integer 0-based index
+ of another entry in the backtrace ``nodes`` array.
+
+ ``commands``
+ A JSON array listing command names referenced by backtrace nodes.
+ Each entry is a string specifying a command name.
+
+ ``files``
+ A JSON array listing CMake language files referenced by backtrace nodes.
+ Each entry is a string specifying the path to a file, represented
+ with forward slashes. If the file is inside the top-level source
+ directory then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+Object Kind "cache"
+-------------------
+
+The ``cache`` object kind lists cache entries. These are the
+:ref:`CMake Language Variables` stored in the persistent cache
+(``CMakeCache.txt``) for the build tree.
+
+There is only one ``cache`` object major version, version 2.
+Version 1 does not exist to avoid confusion with that from
+:manual:`cmake-server(7)` mode.
+
+"cache" version 2
+^^^^^^^^^^^^^^^^^
+
+``cache`` object version 2 is a JSON object:
+
+.. code-block:: json
+
+ {
+ "kind": "cache",
+ "version": { "major": 2, "minor": 0 },
+ "entries": [
+ {
+ "name": "BUILD_SHARED_LIBS",
+ "value": "ON",
+ "type": "BOOL",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Build shared libraries"
+ }
+ ]
+ },
+ {
+ "name": "CMAKE_GENERATOR",
+ "value": "Unix Makefiles",
+ "type": "INTERNAL",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Name of generator."
+ }
+ ]
+ }
+ ]
+ }
+
+The members specific to ``cache`` objects are:
+
+``entries``
+ A JSON array whose entries are each a JSON object specifying a
+ cache entry. The members of each entry are:
+
+ ``name``
+ A string specifying the name of the entry.
+
+ ``value``
+ A string specifying the value of the entry.
+
+ ``type``
+ A string specifying the type of the entry used by
+ :manual:`cmake-gui(1)` to choose a widget for editing.
+
+ ``properties``
+ A JSON array of entries specifying associated
+ :ref:`cache entry properties <Cache Entry Properties>`.
+ Each entry is a JSON object containing members:
+
+ ``name``
+ A string specifying the name of the cache entry property.
+
+ ``value``
+ A string specifying the value of the cache entry property.
+
+Object Kind "cmakeFiles"
+------------------------
+
+The ``cmakeFiles`` object kind lists files used by CMake while
+configuring and generating the build system. These include the
+``CMakeLists.txt`` files as well as included ``.cmake`` files.
+
+There is only one ``cmakeFiles`` object major version, version 1.
+
+"cmakeFiles" version 1
+^^^^^^^^^^^^^^^^^^^^^^
+
+``cmakeFiles`` object version 1 is a JSON object:
+
+.. code-block:: json
+
+ {
+ "kind": "cmakeFiles",
+ "version": { "major": 1, "minor": 0 },
+ "paths": {
+ "build": "/path/to/top-level-build-dir",
+ "source": "/path/to/top-level-source-dir"
+ },
+ "inputs": [
+ {
+ "path": "CMakeLists.txt"
+ },
+ {
+ "isGenerated": true,
+ "path": "/path/to/top-level-build-dir/.../CMakeSystem.cmake"
+ },
+ {
+ "isExternal": true,
+ "path": "/path/to/external/third-party/module.cmake"
+ },
+ {
+ "isCMake": true,
+ "isExternal": true,
+ "path": "/path/to/cmake/Modules/CMakeGenericSystem.cmake"
+ }
+ ]
+ }
+
+The members specific to ``cmakeFiles`` objects are:
+
+``paths``
+ A JSON object containing members:
+
+ ``source``
+ A string specifying the absolute path to the top-level source directory,
+ represented with forward slashes.
+
+ ``build``
+ A string specifying the absolute path to the top-level build directory,
+ represented with forward slashes.
+
+``inputs``
+ A JSON array whose entries are each a JSON object specifying an input
+ file used by CMake when configuring and generating the build system.
+ The members of each entry are:
+
+ ``path``
+ A string specifying the path to an input file to CMake, represented
+ with forward slashes. If the file is inside the top-level source
+ directory then the path is specified relative to that directory.
+ Otherwise the path is absolute.
+
+ ``isGenerated``
+ Optional member that is present with boolean value ``true``
+ if the path specifies a file that is under the top-level
+ build directory and the build is out-of-source.
+ This member is not available on in-source builds.
+
+ ``isExternal``
+ Optional member that is present with boolean value ``true``
+ if the path specifies a file that is not under the top-level
+ source or build directories.
+
+ ``isCMake``
+ Optional member that is present with boolean value ``true``
+ if the path specifies a file in the CMake installation.
diff --git a/Help/manual/cmake-generator-expressions.7.rst b/Help/manual/cmake-generator-expressions.7.rst
index 76fd3d9ed..7f484a42a 100644
--- a/Help/manual/cmake-generator-expressions.7.rst
+++ b/Help/manual/cmake-generator-expressions.7.rst
@@ -20,61 +20,74 @@ commands to populate those properties, such as :command:`target_link_libraries`,
:command:`target_include_directories`, :command:`target_compile_definitions`
and others.
-This means that they enable conditional linking, conditional
-definitions used when compiling, and conditional include directories and
-more. The conditions may be based on the build configuration, target
-properties, platform information or any other queryable information.
+They enable conditional linking, conditional definitions used when compiling,
+conditional include directories, and more. The conditions may be based on
+the build configuration, target properties, platform information or any other
+queryable information.
-Logical Expressions
-===================
+Generator expressions have the form ``$<...>``. To avoid confusion, this page
+deviates from most of the CMake documentation in that it omits angular brackets
+``<...>`` around placeholders like ``condition``, ``string``, ``target``,
+among others.
-Logical expressions are used to create conditional output. The basic
-expressions are the ``0`` and ``1`` expressions. Because other logical
-expressions evaluate to either ``0`` or ``1``, they can be composed to
-create conditional output::
+Generator expressions can be nested, as shown in most of the examples below.
- $<$<CONFIG:Debug>:DEBUG_MODE>
+.. _`Boolean Generator Expressions`:
-expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and
-otherwise expands to nothing.
-
-Available logical expressions are:
-
-``$<BOOL:...>``
- ``1`` if the ``...`` is true, else ``0``
-``$<AND:?[,?]...>``
- ``1`` if all ``?`` are ``1``, else ``0``
-
- The ``?`` must always be either ``0`` or ``1`` in boolean expressions.
-
-``$<OR:?[,?]...>``
- ``0`` if all ``?`` are ``0``, else ``1``
-``$<NOT:?>``
- ``0`` if ``?`` is ``1``, else ``1``
-``$<IF:?,true-value...,false-value...>``
- ``true-value...`` if ``?`` is ``1``, ``false-value...`` if ``?`` is ``0``
-``$<STREQUAL:a,b>``
- ``1`` if ``a`` is STREQUAL ``b``, else ``0``
-``$<EQUAL:a,b>``
- ``1`` if ``a`` is EQUAL ``b`` in a numeric comparison, else ``0``
-``$<IN_LIST:a,b>``
- ``1`` if ``a`` is IN_LIST ``b``, else ``0``
-``$<TARGET_EXISTS:tgt>``
- ``1`` if ``tgt`` is an existed target name, else ``0``.
-``$<CONFIG:cfg>``
- ``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison.
- The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by
- this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED`
- target.
-``$<PLATFORM_ID:comp>``
- ``1`` if the CMake-id of the platform matches ``comp``, otherwise ``0``.
- See also the :variable:`CMAKE_SYSTEM_NAME` variable.
-``$<C_COMPILER_ID:comp>``
- ``1`` if the CMake-id of the C compiler matches ``comp``, otherwise ``0``.
- See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-``$<CXX_COMPILER_ID:comp>``
- ``1`` if the CMake-id of the CXX compiler matches ``comp``, otherwise ``0``.
- See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+Boolean Generator Expressions
+=============================
+
+Boolean expressions evaluate to either ``0`` or ``1``.
+They are typically used to construct the condition in a :ref:`conditional
+generator expression<Conditional Generator Expressions>`.
+
+Available boolean expressions are:
+
+Logical Operators
+-----------------
+
+``$<BOOL:string>``
+ Converts ``string`` to ``0`` or ``1`` according to the rules of the
+ :command:`if()` command. Evaluates to ``0`` if any of the following is true:
+
+ * ``string`` is empty,
+ * ``string`` is a case-insensitive equal of
+ ``0``, ``FALSE``, ``OFF``, ``N``, ``NO``, ``IGNORE``, or ``NOTFOUND``, or
+ * ``string`` ends in the suffix ``-NOTFOUND`` (case-sensitive).
+
+ Otherwise evaluates to ``1``.
+
+``$<AND:conditions>``
+ where ``conditions`` is a comma-separated list of boolean expressions.
+ Evaluates to ``1`` if all conditions are ``1``.
+ Otherwise evaluates to ``0``.
+
+``$<OR:conditions>``
+ where ``conditions`` is a comma-separated list of boolean expressions.
+ Evaluates to ``1`` if at least one of the conditions is ``1``.
+ Otherwise evaluates to ``0``.
+
+``$<NOT:condition>``
+ ``0`` if ``condition`` is ``1``, else ``1``.
+
+String Comparisons
+------------------
+
+``$<STREQUAL:string1,string2>``
+ ``1`` if ``string1`` and ``string2`` are equal, else ``0``.
+ The comparison is case-sensitive. For a case-insensitive comparison,
+ combine with a :ref:`string transforming generator expression
+ <String Transforming Generator Expressions>`,
+
+ .. code-block:: cmake
+
+ $<STREQUAL:$<UPPER_CASE:${foo}>,"BAR"> # "1" if ${foo} is any of "BAR", "Bar", "bar", ...
+
+``$<EQUAL:value1,value2>``
+ ``1`` if ``value1`` and ``value2`` are numerically equal, else ``0``.
+``$<IN_LIST:string,list>``
+ ``1`` if ``string`` is member of the comma-separated ``list``, else ``0``.
+ Uses case-sensitive comparisons.
``$<VERSION_LESS:v1,v2>``
``1`` if ``v1`` is a version less than ``v2``, else ``0``.
``$<VERSION_GREATER:v1,v2>``
@@ -85,27 +98,62 @@ Available logical expressions are:
``1`` if ``v1`` is a version less than or equal to ``v2``, else ``0``.
``$<VERSION_GREATER_EQUAL:v1,v2>``
``1`` if ``v1`` is a version greater than or equal to ``v2``, else ``0``.
-``$<C_COMPILER_VERSION:ver>``
- ``1`` if the version of the C compiler matches ``ver``, otherwise ``0``.
+
+
+Variable Queries
+----------------
+
+``$<TARGET_EXISTS:target>``
+ ``1`` if ``target`` exists, else ``0``.
+``$<CONFIG:cfg>``
+ ``1`` if config is ``cfg``, else ``0``. This is a case-insensitive comparison.
+ The mapping in :prop_tgt:`MAP_IMPORTED_CONFIG_<CONFIG>` is also considered by
+ this expression when it is evaluated on a property on an :prop_tgt:`IMPORTED`
+ target.
+``$<PLATFORM_ID:platform_id>``
+ ``1`` if the CMake-id of the platform matches ``platform_id``
+ otherwise ``0``.
+ See also the :variable:`CMAKE_SYSTEM_NAME` variable.
+``$<C_COMPILER_ID:compiler_id>``
+ ``1`` if the CMake-id of the C compiler matches ``compiler_id``,
+ otherwise ``0``.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<CXX_COMPILER_ID:compiler_id>``
+ ``1`` if the CMake-id of the CXX compiler matches ``compiler_id``,
+ otherwise ``0``.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<Fortran_COMPILER_ID:compiler_id>``
+ ``1`` if the CMake-id of the Fortran compiler matches ``compiler_id``,
+ otherwise ``0``.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<C_COMPILER_VERSION:version>``
+ ``1`` if the version of the C compiler matches ``version``, otherwise ``0``.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
+``$<CXX_COMPILER_VERSION:version>``
+ ``1`` if the version of the CXX compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<CXX_COMPILER_VERSION:ver>``
- ``1`` if the version of the CXX compiler matches ``ver``, otherwise ``0``.
+``$<Fortran_COMPILER_VERSION:version>``
+ ``1`` if the version of the Fortran compiler matches ``version``, otherwise ``0``.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
-``$<TARGET_POLICY:pol>``
- ``1`` if the policy ``pol`` was NEW when the 'head' target was created,
- else ``0``. If the policy was not set, the warning message for the policy
+``$<TARGET_POLICY:policy>``
+ ``1`` if the ``policy`` was NEW when the 'head' target was created,
+ else ``0``. If the ``policy`` was not set, the warning message for the policy
will be emitted. This generator expression only works for a subset of
policies.
-``$<COMPILE_FEATURES:feature[,feature]...>``
- ``1`` if all of the ``feature`` features are available for the 'head'
+``$<COMPILE_FEATURES:features>``
+ where ``features`` is a comma-spearated list.
+ Evaluates to ``1`` if all of the ``features`` are available for the 'head'
target, and ``0`` otherwise. If this expression is used while evaluating
the link implementation of a target and if any dependency transitively
increases the required :prop_tgt:`C_STANDARD` or :prop_tgt:`CXX_STANDARD`
for the 'head' target, an error is reported. See the
:manual:`cmake-compile-features(7)` manual for information on
compile features and a list of supported compilers.
-``$<COMPILE_LANGUAGE:lang>``
- ``1`` when the language used for compilation unit matches ``lang``,
+
+.. _`Boolean COMPILE_LANGUAGE Generator Expression`:
+
+``$<COMPILE_LANGUAGE:language>``
+ ``1`` when the language used for compilation unit matches ``language``,
otherwise ``0``. This expression may be used to specify compile options,
compile definitions, and include directories for source files of a
particular language in a target. For example:
@@ -147,18 +195,24 @@ Available logical expressions are:
add_executable(myapp main.cpp)
target_link_libraries(myapp myapp_c myapp_cxx)
-Informational Expressions
-=========================
+String-Valued Generator Expressions
+===================================
+
+These expressions expand to some string.
+For example,
-These expressions expand to some information. The information may be used
-directly, eg::
+.. code-block:: cmake
include_directories(/usr/include/$<CXX_COMPILER_ID>/)
expands to ``/usr/include/GNU/`` or ``/usr/include/Clang/`` etc, depending on
-the Id of the compiler.
+the compiler identifier.
-These expressions may also may be combined with logical expressions::
+String-valued expressions may also be combined with other expressions.
+Here an example for a string-valued expression within a boolean expressions
+within a conditional expression:
+
+.. code-block:: cmake
$<$<VERSION_LESS:$<CXX_COMPILER_VERSION>,4.2.0>:OLD_COMPILER>
@@ -166,12 +220,123 @@ expands to ``OLD_COMPILER`` if the
:variable:`CMAKE_CXX_COMPILER_VERSION <CMAKE_<LANG>_COMPILER_VERSION>` is less
than 4.2.0.
-Available informational expressions are:
+And here two nested string-valued expressions:
+
+.. code-block:: cmake
+
+ -I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>
+
+generates a string of the entries in the :prop_tgt:`INCLUDE_DIRECTORIES` target
+property with each entry preceded by ``-I``.
+
+Expanding on the previous example, if one first wants to check if the
+``INCLUDE_DIRECTORIES`` property is non-empty, then it is advisable to
+introduce a helper variable to keep the code readable:
+
+.. code-block:: cmake
+
+ set(prop "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>") # helper variable
+ $<$<BOOL:${prop}>:-I$<JOIN:${prop}, -I>>
+
+The following string-valued generator expressions are available:
+
+Escaped Characters
+------------------
+
+String literals to escape the special meaning a character would otherwise have:
+
+``$<ANGLE-R>``
+ A literal ``>``. Used for example to compare strings that contain a ``>``.
+``$<COMMA>``
+ A literal ``,``. Used for example to compare strings which contain a ``,``.
+``$<SEMICOLON>``
+ A literal ``;``. Used to prevent list expansion on an argument with ``;``.
+
+.. _`Conditional Generator Expressions`:
+
+Conditional Expressions
+-----------------------
+
+Conditional generator expressions depend on a boolean condition
+that must be ``0`` or ``1``.
+
+``$<condition:true_string>``
+ Evaluates to ``true_string`` if ``condition`` is ``1``.
+ Otherwise evaluates to the empty string.
+
+``$<IF:condition,true_string,false_string>``
+ Evaluates to ``true_string`` if ``condition`` is ``1``.
+ Otherwise evaluates to ``false_string``.
+
+Typically, the ``condition`` is a :ref:`boolean generator expression
+<Boolean Generator Expressions>`. For instance,
+
+.. code-block:: cmake
+
+ $<$<CONFIG:Debug>:DEBUG_MODE>
+
+expands to ``DEBUG_MODE`` when the ``Debug`` configuration is used, and
+otherwise expands to the empty string.
+
+.. _`String Transforming Generator Expressions`:
+
+String Transformations
+----------------------
+
+``$<JOIN:list,string>``
+ Joins the list with the content of ``string``.
+``$<LOWER_CASE:string>``
+ Content of ``string`` converted to lower case.
+``$<UPPER_CASE:string>``
+ Content of ``string`` converted to upper case.
+
+``$<GENEX_EVAL:expr>``
+ Content of ``expr`` evaluated as a generator expression in the current
+ context. This enables consumption of generator expressions whose
+ evaluation results itself in generator expressions.
+``$<TARGET_GENEX_EVAL:tgt,expr>``
+ Content of ``expr`` evaluated as a generator expression in the context of
+ ``tgt`` target. This enables consumption of custom target properties that
+ themselves contain generator expressions.
+
+ Having the capability to evaluate generator expressions is very useful when
+ you want to manage custom properties supporting generator expressions.
+ For example:
+
+ .. code-block:: cmake
+
+ add_library(foo ...)
+
+ set_property(TARGET foo PROPERTY
+ CUSTOM_KEYS $<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>
+ )
+
+ add_custom_target(printFooKeys
+ COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:foo,CUSTOM_KEYS>
+ )
+
+ This naive implementation of the ``printFooKeys`` custom command is wrong
+ because ``CUSTOM_KEYS`` target property is not evaluated and the content
+ is passed as is (i.e. ``$<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>``).
+
+ To have the expected result (i.e. ``FOO_EXTRA_THINGS`` if config is
+ ``Debug``), it is required to evaluate the output of
+ ``$<TARGET_PROPERTY:foo,CUSTOM_KEYS>``:
+
+ .. code-block:: cmake
+
+ add_custom_target(printFooKeys
+ COMMAND ${CMAKE_COMMAND} -E
+ echo $<TARGET_GENEX_EVAL:foo,$<TARGET_PROPERTY:foo,CUSTOM_KEYS>>
+ )
+
+Variable Queries
+----------------
-``$<CONFIGURATION>``
- Configuration name. Deprecated. Use ``CONFIG`` instead.
``$<CONFIG>``
- Configuration name
+ Configuration name.
+``$<CONFIGURATION>``
+ Configuration name. Deprecated since CMake 3.0. Use ``CONFIG`` instead.
``$<PLATFORM_ID>``
The CMake-id of the platform.
See also the :variable:`CMAKE_SYSTEM_NAME` variable.
@@ -181,12 +346,31 @@ Available informational expressions are:
``$<CXX_COMPILER_ID>``
The CMake-id of the CXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+``$<Fortran_COMPILER_ID>``
+ The CMake-id of the Fortran compiler used.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
``$<C_COMPILER_VERSION>``
The version of the C compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
``$<CXX_COMPILER_VERSION>``
The version of the CXX compiler used.
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
+``$<Fortran_COMPILER_VERSION>``
+ The version of the Fortran compiler used.
+ See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable.
+``$<COMPILE_LANGUAGE>``
+ The compile language of source files when evaluating compile options.
+ See :ref:`the related boolean expression
+ <Boolean COMPILE_LANGUAGE Generator Expression>`
+ ``$<COMPILE_LANGUAGE:language>``
+ for notes about the portability of this generator expression.
+
+Target-Dependent Queries
+------------------------
+
+``$<TARGET_NAME_IF_EXISTS:tgt>``
+ Expands to the ``tgt`` if the given target exists, an empty string
+ otherwise.
``$<TARGET_FILE:tgt>``
Full path to main file (.exe, .so.1.2, .a) where ``tgt`` is the name of a target.
``$<TARGET_FILE_NAME:tgt>``
@@ -232,56 +416,21 @@ Available informational expressions are:
expression is evaluated on.
``$<TARGET_PROPERTY:prop>``
Value of the property ``prop`` on the target on which the generator
- expression is evaluated.
+ expression is evaluated. Note that for generator expressions in
+ :ref:`Target Usage Requirements` this is the value of the property
+ on the consuming target rather than the target specifying the
+ requirement.
``$<INSTALL_PREFIX>``
Content of the install prefix when the target is exported via
:command:`install(EXPORT)` and empty otherwise.
-``$<COMPILE_LANGUAGE>``
- The compile language of source files when evaluating compile options. See
- the unary version for notes about portability of this generator
- expression.
-
-Output Expressions
-==================
-These expressions generate output, in some cases depending on an input. These
-expressions may be combined with other expressions for information or logical
-comparison::
+Output-Related Expressions
+--------------------------
- -I$<JOIN:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>, -I>
-
-generates a string of the entries in the :prop_tgt:`INCLUDE_DIRECTORIES` target
-property with each entry preceded by ``-I``. Note that a more-complete use
-in this situation would require first checking if the INCLUDE_DIRECTORIES
-property is non-empty::
-
- $<$<BOOL:${prop}>:-I$<JOIN:${prop}, -I>>
-
-where ``${prop}`` refers to a helper variable::
-
- set(prop "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>")
-
-Available output expressions are:
-
-``$<0:...>``
- Empty string (ignores ``...``)
-``$<1:...>``
- Content of ``...``
-``$<JOIN:list,...>``
- Joins the list with the content of ``...``
-``$<ANGLE-R>``
- A literal ``>``. Used to compare strings which contain a ``>`` for example.
-``$<COMMA>``
- A literal ``,``. Used to compare strings which contain a ``,`` for example.
-``$<SEMICOLON>``
- A literal ``;``. Used to prevent list expansion on an argument with ``;``.
``$<TARGET_NAME:...>``
Marks ``...`` as being the name of a target. This is required if exporting
targets to multiple dependent export sets. The ``...`` must be a literal
name of a target- it may not contain generator expressions.
-``$<TARGET_NAME_IF_EXISTS:...>``
- Expands to the ``...`` if the given target exists, an empty string
- otherwise.
``$<LINK_ONLY:...>``
Content of ``...`` except when evaluated in a link interface while
propagating :ref:`Target Usage Requirements`, in which case it is the
@@ -296,10 +445,6 @@ Available output expressions are:
Content of ``...`` when the property is exported using :command:`export`, or
when the target is used by another target in the same buildsystem. Expands to
the empty string otherwise.
-``$<LOWER_CASE:...>``
- Content of ``...`` converted to lower case.
-``$<UPPER_CASE:...>``
- Content of ``...`` converted to upper case.
``$<MAKE_C_IDENTIFIER:...>``
Content of ``...`` converted to a C identifier. The conversion follows the
same behavior as :command:`string(MAKE_C_IDENTIFIER)`.
@@ -310,42 +455,25 @@ Available output expressions are:
Content of ``...`` converted to shell path style. For example, slashes are
converted to backslashes in Windows shells and drive letters are converted
to posix paths in MSYS shells. The ``...`` must be an absolute path.
-``$<GENEX_EVAL:...>``
- Content of ``...`` evaluated as a generator expression in the current
- context. This enables consumption of generator expressions
- whose evaluation results itself in generator expressions.
-``$<TARGET_GENEX_EVAL:tgt,...>``
- Content of ``...`` evaluated as a generator expression in the context of
- ``tgt`` target. This enables consumption of custom target properties that
- themselves contain generator expressions.
- Having the capability to evaluate generator expressions is very useful when
- you want to manage custom properties supporting generator expressions.
- For example:
+Debugging
+=========
- .. code-block:: cmake
+Since generator expressions are evaluated during generation of the buildsystem,
+and not during processing of ``CMakeLists.txt`` files, it is not possible to
+inspect their result with the :command:`message()` command.
- add_library(foo ...)
+One possible way to generate debug messages is to add a custom target,
- set_property(TARGET foo PROPERTY
- CUSTOM_KEYS $<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>
- )
+.. code-block:: cmake
- add_custom_target(printFooKeys
- COMMAND ${CMAKE_COMMAND} -E echo $<TARGET_PROPERTY:foo,CUSTOM_KEYS>
- )
+ add_custom_target(genexdebug COMMAND ${CMAKE_COMMAND} -E echo "$<...>")
- This naive implementation of the ``printFooKeys`` custom command is wrong
- because ``CUSTOM_KEYS`` target property is not evaluated and the content
- is passed as is (i.e. ``$<$<CONFIG:DEBUG>:FOO_EXTRA_THINGS>``).
+The shell command ``make genexdebug`` (invoked after execution of ``cmake``)
+would then print the result of ``$<...>``.
- To have the expected result (i.e. ``FOO_EXTRA_THINGS`` if config is
- ``Debug``), it is required to evaluate the output of
- ``$<TARGET_PROPERTY:foo,CUSTOM_KEYS>``:
+Another way is to write debug messages to a file:
- .. code-block:: cmake
+.. code-block:: cmake
- add_custom_target(printFooKeys
- COMMAND ${CMAKE_COMMAND} -E
- echo $<TARGET_GENEX_EVAL:foo,$<TARGET_PROPERTY:foo,CUSTOM_KEYS>>
- )
+ file(GENERATE OUTPUT filename CONTENT "$<...>")
diff --git a/Help/manual/cmake-generators.7.rst b/Help/manual/cmake-generators.7.rst
index 028776750..41f765220 100644
--- a/Help/manual/cmake-generators.7.rst
+++ b/Help/manual/cmake-generators.7.rst
@@ -27,6 +27,8 @@ when creating a new build tree.
CMake Generators
================
+.. _`Command-Line Build Tool Generators`:
+
Command-Line Build Tool Generators
----------------------------------
@@ -58,6 +60,8 @@ Ninja Generator
/generator/Ninja
+.. _`IDE Build Tool Generators`:
+
IDE Build Tool Generators
-------------------------
@@ -83,6 +87,7 @@ Visual Studio Generators
/generator/Visual Studio 12 2013
/generator/Visual Studio 14 2015
/generator/Visual Studio 15 2017
+ /generator/Visual Studio 16 2019
Other Generators
^^^^^^^^^^^^^^^^
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst
index 57a98503b..856aa2fba 100644
--- a/Help/manual/cmake-gui.1.rst
+++ b/Help/manual/cmake-gui.1.rst
@@ -10,11 +10,12 @@ Synopsis
cmake-gui [<options>]
cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>}
+ cmake-gui [<options>] -S <path-to-source> -B <path-to-build>
Description
===========
-The "cmake-gui" executable is the CMake GUI. Project configuration
+The **cmake-gui** executable is the CMake GUI. Project configuration
settings may be specified interactively. Brief instructions are
provided at the bottom of the window when the program is running.
@@ -27,6 +28,14 @@ native tool on their platform.
Options
=======
+``-S <path-to-source>``
+ Path to root directory of the CMake project to build.
+
+``-B <path-to-build>``
+ Path to directory which CMake will use as the root of build directory.
+
+ If the directory doesn't already exist CMake will make it.
+
.. include:: OPTIONS_HELP.txt
See Also
diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index 71649ba3e..5e5cffffd 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -206,9 +206,10 @@ enclosed content, such as `Escape Sequences`_ or `Variable References`_,
is performed. A bracket argument is always given to the command
invocation as exactly one argument.
-For example:
+.. No code-block syntax highlighting in the following example
+ (long string literal not supported by our cmake.py)
-.. code-block:: cmake
+For example::
message([=[
This is the first line in a bracket argument with bracket length 1.
@@ -253,16 +254,22 @@ closing quotes. Both `Escape Sequences`_ and `Variable References`_
are evaluated. A quoted argument is always given to the command
invocation as exactly one argument.
+.. No code-block syntax highlighting in the following example
+ (escape \" not supported by our cmake.py)
+
For example:
-::
+.. code-block:: cmake
- message("This is a quoted argument containing multiple lines.
- This is always one argument even though it contains a ; character.
- Both \\-escape sequences and ${variable} references are evaluated.
- The text does not end on an escaped double-quote like \".
- It does end in an unescaped double quote.
- ")
+ message("This is a quoted argument containing multiple lines.
+ This is always one argument even though it contains a ; character.
+ Both \\-escape sequences and ${variable} references are evaluated.
+ The text does not end on an escaped double-quote like \".
+ It does end in an unescaped double quote.
+ ")
+
+.. No code-block syntax highlighting in the following example
+ (for conformity with the two above examples)
The final ``\`` on any line ending in an odd number of backslashes
is treated as a line continuation and ignored along with the
@@ -270,11 +277,11 @@ immediately following newline character. For example:
.. code-block:: cmake
- message("\
- This is the first line of a quoted argument. \
- In fact it is the only line but since it is long \
- the source code uses line continuation.\
- ")
+ message("\
+ This is the first line of a quoted argument. \
+ In fact it is the only line but since it is long \
+ the source code uses line continuation.\
+ ")
.. note::
CMake versions prior to 3.0 do not support continuation with ``\``.
@@ -382,7 +389,7 @@ historical considerations.)
Variable References
-------------------
-A *variable reference* has the form ``${variable_name}`` and is
+A *variable reference* has the form ``${<variable>}`` and is
evaluated inside a `Quoted Argument`_ or an `Unquoted Argument`_.
A variable reference is replaced by the value of the variable,
or by the empty string if the variable is not set.
@@ -398,14 +405,18 @@ the ``$`` is also technically permitted but is discouraged.
The `Variables`_ section documents the scope of variable names
and how their values are set.
-An *environment variable reference* has the form ``$ENV{VAR}`` and
-is evaluated in the same contexts as a normal variable reference.
-See :variable:`ENV` for more information.
+An *environment variable reference* has the form ``$ENV{<variable>}``.
+See the `Environment Variables`_ section for more information.
-A *cache variable reference* has the form ``$CACHE{VAR}`` and
-is evaluated in the same contexts as a normal variable reference.
+A *cache variable reference* has the form ``$CACHE{<variable>}``.
See :variable:`CACHE` for more information.
+The :command:`if` command has a special condition syntax that
+allows for variable references in the short form ``<variable>``
+instead of ``${<variable>}``.
+However, environment and cache variables always need to be
+referenced as ``$ENV{<variable>}`` or ``$CACHE{<variable>}``.
+
Comments
--------
@@ -552,10 +563,38 @@ Otherwise, the variable reference evaluates to an empty string.
The ``$CACHE{VAR}`` syntax can be used to do direct cache entry
lookups.
-The :manual:`cmake-variables(7)` manual documents many variables
+The :manual:`cmake-variables(7)` manual documents the many variables
that are provided by CMake or have meaning to CMake when set
by project code.
+.. _`CMake Language Environment Variables`:
+
+Environment Variables
+=====================
+
+Environment Variables are like ordinary `Variables`_, with the
+following differences:
+
+Scope
+ Environment variables have global scope in a CMake process.
+ They are never cached.
+
+References
+ `Variable References`_ have the form ``$ENV{<variable>}``.
+
+Initialization
+ Initial values of the CMake environment variables are those of
+ the calling process.
+ Values can be changed using the :command:`set` and :command:`unset`
+ commands.
+ These commands only affect the running CMake process,
+ not the system environment at large.
+ Changed values are not written back to the calling process,
+ and they are not seen by subsequent build or test processes.
+
+The :manual:`cmake-env-variables(7)` manual documents environment
+variables that have special meaning to CMake.
+
.. _`CMake Language Lists`:
Lists
diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index b7276b657..d9b939f3b 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -3,12 +3,14 @@
cmake-modules(7)
****************
-.. only:: html
+The modules listed here are part of the CMake distribution.
+Projects may provide further modules; their location(s)
+can be specified in the :variable:`CMAKE_MODULE_PATH` variable.
- .. contents::
+Utility Modules
+^^^^^^^^^^^^^^^
-All Modules
-===========
+These modules are loaded using the :command:`include` command.
.. toctree::
:maxdepth: 1
@@ -26,6 +28,7 @@ All Modules
/module/CheckFortranCompilerFlag
/module/CheckFortranFunctionExists
/module/CheckFortranSourceCompiles
+ /module/CheckFortranSourceRuns
/module/CheckFunctionExists
/module/CheckIPOSupported
/module/CheckIncludeFileCXX
@@ -33,6 +36,7 @@ All Modules
/module/CheckIncludeFiles
/module/CheckLanguage
/module/CheckLibraryExists
+ /module/CheckPIESupported
/module/CheckPrototypeDefinition
/module/CheckStructHasMember
/module/CheckSymbolExists
@@ -41,15 +45,11 @@ All Modules
/module/CMakeAddFortranSubdirectory
/module/CMakeBackwardCompatibilityCXX
/module/CMakeDependentOption
- /module/CMakeDetermineVSServicePack
- /module/CMakeExpandImportedTargets
/module/CMakeFindDependencyMacro
/module/CMakeFindFrameworks
/module/CMakeFindPackageMode
- /module/CMakeForceCompiler
/module/CMakeGraphVizOptions
/module/CMakePackageConfigHelpers
- /module/CMakeParseArguments
/module/CMakePrintHelpers
/module/CMakePrintSystemInformation
/module/CMakePushCheckState
@@ -70,6 +70,39 @@ All Modules
/module/ExternalProject
/module/FeatureSummary
/module/FetchContent
+ /module/FindPackageHandleStandardArgs
+ /module/FindPackageMessage
+ /module/FortranCInterface
+ /module/GenerateExportHeader
+ /module/GetPrerequisites
+ /module/GNUInstallDirs
+ /module/GoogleTest
+ /module/InstallRequiredSystemLibraries
+ /module/ProcessorCount
+ /module/SelectLibraryConfigurations
+ /module/SquishTestScript
+ /module/TestBigEndian
+ /module/TestForANSIForScope
+ /module/TestForANSIStreamHeaders
+ /module/TestForSSTREAM
+ /module/TestForSTDNamespace
+ /module/UseEcos
+ /module/UseJavaClassFilelist
+ /module/UseJava
+ /module/UseJavaSymlinks
+ /module/UseSWIG
+ /module/UsewxWidgets
+ /module/WriteCompilerDetectionHeader
+
+Find Modules
+^^^^^^^^^^^^
+
+These modules search for third-party software.
+They are normally called through the :command:`find_package` command.
+
+.. toctree::
+ :maxdepth: 1
+
/module/FindALSA
/module/FindArmadillo
/module/FindASPELL
@@ -82,7 +115,6 @@ All Modules
/module/FindBZip2
/module/FindCABLE
/module/FindCoin3D
- /module/FindCUDA
/module/FindCups
/module/FindCURL
/module/FindCurses
@@ -97,6 +129,7 @@ All Modules
/module/FindFLEX
/module/FindFLTK2
/module/FindFLTK
+ /module/FindFontconfig
/module/FindFreetype
/module/FindGCCXML
/module/FindGDAL
@@ -131,6 +164,7 @@ All Modules
/module/FindLAPACK
/module/FindLATEX
/module/FindLibArchive
+ /module/FindLibinput
/module/FindLibLZMA
/module/FindLibXml2
/module/FindLibXslt
@@ -173,8 +207,6 @@ All Modules
/module/FindosgViewer
/module/FindosgVolume
/module/FindosgWidget
- /module/FindPackageHandleStandardArgs
- /module/FindPackageMessage
/module/FindPatch
/module/FindPerlLibs
/module/FindPerl
@@ -189,11 +221,8 @@ All Modules
/module/FindPython
/module/FindPython2
/module/FindPython3
- /module/FindPythonInterp
- /module/FindPythonLibs
/module/FindQt3
/module/FindQt4
- /module/FindQt
/module/FindQuickTime
/module/FindRTI
/module/FindRuby
@@ -205,6 +234,7 @@ All Modules
/module/FindSDL_ttf
/module/FindSelfPackers
/module/FindSquish
+ /module/FindSQLite3
/module/FindSubversion
/module/FindSWIG
/module/FindTCL
@@ -218,39 +248,43 @@ All Modules
/module/FindWget
/module/FindWish
/module/FindwxWidgets
- /module/FindwxWindows
/module/FindXCTest
/module/FindXalanC
/module/FindXercesC
/module/FindX11
/module/FindXMLRPC
/module/FindZLIB
- /module/FortranCInterface
- /module/GenerateExportHeader
- /module/GetPrerequisites
- /module/GNUInstallDirs
- /module/GoogleTest
- /module/InstallRequiredSystemLibraries
+
+Deprecated Modules
+^^^^^^^^^^^^^^^^^^^
+
+Deprecated Utility Modules
+==========================
+
+.. toctree::
+ :maxdepth: 1
+
+ /module/CMakeDetermineVSServicePack
+ /module/CMakeExpandImportedTargets
+ /module/CMakeForceCompiler
+ /module/CMakeParseArguments
/module/MacroAddFileDependencies
- /module/ProcessorCount
- /module/SelectLibraryConfigurations
- /module/SquishTestScript
- /module/TestBigEndian
/module/TestCXXAcceptsFlag
- /module/TestForANSIForScope
- /module/TestForANSIStreamHeaders
- /module/TestForSSTREAM
- /module/TestForSTDNamespace
- /module/UseEcos
- /module/UseJavaClassFilelist
- /module/UseJava
- /module/UseJavaSymlinks
/module/UsePkgConfig
- /module/UseSWIG
- /module/UsewxWidgets
/module/Use_wxWindows
/module/WriteBasicConfigVersionFile
- /module/WriteCompilerDetectionHeader
+
+Deprecated Find Modules
+=======================
+
+.. toctree::
+ :maxdepth: 1
+
+ /module/FindCUDA
+ /module/FindPythonInterp
+ /module/FindPythonLibs
+ /module/FindQt
+ /module/FindwxWindows
Legacy CPack Modules
====================
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 2cc52fe1a..409b5b1c7 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -51,6 +51,20 @@ 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.14
+=================================
+
+.. toctree::
+ :maxdepth: 1
+
+ CMP0088: FindBISON runs bison in CMAKE_CURRENT_BINARY_DIR when executing. </policy/CMP0088>
+ CMP0087: install(SCRIPT | CODE) supports generator expressions. </policy/CMP0087>
+ CMP0086: UseSWIG honors SWIG_MODULE_NAME via -module flag. </policy/CMP0086>
+ CMP0085: IN_LIST generator expression handles empty list items. </policy/CMP0085>
+ CMP0084: The FindQt module does not exist for find_package(). </policy/CMP0084>
+ CMP0083: Add PIE options when linking executable. </policy/CMP0083>
+ CMP0082: Install rules from add_subdirectory() are interleaved with those in caller. </policy/CMP0082>
+
Policies Introduced by CMake 3.13
=================================
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 5c3eb81fc..ef864129b 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -23,6 +23,7 @@ Properties of Global Scope
/prop_gbl/AUTORCC_SOURCE_GROUP
/prop_gbl/CMAKE_C_KNOWN_FEATURES
/prop_gbl/CMAKE_CXX_KNOWN_FEATURES
+ /prop_gbl/CMAKE_ROLE
/prop_gbl/DEBUG_CONFIGURATIONS
/prop_gbl/DISABLED_FEATURES
/prop_gbl/ENABLED_FEATURES
@@ -124,20 +125,25 @@ Properties on Targets
/prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG
/prop_tgt/ARCHIVE_OUTPUT_NAME
/prop_tgt/AUTOGEN_BUILD_DIR
+ /prop_tgt/AUTOGEN_ORIGIN_DEPENDS
/prop_tgt/AUTOGEN_PARALLEL
/prop_tgt/AUTOGEN_TARGET_DEPENDS
/prop_tgt/AUTOMOC_COMPILER_PREDEFINES
/prop_tgt/AUTOMOC_DEPEND_FILTERS
+ /prop_tgt/AUTOMOC_EXECUTABLE
/prop_tgt/AUTOMOC_MACRO_NAMES
/prop_tgt/AUTOMOC_MOC_OPTIONS
/prop_tgt/AUTOMOC
/prop_tgt/AUTOUIC
+ /prop_tgt/AUTOUIC_EXECUTABLE
/prop_tgt/AUTOUIC_OPTIONS
/prop_tgt/AUTOUIC_SEARCH_PATHS
/prop_tgt/AUTORCC
+ /prop_tgt/AUTORCC_EXECUTABLE
/prop_tgt/AUTORCC_OPTIONS
/prop_tgt/BINARY_DIR
/prop_tgt/BUILD_RPATH
+ /prop_tgt/BUILD_RPATH_USE_ORIGIN
/prop_tgt/BUILD_WITH_INSTALL_NAME_DIR
/prop_tgt/BUILD_WITH_INSTALL_RPATH
/prop_tgt/BUNDLE_EXTENSION
@@ -188,6 +194,8 @@ Properties on Targets
/prop_tgt/FRAMEWORK
/prop_tgt/FRAMEWORK_VERSION
/prop_tgt/GENERATOR_FILE_NAME
+ /prop_tgt/GHS_INTEGRITY_APP
+ /prop_tgt/GHS_NO_SOURCE_GROUP_FILE
/prop_tgt/GNUtoMS
/prop_tgt/HAS_CXX
/prop_tgt/IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
@@ -199,7 +207,6 @@ Properties on Targets
/prop_tgt/IMPORTED_LIBNAME_CONFIG
/prop_tgt/IMPORTED_LIBNAME
/prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
- /prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES_CONFIG
/prop_tgt/IMPORTED_LINK_DEPENDENT_LIBRARIES
/prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES_CONFIG
/prop_tgt/IMPORTED_LINK_INTERFACE_LANGUAGES
@@ -344,22 +351,22 @@ Properties on Targets
/prop_tgt/XCODE_PRODUCT_TYPE
/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER
/prop_tgt/XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
+ /prop_tgt/XCODE_SCHEME_ARGUMENTS
+ /prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
+ /prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
+ /prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+ /prop_tgt/XCODE_SCHEME_ENVIRONMENT
+ /prop_tgt/XCODE_SCHEME_EXECUTABLE
+ /prop_tgt/XCODE_SCHEME_GUARD_MALLOC
+ /prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
+ /prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES
+ /prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE
+ /prop_tgt/XCODE_SCHEME_MALLOC_STACK
/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER
/prop_tgt/XCODE_SCHEME_THREAD_SANITIZER_STOP
/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
/prop_tgt/XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
- /prop_tgt/XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
- /prop_tgt/XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
- /prop_tgt/XCODE_SCHEME_MALLOC_SCRIBBLE
- /prop_tgt/XCODE_SCHEME_MALLOC_GUARD_EDGES
- /prop_tgt/XCODE_SCHEME_GUARD_MALLOC
/prop_tgt/XCODE_SCHEME_ZOMBIE_OBJECTS
- /prop_tgt/XCODE_SCHEME_MALLOC_STACK
- /prop_tgt/XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
- /prop_tgt/XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
- /prop_tgt/XCODE_SCHEME_EXECUTABLE
- /prop_tgt/XCODE_SCHEME_ARGUMENTS
- /prop_tgt/XCODE_SCHEME_ENVIRONMENT
/prop_tgt/XCTEST
.. _`Test Properties`:
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 724d8ec2a..d8d61729e 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -44,14 +44,10 @@ Qt Build Tools
Qt relies on some bundled tools for code generation, such as ``moc`` for
meta-object code generation, ``uic`` for widget layout and population,
-and ``rcc`` for virtual filesystem content generation. These tools may be
+and ``rcc`` for virtual file system content generation. These tools may be
automatically invoked by :manual:`cmake(1)` if the appropriate conditions
are met. The automatic tool invocation may be used with both Qt 4 and Qt 5.
-The tools are executed as part of a synthesized custom target generated by
-CMake. Target dependencies may be added to that custom target by adding them
-to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property.
-
AUTOMOC
^^^^^^^
@@ -214,20 +210,33 @@ overrides options from the :prop_tgt:`AUTORCC_OPTIONS` target property.
Source files can be excluded from :prop_tgt:`AUTORCC` processing by
enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
+The ``<ORIGIN>_autogen`` target
+===============================
+
+The ``moc`` and ``uic`` tools are executed as part of a synthesized
+``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` generated by
+CMake. By default that ``<ORIGIN>_autogen`` target inherits the dependencies
+of the ``<ORIGIN>`` target (see :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`).
+Target dependencies may be added to the ``<ORIGIN>_autogen`` target by adding
+them to the :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property.
+
Visual Studio Generators
========================
-When using the :manual:`Visual Studio generators <cmake-generators(7)>`,
-CMake uses a ``PRE_BUILD`` :command:`custom command <add_custom_command>` for
-:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
-If the :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` processing depends on files,
-a :command:`custom target <add_custom_target>` is used instead.
-This happens when
-
-- The origin target depends on :prop_sf:`GENERATED` files which aren't excluded
- from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` by :prop_sf:`SKIP_AUTOMOC`,
- :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071`
+When using the :manual:`Visual Studio generators <cmake-generators(7)>`, CMake
+generates a ``PRE_BUILD`` :command:`custom command <add_custom_command>`
+instead of the ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>`
+(for :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`).
+This isn't always possible though and
+an ``<ORIGIN>_autogen`` :command:`custom target <add_custom_target>` is used,
+when either
+
+- the ``<ORIGIN>`` target depends on :prop_sf:`GENERATED` files which aren't
+ excluded from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` by
+ :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN`
+ or :policy:`CMP0071`
- :prop_tgt:`AUTOGEN_TARGET_DEPENDS` lists a source file
+- :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled
qtmain.lib on Windows
=====================
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 8554e87f9..ba44b7f21 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -522,3 +522,132 @@ See also target properties:
* :prop_tgt:`ANDROID_SECURE_PROPS_PATH`
* :prop_tgt:`ANDROID_SKIP_ANT_STEP`
* :prop_tgt:`ANDROID_STL_TYPE`
+
+.. _`Cross Compiling for iOS, tvOS, or watchOS`:
+
+Cross Compiling for iOS, tvOS, or watchOS
+-----------------------------------------
+
+For cross-compiling to iOS, tvOS, 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.
+
+Any of the three systems can be targetted by setting the
+:variable:`CMAKE_SYSTEM_NAME` variable to a value from the table below.
+By default, the latest Device SDK is chosen. As for all Apple platforms,
+a different SDK (e.g. a simulator) can be selected by setting the
+:variable:`CMAKE_OSX_SYSROOT` variable, although this should rarely be
+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
+======= ================= ==================== ================
+
+For example, to create a CMake configuration for iOS, the following
+command is sufficient:
+
+.. code-block:: console
+
+ cmake .. -GXcode -DCMAKE_SYSTEM_NAME=iOS
+
+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.
+
+Next configuration will install fat 5 architectures iOS library
+and add the ``-miphoneos-version-min=9.3``/``-mios-simulator-version-min=9.3``
+flags to the compiler:
+
+.. code-block:: console
+
+ $ cmake -S. -B_builds -GXcode \
+ -DCMAKE_SYSTEM_NAME=iOS \
+ "-DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64;i386;x86_64" \
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=9.3 \
+ -DCMAKE_INSTALL_PREFIX=`pwd`/_install \
+ -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
+ -DCMAKE_IOS_INSTALL_COMBINED=YES
+
+Example:
+
+.. code-block:: cmake
+
+ # CMakeLists.txt
+ cmake_minimum_required(VERSION 3.14)
+ project(foo)
+ add_library(foo foo.cpp)
+ install(TARGETS foo DESTINATION lib)
+
+Install:
+
+.. code-block:: console
+
+ $ cmake --build _builds --config Release --target install
+
+Check library:
+
+.. code-block:: console
+
+ $ lipo -info _install/lib/libfoo.a
+ Architectures in the fat file: _install/lib/libfoo.a are: i386 armv7 armv7s x86_64 arm64
+
+.. code-block:: console
+
+ $ otool -l _install/lib/libfoo.a | grep -A2 LC_VERSION_MIN_IPHONEOS
+ cmd LC_VERSION_MIN_IPHONEOS
+ cmdsize 16
+ version 9.3
+
+Code Signing
+^^^^^^^^^^^^
+
+Some build artifacts for the embedded Apple platforms require mandatory
+code signing. If the :generator:`Xcode` generator is being used and
+code signing is required or desired, the developmemt team ID can be
+specified via the ``CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM`` CMake variable.
+This team ID will then be included in the generated Xcode project.
+By default, CMake avoids the need for code signing during the internal
+configuration phase (i.e compiler ID and feature detection).
+
+.. _`Switching Between Device and Simulator`:
+
+Switching Between Device and Simulator
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When configuring for any of the embedded platforms, one can target either
+real devices or the simulator. Both have their own separate SDK, but CMake
+only supports specifying a single SDK for the configuration phase. This
+means the developer must select one or the other at configuration time.
+When using the :generator:`Xcode` generator, this is less of a limitation
+because Xcode still allows you to build for either a device or a simulator,
+even though configuration was only performed for one of the two. From
+within the Xcode IDE, builds are performed for the selected "destination"
+platform. When building from the command line, the desired sdk can be
+specified directly by passing a ``-sdk`` option to the underlying build
+tool (``xcodebuild``). For example:
+
+.. code-block:: console
+
+ $ cmake --build ... -- -sdk iphonesimulator
+
+Please note that checks made during configuration were performed against
+the configure-time SDK and might not hold true for other SDKs. Commands
+like :command:`find_package`, :command:`find_library`, etc. store and use
+details only for the configured SDK/platform, so they can be problematic
+if wanting to switch between device and simulator builds. You can follow
+the next rules to make device + simulator configuration work:
+
+- Use explicit ``-l`` linker flag,
+ e.g. ``target_link_libraries(foo PUBLIC "-lz")``
+
+- Use explicit ``-framework`` linker flag,
+ e.g. ``target_link_libraries(foo PUBLIC "-framework CoreFoundation")``
+
+- Use :command:`find_package` only for libraries installed with
+ :variable:`CMAKE_IOS_INSTALL_COMBINED` feature
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 9dd36ede4..6bb30cba3 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -7,6 +7,14 @@ cmake-variables(7)
.. contents::
+This page documents variables that are provided by CMake
+or have meaning to CMake when set by project code.
+
+For general information on variables, see the
+:ref:`Variables <CMake Language Variables>`
+section in the cmake-language manual.
+
+
Variables that Provide Information
==================================
@@ -47,7 +55,6 @@ Variables that Provide Information
/variable/CMAKE_GENERATOR_INSTANCE
/variable/CMAKE_GENERATOR_PLATFORM
/variable/CMAKE_GENERATOR_TOOLSET
- /variable/CMAKE_HOME_DIRECTORY
/variable/CMAKE_IMPORT_LIBRARY_PREFIX
/variable/CMAKE_IMPORT_LIBRARY_SUFFIX
/variable/CMAKE_JOB_POOL_COMPILE
@@ -95,7 +102,6 @@ Variables that Provide Information
/variable/CMAKE_VERBOSE_MAKEFILE
/variable/CMAKE_VERSION
/variable/CMAKE_VS_DEVENV_COMMAND
- /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
/variable/CMAKE_VS_MSBUILD_COMMAND
/variable/CMAKE_VS_NsightTegra_VERSION
/variable/CMAKE_VS_PLATFORM_NAME
@@ -162,6 +168,7 @@ Variables that Change Behavior
/variable/CMAKE_FIND_NO_INSTALL_PREFIX
/variable/CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY
/variable/CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY
+ /variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
/variable/CMAKE_FIND_PACKAGE_WARN_NO_MODULE
/variable/CMAKE_FIND_ROOT_PATH
/variable/CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
@@ -181,8 +188,8 @@ Variables that Change Behavior
/variable/CMAKE_LIBRARY_PATH
/variable/CMAKE_LINK_DIRECTORIES_BEFORE
/variable/CMAKE_MFC_FLAG
+ /variable/CMAKE_MAXIMUM_RECURSION_DEPTH
/variable/CMAKE_MODULE_PATH
- /variable/CMAKE_NOT_USING_CONFIG_FLAGS
/variable/CMAKE_POLICY_DEFAULT_CMPNNNN
/variable/CMAKE_POLICY_WARNING_CMPNNNN
/variable/CMAKE_PREFIX_PATH
@@ -209,19 +216,19 @@ Variables that Change Behavior
/variable/CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER
/variable/CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN
+ /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
+ /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
+ /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
+ /variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC
+ /variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
+ /variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
+ /variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
+ /variable/CMAKE_XCODE_SCHEME_MALLOC_STACK
/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER
/variable/CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP
/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER
/variable/CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP
- /variable/CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER
- /variable/CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP
- /variable/CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE
- /variable/CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES
- /variable/CMAKE_XCODE_SCHEME_GUARD_MALLOC
/variable/CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS
- /variable/CMAKE_XCODE_SCHEME_MALLOC_STACK
- /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE
- /variable/CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS
/variable/PackageName_ROOT
Variables that Describe the System
@@ -233,7 +240,6 @@ Variables that Describe the System
/variable/ANDROID
/variable/APPLE
/variable/BORLAND
- /variable/CACHE
/variable/CMAKE_CL_64
/variable/CMAKE_COMPILER_2005
/variable/CMAKE_HOST_APPLE
@@ -252,8 +258,8 @@ Variables that Describe the System
/variable/CMAKE_SYSTEM_PROCESSOR
/variable/CMAKE_SYSTEM_VERSION
/variable/CYGWIN
- /variable/ENV
/variable/GHS-MULTI
+ /variable/IOS
/variable/MINGW
/variable/MSVC
/variable/MSVC10
@@ -268,6 +274,7 @@ Variables that Describe the System
/variable/MSVC_IDE
/variable/MSVC_TOOLSET_VERSION
/variable/MSVC_VERSION
+ /variable/MSYS
/variable/UNIX
/variable/WIN32
/variable/WINCE
@@ -309,6 +316,7 @@ Variables that Control the Build
/variable/CMAKE_ANDROID_STL_TYPE
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY
/variable/CMAKE_ARCHIVE_OUTPUT_DIRECTORY_CONFIG
+ /variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS
/variable/CMAKE_AUTOGEN_PARALLEL
/variable/CMAKE_AUTOGEN_VERBOSE
/variable/CMAKE_AUTOMOC
@@ -322,6 +330,7 @@ Variables that Control the Build
/variable/CMAKE_AUTOUIC_OPTIONS
/variable/CMAKE_AUTOUIC_SEARCH_PATHS
/variable/CMAKE_BUILD_RPATH
+ /variable/CMAKE_BUILD_RPATH_USE_ORIGIN
/variable/CMAKE_BUILD_WITH_INSTALL_NAME_DIR
/variable/CMAKE_BUILD_WITH_INSTALL_RPATH
/variable/CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
@@ -337,6 +346,11 @@ Variables that Control the Build
/variable/CMAKE_FOLDER
/variable/CMAKE_Fortran_FORMAT
/variable/CMAKE_Fortran_MODULE_DIRECTORY
+ /variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE
+ /variable/CMAKE_GLOBAL_AUTOGEN_TARGET
+ /variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
+ /variable/CMAKE_GLOBAL_AUTORCC_TARGET
+ /variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME
/variable/CMAKE_GNUtoMS
/variable/CMAKE_INCLUDE_CURRENT_DIR
/variable/CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE
@@ -437,7 +451,6 @@ Variables for Languages
/variable/CMAKE_Fortran_MODDIR_DEFAULT
/variable/CMAKE_Fortran_MODDIR_FLAG
/variable/CMAKE_Fortran_MODOUT_FLAG
- /variable/CMAKE_INTERNAL_PLATFORM_ABI
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_MACHINE
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_PREFIX
/variable/CMAKE_LANG_ANDROID_TOOLCHAIN_SUFFIX
@@ -445,15 +458,12 @@ Variables for Languages
/variable/CMAKE_LANG_ARCHIVE_CREATE
/variable/CMAKE_LANG_ARCHIVE_FINISH
/variable/CMAKE_LANG_COMPILER
- /variable/CMAKE_LANG_COMPILER_ABI
- /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
/variable/CMAKE_LANG_COMPILER_EXTERNAL_TOOLCHAIN
/variable/CMAKE_LANG_COMPILER_ID
/variable/CMAKE_LANG_COMPILER_LOADED
/variable/CMAKE_LANG_COMPILER_PREDEFINES_COMMAND
/variable/CMAKE_LANG_COMPILER_TARGET
/variable/CMAKE_LANG_COMPILER_VERSION
- /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
/variable/CMAKE_LANG_COMPILE_OBJECT
/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY
/variable/CMAKE_LANG_CREATE_SHARED_MODULE
@@ -470,11 +480,6 @@ Variables for Languages
/variable/CMAKE_LANG_FLAGS_RELEASE_INIT
/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO
/variable/CMAKE_LANG_FLAGS_RELWITHDEBINFO_INIT
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE
- /variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO
/variable/CMAKE_LANG_IGNORE_EXTENSIONS
/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES
/variable/CMAKE_LANG_IMPLICIT_LINK_DIRECTORIES
@@ -487,7 +492,6 @@ Variables for Languages
/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG_SEP
/variable/CMAKE_LANG_LINK_EXECUTABLE
/variable/CMAKE_LANG_OUTPUT_EXTENSION
- /variable/CMAKE_LANG_PLATFORM_ID
/variable/CMAKE_LANG_SIMULATE_ID
/variable/CMAKE_LANG_SIMULATE_VERSION
/variable/CMAKE_LANG_SIZEOF_DATA_PTR
@@ -529,7 +533,7 @@ Variables for CTest
/variable/CTEST_CUSTOM_POST_TEST
/variable/CTEST_CUSTOM_PRE_MEMCHECK
/variable/CTEST_CUSTOM_PRE_TEST
- /variable/CTEST_CUSTOM_TEST_IGNORE
+ /variable/CTEST_CUSTOM_TESTS_IGNORE
/variable/CTEST_CUSTOM_WARNING_EXCEPTION
/variable/CTEST_CUSTOM_WARNING_MATCH
/variable/CTEST_CVS_CHECKOUT
@@ -562,6 +566,7 @@ Variables for CTest
/variable/CTEST_RUN_CURRENT_SCRIPT
/variable/CTEST_SCP_COMMAND
/variable/CTEST_SITE
+ /variable/CTEST_SUBMIT_URL
/variable/CTEST_SOURCE_DIRECTORY
/variable/CTEST_SVN_COMMAND
/variable/CTEST_SVN_OPTIONS
@@ -589,3 +594,32 @@ Variables for CPack
/variable/CPACK_PACKAGING_INSTALL_PREFIX
/variable/CPACK_SET_DESTDIR
/variable/CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION
+
+Variable Expansion Operators
+============================
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CACHE
+ /variable/ENV
+
+Internal Variables
+==================
+
+CMake has many internal variables. Most of them are undocumented.
+Some of them, however, were at some point described as normal
+variables, and therefore may be encountered in legacy code. They
+are subject to change, and not recommended for use in project code.
+
+.. toctree::
+ :maxdepth: 1
+
+ /variable/CMAKE_HOME_DIRECTORY
+ /variable/CMAKE_INTERNAL_PLATFORM_ABI
+ /variable/CMAKE_LANG_COMPILER_ABI
+ /variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID
+ /variable/CMAKE_LANG_COMPILER_VERSION_INTERNAL
+ /variable/CMAKE_LANG_PLATFORM_ID
+ /variable/CMAKE_NOT_USING_CONFIG_FLAGS
+ /variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index b11526c43..f3b81ecb6 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -8,37 +8,164 @@ Synopsis
.. parsed-literal::
- cmake [<options>] {<path-to-source> | <path-to-existing-build>}
- cmake [<options>] -S <path-to-source> -B <path-to-build>
- cmake [{-D <var>=<value>}...] -P <cmake-script-file>
- cmake --build <dir> [<options>...] [-- <build-tool-options>...]
- cmake --open <dir>
- cmake -E <command> [<options>...]
- cmake --find-package <options>...
+ `Generate a Project Buildsystem`_
+ cmake [<options>] <path-to-source>
+ cmake [<options>] <path-to-existing-build>
+ cmake [<options>] -S <path-to-source> -B <path-to-build>
+
+ `Build a Project`_
+ cmake --build <dir> [<options>] [-- <build-tool-options>]
+
+ `Open a Project`_
+ cmake --open <dir>
+
+ `Run a Script`_
+ cmake [{-D <var>=<value>}...] -P <cmake-script-file>
+
+ `Run a Command-Line Tool`_
+ cmake -E <command> [<options>]
+
+ `Run the Find-Package Tool`_
+ cmake --find-package [<options>]
+
+ `View Help`_
+ cmake --help[-<topic>]
Description
===========
-The "cmake" executable is the CMake command-line interface. It may be
-used to configure projects in scripts. Project configuration settings
-may be specified on the command line with the -D option.
+The **cmake** executable is the command-line interface of the cross-platform
+buildsystem generator CMake. The above `Synopsis`_ lists various actions
+the tool can perform as described in sections below.
+
+To build a software project with CMake, `Generate a Project Buildsystem`_.
+Optionally use **cmake** to `Build a Project`_ or just run the
+corresponding build tool (e.g. ``make``) directly. **cmake** can also
+be used to `View Help`_.
+
+The other actions are meant for use by software developers writing
+scripts in the :manual:`CMake language <cmake-language(7)>` to support
+their builds.
+
+For graphical user interfaces that may be used in place of **cmake**,
+see :manual:`ccmake <ccmake(1)>` and :manual:`cmake-gui <cmake-gui(1)>`.
+For command-line interfaces to the CMake testing and packaging facilities,
+see :manual:`ctest <ctest(1)>` and :manual:`cpack <cpack(1)>`.
+
+For more information on CMake at large, `see also`_ the links at the end
+of this manual.
+
+
+Introduction to CMake Buildsystems
+==================================
+
+A *buildsystem* describes how to build a project's executables and libraries
+from its source code using a *build tool* to automate the process. For
+example, a buildsystem may be a ``Makefile`` for use with a command-line
+``make`` tool or a project file for an Integrated Development Environment
+(IDE). In order to avoid maintaining multiple such buildsystems, a project
+may specify its buildsystem abstractly using files written in the
+:manual:`CMake language <cmake-language(7)>`. From these files CMake
+generates a preferred buildsystem locally for each user through a backend
+called a *generator*.
+
+To generate a buildsystem with CMake, the following must be selected:
+
+Source Tree
+ The top-level directory containing source files provided by the project.
+ The project specifies its buildsystem using files as described in the
+ :manual:`cmake-language(7)` manual, starting with a top-level file named
+ ``CMakeLists.txt``. These files specify build targets and their
+ dependencies as described in the :manual:`cmake-buildsystem(7)` manual.
+
+Build Tree
+ The top-level directory in which buildsystem files and build output
+ artifacts (e.g. executables and libraries) are to be stored.
+ CMake will write a ``CMakeCache.txt`` file to identify the directory
+ as a build tree and store persistent information such as buildsystem
+ configuration options.
+
+ To maintain a pristine source tree, perform an *out-of-source* build
+ by using a separate dedicated build tree. An *in-source* build in
+ which the build tree is placed in the same directory as the source
+ tree is also supported, but discouraged.
+
+Generator
+ This chooses the kind of buildsystem to generate. See the
+ :manual:`cmake-generators(7)` manual for documentation of all generators.
+ Run ``cmake --help`` to see a list of generators available locally.
+ Optionally use the ``-G`` option below to specify a generator, or simply
+ accept the default CMake chooses for the current platform.
+
+ When using one of the :ref:`Command-Line Build Tool Generators`
+ CMake expects that the environment needed by the compiler toolchain
+ is already configured in the shell. When using one of the
+ :ref:`IDE Build Tool Generators`, no particular environment is needed.
+
-CMake is a cross-platform build system generator. Projects specify
-their build process with platform-independent CMake listfiles included
-in each directory of a source tree with the name CMakeLists.txt.
-Users build a project by using CMake to generate a build system for a
-native tool on their platform.
+Generate a Project Buildsystem
+==============================
+
+Run CMake with one of the following command signatures to specify the
+source and build trees and generate a buildsystem:
+
+``cmake [<options>] <path-to-source>``
+ Uses the current working directory as the build tree, and
+ ``<path-to-source>`` as the source tree. The specified path may
+ be absolute or relative to the current working directory.
+ The source tree must contain a ``CMakeLists.txt`` file and must
+ *not* contain a ``CMakeCache.txt`` file because the latter
+ identifies an existing build tree. For example:
+
+ .. code-block:: console
+
+ $ mkdir build ; cd build
+ $ cmake ../src
+
+``cmake [<options>] <path-to-existing-build>``
+ Uses ``<path-to-existing-build>`` as the build tree, and loads the
+ path to the source tree from its ``CMakeCache.txt`` file, which must
+ have already been generated by a previous run of CMake. The specified
+ path may be absolute or relative to the current working directory.
+ For example:
+
+ .. code-block:: console
+
+ $ cd build
+ $ cmake .
+
+``cmake [<options>] -S <path-to-source> -B <path-to-build>``
+ Uses ``<path-to-build>`` as the build tree and ``<path-to-source>``
+ as the source tree. The specified paths may be absolute or relative
+ to the current working directory. The source tree must contain a
+ ``CMakeLists.txt`` file. The build tree will be created automatically
+ if it does not already exist. For example:
+
+ .. code-block:: console
+
+ $ cmake -S src -B build
+
+In all cases the ``<options>`` may be zero or more of the `Options`_ below.
+
+After generating a buildsystem one may use the corresponding native
+build tool to build the project. For example, after using the
+:generator:`Unix Makefiles` generator one may run ``make`` directly:
+
+ .. code-block:: console
+
+ $ make
+ $ make install
+
+Alternatively, one may use **cmake** to `Build a Project`_ by
+automatically choosing and invoking the appropriate native build tool.
.. _`CMake Options`:
Options
-=======
+-------
.. include:: OPTIONS_BUILD.txt
-``-E <command> [<options>...]``
- See `Command-Line Tool Mode`_.
-
``-L[A][H]``
List non-advanced cached variables.
@@ -50,30 +177,12 @@ Options
display also advanced variables. If H is specified, it will also
display help for each variable.
-``--build <dir>``
- See `Build Tool Mode`_.
-
-``--open <dir>``
- Open the generated project in the associated application. This is
- only supported by some generators.
-
``-N``
View mode only.
Only load the cache. Do not actually run configure and generate
steps.
-``-P <file>``
- Process script mode.
-
- Process the given cmake file as a script written in the CMake
- language. No configure or generate step is performed and the cache
- is not modified. If variables are defined using -D, this must be
- done before the -P argument.
-
-``--find-package``
- See `Find-Package Tool Mode`_.
-
``--graphviz=[file]``
Generate graphviz of dependencies, see :module:`CMakeGraphVizOptions` for more.
@@ -142,17 +251,17 @@ Options
in CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR. This flag tells CMake to
warn about other files as well.
-.. include:: OPTIONS_HELP.txt
-
.. _`Build Tool Mode`:
-Build Tool Mode
+Build a Project
===============
CMake provides a command-line signature to build an already-generated
-project binary tree::
+project binary tree:
- cmake --build <dir> [<options>...] [-- <build-tool-options>...]
+.. code-block:: shell
+
+ cmake --build <dir> [<options>] [-- <build-tool-options>]
This abstracts a native build tool's command-line interface with the
following options:
@@ -180,17 +289,54 @@ following options:
``--use-stderr``
Ignored. Behavior is default in CMake >= 3.0.
+``-v, --verbose``
+ Enable verbose output - if supported - including the build commands to be
+ executed.
+
+ This option can be omitted if :envvar:`VERBOSE` environment variable or
+ :variable:`CMAKE_VERBOSE_MAKEFILE` cached variable is set.
+
+
``--``
Pass remaining options to the native tool.
Run ``cmake --build`` with no options for quick help.
-Command-Line Tool Mode
-======================
-CMake provides builtin command-line tools through the signature::
+Open a Project
+==============
+
+.. code-block:: shell
+
+ cmake --open <dir>
+
+Open the generated project in the associated application. This is only
+supported by some generators.
+
+
+.. _`Script Processing Mode`:
+
+Run a Script
+============
- cmake -E <command> [<options>...]
+.. code-block:: shell
+
+ cmake [{-D <var>=<value>}...] -P <cmake-script-file>
+
+Process the given cmake file as a script written in the CMake
+language. No configure or generate step is performed and the cache
+is not modified. If variables are defined using -D, this must be
+done before the -P argument.
+
+
+Run a Command-Line Tool
+=======================
+
+CMake provides builtin command-line tools through the signature
+
+.. code-block:: shell
+
+ cmake -E <command> [<options>]
Run ``cmake -E`` or ``cmake -E help`` for a summary of commands.
Available commands are:
@@ -235,9 +381,10 @@ Available commands are:
``chdir <dir> <cmd> [<arg>...]``
Change the current working directory and run a command.
-``compare_files <file1> <file2>``
+``compare_files [--ignore-eol] <file1> <file2>``
Check if ``<file1>`` is same as ``<file2>``. If files are the same,
- then returns 0, if not it returns 1.
+ then returns 0, if not it returns 1. The ``--ignore-eol`` option
+ implies line-wise comparison and ignores LF/CRLF differences.
``copy <file>... <destination>``
Copy files to ``<destination>`` (either file or directory).
@@ -326,7 +473,7 @@ Available commands are:
``sleep <number>...``
Sleep for given number of seconds.
-``tar [cxt][vf][zjJ] file.tar [<options>...] [--] [<file>...]``
+``tar [cxt][vf][zjJ] file.tar [<options>] [--] [<file>...]``
Create or extract a tar or zip archive. Options are:
``--``
@@ -379,24 +526,40 @@ The following ``cmake -E`` commands are available only on Windows:
``write_regv <key> <value>``
Write Windows registry value.
-Find-Package Tool Mode
-======================
-CMake provides a helper for Makefile-based projects with the signature::
+Run the Find-Package Tool
+=========================
- cmake --find-package <options>...
+CMake provides a pkg-config like helper for Makefile-based projects:
-This runs in a pkg-config like mode.
+.. code-block:: shell
-Search a package using :command:`find_package()` and print the resulting flags
-to stdout. This can be used to use cmake instead of pkg-config to find
-installed libraries in plain Makefile-based projects or in autoconf-based
-projects (via ``share/aclocal/cmake.m4``).
+ cmake --find-package [<options>]
+
+It searches a package using :command:`find_package()` and prints the
+resulting flags to stdout. This can be used instead of pkg-config
+to find installed libraries in plain Makefile-based projects or in
+autoconf-based projects (via ``share/aclocal/cmake.m4``).
.. note::
This mode is not well-supported due to some technical limitations.
It is kept for compatibility but should not be used in new projects.
+
+View Help
+=========
+
+To print selected pages from the CMake documentation, use
+
+.. code-block:: shell
+
+ cmake --help[-<topic>]
+
+with one of the following options:
+
+.. include:: OPTIONS_HELP.txt
+
+
See Also
========
diff --git a/Help/manual/cpack.1.rst b/Help/manual/cpack.1.rst
index 6159d7bee..679c5478e 100644
--- a/Help/manual/cpack.1.rst
+++ b/Help/manual/cpack.1.rst
@@ -13,12 +13,29 @@ Synopsis
Description
===========
-The ``cpack`` executable is the CMake packaging program.
-CMake projects use :command:`install` commands to define the contents of
-packages which can be generated in various formats by this tool.
-The :module:`CPack` module greatly simplifies the creation of the input file
-used by ``cpack``, allowing most aspects of the packaging configuration to be
-controlled directly from the CMake project's own ``CMakeLists.txt`` files.
+The **cpack** executable is the CMake packaging program. It generates
+installers and source packages in a variety of formats.
+
+For each installer or package format, **cpack** has a specific backend,
+called "generator". A generator is responsible for generating the required
+inputs and invoking the specific package creation tools. These installer
+or package generators are not to be confused with the makefile generators
+of the :manual:`cmake <cmake(1)>` command.
+
+All supported generators are specified in the :manual:`cpack-generators
+<cpack-generators(7)>` manual. The command ``cpack --help`` prints a
+list of generators supported for the target platform. Which of them are
+to be used can be selected through the :variable:`CPACK_GENERATOR` variable
+or through the command-line option ``-G``.
+
+The **cpack** program is steered by a configuration file written in the
+:manual:`CMake language <cmake-language(7)>`. Unless chosen differently
+through the command-line option ``--config``, the file ``CPackConfig.cmake``
+in the current directory is used.
+
+In the standard CMake workflow, the file ``CPackConfig.cmake`` is generated
+by the :manual:`cmake <cmake(1)>` executable, provided the :module:`CPack`
+module is included by the project's ``CMakeLists.txt`` file.
Options
=======
@@ -27,14 +44,9 @@ Options
``<generators>`` is a :ref:`semicolon-separated list <CMake Language Lists>`
of generator names. ``cpack`` will iterate through this list and produce
package(s) in that generator's format according to the details provided in
- the ``CPackConfig.cmake`` configuration file. A generator is responsible for
- generating the required inputs for a particular package system and invoking
- that system's package creation tools. All supported generators are specified
- in the :manual:`Generators <cpack-generators(7)>` section of the manual and
- the ``--help`` option lists the generators supported for the target platform.
-
- If this option is not given, the :variable:`CPACK_GENERATOR` variable
- determines the default set of generators that will be used.
+ the ``CPackConfig.cmake`` configuration file. If this option is not given,
+ the :variable:`CPACK_GENERATOR` variable determines the default set of
+ generators that will be used.
``-C <Configuration>``
Specify the project configuration to be packaged (e.g. ``Debug``,
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index e24b10daf..d1bd69b66 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -11,15 +11,16 @@ Synopsis
.. parsed-literal::
ctest [<options>]
- ctest <path-to-source> <path-to-build> --build-generator <generator>
- [<options>...] [-- <build-options>...] [--test-command <test>]
+ ctest --build-and-test <path-to-source> <path-to-build>
+ --build-generator <generator> [<options>...]
+ [--build-options <opts>...] [--test-command <command> [<args>...]]
ctest {-D <dashboard> | -M <model> -T <action> | -S <script> | -SP <script>}
[-- <dashboard-options>...]
Description
===========
-The "ctest" executable is the CMake test driver program.
+The **ctest** executable is the CMake test driver program.
CMake-generated build trees created for projects that use the
ENABLE_TESTING and ADD_TEST commands have testing support. This
program will run the tests and report results.
@@ -38,7 +39,7 @@ Options
``--progress``
Enable short progress output from tests.
- When the output of ``ctest`` is being sent directly to a terminal, the
+ When the output of **ctest** is being sent directly to a terminal, the
progress through the set of tests is reported by updating the same line
rather than printing start and end messages for each test on new lines.
This can significantly reduce the verbosity of the test output.
@@ -109,13 +110,23 @@ Options
This option tells CTest to write all its output to a log file.
-``-N,--show-only``
+``-N,--show-only[=<format>]``
Disable actual execution of tests.
This option tells CTest to list the tests that would be run but not
actually run them. Useful in conjunction with the ``-R`` and ``-E``
options.
+ ``<format>`` can be one of the following values.
+
+ ``human``
+ Human-friendly output. This is not guaranteed to be stable.
+ This is the default.
+
+ ``json-v1``
+ Dump the test information in JSON format.
+ See `Show as JSON Object Model`_.
+
``-L <regex>, --label-regex <regex>``
Run tests with labels matching regular expression.
@@ -313,10 +324,11 @@ See `Build and Test Mode`_.
Do not use.
``--timeout <seconds>``
- Set a global timeout on all tests.
+ Set the default test timeout.
- This option will set a global timeout on all tests that do not
- already have a timeout set on them.
+ This option effectively sets a timeout on all tests that do not
+ already have a timeout set on them via the :prop_test:`TIMEOUT`
+ property.
``--stop-time <time>``
Set a time at which all tests should stop running.
@@ -1069,7 +1081,7 @@ Configuration settings include:
* :module:`CTest` module variable: ``BUILDNAME``
``CDashVersion``
- Specify the version of `CDash`_ on the server.
+ Legacy option. Not used.
* `CTest Script`_ variable: none, detected from server
* :module:`CTest` module variable: ``CTEST_CDASH_VERSION``
@@ -1098,55 +1110,58 @@ Configuration settings include:
* :module:`CTest` module variable: ``CTEST_CURL_OPTIONS``
``DropLocation``
- The path on the dashboard server to send the submission.
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_LOCATION`
* :module:`CTest` module variable: ``DROP_LOCATION`` if set,
else ``CTEST_DROP_LOCATION``
``DropMethod``
- Specify the method by which results should be submitted to the
- dashboard server. The value may be ``cp``, ``ftp``, ``http``,
- ``https``, ``scp``, or ``xmlrpc`` (if CMake was built with
- support for it).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_METHOD`
* :module:`CTest` module variable: ``DROP_METHOD`` if set,
else ``CTEST_DROP_METHOD``
``DropSite``
- The dashboard server name
- (for ``ftp``, ``http``, and ``https``, ``scp``, and ``xmlrpc``).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE`
* :module:`CTest` module variable: ``DROP_SITE`` if set,
else ``CTEST_DROP_SITE``
``DropSitePassword``
- The dashboard server login password, if any
- (for ``ftp``, ``http``, and ``https``).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_PASSWORD`
* :module:`CTest` module variable: ``DROP_SITE_PASSWORD`` if set,
else ``CTEST_DROP_SITE_PASWORD``
``DropSiteUser``
- The dashboard server login user name, if any
- (for ``ftp``, ``http``, and ``https``).
+ Legacy option. When ``SubmitURL`` is not set, it is constructed from
+ ``DropMethod``, ``DropSiteUser``, ``DropSitePassword``, ``DropSite``, and
+ ``DropLocation``.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_USER`
* :module:`CTest` module variable: ``DROP_SITE_USER`` if set,
else ``CTEST_DROP_SITE_USER``
``IsCDash``
- Specify whether the dashboard server is `CDash`_ or an older
- dashboard server implementation requiring ``TriggerSite``.
+ Legacy option. Not used.
* `CTest Script`_ variable: :variable:`CTEST_DROP_SITE_CDASH`
* :module:`CTest` module variable: ``CTEST_DROP_SITE_CDASH``
``ScpCommand``
- ``scp`` command-line tool to use when ``DropMethod`` is ``scp``.
+ Legacy option. Not used.
* `CTest Script`_ variable: :variable:`CTEST_SCP_COMMAND`
* :module:`CTest` module variable: ``SCPCOMMAND``
@@ -1159,14 +1174,80 @@ Configuration settings include:
* :module:`CTest` module variable: ``SITE``,
initialized by the :command:`site_name` command
+``SubmitURL``
+ The ``http`` or ``https`` URL of the dashboard server to send the submission
+ to.
+
+ * `CTest Script`_ variable: :variable:`CTEST_SUBMIT_URL`
+ * :module:`CTest` module variable: ``SUBMIT_URL`` if set,
+ else ``CTEST_SUBMIT_URL``
+
``TriggerSite``
- Legacy option to support older dashboard server implementations.
- Not used when ``IsCDash`` is true.
+ Legacy option. Not used.
* `CTest Script`_ variable: :variable:`CTEST_TRIGGER_SITE`
* :module:`CTest` module variable: ``TRIGGER_SITE`` if set,
else ``CTEST_TRIGGER_SITE``
+.. _`Show as JSON Object Model`:
+
+Show as JSON Object Model
+=========================
+
+When the ``--show-only=json-v1`` command line option is given, the test
+information is output in JSON format. Version 1.0 of the JSON object
+model is defined as follows:
+
+``kind``
+ The string "ctestInfo".
+
+``version``
+ A JSON object specifying the version components. Its members are
+
+ ``major``
+ A non-negative integer specifying the major version component.
+ ``minor``
+ A non-negative integer specifying the minor version component.
+
+``backtraceGraph``
+ JSON object representing backtrace information with the
+ following members:
+
+ ``commands``
+ List of command names.
+ ``files``
+ List of file names.
+ ``nodes``
+ List of node JSON objects with members:
+
+ ``command``
+ Index into the ``commands`` member of the ``backtraceGraph``.
+ ``file``
+ Index into the ``files`` member of the ``backtraceGraph``.
+ ``line``
+ Line number in the file where the backtrace was added.
+ ``parent``
+ Index into the ``nodes`` member of the ``backtraceGraph``
+ representing the parent in the graph.
+
+``tests``
+ A JSON array listing information about each test. Each entry
+ is a JSON object with members:
+
+ ``name``
+ Test name.
+ ``config``
+ Configuration that the test can run on.
+ Empty string means any config.
+ ``command``
+ List where the first element is the test command and the
+ remaining elements are the command arguments.
+ ``backtrace``
+ Index into the ``nodes`` member of the ``backtraceGraph``.
+ ``properties``
+ Test properties.
+ Can contain keys for each of the supported test properties.
+
See Also
========
diff --git a/Help/module/CheckFortranSourceRuns.rst b/Help/module/CheckFortranSourceRuns.rst
new file mode 100644
index 000000000..a1bff7063
--- /dev/null
+++ b/Help/module/CheckFortranSourceRuns.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CheckFortranSourceRuns.cmake
diff --git a/Help/module/CheckPIESupported.rst b/Help/module/CheckPIESupported.rst
new file mode 100644
index 000000000..02e7b4316
--- /dev/null
+++ b/Help/module/CheckPIESupported.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/CheckPIESupported.cmake
diff --git a/Help/module/FindFontconfig.rst b/Help/module/FindFontconfig.rst
new file mode 100644
index 000000000..449fe09d0
--- /dev/null
+++ b/Help/module/FindFontconfig.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindFontconfig.cmake
diff --git a/Help/module/FindLibinput.rst b/Help/module/FindLibinput.rst
new file mode 100644
index 000000000..a8ca0b024
--- /dev/null
+++ b/Help/module/FindLibinput.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindLibinput.cmake
diff --git a/Help/module/FindSQLite3.rst b/Help/module/FindSQLite3.rst
new file mode 100644
index 000000000..d1910e5a6
--- /dev/null
+++ b/Help/module/FindSQLite3.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindSQLite3.cmake
diff --git a/Help/policy/CMP0049.rst b/Help/policy/CMP0049.rst
index a3ce4b1fa..291bf5752 100644
--- a/Help/policy/CMP0049.rst
+++ b/Help/policy/CMP0049.rst
@@ -3,14 +3,14 @@ CMP0049
Do not expand variables in target source entries.
-CMake 2.8.12 and lower performed and extra layer of variable expansion
-when evaluating source file names:
-
-.. code-block:: cmake
+CMake 2.8.12 and lower performed an extra layer of variable expansion
+when evaluating source file names::
set(a_source foo.c)
add_executable(foo \${a_source})
+.. note: no cmake highlighting since this syntax is deprecated
+
This was undocumented behavior.
The OLD behavior for this policy is to expand such variables when processing
diff --git a/Help/policy/CMP0078.rst b/Help/policy/CMP0078.rst
index 54cdc9cc7..2e97934f4 100644
--- a/Help/policy/CMP0078.rst
+++ b/Help/policy/CMP0078.rst
@@ -1,6 +1,8 @@
CMP0078
-------
+:module:`UseSWIG` generates standard target names.
+
Starting with CMake 3.13, :module:`UseSWIG` generates now standard target
names. This policy provides compatibility with projects that expect the legacy
behavior.
diff --git a/Help/policy/CMP0082.rst b/Help/policy/CMP0082.rst
new file mode 100644
index 000000000..8256444c8
--- /dev/null
+++ b/Help/policy/CMP0082.rst
@@ -0,0 +1,26 @@
+CMP0082
+-------
+
+Install rules from :command:`add_subdirectory` calls are interleaved with
+those in caller.
+
+CMake 3.13 and lower ran the install rules from :command:`add_subdirectory`
+after all other install rules, even if :command:`add_subdirectory` was called
+before the other install rules. CMake 3.14 and above prefer to interleave
+these :command:`add_subdirectory` install rules with the others so that
+they are run in the order they are declared. This policy provides
+compatibility for projects that have not been updated to expect the
+new behavior.
+
+The ``OLD`` behavior for this policy is to run the install rules from
+:command:`add_subdirectory` after the other install rules. The ``NEW``
+behavior for this policy is to run all install rules in the order they are
+declared.
+
+This policy was introduced in CMake version 3.14. Unlike most policies,
+CMake version |release| does *not* warn by default when this policy
+is not set and simply uses OLD behavior. See documentation of the
+:variable:`CMAKE_POLICY_WARNING_CMP0082 <CMAKE_POLICY_WARNING_CMP<NNNN>>`
+variable to control the warning.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0083.rst b/Help/policy/CMP0083.rst
new file mode 100644
index 000000000..32acf1f12
--- /dev/null
+++ b/Help/policy/CMP0083.rst
@@ -0,0 +1,63 @@
+CMP0083
+-------
+
+To control generation of Position Independent Executable (``PIE``) or not, some
+flags are required at link time.
+
+CMake 3.13 and lower did not add these link flags when
+:prop_tgt:`POSITION_INDEPENDENT_CODE` is set.
+
+The ``OLD`` behavior for this policy is to not manage ``PIE`` link flags. The
+``NEW`` behavior is to add link flags if :prop_tgt:`POSITION_INDEPENDENT_CODE`
+is set:
+
+* Set to ``TRUE``: flags to produce a position independent executable are
+ passed to the linker step. For example ``-pie`` for ``GCC``.
+* Set to ``FALSE``: flags not to produce a position independent executable are
+ passed to the linker step. For example ``-no-pie`` for ``GCC``.
+* Not set: no flags are passed to the linker step.
+
+Since a given linker may not support ``PIE`` flags in all environments in
+which it is used, it is the project's responsibility to use the
+:module:`CheckPIESupported` module to check for support to ensure that the
+:prop_tgt:`POSITION_INDEPENDENT_CODE` target property for executables will be
+honored at link time.
+
+This policy was introduced in CMake version 3.14. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike most policies, CMake version |release| does not warn when this policy is
+not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
+
+Examples
+^^^^^^^^
+
+Behave like CMake 3.13 and do not apply any ``PIE`` flags at link stage.
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION 3.13)
+ project(foo)
+
+ # ...
+
+ add_executable(foo ...)
+ set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+
+Use the :module:`CheckPIESupported` module to detect whether ``PIE`` is
+supported by the current linker and environment. Apply ``PIE`` flags only
+if the linker supports them.
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION 3.14) # CMP0083 NEW
+ project(foo)
+
+ include(CheckPIESupported)
+ check_pie_supported()
+
+ # ...
+
+ add_executable(foo ...)
+ set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
diff --git a/Help/policy/CMP0084.rst b/Help/policy/CMP0084.rst
new file mode 100644
index 000000000..713d295f8
--- /dev/null
+++ b/Help/policy/CMP0084.rst
@@ -0,0 +1,26 @@
+CMP0084
+-------
+
+The :module:`FindQt` module does not exist for :command:`find_package`.
+
+The existence of :module:`FindQt` means that for Qt upstream to provide
+package config files that can be found by ``find_package(Qt)``, the consuming
+project has to explicitly specify ``find_package(Qt CONFIG)``. Removing this
+module gives Qt a path forward for exporting its own config files which can
+easily be found by consuming projects.
+
+This policy pretends that CMake's internal :module:`FindQt` module does not
+exist for :command:`find_package`. If a project really wants to use Qt 3 or 4,
+it can call ``find_package(Qt[34])``, ``include(FindQt)``, or add
+:module:`FindQt` to their :variable:`CMAKE_MODULE_PATH`.
+
+The ``OLD`` behavior of this policy is for :module:`FindQt` to exist for
+:command:`find_package`. The ``NEW`` behavior is to pretend that it doesn't
+exist for :command:`find_package`.
+
+This policy was introduced in CMake version 3.14. CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0085.rst b/Help/policy/CMP0085.rst
new file mode 100644
index 000000000..d9ec9a207
--- /dev/null
+++ b/Help/policy/CMP0085.rst
@@ -0,0 +1,21 @@
+CMP0085
+-------
+
+``$<IN_LIST:...>`` handles empty list items.
+
+In CMake 3.13 and lower, the ``$<IN_LIST:...>`` generator expression always
+returned ``0`` if the first argument was empty, even if the list contained an
+empty item. This behavior is inconsistent with the ``IN_LIST`` behavior of
+:command:`if`, which this generator expression is meant to emulate. CMake 3.14
+and later handles this case correctly.
+
+The ``OLD`` behavior of this policy is for ``$<IN_LIST:...>`` to always return
+``0`` if the first argument is empty. The ``NEW`` behavior is to return ``1``
+if the first argument is empty and the list contains an empty item.
+
+This policy was introduced in CMake version 3.14. CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0086.rst b/Help/policy/CMP0086.rst
new file mode 100644
index 000000000..4a9e8b80a
--- /dev/null
+++ b/Help/policy/CMP0086.rst
@@ -0,0 +1,20 @@
+CMP0086
+-------
+
+:module:`UseSWIG` honors ``SWIG_MODULE_NAME`` via ``-module`` flag.
+
+Starting with CMake 3.14, :module:`UseSWIG` passes option
+``-module <module_name>`` to ``SWIG`` compiler if the file property
+``SWIG_MODULE_NAME`` is specified. This policy provides compatibility with
+projects that expect the legacy behavior.
+
+The ``OLD`` behavior for this policy is to never pass ``-module`` option.
+The ``NEW`` behavior is to pass ``-module`` option to ``SWIG`` compiler if
+``SWIG_MODULE_NAME`` is specified.
+
+This policy was introduced in CMake version 3.14. CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0087.rst b/Help/policy/CMP0087.rst
new file mode 100644
index 000000000..4c45b99e4
--- /dev/null
+++ b/Help/policy/CMP0087.rst
@@ -0,0 +1,29 @@
+CMP0087
+-------
+
+:command:`install(CODE)` and :command:`install(SCRIPT)` support generator
+expressions.
+
+In CMake 3.13 and earlier, :command:`install(CODE)` and
+:command:`install(SCRIPT)` did not evaluate generator expressions. CMake 3.14
+and later will evaluate generator expressions for :command:`install(CODE)` and
+:command:`install(SCRIPT)`.
+
+The ``OLD`` behavior of this policy is for :command:`install(CODE)` and
+:command:`install(SCRIPT)` to not evaluate generator expressions. The ``NEW``
+behavior is to evaluate generator expressions for :command:`install(CODE)` and
+:command:`install(SCRIPT)`.
+
+Note that it is the value of this policy setting at the end of the directory
+scope that is important, not its setting at the time of the call to
+:command:`install(CODE)` or :command:`install(SCRIPT)`. This has implications
+for calling these commands from places that have their own policy scope but not
+their own directory scope (e.g. from files brought in via :command:`include()`
+rather than :command:`add_subdirectory()`).
+
+This policy was introduced in CMake version 3.14. CMake version
+|release| warns when the policy is not set and uses ``OLD`` behavior.
+Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
+explicitly.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/policy/CMP0088.rst b/Help/policy/CMP0088.rst
new file mode 100644
index 000000000..82c04ef7b
--- /dev/null
+++ b/Help/policy/CMP0088.rst
@@ -0,0 +1,29 @@
+CMP0088
+-------
+
+:module:`FindBISON` runs bison in :variable:`CMAKE_CURRENT_BINARY_DIR`
+when executing.
+
+The module provides a ``BISON_TARGET`` macro which generates BISON output.
+In CMake 3.13 and below the macro would generate a custom command that runs
+``bison`` in the source directory. CMake 3.14 and later prefer to run it
+in the build directory and use :variable:`CMAKE_CURRENT_BINARY_DIR` as the
+``WORKING_DIRECTORY`` of its :command:`add_custom_command` invocation.
+This ensures that any implicitly generated file is written to the build
+tree rather than the source.
+
+This policy provides compatibility for projects that have not been updated
+to expect the new behavior.
+
+The ``OLD`` behavior for this policy is for ``BISON_TARGET`` to use
+the current source directory for the ``WORKING_DIRECTORY`` and where
+to generate implicit files. The ``NEW`` behavior of this policy is to
+use the current binary directory for the ``WORKING_DIRECTORY`` and where
+to generate implicit files.
+
+This policy was introduced in CMake version 3.14. Use the
+:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
+Unlike most policies, CMake version |release| does *not* warn
+when this policy is not set and simply uses ``OLD`` behavior.
+
+.. include:: DEPRECATED.txt
diff --git a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
index da907cb93..04bb56ec1 100644
--- a/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
+++ b/Help/prop_dir/BUILDSYSTEM_TARGETS.rst
@@ -2,7 +2,7 @@ BUILDSYSTEM_TARGETS
-------------------
This read-only directory property contains a
-:ref:`;-list <CMake Language Lists>` of buildsystem targets added in the
+:ref:`semicolon-separated list <CMake Language Lists>` of buildsystem targets added in the
directory by calls to the :command:`add_library`, :command:`add_executable`,
and :command:`add_custom_target` commands. The list does not include any
:ref:`Imported Targets` or :ref:`Alias Targets`, but does include
diff --git a/Help/prop_dir/COMPILE_OPTIONS.rst b/Help/prop_dir/COMPILE_OPTIONS.rst
index 877deb000..48e8b9b8d 100644
--- a/Help/prop_dir/COMPILE_OPTIONS.rst
+++ b/Help/prop_dir/COMPILE_OPTIONS.rst
@@ -3,7 +3,7 @@ COMPILE_OPTIONS
List of options to pass to the compiler.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
given so far to the :command:`add_compile_options` command.
This property is used to initialize the :prop_tgt:`COMPILE_OPTIONS` target
diff --git a/Help/prop_dir/EXCLUDE_FROM_ALL.rst b/Help/prop_dir/EXCLUDE_FROM_ALL.rst
index 1aa24e44b..9d3192c1b 100644
--- a/Help/prop_dir/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_dir/EXCLUDE_FROM_ALL.rst
@@ -7,3 +7,9 @@ A property on a directory that indicates if its targets are excluded
from the default build target. If it is not, then with a Makefile for
example typing make will cause the targets to be built. The same
concept applies to the default build of other generators.
+
+Targets inherit the :prop_tgt:`EXCLUDE_FROM_ALL` property from the directory
+that they are created in. When a directory is excluded, all of its targets will
+have :prop_tgt:`EXCLUDE_FROM_ALL` set to ``TRUE``. After creating such a target
+you can change its :prop_tgt:`EXCLUDE_FROM_ALL` property to ``FALSE``. This
+will cause the target to be included in the default build target.
diff --git a/Help/prop_dir/LINK_DIRECTORIES.rst b/Help/prop_dir/LINK_DIRECTORIES.rst
index f9fb81535..44dc2304e 100644
--- a/Help/prop_dir/LINK_DIRECTORIES.rst
+++ b/Help/prop_dir/LINK_DIRECTORIES.rst
@@ -3,7 +3,7 @@ LINK_DIRECTORIES
List of linker search directories.
-This property holds a :ref:`;-list <CMake Language Lists>` of directories
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of directories
and is typically populated using the :command:`link_directories` command.
It gets its initial value from its parent directory, if it has one.
diff --git a/Help/prop_dir/LINK_OPTIONS.rst b/Help/prop_dir/LINK_OPTIONS.rst
index 15c555fda..54ac6ddaa 100644
--- a/Help/prop_dir/LINK_OPTIONS.rst
+++ b/Help/prop_dir/LINK_OPTIONS.rst
@@ -4,7 +4,7 @@ LINK_OPTIONS
List of options to use for the link step of shared library, module
and executable targets.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
given so far to the :command:`add_link_options` command.
This property is used to initialize the :prop_tgt:`LINK_OPTIONS` target
diff --git a/Help/prop_dir/SUBDIRECTORIES.rst b/Help/prop_dir/SUBDIRECTORIES.rst
index 2c2ea773e..6a0ac80d8 100644
--- a/Help/prop_dir/SUBDIRECTORIES.rst
+++ b/Help/prop_dir/SUBDIRECTORIES.rst
@@ -2,7 +2,7 @@ SUBDIRECTORIES
--------------
This read-only directory property contains a
-:ref:`;-list <CMake Language Lists>` of subdirectories processed so far by
+:ref:`semicolon-separated list <CMake Language Lists>` of subdirectories processed so far by
the :command:`add_subdirectory` or :command:`subdirs` commands. Each entry is
the absolute path to the source directory (containing the ``CMakeLists.txt``
file). This is suitable to pass to the :command:`get_property` command
diff --git a/Help/prop_dir/TESTS.rst b/Help/prop_dir/TESTS.rst
index 91acd3e7e..56e230eb7 100644
--- a/Help/prop_dir/TESTS.rst
+++ b/Help/prop_dir/TESTS.rst
@@ -3,5 +3,5 @@ TESTS
List of tests.
-This read-only property holds a :ref:`;-list <CMake Language Lists>` of tests
+This read-only property holds a :ref:`semicolon-separated list <CMake Language Lists>` of tests
defined so far, in the current directory, by the :command:`add_test` command.
diff --git a/Help/prop_gbl/CMAKE_ROLE.rst b/Help/prop_gbl/CMAKE_ROLE.rst
new file mode 100644
index 000000000..27512fada
--- /dev/null
+++ b/Help/prop_gbl/CMAKE_ROLE.rst
@@ -0,0 +1,20 @@
+CMAKE_ROLE
+----------
+
+Tells what mode the current running script is in. Could be one of several
+values:
+
+``PROJECT``
+ Running in project mode (processing a ``CMakeLists.txt`` file).
+
+``SCRIPT``
+ Running in ``-P`` script mode.
+
+``FIND_PACKAGE``
+ Running in ``--find-package`` mode.
+
+``CTEST``
+ Running in CTest script mode.
+
+``CPACK``
+ Running in CPack.
diff --git a/Help/prop_sf/COMPILE_OPTIONS.rst b/Help/prop_sf/COMPILE_OPTIONS.rst
index 3b2bc8da2..7e48271d0 100644
--- a/Help/prop_sf/COMPILE_OPTIONS.rst
+++ b/Help/prop_sf/COMPILE_OPTIONS.rst
@@ -3,7 +3,7 @@ COMPILE_OPTIONS
List of additional options to pass to the compiler.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
and will be added to the list of compile flags when this
source file builds. Use :prop_sf:`COMPILE_DEFINITIONS` to pass
additional preprocessor definitions and :prop_sf:`INCLUDE_DIRECTORIES` to pass
diff --git a/Help/prop_sf/INCLUDE_DIRECTORIES.rst b/Help/prop_sf/INCLUDE_DIRECTORIES.rst
index 55780e560..23de70e16 100644
--- a/Help/prop_sf/INCLUDE_DIRECTORIES.rst
+++ b/Help/prop_sf/INCLUDE_DIRECTORIES.rst
@@ -3,7 +3,7 @@ INCLUDE_DIRECTORIES
List of preprocessor include file search directories.
-This property holds a :ref:`;-list <CMake Language Lists>` of paths
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of paths
and will be added to the list of include directories when this
source file builds. These directories will take precedence over directories
defined at target level except for :generator:`Xcode` generator due to technical
diff --git a/Help/prop_sf/OBJECT_DEPENDS.rst b/Help/prop_sf/OBJECT_DEPENDS.rst
index 1d24960b5..aaff95659 100644
--- a/Help/prop_sf/OBJECT_DEPENDS.rst
+++ b/Help/prop_sf/OBJECT_DEPENDS.rst
@@ -3,7 +3,7 @@ OBJECT_DEPENDS
Additional files on which a compiled object file depends.
-Specifies a :ref:`;-list <CMake Language Lists>` of full-paths to
+Specifies a :ref:`semicolon-separated list <CMake Language Lists>` of full-paths to
files on which any object files compiled from this source file depend.
On :ref:`Makefile Generators` and the :generator:`Ninja` generator an
object file will be recompiled if any of the named files is newer than it.
diff --git a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
index bc673804d..d0cd29de8 100644
--- a/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
+++ b/Help/prop_tgt/ANDROID_NATIVE_LIB_DIRECTORIES.rst
@@ -1,8 +1,8 @@
ANDROID_NATIVE_LIB_DIRECTORIES
------------------------------
-Set the Android property that specifies directories to search for the
-.so libraries.
+Set the Android property that specifies directories to search for the ``.so``
+libraries.
This a string property that contains the directory paths separated
by semicolons.
diff --git a/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
new file mode 100644
index 000000000..022bab502
--- /dev/null
+++ b/Help/prop_tgt/AUTOGEN_ORIGIN_DEPENDS.rst
@@ -0,0 +1,38 @@
+AUTOGEN_ORIGIN_DEPENDS
+----------------------
+
+Switch for forwarding origin target dependencies to the corresponding
+``_autogen`` target.
+
+Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property
+``ON`` have a corresponding ``_autogen`` target which generates
+``moc`` and ``uic`` files. As this ``_autogen`` target is created at
+generate-time, it is not possible to define dependencies of it using
+e.g. :command:`add_dependencies`. Instead the
+:prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property decides whether the origin
+target dependencies should be forwarded to the ``_autogen`` target or not.
+
+By default :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is initialized from
+:variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` which is ``ON`` by default.
+
+In total the dependencies of the ``_autogen`` target are composed from
+
+- forwarded origin target dependencies
+ (enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`)
+- additional user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS`
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
+
+Note
+^^^^
+
+Disabling :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is useful to avoid building of
+origin target dependencies when building the ``_autogen`` target only.
+This is especially interesting when a
+:variable:`global autogen target <CMAKE_GLOBAL_AUTOGEN_TARGET>` is enabled.
+
+When the ``_autogen`` target doesn't require all the origin target's
+dependencies, and :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` is disabled, it might be
+necessary to extend :prop_tgt:`AUTOGEN_TARGET_DEPENDS` to add missing
+dependencies.
diff --git a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
index 7d3dfd1b7..d5c5e147d 100644
--- a/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
+++ b/Help/prop_tgt/AUTOGEN_TARGET_DEPENDS.rst
@@ -1,17 +1,22 @@
AUTOGEN_TARGET_DEPENDS
----------------------
-Target dependencies of the corresponding ``_autogen`` target.
+Additional target dependencies of the corresponding ``_autogen`` target.
Targets which have their :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` property
-``ON`` have a corresponding ``_autogen`` target which is used to auto generate
+``ON`` have a corresponding ``_autogen`` target which generates
``moc`` and ``uic`` files. As this ``_autogen`` target is created at
-generate-time, it is not possible to define dependencies of it,
-such as to create inputs for the ``moc`` or ``uic`` executable.
+generate-time, it is not possible to define dependencies of it using
+e.g. :command:`add_dependencies`. Instead the
+:prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set to a
+:ref:`;-list <CMake Language Lists>` of additional dependencies for the
+``_autogen`` target. Dependencies can be target names or file names.
-The :prop_tgt:`AUTOGEN_TARGET_DEPENDS` target property can be set instead to a
-list of dependencies of the ``_autogen`` target. Dependencies can be target
-names or file names.
+In total the dependencies of the ``_autogen`` target are composed from
+
+- forwarded origin target dependencies
+ (enabled by default via :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`)
+- additional user defined dependencies from :prop_tgt:`AUTOGEN_TARGET_DEPENDS`
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
@@ -26,6 +31,6 @@ If :prop_tgt:`AUTOMOC` or :prop_tgt:`AUTOUIC` depends on a file that is either
- a :prop_sf:`GENERATED` C++ file that isn't recognized by :prop_tgt:`AUTOMOC`
and :prop_tgt:`AUTOUIC` because it's skipped by :prop_sf:`SKIP_AUTOMOC`,
:prop_sf:`SKIP_AUTOUIC`, :prop_sf:`SKIP_AUTOGEN` or :policy:`CMP0071` or
-- a file that isn't in the target's sources
+- a file that isn't in the origin target's sources
it must added to :prop_tgt:`AUTOGEN_TARGET_DEPENDS`.
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 3bd693a19..3e6d5602d 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -3,8 +3,8 @@ AUTOMOC
Should the target be processed with automoc (for Qt projects).
-AUTOMOC is a boolean specifying whether CMake will handle the Qt ``moc``
-preprocessor automatically, i.e. without having to use the
+:prop_tgt:`AUTOMOC` is a boolean specifying whether CMake will handle the Qt
+``moc`` preprocessor automatically, i.e. without having to use the
:module:`QT4_WRAP_CPP() <FindQt4>` or QT5_WRAP_CPP() macro.
Currently Qt4 and Qt5 are supported.
@@ -58,6 +58,9 @@ source files at build time and invoke moc accordingly.
This property is initialized by the value of the :variable:`CMAKE_AUTOMOC`
variable if it is set when a target is created.
+The ``moc`` executable will be detected automatically, but can be forced to
+a certain binary using the :prop_tgt:`AUTOMOC_EXECUTABLE` property.
+
Additional command line options for ``moc`` can be set via the
:prop_tgt:`AUTOMOC_MOC_OPTIONS` property.
@@ -86,5 +89,9 @@ enabling :prop_sf:`SKIP_AUTOMOC` or the broader :prop_sf:`SKIP_AUTOGEN`.
The number of parallel ``moc`` processes to start can be modified by
setting :prop_tgt:`AUTOGEN_PARALLEL`.
+A global ``autogen`` target that depends on all :prop_tgt:`AUTOMOC` generated
+``<ORIGIN>_autogen`` targets in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst
new file mode 100644
index 000000000..6b66ce81f
--- /dev/null
+++ b/Help/prop_tgt/AUTOMOC_EXECUTABLE.rst
@@ -0,0 +1,15 @@
+AUTOMOC_EXECUTABLE
+------------------
+
+:prop_tgt:`AUTOMOC_EXECUTABLE` is file path pointing to the ``moc``
+executable to use for :prop_tgt:`AUTOMOC` enabled files. Setting
+this property will make CMake skip the automatic detection of the
+``moc`` binary as well as the sanity-tests normally run to ensure
+that the binary is available and working as expected.
+
+Usually this property does not need to be set. Only consider this
+property if auto-detection of ``moc`` can not work -- e.g. because
+you are building the ``moc`` binary as part of your project.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
index a9a0ecf1e..5329bbac9 100644
--- a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
+++ b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
@@ -1,7 +1,7 @@
AUTOMOC_MACRO_NAMES
-------------------
-A :ref:`;-list <CMake Language Lists>` list of macro names used by
+A :ref:`semicolon-separated list <CMake Language Lists>` list of macro names used by
:prop_tgt:`AUTOMOC` to determine if a C++ file needs to be processed by ``moc``.
This property is only used if the :prop_tgt:`AUTOMOC` property is ``ON``
diff --git a/Help/prop_tgt/AUTORCC.rst b/Help/prop_tgt/AUTORCC.rst
index 3cc5990ac..5db6ed02e 100644
--- a/Help/prop_tgt/AUTORCC.rst
+++ b/Help/prop_tgt/AUTORCC.rst
@@ -3,7 +3,7 @@ AUTORCC
Should the target be processed with autorcc (for Qt projects).
-``AUTORCC`` is a boolean specifying whether CMake will handle
+:prop_tgt:`AUTORCC` is a boolean specifying whether CMake will handle
the Qt ``rcc`` code generator automatically, i.e. without having to use
the :module:`QT4_ADD_RESOURCES() <FindQt4>` or ``QT5_ADD_RESOURCES()``
macro. Currently Qt4 and Qt5 are supported.
@@ -21,6 +21,9 @@ If the ``.qrc`` file is :prop_sf:`GENERATED` though, a
Additional command line options for rcc can be set via the
:prop_sf:`AUTORCC_OPTIONS` source file property on the ``.qrc`` file.
+The ``rcc`` executable will be detected automatically, but can be forced to
+a certain binary using the :prop_tgt:`AUTORCC_EXECUTABLE` property.
+
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group
the autorcc targets together in an IDE, e.g. in MSVS.
@@ -35,5 +38,9 @@ generate unspecified unique names for ``rcc``. Therefore if
Source files can be excluded from :prop_tgt:`AUTORCC` processing by
enabling :prop_sf:`SKIP_AUTORCC` or the broader :prop_sf:`SKIP_AUTOGEN`.
+A global ``autorcc`` target that depends on all :prop_tgt:`AUTORCC` targets
+in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTORCC_TARGET`.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTORCC_EXECUTABLE.rst b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst
new file mode 100644
index 000000000..ca0fbd75b
--- /dev/null
+++ b/Help/prop_tgt/AUTORCC_EXECUTABLE.rst
@@ -0,0 +1,15 @@
+AUTORCC_EXECUTABLE
+------------------
+
+:prop_tgt:`AUTORCC_EXECUTABLE` is file path pointing to the ``rcc``
+executable to use for :prop_tgt:`AUTORCC` enabled files. Setting
+this property will make CMake skip the automatic detection of the
+``rcc`` binary as well as the sanity-tests normally run to ensure
+that the binary is available and working as expected.
+
+Usually this property does not need to be set. Only consider this
+property if auto-detection of ``rcc`` can not work -- e.g. because
+you are building the ``rcc`` binary as part of your project.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst
index 4fc603fa6..85226c15f 100644
--- a/Help/prop_tgt/AUTOUIC.rst
+++ b/Help/prop_tgt/AUTOUIC.rst
@@ -3,7 +3,7 @@ AUTOUIC
Should the target be processed with autouic (for Qt projects).
-``AUTOUIC`` is a boolean specifying whether CMake will handle
+:prop_tgt:`AUTOUIC` is a boolean specifying whether CMake will handle
the Qt ``uic`` code generator automatically, i.e. without having to use
the :module:`QT4_WRAP_UI() <FindQt4>` or ``QT5_WRAP_UI()`` macro. Currently
Qt4 and Qt5 are supported.
@@ -30,11 +30,18 @@ Additional command line options for ``uic`` can be set via the
The global property :prop_gbl:`AUTOGEN_TARGETS_FOLDER` can be used to group the
autouic targets together in an IDE, e.g. in MSVS.
+The ``uic`` executable will be detected automatically, but can be forced to
+a certain binary using the :prop_tgt:`AUTOUIC_EXECUTABLE` property.
+
Source files can be excluded from :prop_tgt:`AUTOUIC` processing by
enabling :prop_sf:`SKIP_AUTOUIC` or the broader :prop_sf:`SKIP_AUTOGEN`.
The number of parallel ``uic`` processes to start can be modified by
setting :prop_tgt:`AUTOGEN_PARALLEL`.
+A global ``autogen`` target that depends on all :prop_tgt:`AUTOUIC` generated
+``<ORIGIN>_autogen`` targets in the project can be generated by enabling
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`.
+
See the :manual:`cmake-qt(7)` manual for more information on using CMake
with Qt.
diff --git a/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst
new file mode 100644
index 000000000..03bd55499
--- /dev/null
+++ b/Help/prop_tgt/AUTOUIC_EXECUTABLE.rst
@@ -0,0 +1,15 @@
+AUTOUIC_EXECUTABLE
+------------------
+
+:prop_tgt:`AUTOUIC_EXECUTABLE` is file path pointing to the ``uic``
+executable to use for :prop_tgt:`AUTOUIC` enabled files. Setting
+this property will make CMake skip the automatic detection of the
+``uic`` binary as well as the sanity-tests normally run to ensure
+that the binary is available and working as expected.
+
+Usually this property does not need to be set. Only consider this
+property if auto-detection of ``uic`` can not work -- e.g. because
+you are building the ``uic`` binary as part of your project.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/prop_tgt/BUILD_RPATH.rst b/Help/prop_tgt/BUILD_RPATH.rst
index 27393f5d7..13c9c1de8 100644
--- a/Help/prop_tgt/BUILD_RPATH.rst
+++ b/Help/prop_tgt/BUILD_RPATH.rst
@@ -1,7 +1,7 @@
BUILD_RPATH
-----------
-A :ref:`;-list <CMake Language Lists>` specifying runtime path (``RPATH``)
+A :ref:`semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``)
entries to add to binaries linked in the build tree (for platforms that
support it). The entries will *not* be used for binaries in the install
tree. See also the :prop_tgt:`INSTALL_RPATH` target property.
diff --git a/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
new file mode 100644
index 000000000..337879780
--- /dev/null
+++ b/Help/prop_tgt/BUILD_RPATH_USE_ORIGIN.rst
@@ -0,0 +1,24 @@
+BUILD_RPATH_USE_ORIGIN
+----------------------
+
+Whether to use relative paths for the build ``RPATH``.
+
+This property is initialized by the value of the variable
+:variable:`CMAKE_BUILD_RPATH_USE_ORIGIN`.
+
+On platforms that support runtime paths (``RPATH``) with the
+``$ORIGIN`` token, setting this property to ``TRUE`` enables relative
+paths in the build ``RPATH`` for executables and shared libraries that
+point to shared libraries in the same build tree.
+
+Normally the build ``RPATH`` of a binary contains absolute paths
+to the directory of each shared library it links to. The ``RPATH``
+entries for directories contained within the build tree can be made
+relative to enable relocatable builds and to help achieve reproducible
+builds by omitting the build directory from the build environment.
+
+This property has no effect on platforms that do not support the
+``$ORIGIN`` token in ``RPATH``, or when the :variable:`CMAKE_SKIP_RPATH`
+variable is set. The runtime path set through the
+:prop_tgt:`BUILD_RPATH` target property is also unaffected by this
+property.
diff --git a/Help/prop_tgt/COMPILE_OPTIONS.rst b/Help/prop_tgt/COMPILE_OPTIONS.rst
index 892ac23e1..0cd683610 100644
--- a/Help/prop_tgt/COMPILE_OPTIONS.rst
+++ b/Help/prop_tgt/COMPILE_OPTIONS.rst
@@ -3,7 +3,7 @@ COMPILE_OPTIONS
List of options to pass to the compiler.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
specified so far for its target. Use the :command:`target_compile_options`
command to append more options.
diff --git a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
index 127d79fb3..ef74ae26f 100644
--- a/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
+++ b/Help/prop_tgt/CUDA_RESOLVE_DEVICE_SYMBOLS.rst
@@ -1,12 +1,18 @@
CUDA_RESOLVE_DEVICE_SYMBOLS
---------------------------
-CUDA only: Enables device linking for the specific static library target
+CUDA only: Enables device linking for the specific library target
-If set this will enable device linking on this static library target. Normally
+If set this will enable device linking on the library target. Normally
device linking is deferred until a shared library or executable is generated,
allowing for multiple static libraries to resolve device symbols at the same
-time.
+time when they are used by a shared library or executable.
+
+By default static library targets have this property is disabled,
+while shared, module, and executable targets have this property enabled.
+
+Note that device linking is not supported for :ref:`Object Libraries`.
+
For instance:
diff --git a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
index caa5741f8..0eee29792 100644
--- a/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
+++ b/Help/prop_tgt/EXCLUDE_FROM_ALL.rst
@@ -6,5 +6,16 @@ Exclude the target from the all target.
A property on a target that indicates if the target is excluded from
the default build target. If it is not, then with a Makefile for
example typing make will cause this target to be built. The same
-concept applies to the default build of other generators. Installing
-a target with EXCLUDE_FROM_ALL set to true has undefined behavior.
+concept applies to the default build of other generators.
+
+With ``EXCLUDE_FROM_ALL`` set to false or not set at all, the target
+will be brought up to date as part of doing a ``make install`` or its
+equivalent for the CMake generator being used. If a target has
+``EXCLUDE_FROM_ALL`` set to true, then any attempt to install that
+target has undefined behavior. Note that such a target can still safely
+be listed in an :command:`install(TARGETS)` command as long as the install
+components the target belongs to are not part of the set of components
+that anything tries to install.
+
+This property is enabled by default for targets that are created in
+directories that have :prop_dir:`EXCLUDE_FROM_ALL` set to ``TRUE``.
diff --git a/Help/prop_tgt/GHS_INTEGRITY_APP.rst b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
new file mode 100644
index 000000000..764303850
--- /dev/null
+++ b/Help/prop_tgt/GHS_INTEGRITY_APP.rst
@@ -0,0 +1,10 @@
+GHS_INTEGRITY_APP
+-----------------
+
+``ON`` / ``OFF`` boolean to determine if an executable target should
+be treated as an `Integrity Application`.
+
+If no value is set and if a `.int` file is added as a source file to the
+executable target it will be treated as an `Integrity Application`.
+
+Supported on :generator:`Green Hills MULTI`.
diff --git a/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
new file mode 100644
index 000000000..11ce0b223
--- /dev/null
+++ b/Help/prop_tgt/GHS_NO_SOURCE_GROUP_FILE.rst
@@ -0,0 +1,13 @@
+GHS_NO_SOURCE_GROUP_FILE
+------------------------
+
+``ON`` / ``OFF`` boolean to control if the project file for a target should
+be one single file or multiple files.
+
+The default behavior or when the property is ``OFF`` is to generate a project
+file for the target and then a sub-project file for each source group.
+
+When this property is ``ON`` or if :variable:`CMAKE_GHS_NO_SOURCE_GROUP_FILE`
+is ``ON`` then only a single project file is generated for the target.
+
+Supported on :generator:`Green Hills MULTI`.
diff --git a/Help/prop_tgt/IMPORTED_OBJECTS.rst b/Help/prop_tgt/IMPORTED_OBJECTS.rst
index 222e6cc02..50a329fb3 100644
--- a/Help/prop_tgt/IMPORTED_OBJECTS.rst
+++ b/Help/prop_tgt/IMPORTED_OBJECTS.rst
@@ -1,7 +1,7 @@
IMPORTED_OBJECTS
----------------
-:ref:`;-list <CMake Language Lists>` of absolute paths to the object
+A :ref:`semicolon-separated list <CMake Language Lists>` of absolute paths to the object
files on disk for an :ref:`imported <Imported targets>`
:ref:`object library <object libraries>`.
diff --git a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
index ea700dfe9..4336d7182 100644
--- a/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
+++ b/Help/prop_tgt/INTERFACE_POSITION_INDEPENDENT_CODE.rst
@@ -14,3 +14,9 @@ undefined, then consumers will determine their
:prop_tgt:`POSITION_INDEPENDENT_CODE` property by other means. Consumers
must ensure that the targets that they link to have a consistent
requirement for their ``INTERFACE_POSITION_INDEPENDENT_CODE`` property.
+
+Contents of ``INTERFACE_POSITION_INDEPENDENT_CODE`` may use
+"generator expressions" with the syntax ``$<...>``. See the
+:manual:`cmake-generator-expressions(7)` manual for available expressions.
+See the :manual:`cmake-buildsystem(7)` manual for more on defining buildsystem
+properties.
diff --git a/Help/prop_tgt/LANG_CLANG_TIDY.rst b/Help/prop_tgt/LANG_CLANG_TIDY.rst
index 2887e235d..2bfef6673 100644
--- a/Help/prop_tgt/LANG_CLANG_TIDY.rst
+++ b/Help/prop_tgt/LANG_CLANG_TIDY.rst
@@ -3,7 +3,7 @@
This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
line for the ``clang-tidy`` tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run this tool along with the
compiler and report a warning if the tool reports any problems.
diff --git a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
index b63d6d78a..23af503af 100644
--- a/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
+++ b/Help/prop_tgt/LANG_COMPILER_LAUNCHER.rst
@@ -4,7 +4,7 @@
This property is implemented only when ``<LANG>`` is ``C``, ``CXX``,
``Fortran``, or ``CUDA``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command line
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
for a compiler launching tool. The :ref:`Makefile Generators` and the
:generator:`Ninja` generator will run this tool and pass the compiler and
its arguments to the tool. Some example tools are distcc and ccache.
diff --git a/Help/prop_tgt/LANG_CPPCHECK.rst b/Help/prop_tgt/LANG_CPPCHECK.rst
index 5f8be00f1..60785d062 100644
--- a/Help/prop_tgt/LANG_CPPCHECK.rst
+++ b/Help/prop_tgt/LANG_CPPCHECK.rst
@@ -3,10 +3,12 @@
This property is supported only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command line
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
for the ``cppcheck`` static analysis tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run ``cppcheck`` along with the
-compiler and report any problems.
+compiler and report any problems. If the command-line specifies the
+exit code options to ``cppcheck`` then the build will fail if the
+tool returns non-zero.
This property is initialized by the value of the
:variable:`CMAKE_<LANG>_CPPCHECK` variable if it is set when a target is
diff --git a/Help/prop_tgt/LANG_CPPLINT.rst b/Help/prop_tgt/LANG_CPPLINT.rst
index 14f47d465..9944c88ba 100644
--- a/Help/prop_tgt/LANG_CPPLINT.rst
+++ b/Help/prop_tgt/LANG_CPPLINT.rst
@@ -3,7 +3,7 @@
This property is supported only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command line
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command line
for the ``cpplint`` style checker. The :ref:`Makefile Generators` and the
:generator:`Ninja` generator will run ``cpplint`` along with the compiler
and report any problems.
diff --git a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
index 26f6d1671..35220e414 100644
--- a/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
+++ b/Help/prop_tgt/LANG_INCLUDE_WHAT_YOU_USE.rst
@@ -3,7 +3,7 @@
This property is implemented only when ``<LANG>`` is ``C`` or ``CXX``.
-Specify a :ref:`;-list <CMake Language Lists>` containing a command
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` containing a command
line for the ``include-what-you-use`` tool. The :ref:`Makefile Generators`
and the :generator:`Ninja` generator will run this tool along with the
compiler and report a warning if the tool reports any problems.
diff --git a/Help/prop_tgt/LINK_DIRECTORIES.rst b/Help/prop_tgt/LINK_DIRECTORIES.rst
index 085a70119..c2905b37d 100644
--- a/Help/prop_tgt/LINK_DIRECTORIES.rst
+++ b/Help/prop_tgt/LINK_DIRECTORIES.rst
@@ -4,7 +4,7 @@ LINK_DIRECTORIES
List of directories to use for the link step of shared library, module
and executable targets.
-This property holds a :ref:`;-list <CMake Language Lists>` of directories
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of directories
specified so far for its target. Use the :command:`target_link_directories`
command to append more search directories.
diff --git a/Help/prop_tgt/LINK_OPTIONS.rst b/Help/prop_tgt/LINK_OPTIONS.rst
index bd5e9370b..2a05ea75a 100644
--- a/Help/prop_tgt/LINK_OPTIONS.rst
+++ b/Help/prop_tgt/LINK_OPTIONS.rst
@@ -6,7 +6,7 @@ and executable targets. Targets that are static libraries need to use
the :prop_tgt:`STATIC_LIBRARY_OPTIONS` target property.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
specified so far for its target. Use the :command:`target_link_options`
command to append more options.
diff --git a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst
index 54af8c6de..0aaf66bd0 100644
--- a/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst
+++ b/Help/prop_tgt/POSITION_INDEPENDENT_CODE.rst
@@ -9,3 +9,8 @@ property is ``True`` by default for ``SHARED`` and ``MODULE`` library
targets and ``False`` otherwise. This property is initialized by the value
of the :variable:`CMAKE_POSITION_INDEPENDENT_CODE` variable if it is set
when a target is created.
+
+.. note::
+
+ For executable targets, the link step is controlled by the :policy:`CMP0083`
+ policy and the :module:`CheckPIESupported` module.
diff --git a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
index 6e0318594..d05fda4aa 100644
--- a/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
+++ b/Help/prop_tgt/STATIC_LIBRARY_OPTIONS.rst
@@ -5,7 +5,7 @@ Archiver (or MSVC librarian) flags for a static library target.
Targets that are shared libraries, modules, or executables need to use
the :prop_tgt:`LINK_OPTIONS` target property.
-This property holds a :ref:`;-list <CMake Language Lists>` of options
+This property holds a :ref:`semicolon-separated list <CMake Language Lists>` of options
specified so far for its target. Use :command:`set_target_properties` or
:command:`set_property` commands to set its content.
diff --git a/Help/prop_tgt/VS_SDK_REFERENCES.rst b/Help/prop_tgt/VS_SDK_REFERENCES.rst
index 769a0d1d5..99987f561 100644
--- a/Help/prop_tgt/VS_SDK_REFERENCES.rst
+++ b/Help/prop_tgt/VS_SDK_REFERENCES.rst
@@ -2,6 +2,6 @@ VS_SDK_REFERENCES
-----------------
Visual Studio project SDK references.
-Specify a :ref:`;-list <CMake Language Lists>` of SDK references
+Specify a :ref:`semicolon-separated list <CMake Language Lists>` of SDK references
to be added to a generated Visual Studio project, e.g.
``Microsoft.AdMediatorWindows81, Version=1.0``.
diff --git a/Help/prop_tgt/WIN32_EXECUTABLE.rst b/Help/prop_tgt/WIN32_EXECUTABLE.rst
index 336d5f7f3..060d16671 100644
--- a/Help/prop_tgt/WIN32_EXECUTABLE.rst
+++ b/Help/prop_tgt/WIN32_EXECUTABLE.rst
@@ -5,8 +5,9 @@ Build an executable with a WinMain entry point on windows.
When this property is set to true the executable when linked on
Windows will be created with a WinMain() entry point instead of just
-main(). This makes it a GUI executable instead of a console
-application. See the CMAKE_MFC_FLAG variable documentation to
-configure use of MFC for WinMain executables. This property is
-initialized by the value of the variable CMAKE_WIN32_EXECUTABLE if it
-is set when a target is created.
+main(). This makes it a GUI executable instead of a console application.
+See the :variable:`CMAKE_MFC_FLAG` variable documentation to
+configure use of the Microsoft Foundation Classes (MFC) for WinMain
+executables. This property is initialized by the value of the
+:variable:`CMAKE_WIN32_EXECUTABLE` variable if it is set when
+a target is created.
diff --git a/Help/release/3.13.rst b/Help/release/3.13.rst
index a8dd0baf7..1c58550ff 100644
--- a/Help/release/3.13.rst
+++ b/Help/release/3.13.rst
@@ -278,12 +278,3 @@ Changes made since CMake 3.13.0 include the following.
relying on the old behavior can be trivially fixed by specifying
the path to the source tree (even if just ``.``) explicitly and
continue to work with all versions of CMake.
-
-3.13.5
-------
-
-* In CMake 3.13.0 through 3.13.4, calling :command:`target_link_libraries`
- to add ``PRIVATE`` dependencies to a static library created in another
- directory (under policy :policy:`CMP0079` ``NEW`` behavior) would
- incorrectly propagate usage requirements of those dependencies to
- dependents that link the static library. This has been fixed.
diff --git a/Help/release/3.14.rst b/Help/release/3.14.rst
new file mode 100644
index 000000000..f2a91c614
--- /dev/null
+++ b/Help/release/3.14.rst
@@ -0,0 +1,393 @@
+CMake 3.14 Release Notes
+************************
+
+.. only:: html
+
+ .. contents::
+
+Changes made since CMake 3.13 include the following.
+
+New Features
+============
+
+Generators
+----------
+
+* The :generator:`Visual Studio 16 2019` generator was added. This is
+ experimental and based on "Visual Studio 2019 Preview 4" because this
+ version of VS has not been released.
+
+ The VS 2019 generator differs from generators for earlier versions
+ in that it does not provide variants that specify the target platform
+ in the generator name. Instead :variable:`CMAKE_GENERATOR_PLATFORM`
+ must be used, e.g. through the ``-A`` command-line option. Furthermore,
+ the default target platform (architecture) is now based on the *host*
+ platform. The VS host toolset selection is now based on the host
+ architecture as well.
+
+* The :generator:`Green Hills MULTI` generator has been updated:
+
+ * Now supports :ref:`Object Libraries`.
+
+ * Now warns on unsupported project types such as shared libraries.
+
+ * Now generates a top-level ``<PROJECT-NAME>.top.gpj`` for each directory
+ calling the :command:`project` command. The top-level project file
+ ``default.gpj`` is no longer created.
+
+ * Now honors target renaming and destination output control properties
+ such as :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` and :prop_tgt:`OUTPUT_NAME`.
+ This also fixes support for installation rules generated by
+ :command:`install`.
+
+ * Now honors source file properties :prop_sf:`INCLUDE_DIRECTORIES`,
+ :prop_sf:`COMPILE_DEFINITIONS`, and :prop_sf:`COMPILE_OPTIONS`.
+
+ * Now supports Dynamic Download Integrity Applications which did not include
+ Integrate Files via :prop_tgt:`GHS_INTEGRITY_APP` and setting a target
+ link flag of ``-dynamic``.
+
+ * The contents of project files now sorts sources groups and files by name.
+ Set the :prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` target property to ``ON`` to
+ generate a single project file for the target instead of a project file for
+ each source group. Set the :variable:`CMAKE_GHS_NO_SOURCE_GROUP_FILE`
+ variable to enable this for all targets.
+
+File-Based API
+--------------
+
+* A file-based api for clients to get semantic buildsystem information
+ has been added. See the :manual:`cmake-file-api(7)` manual.
+ This is intended to replace the :manual:`cmake-server(7)` mode for IDEs.
+
+Platforms
+---------
+
+* CMake now supports :ref:`Cross Compiling for iOS, tvOS, or watchOS`
+ using simple toolchain files.
+
+Command-Line
+------------
+
+* The :manual:`cmake(1)` :ref:`Build Tool Mode <Build Tool Mode>`
+ (``cmake --build``) gained ``--verbose`` and ``-v`` options to
+ specify verbose build output. Some generators such as Xcode don't
+ support this option currently.
+
+* The :manual:`cmake(1)` ``-E compare_files`` command learned a new
+ ``--ignore-eol`` option to specify that end-of-line differences
+ (e.g. LF vs CRLF) should be ignored when comparing files.
+
+* The :manual:`cmake-gui(1)` dialog gained new ``-S`` and ``-B`` arguments to
+ explicitly specify source and build directories.
+
+Commands
+--------
+
+* The :command:`file` command learned a new sub-command, ``CREATE_LINK``,
+ which can be used to create hard or symbolic links.
+
+* The :command:`file` command learned a new sub-command, ``READ_SYMLINK``,
+ which can be used to determine the path that a symlink points to.
+
+* The :command:`file` command gained a ``SIZE`` mode to get the size
+ of a file on disk.
+
+* The :command:`find_package` command learned to optionally resolve
+ symbolic links in the paths to package configuration files.
+ See the :variable:`CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS` variable.
+
+* The :command:`get_filename_component` command gained new
+ ``LAST_EXT`` and ``NAME_WLE`` variants to work with the
+ extension after the last ``.`` in the name.
+
+* The :command:`if` command gained support for checking if cache variables
+ are defined with the ``DEFINED CACHE{VAR}`` syntax.
+
+* The :command:`install(CODE)` and :command:`install(SCRIPT)` commands
+ learned to support generator expressions. See policy :policy:`CMP0087`.
+
+* The :command:`install(TARGETS)` command learned how to install to an
+ appropriate default directory for a given target type, based on
+ variables from the :module:`GNUInstallDirs` module and built-in defaults,
+ in lieu of a ``DESTINATION`` argument.
+
+* The :command:`install(FILES)` and :command:`install(DIRECTORY)` commands
+ learned a new set of parameters for installing files as a file type,
+ setting the destination based on the appropriate variables from
+ :module:`GNUInstallDirs` and built-in defaults, in lieu of a
+ ``DESTINATION`` argument.
+
+* The :command:`list` operations ``REMOVE_ITEM``, ``REMOVE_DUPLICATES``,
+ ``SORT``, ``REVERSE``, and ``FILTER`` all now accept a non-existent variable
+ as the list since these operations on empty lists is also the empty list.
+
+* The :command:`list` operation ``REMOVE_AT`` now indicates that the given
+ indices are invalid for a non-existent variable or empty list.
+
+* The :command:`try_compile` and :command:`try_run` commands gained a new
+ ``LINK_OPTIONS`` option.
+
+Variables
+---------
+
+* A :variable:`CMAKE_BUILD_RPATH_USE_ORIGIN` variable and corresponding
+ :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target property were added to
+ enable use of relative runtime paths (RPATHs). This helps achieving
+ relocatable and reproducible builds that are invariant of the build
+ directory.
+
+Properties
+----------
+
+* A :prop_gbl:`CMAKE_ROLE` global property was added to allow scripts to
+ determine whether they're running in project mode, script mode,
+ find-package mode, CTest, or CPack.
+
+* The :prop_tgt:`CUDA_RESOLVE_DEVICE_SYMBOLS` target property is now supported
+ on shared library, module library, and executable targets. Previously it was
+ only honored on static libraries.
+
+* The :prop_tgt:`EXCLUDE_FROM_ALL` target property was created to override
+ the setting of its directory. A target will now be built as part of "all"
+ if its :prop_tgt:`EXCLUDE_FROM_ALL` property is set to ``OFF``, even if its
+ containing directory is marked as :prop_dir:`EXCLUDE_FROM_ALL`.
+
+* :prop_tgt:`INTERFACE_POSITION_INDEPENDENT_CODE` target property gains the
+ support of :manual:`generator expressions <cmake-generator-expressions(7)>`.
+
+Modules
+-------
+
+* The family of modules to check capabilities (like
+ :module:`CheckCSourceCompiles`) gain capability to manage ``LINK_OPTIONS``.
+
+* A :module:`CheckFortranSourceRuns` module was added to provide a
+ :command:`check_fortran_source_runs` command to check if a Fortran
+ source snippet compiles and runs.
+
+* The :module:`CMakePackageConfigHelpers` module's
+ :command:`write_basic_package_version_file` command gained a new
+ ``ARCH_INDEPENDENT`` option for supporting architecture-independent
+ packages.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ gained ``LOG_DIR`` and ``LOG_MERGED_STDOUTERR`` options to control logging.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ gained ``LOG_PATCH`` to optionally log the patch step.
+
+* The :module:`ExternalProject` module :command:`ExternalProject_Add` command
+ learned to apply ``SOURCE_SUBDIR`` when ``BUILD_IN_SOURCE`` is also used.
+ The ``BUILD_COMMAND`` is run in the given ``SOURCE_SUBDIR`` of the
+ ``SOURCE_DIR``.
+
+* The :module:`FetchContent` module gained a new
+ :command:`FetchContent_MakeAvailable` command. It accepts a list of
+ dependency names, which it then iterates over, populating and adding
+ each one to the main build using the canonical pattern. This
+ significantly reduces the amount of boilerplate needed in a project.
+
+* The :module:`FindBISON` module's ``BISON_TARGET`` command now runs ``bison``
+ with :variable:`CMAKE_CURRENT_BINARY_DIR` as the working directory.
+ See policy :policy:`CMP0088`.
+
+* The :module:`FindCURL` module gained support for requesting
+ protocols as package components.
+
+* The :module:`FindFontconfig` module was added to find `fontconfig`_.
+
+* The :module:`FindGDAL` module now provides imported targets.
+
+* The :module:`FindGIF` module now provides imported targets.
+
+* The :module:`FindGit` module now provides an imported target for the
+ Git executable.
+
+* The :module:`FindIce` module learned to find ``slice2confluence``
+ and ``slice2matlab``.
+
+* The :module:`FindLibinput` module was added to find `libinput`_.
+
+* The :module:`FindLibLZMA` module now provides imported targets.
+
+* The :module:`FindMatlab` module gained new options ``R2017b`` and
+ ``R2018a`` to specify the MEX API version to use; these options
+ mirror the new options to the ``mex`` command in MATLAB R2018a.
+ The option ``MX_LIBRARY`` is no longer needed.
+
+* The :module:`FindPostgreSQL` module now provides imported targets.
+
+* The :module:`FindPython`, :module:`FindPython2`, and :module:`FindPython3`
+ modules gained support for ``NumPy`` component.
+
+* The :module:`FindPython2`, :module:`FindPython3`, and :module:`FindPython`
+ modules now support running in script mode by skipping the creation of
+ imported targets and helper functions.
+
+* The :module:`FindSQLite3` module was added to find the SQLite v3.x library.
+
+* The :module:`FindX11` had the following variables renamed in order to match
+ their library names rather than header names. The old variables are provided
+ for compatibility:
+
+ - ``X11_Xxf86misc_INCLUDE_PATH`` instead of ``X11_xf86misc_INCLUDE_PATH``
+ - ``X11_Xxf86misc_LIB`` instead of ``X11_xf86misc_LIB``
+ - ``X11_Xxf86misc_FOUND`` instead of ``X11_xf86misc_FOUND``
+ - ``X11_Xxf86vm_INCLUDE_PATH`` instead of ``X11_xf86vmode_INCLUDE_PATH``
+ - ``X11_Xxf86vm_LIB`` instead of ``X11_xf86vmode_LIB``
+ - ``X11_Xxf86vm_FOUND`` instead of ``X11_xf86vmode_FOUND``
+ - ``X11_xkbfile_INCLUDE_PATH`` instead of ``X11_Xkbfile_INCLUDE_PATH``
+ - ``X11_xkbfile_LIB`` instead of ``X11_Xkbfile_LIB``
+ - ``X11_xkbfile_FOUND`` instead of ``X11_Xkbfile_FOUND``
+ - ``X11_Xtst_INCLUDE_PATH`` instead of ``X11_XTest_INCLUDE_PATH``
+ - ``X11_Xtst_LIB`` instead of ``X11_XTest_LIB``
+ - ``X11_Xtst_FOUND`` instead of ``X11_XTest_FOUND``
+ - ``X11_Xss_INCLUDE_PATH`` instead of ``X11_Xscreensaver_INCLUDE_PATH``
+ - ``X11_Xss_LIB`` instead of ``X11_Xscreensaver_LIB``
+ - ``X11_Xss_FOUND`` instead of ``X11_Xscreensaver_FOUND``
+
+ The following variables are deprecated completely since they were
+ essentially duplicates:
+
+ - ``X11_Xinput_INCLUDE_PATH`` (use ``X11_Xi_INCLUDE_PATH``)
+ - ``X11_Xinput_LIB`` (use ``X11_Xi_LIB``)
+ - ``X11_Xinput_FOUND`` (use ``X11_Xi_FOUND``)
+
+* The :module:`FindX11` now provides ``X11_Xext_INCLUDE_PATH``.
+
+* The :module:`FindX11` now provides imported targets.
+
+* The :module:`UseSWIG` module learned to pass ``-module <module_name>`` to
+ the ``SWIG`` compiler if the file property ``SWIG_MODULE_NAME`` is defined.
+ See policy :policy:`CMP0086`.
+
+* The :module:`UseSWIG` module gained an option to specify
+ ``SWIG`` source file extensions.
+
+.. _`fontconfig`: https://www.freedesktop.org/wiki/Software/fontconfig/
+.. _`libinput`: https://www.freedesktop.org/wiki/Software/libinput/
+
+Generator Expressions
+---------------------
+
+* The ``$<Fortran_COMPILER_ID:...>`` and ``$<Fortran_COMPILER_VERSION:...>``
+ :manual:`generator expressions <cmake-generator-expressions(7)>` were added.
+
+* The ``$<IN_LIST:...>`` generator expression now correctly handles an
+ empty argument. See :policy:`CMP0085` for details.
+
+Autogen
+-------
+
+* The :prop_tgt:`AUTOMOC_EXECUTABLE`, :prop_tgt:`AUTORCC_EXECUTABLE`, and
+ :prop_tgt:`AUTOUIC_EXECUTABLE` target properties were added. They all
+ take a path to an executable and force automoc/autorcc/autouic to use
+ this executable.
+
+ Setting these will also prevent the configure time testing for these
+ executables. This is mainly useful when you build these tools yourself.
+
+* The new variables :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET`,
+ :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`,
+ :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` and
+ :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME` control the generation
+ of global ``autogen`` and ``autorcc`` targets.
+
+* A new :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` variable and
+ :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` target property may be set to enable or
+ disable forwarding of the origin target dependencies to the corresponding
+ ``_autogen`` target.
+
+CTest
+-----
+
+* :manual:`ctest(1)` gained a ``--show-only=json-v1`` option to show the
+ list of tests in a machine-readable JSON format.
+ See the :ref:`Show as JSON Object Model` section of the manual.
+
+* The :command:`ctest_submit` command learned a new ``Done`` part that can be used
+ to inform CDash that a build is complete and that no more parts will be uploaded.
+
+* CTest learned to accept the dashboard server submission URL from a single
+ variable. See the ``SubmitURL`` setting in :manual:`ctest(1)`,
+ the :variable:`CTEST_SUBMIT_URL` variable, and the ``SUBMIT_URL``
+ argument of the :command:`ctest_submit` command.
+
+Deprecated and Removed Features
+===============================
+
+* An explicit deprecation diagnostic was added for policies ``CMP0064``
+ and ``CMP0065`` (``CMP0063`` and below were already deprecated).
+ The :manual:`cmake-policies(7)` manual explains that the OLD behaviors
+ of all policies are deprecated and that projects should port to the
+ NEW behaviors.
+
+* The :generator:`Xcode` generator deprecated support for Xcode
+ versions prior to Xcode 5. Support for those will be dropped in a
+ future version of CMake.
+
+* The :module:`FindQt` module is no longer used by the :command:`find_package`
+ command as a find module. This allows the Qt Project upstream to optionally
+ provide its own ``QtConfig.cmake`` package configuration file and have
+ applications use it via ``find_package(Qt)`` rather than
+ ``find_package(Qt CONFIG)``. See policy :policy:`CMP0084`.
+
+* Support for running CMake on Windows XP and Windows Vista has been dropped.
+ The precompiled Windows binaries provided on ``cmake.org`` now require
+ Windows 7 or higher.
+
+* CTest no longer supports submissions via ``ftp``, ``scp``, ``cp``, and
+ ``xmlrpc``. CDash is the only maintained testing dashboard for CTest,
+ and it only supports submissions over ``http`` and ``https``.
+
+Other Changes
+=============
+
+* Object library linking has been fixed to propagate private link libraries
+ of object libraries to consuming targets.
+
+* Install rules under :command:`add_subdirectory` now interleave with those in
+ the calling directory. See policy :policy:`CMP0082` for details.
+
+* CMake now imposes a maximum recursion limit to prevent a stack overflow on
+ scripts that recurse infinitely. The limit can be adjusted at runtime with
+ :variable:`CMAKE_MAXIMUM_RECURSION_DEPTH`.
+
+* When using cppcheck via the :variable:`CMAKE_<LANG>_CPPCHECK` variable
+ or :prop_tgt:`<LANG>_CPPCHECK` property, the build will now fail if
+ ``cppcheck`` returns non-zero as configured by its command-line options.
+
+* Required link options to manage Position Independent Executable are now
+ added when :prop_tgt:`POSITION_INDEPENDENT_CODE` is set. The project is
+ responsible for using the :module:`CheckPIESupported` module to check for
+ ``PIE`` support to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE`
+ target property will be honored at link time for executables. This behavior
+ is controlled by policy :policy:`CMP0083`.
+
+* :ref:`Visual Studio Generators` for VS 2010 and above learned
+ to support the ``VS_DEBUGGER_*`` properties on targets created
+ via :command:`add_custom_target`.
+
+* The :module:`CPack` module no longer defaults to the ``paxr`` value in the
+ :variable:`CPACK_DEBIAN_ARCHIVE_TYPE` variable, because ``dpkg`` has
+ never supported the PAX tar format. The ``paxr`` value will be mapped
+ to ``gnutar`` and a deprecation message emitted.
+
+* CMake no longer issues a warning if a target listed in an
+ :command:`install(TARGETS)` command has its :prop_tgt:`EXCLUDE_FROM_ALL`
+ property set to true.
+
+Updates
+=======
+
+Changes made since CMake 3.14.0 include the following.
+
+3.14.1
+------
+
+* The :module:`FindFontconfig` module added by 3.14.0 accidentally
+ used uppercase ``FONTCONFIG_*`` variable names that do not match
+ our conventions. 3.14.1 revises the module to use ``Fontconfig_*``
+ variable names. This is incompatible with 3.14.0 but since the
+ module is new in the 3.14 series usage should not yet be widespread.
diff --git a/Help/release/3.6.rst b/Help/release/3.6.rst
index 74dac1c20..f0add07ff 100644
--- a/Help/release/3.6.rst
+++ b/Help/release/3.6.rst
@@ -251,7 +251,7 @@ Deprecated and Removed Features
Users that keep some ``<prefix>/bin`` directories in the ``PATH`` just for
their tools do not necessarily want any supporting ``<prefix>/lib``
directories searched. One may set the ``CMAKE_PREFIX_PATH`` environment
- variable with a :ref:`;-list <CMake Language Lists>` of prefixes that are
+ variable with a :ref:`semicolon-separated list <CMake Language Lists>` of prefixes that are
to be searched.
* The :generator:`Visual Studio 7 .NET 2003` generator is now
diff --git a/Help/release/index.rst b/Help/release/index.rst
index fbe4cf625..4fcd4ca4f 100644
--- a/Help/release/index.rst
+++ b/Help/release/index.rst
@@ -13,6 +13,7 @@ Releases
.. toctree::
:maxdepth: 1
+ 3.14 <3.14>
3.13 <3.13>
3.12 <3.12>
3.11 <3.11>
diff --git a/Help/variable/CACHE.rst b/Help/variable/CACHE.rst
index 230739acc..2cef27efa 100644
--- a/Help/variable/CACHE.rst
+++ b/Help/variable/CACHE.rst
@@ -1,7 +1,7 @@
CACHE
-----
-Read cache variables.
+Operator to read cache variables.
Use the syntax ``$CACHE{VAR}`` to read cache entry ``VAR``.
See the :ref:`cmake-language(7) variables <CMake Language Variables>`
@@ -14,4 +14,5 @@ found CMake will search for a cache entry with that name.
The ``$CACHE{VAR}`` syntax can be used to do direct cache lookup and
ignore any existing normal variable.
-See the :command:`set` command to see how to write cache variables.
+See the :command:`set` and :command:`unset` commands to see how to
+write or remove cache variables.
diff --git a/Help/variable/CMAKE_APPBUNDLE_PATH.rst b/Help/variable/CMAKE_APPBUNDLE_PATH.rst
index c1f0951cc..1c7ca51c2 100644
--- a/Help/variable/CMAKE_APPBUNDLE_PATH.rst
+++ b/Help/variable/CMAKE_APPBUNDLE_PATH.rst
@@ -1,6 +1,6 @@
CMAKE_APPBUNDLE_PATH
--------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for macOS application bundles used by the :command:`find_program`, and
:command:`find_package` commands.
diff --git a/Help/variable/CMAKE_ARGC.rst b/Help/variable/CMAKE_ARGC.rst
index aec97119a..30db2a2da 100644
--- a/Help/variable/CMAKE_ARGC.rst
+++ b/Help/variable/CMAKE_ARGC.rst
@@ -3,6 +3,6 @@ CMAKE_ARGC
Number of command line arguments passed to CMake in script mode.
-When run in :ref:`-P <CMake Options>` script mode, CMake sets this variable to
-the number of command line arguments. See also :variable:`CMAKE_ARGV0`,
-``1``, ``2`` ...
+When run in :ref:`-P <Script Processing Mode>` script mode, CMake sets this
+variable to the number of command line arguments. See also
+:variable:`CMAKE_ARGV0`, ``1``, ``2`` ...
diff --git a/Help/variable/CMAKE_ARGV0.rst b/Help/variable/CMAKE_ARGV0.rst
index 8b1ecb79e..c4d1c219e 100644
--- a/Help/variable/CMAKE_ARGV0.rst
+++ b/Help/variable/CMAKE_ARGV0.rst
@@ -3,7 +3,7 @@ CMAKE_ARGV0
Command line argument passed to CMake in script mode.
-When run in :ref:`-P <CMake Options>` script mode, CMake sets this variable to
-the first command line argument. It then also sets ``CMAKE_ARGV1``,
+When run in :ref:`-P <Script Processing Mode>` script mode, CMake sets this
+variable to the first command line argument. It then also sets ``CMAKE_ARGV1``,
``CMAKE_ARGV2``, ... and so on, up to the number of command line arguments
given. See also :variable:`CMAKE_ARGC`.
diff --git a/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
new file mode 100644
index 000000000..1398e7856
--- /dev/null
+++ b/Help/variable/CMAKE_AUTOGEN_ORIGIN_DEPENDS.rst
@@ -0,0 +1,11 @@
+CMAKE_AUTOGEN_ORIGIN_DEPENDS
+----------------------------
+
+Switch for forwarding origin target dependencies to the corresponding
+``_autogen`` targets.
+
+This variable is used to initialize the :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS`
+property on all the targets. See that target property for additional
+information.
+
+By default :variable:`CMAKE_AUTOGEN_ORIGIN_DEPENDS` is ``ON``.
diff --git a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
index 2c8997bbf..ba1b9d27a 100644
--- a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
+++ b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
@@ -1,7 +1,7 @@
CMAKE_AUTOMOC_MACRO_NAMES
----------------------------
-A :ref:`;-list <CMake Language Lists>` list of macro names used by
+:ref:`Semicolon-separated list <CMake Language Lists>` list of macro names used by
:variable:`CMAKE_AUTOMOC` to determine if a C++ file needs to be
processed by ``moc``.
diff --git a/Help/variable/CMAKE_BUILD_RPATH.rst b/Help/variable/CMAKE_BUILD_RPATH.rst
index f20eb418f..f5d53b88c 100644
--- a/Help/variable/CMAKE_BUILD_RPATH.rst
+++ b/Help/variable/CMAKE_BUILD_RPATH.rst
@@ -1,7 +1,7 @@
CMAKE_BUILD_RPATH
-----------------
-A :ref:`;-list <CMake Language Lists>` specifying runtime path (``RPATH``)
+:ref:`Semicolon-separated list <CMake Language Lists>` specifying runtime path (``RPATH``)
entries to add to binaries linked in the build tree (for platforms that
support it). The entries will *not* be used for binaries in the install
tree. See also the :variable:`CMAKE_INSTALL_RPATH` variable.
diff --git a/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst
new file mode 100644
index 000000000..e34ede6ad
--- /dev/null
+++ b/Help/variable/CMAKE_BUILD_RPATH_USE_ORIGIN.rst
@@ -0,0 +1,7 @@
+CMAKE_BUILD_RPATH_USE_ORIGIN
+----------------------------
+
+Whether to use relative paths for the build ``RPATH``.
+
+This is used to initialize the :prop_tgt:`BUILD_RPATH_USE_ORIGIN` target
+property for all targets, see that property for more details.
diff --git a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
index 768f571c0..7de50a5a7 100644
--- a/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES.rst
@@ -2,6 +2,6 @@ CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
--------------------------------------
When the ``CUDA`` language has been enabled, this provides a
-:ref:`;-list <CMake Language Lists>` of include directories provided
+:ref:`semicolon-separated list <CMake Language Lists>` of include directories provided
by the CUDA Toolkit. The value may be useful for C++ source files
to include CUDA headers.
diff --git a/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst
new file mode 100644
index 000000000..dfbde2035
--- /dev/null
+++ b/Help/variable/CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS.rst
@@ -0,0 +1,10 @@
+CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS
+-----------------------------------
+
+Set to ``TRUE`` to tell :command:`find_package` calls to resolve symbolic
+links in the value of ``<PackageName>_DIR``.
+
+This is helpful in use cases where the package search path points at a
+proxy directory in which symlinks to the real package locations appear.
+This is not enabled by default because there are also common use cases
+in which the symlinks should be preserved.
diff --git a/Help/variable/CMAKE_FIND_ROOT_PATH.rst b/Help/variable/CMAKE_FIND_ROOT_PATH.rst
index ba2cf313e..6172c56ae 100644
--- a/Help/variable/CMAKE_FIND_ROOT_PATH.rst
+++ b/Help/variable/CMAKE_FIND_ROOT_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_FIND_ROOT_PATH
--------------------
-:ref:`;-list <CMake Language Lists>` of root paths to search on the filesystem.
+:ref:`Semicolon-separated list <CMake Language Lists>` of root paths to search on the filesystem.
This variable is most useful when cross-compiling. CMake uses the paths in
this list as alternative roots to find filesystem items with
diff --git a/Help/variable/CMAKE_FRAMEWORK_PATH.rst b/Help/variable/CMAKE_FRAMEWORK_PATH.rst
index 04751f88d..13ade4e5f 100644
--- a/Help/variable/CMAKE_FRAMEWORK_PATH.rst
+++ b/Help/variable/CMAKE_FRAMEWORK_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_FRAMEWORK_PATH
--------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for macOS frameworks used by the :command:`find_library`,
:command:`find_package`, :command:`find_path`, and :command:`find_file`
commands.
diff --git a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
index e9bc28b9e..e77f211dd 100644
--- a/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
+++ b/Help/variable/CMAKE_GENERATOR_TOOLSET.rst
@@ -44,8 +44,8 @@ Supported pairs are:
and above with the CUDA toolkit VS integration installed.
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_CUDA` variable.
-``host=x64``
- Request use of the native ``x64`` toolchain on ``x64`` hosts.
+``host=<arch>``
+ Specify the host tools architecture as ``x64`` or ``x86``.
Supported by VS 2013 and above.
See the :variable:`CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE`
variable.
diff --git a/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
new file mode 100644
index 000000000..b6768a131
--- /dev/null
+++ b/Help/variable/CMAKE_GHS_NO_SOURCE_GROUP_FILE.rst
@@ -0,0 +1,6 @@
+CMAKE_GHS_NO_SOURCE_GROUP_FILE
+------------------------------
+
+``ON`` / ``OFF`` boolean to control if the project file for a target should
+be one single file or multiple files. Refer to
+:prop_tgt:`GHS_NO_SOURCE_GROUP_FILE` for further details.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
new file mode 100644
index 000000000..e82867dfd
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET.rst
@@ -0,0 +1,26 @@
+CMAKE_GLOBAL_AUTOGEN_TARGET
+---------------------------
+
+Switch to enable generation of a global ``autogen`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target
+``autogen`` is generated. This target depends on all :prop_tgt:`AUTOMOC` and
+:prop_tgt:`AUTOUIC` generated ``<ORIGIN>_autogen`` targets in the project.
+By building the global ``autogen`` target, all :prop_tgt:`AUTOMOC` and
+:prop_tgt:`AUTOUIC` files in the project will be generated.
+
+The name of the global ``autogen`` target can be changed by setting
+:variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
+
+Note
+^^^^
+
+``<ORIGIN>_autogen`` targets by default inherit their origin target's
+dependencies. This might result in unintended dependency target
+builds when only ``<ORIGIN>_autogen`` targets are built. A solution is to
+disable :prop_tgt:`AUTOGEN_ORIGIN_DEPENDS` on the respective origin targets.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
new file mode 100644
index 000000000..c86a5d0af
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTOGEN_TARGET_NAME.rst
@@ -0,0 +1,13 @@
+CMAKE_GLOBAL_AUTOGEN_TARGET_NAME
+--------------------------------
+
+Change the name of the global ``autogen`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET` is enabled, a global custom target
+named ``autogen`` is created. :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME`
+allows to set a different name for that target.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
new file mode 100644
index 000000000..f92128cda
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET.rst
@@ -0,0 +1,18 @@
+CMAKE_GLOBAL_AUTORCC_TARGET
+---------------------------
+
+Switch to enable generation of a global ``autorcc`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a custom target
+``autorcc`` is generated. This target depends on all :prop_tgt:`AUTORCC`
+generated ``<ORIGIN>_arcc_<QRC>`` targets in the project.
+By building the global ``autorcc`` target, all :prop_tgt:`AUTORCC`
+files in the project will be generated.
+
+The name of the global ``autorcc`` target can be changed by setting
+:variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME`.
+
+By default :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
new file mode 100644
index 000000000..c6e05de4e
--- /dev/null
+++ b/Help/variable/CMAKE_GLOBAL_AUTORCC_TARGET_NAME.rst
@@ -0,0 +1,13 @@
+CMAKE_GLOBAL_AUTORCC_TARGET_NAME
+--------------------------------
+
+Change the name of the global ``autorcc`` target.
+
+When :variable:`CMAKE_GLOBAL_AUTORCC_TARGET` is enabled, a global custom target
+named ``autorcc`` is created. :variable:`CMAKE_GLOBAL_AUTORCC_TARGET_NAME`
+allows to set a different name for that target.
+
+By default :variable:`CMAKE_GLOBAL_AUTOGEN_TARGET_NAME` is unset.
+
+See the :manual:`cmake-qt(7)` manual for more information on using CMake
+with Qt.
diff --git a/Help/variable/CMAKE_HOME_DIRECTORY.rst b/Help/variable/CMAKE_HOME_DIRECTORY.rst
index fdc5d8190..b03d95618 100644
--- a/Help/variable/CMAKE_HOME_DIRECTORY.rst
+++ b/Help/variable/CMAKE_HOME_DIRECTORY.rst
@@ -1,6 +1,9 @@
CMAKE_HOME_DIRECTORY
--------------------
-Path to top of source tree.
+Path to top of source tree. Same as :variable:`CMAKE_SOURCE_DIR`.
-This is the path to the top level of the source tree.
+This is an internal cache entry used to locate the source directory
+when loading a ``CMakeCache.txt`` from a build tree. It should not
+be used in project code. The variable :variable:`CMAKE_SOURCE_DIR`
+has the same value and should be preferred.
diff --git a/Help/variable/CMAKE_IGNORE_PATH.rst b/Help/variable/CMAKE_IGNORE_PATH.rst
index 92f377086..4bca34b7e 100644
--- a/Help/variable/CMAKE_IGNORE_PATH.rst
+++ b/Help/variable/CMAKE_IGNORE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_IGNORE_PATH
-----------------
-:ref:`;-list <CMake Language Lists>` of directories to be *ignored* by
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories to be *ignored* by
the :command:`find_program`, :command:`find_library`, :command:`find_file`,
and :command:`find_path` commands. This is useful in cross-compiling
environments where some system directories contain incompatible but
diff --git a/Help/variable/CMAKE_INCLUDE_PATH.rst b/Help/variable/CMAKE_INCLUDE_PATH.rst
index e4e7f2cfc..4918e9960 100644
--- a/Help/variable/CMAKE_INCLUDE_PATH.rst
+++ b/Help/variable/CMAKE_INCLUDE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_INCLUDE_PATH
------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_file` and :command:`find_path` commands. By default it
is empty, it is intended to be set by the project. See also
:variable:`CMAKE_SYSTEM_INCLUDE_PATH` and :variable:`CMAKE_PREFIX_PATH`.
diff --git a/Help/variable/CMAKE_LANG_COMPILER_ID.rst b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
index 226426970..5323880d5 100644
--- a/Help/variable/CMAKE_LANG_COMPILER_ID.rst
+++ b/Help/variable/CMAKE_LANG_COMPILER_ID.rst
@@ -17,8 +17,10 @@ include:
Clang = LLVM Clang (clang.llvm.org)
Cray = Cray Compiler (cray.com)
Embarcadero, Borland = Embarcadero (embarcadero.com)
+ Flang = Flang LLVM Fortran Compiler
G95 = G95 Fortran (g95.org)
GNU = GNU Compiler Collection (gcc.gnu.org)
+ GHS = Green Hills Software (www.ghs.com)
HP = Hewlett-Packard Compiler (hp.com)
IAR = IAR Systems (iar.com)
Intel = Intel Compiler (intel.com)
@@ -27,7 +29,6 @@ include:
NVIDIA = NVIDIA CUDA Compiler (nvidia.com)
OpenWatcom = Open Watcom (openwatcom.org)
PGI = The Portland Group (pgroup.com)
- Flang = Flang Fortran Compiler
PathScale = PathScale (pathscale.com)
SDCC = Small Device C Compiler (sdcc.sourceforge.net)
SunPro = Oracle Solaris Studio (oracle.com)
diff --git a/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst b/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
index be89f8529..16fcc0344 100644
--- a/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
+++ b/Help/variable/CMAKE_LANG_CREATE_SHARED_LIBRARY.rst
@@ -4,4 +4,5 @@ CMAKE_<LANG>_CREATE_SHARED_LIBRARY
Rule variable to create a shared library.
This is a rule variable that tells CMake how to create a shared
-library for the language ``<LANG>``.
+library for the language ``<LANG>``. This rule variable is a ``;`` delimited
+list of commands to run to perform the linking step.
diff --git a/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst b/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
index ae5f69d56..807229dec 100644
--- a/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
+++ b/Help/variable/CMAKE_LANG_CREATE_SHARED_MODULE.rst
@@ -4,4 +4,5 @@ CMAKE_<LANG>_CREATE_SHARED_MODULE
Rule variable to create a shared module.
This is a rule variable that tells CMake how to create a shared
-library for the language ``<LANG>``.
+library for the language ``<LANG>``. This rule variable is a ``;`` delimited
+list of commands to run.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst
deleted file mode 100644
index 8ed1c02cc..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_CONFIG.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>
---------------------------------------
-
-GHS kernel flags for language ``<LANG>`` when building for the ``<CONFIG>``
-configuration.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst
deleted file mode 100644
index 4fea67a4a..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_DEBUG.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_DEBUG
------------------------------------
-
-This variable is the ``Debug`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst
deleted file mode 100644
index 31f87f2ac..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_MINSIZEREL.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_MINSIZEREL
-----------------------------------------
-
-This variable is the ``MinSizeRel`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst
deleted file mode 100644
index 1acd19876..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELEASE.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELEASE
--------------------------------------
-
-This variable is the ``Release`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst b/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst
deleted file mode 100644
index ac1b6bceb..000000000
--- a/Help/variable/CMAKE_LANG_GHS_KERNEL_FLAGS_RELWITHDEBINFO.rst
+++ /dev/null
@@ -1,5 +0,0 @@
-CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELWITHDEBINFO
---------------------------------------------
-
-This variable is the ``RelWithDebInfo`` variant of the
-:variable:`CMAKE_<LANG>_GHS_KERNEL_FLAGS_<CONFIG>` variable.
diff --git a/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst b/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
index cc8085107..e361fd98e 100644
--- a/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
+++ b/Help/variable/CMAKE_LANG_IMPLICIT_INCLUDE_DIRECTORIES.rst
@@ -6,4 +6,9 @@ Directories implicitly searched by the compiler for header files.
CMake does not explicitly specify these directories on compiler
command lines for language ``<LANG>``. This prevents system include
directories from being treated as user include directories on some
-compilers.
+compilers, which is important for ``C``, ``CXX``, and ``CUDA`` to
+avoid overriding standard library headers.
+
+This value is not used for ``Fortran`` because it has no standard
+library headers and some compilers do not search their implicit
+include directories for module ``.mod`` files.
diff --git a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
index 321f97ed1..df514075c 100644
--- a/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
+++ b/Help/variable/CMAKE_LANG_LINKER_WRAPPER_FLAG.rst
@@ -5,7 +5,7 @@ Defines the syntax of compiler driver option to pass options to the linker
tool. It will be used to translate the ``LINKER:`` prefix in the link options
(see :command:`add_link_options` and :command:`target_link_options`).
-This variable holds a :ref:`;-list <CMake Language Lists>` of tokens.
+This variable holds a :ref:`semicolon-separated list <CMake Language Lists>` of tokens.
If a space (i.e. " ") is specified as last token, flag and ``LINKER:``
arguments will be specified as separate arguments to the compiler driver.
The :variable:`CMAKE_<LANG>_LINKER_WRAPPER_FLAG_SEP` variable can be specified
diff --git a/Help/variable/CMAKE_LIBRARY_PATH.rst b/Help/variable/CMAKE_LIBRARY_PATH.rst
index b1770dc26..8135b6581 100644
--- a/Help/variable/CMAKE_LIBRARY_PATH.rst
+++ b/Help/variable/CMAKE_LIBRARY_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_LIBRARY_PATH
------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_library` command. By default it is empty, it is
intended to be set by the project. See also
:variable:`CMAKE_SYSTEM_LIBRARY_PATH` and :variable:`CMAKE_PREFIX_PATH`.
diff --git a/Help/variable/CMAKE_MACOSX_BUNDLE.rst b/Help/variable/CMAKE_MACOSX_BUNDLE.rst
index 0badaf0da..43ddff517 100644
--- a/Help/variable/CMAKE_MACOSX_BUNDLE.rst
+++ b/Help/variable/CMAKE_MACOSX_BUNDLE.rst
@@ -5,3 +5,6 @@ Default value for :prop_tgt:`MACOSX_BUNDLE` of targets.
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>`.
diff --git a/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
new file mode 100644
index 000000000..7110b1685
--- /dev/null
+++ b/Help/variable/CMAKE_MAXIMUM_RECURSION_DEPTH.rst
@@ -0,0 +1,33 @@
+CMAKE_MAXIMUM_RECURSION_DEPTH
+-----------------------------
+
+Maximum recursion depth for CMake scripts. It is intended to be set on the
+command line with ``-DCMAKE_MAXIMUM_RECURSION_DEPTH=<x>``, or within
+``CMakeLists.txt`` by projects that require a large recursion depth. Projects
+that set this variable should provide the user with a way to override it. For
+example:
+
+.. code-block:: cmake
+
+ # About to perform deeply recursive actions
+ if(NOT CMAKE_MAXIMUM_RECURSION_DEPTH)
+ set(CMAKE_MAXIMUM_RECURSION_DEPTH 2000)
+ endif()
+
+If it is not set, or is set to a non-integer value, a sensible default limit is
+used. If the recursion limit is reached, the script terminates immediately with
+a fatal error.
+
+Calling any of the following commands increases the recursion depth:
+
+* :command:`include`
+* :command:`find_package`
+* :command:`add_subdirectory`
+* :command:`try_compile`
+* :command:`ctest_read_custom_files`
+* :command:`ctest_run_script` (unless ``NEW_PROCESS`` is specified)
+* User-defined :command:`function`'s and :command:`macro`'s (note that
+ :command:`function` and :command:`macro` themselves don't increase recursion
+ depth)
+* Reading or writing variables that are being watched by a
+ :command:`variable_watch`
diff --git a/Help/variable/CMAKE_MFC_FLAG.rst b/Help/variable/CMAKE_MFC_FLAG.rst
index 5a392bfbb..2c4d1c551 100644
--- a/Help/variable/CMAKE_MFC_FLAG.rst
+++ b/Help/variable/CMAKE_MFC_FLAG.rst
@@ -1,15 +1,16 @@
CMAKE_MFC_FLAG
--------------
-Tell cmake to use MFC for an executable or dll.
+Use the MFC library for an executable or dll.
-This can be set in a ``CMakeLists.txt`` file and will enable MFC in the
-application. It should be set to ``1`` for the static MFC library, and ``2``
-for the shared MFC library. This is used in Visual Studio
-project files. The CMakeSetup dialog used MFC and the ``CMakeLists.txt``
-looks like this:
+Enables the use of the Microsoft Foundation Classes (MFC).
+It should be set to ``1`` for the static MFC library, and
+``2`` for the shared MFC library. This is used in Visual Studio
+project files.
-::
+Usage example:
+
+.. code-block:: cmake
add_definitions(-D_AFXDLL)
set(CMAKE_MFC_FLAG 2)
diff --git a/Help/variable/CMAKE_MODULE_PATH.rst b/Help/variable/CMAKE_MODULE_PATH.rst
index 6490054a4..4dcf6b526 100644
--- a/Help/variable/CMAKE_MODULE_PATH.rst
+++ b/Help/variable/CMAKE_MODULE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_MODULE_PATH
-----------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for CMake modules to be loaded by the :command:`include` or
:command:`find_package` commands before checking the default modules that come
with CMake. By default it is empty, it is intended to be set by the project.
diff --git a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
index aa23b65f9..d17972873 100644
--- a/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
+++ b/Help/variable/CMAKE_POLICY_WARNING_CMPNNNN.rst
@@ -19,6 +19,8 @@ warn by default:
policy :policy:`CMP0066`.
* ``CMAKE_POLICY_WARNING_CMP0067`` controls the warning for
policy :policy:`CMP0067`.
+* ``CMAKE_POLICY_WARNING_CMP0082`` controls the warning for
+ policy :policy:`CMP0082`.
This variable should not be set by a project in CMake code. Project
developers running CMake may set this variable in their cache to
diff --git a/Help/variable/CMAKE_PREFIX_PATH.rst b/Help/variable/CMAKE_PREFIX_PATH.rst
index c2a4a6038..1d4fd0b42 100644
--- a/Help/variable/CMAKE_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_PREFIX_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_PREFIX_PATH
-----------------
-:ref:`;-list <CMake Language Lists>` of directories specifying installation
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying installation
*prefixes* to be searched by the :command:`find_package`,
:command:`find_program`, :command:`find_library`, :command:`find_file`, and
:command:`find_path` commands. Each command will add appropriate
diff --git a/Help/variable/CMAKE_PROGRAM_PATH.rst b/Help/variable/CMAKE_PROGRAM_PATH.rst
index 799e1192c..2d0c090df 100644
--- a/Help/variable/CMAKE_PROGRAM_PATH.rst
+++ b/Help/variable/CMAKE_PROGRAM_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_PROGRAM_PATH
------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_program` command. By default it is empty, it is
intended to be set by the project. See also
:variable:`CMAKE_SYSTEM_PROGRAM_PATH` and :variable:`CMAKE_PREFIX_PATH`.
diff --git a/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst b/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
index 4ad7e33ce..6afbd337a 100644
--- a/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_IGNORE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_IGNORE_PATH
------------------------
-:ref:`;-list <CMake Language Lists>` of directories to be *ignored* by
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories to be *ignored* by
the :command:`find_program`, :command:`find_library`, :command:`find_file`,
and :command:`find_path` commands. This is useful in cross-compiling
environments where some system directories contain incompatible but
diff --git a/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst b/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst
index 2c14345c0..680404ef5 100644
--- a/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_INCLUDE_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_INCLUDE_PATH
-------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_file` and :command:`find_path` commands. By default
this contains the standard directories for the current system. It is *not*
intended to be modified by the project; use :variable:`CMAKE_INCLUDE_PATH` for
diff --git a/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst b/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst
index 3969cb94c..116832bf9 100644
--- a/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_LIBRARY_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_LIBRARY_PATH
-------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_library` command. By default this contains the
standard directories for the current system. It is *not* intended to be
modified by the project; use :variable:`CMAKE_LIBRARY_PATH` for this.
diff --git a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
index 38b2f8dca..87a9d06a8 100644
--- a/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_PREFIX_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_PREFIX_PATH
------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying installation
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying installation
*prefixes* to be searched by the :command:`find_package`,
:command:`find_program`, :command:`find_library`, :command:`find_file`, and
:command:`find_path` commands. Each command will add appropriate
diff --git a/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst b/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst
index cf1b83e80..9b7036182 100644
--- a/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst
+++ b/Help/variable/CMAKE_SYSTEM_PROGRAM_PATH.rst
@@ -1,7 +1,7 @@
CMAKE_SYSTEM_PROGRAM_PATH
-------------------------
-:ref:`;-list <CMake Language Lists>` of directories specifying a search path
+:ref:`Semicolon-separated list <CMake Language Lists>` of directories specifying a search path
for the :command:`find_program` command. By default this contains the
standard directories for the current system. It is *not* intended to be
modified by the project; use :variable:`CMAKE_PROGRAM_PATH` for this.
diff --git a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
index 50121e286..b4a74eb03 100644
--- a/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
+++ b/Help/variable/CMAKE_Swift_LANGUAGE_VERSION.rst
@@ -1,5 +1,9 @@
CMAKE_Swift_LANGUAGE_VERSION
----------------------------
-Set to the Swift language version number. If not set, the legacy "2.3"
-version is assumed.
+Set to the Swift language version number. If not set, the oldest legacy
+version known to be available in the host Xcode version is assumed:
+
+* Swift ``4.0`` for Xcode 10.2 and above.
+* Swift ``3.0`` for Xcode 8.3 and above.
+* Swift ``2.3`` for Xcode 8.2 and below.
diff --git a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
index 9b59c52a6..99ac90ddc 100644
--- a/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
+++ b/Help/variable/CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE.rst
@@ -3,8 +3,8 @@ CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
Visual Studio preferred tool architecture.
-The :ref:`Visual Studio Generators` for VS 2013 and above support optional
-selection of a 64-bit toolchain on 64-bit hosts by specifying a ``host=x64``
-value in the :variable:`CMAKE_GENERATOR_TOOLSET` option. CMake provides
-the selected toolchain architecture preference in this variable (either
-``x64`` or empty).
+The :ref:`Visual Studio Generators` for VS 2013 and above support using
+either the 32-bit or 64-bit host toolchains by specifying a ``host=x86``
+or ``host=x64`` value in the :variable:`CMAKE_GENERATOR_TOOLSET` option.
+CMake provides the selected toolchain architecture preference in this
+variable (``x86``, ``x64``, or empty).
diff --git a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
index ed20bbe92..74667845d 100644
--- a/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
+++ b/Help/variable/CMAKE_XCODE_GENERATE_SCHEME.rst
@@ -1,15 +1,10 @@
CMAKE_XCODE_GENERATE_SCHEME
---------------------------
-If enabled, the Xcode generator will generate schema files. Those are
+If enabled, the Xcode generator will generate schema files. These
are useful to invoke analyze, archive, build-for-testing and test
actions from the command line.
-.. note::
-
- The Xcode Schema Generator is still experimental and subject to
- change.
-
The following target properties overwrite the default of the
corresponding settings on the "Diagnostic" tab for each schema file.
Each of those is initialized by the respective ``CMAKE_`` variable
@@ -17,23 +12,23 @@ at target creation time.
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER`
- :prop_tgt:`XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN`
+- :prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
+- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS`
+- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE`
+- :prop_tgt:`XCODE_SCHEME_GUARD_MALLOC`
+- :prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP`
+- :prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES`
+- :prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE`
+- :prop_tgt:`XCODE_SCHEME_MALLOC_STACK`
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER`
- :prop_tgt:`XCODE_SCHEME_THREAD_SANITIZER_STOP`
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER`
- :prop_tgt:`XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP`
-- :prop_tgt:`XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER`
-- :prop_tgt:`XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP`
-- :prop_tgt:`XCODE_SCHEME_MALLOC_SCRIBBLE`
-- :prop_tgt:`XCODE_SCHEME_MALLOC_GUARD_EDGES`
-- :prop_tgt:`XCODE_SCHEME_GUARD_MALLOC`
- :prop_tgt:`XCODE_SCHEME_ZOMBIE_OBJECTS`
-- :prop_tgt:`XCODE_SCHEME_MALLOC_STACK`
-- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE`
-- :prop_tgt:`XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS`
The following target properties will be applied on the
"Info" and "Arguments" tab:
-- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
- :prop_tgt:`XCODE_SCHEME_ARGUMENTS`
- :prop_tgt:`XCODE_SCHEME_ENVIRONMENT`
+- :prop_tgt:`XCODE_SCHEME_EXECUTABLE`
diff --git a/Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
index 6114e608c..57222ca1e 100644
--- a/Help/variable/CTEST_CUSTOM_TEST_IGNORE.rst
+++ b/Help/variable/CTEST_CUSTOM_TESTS_IGNORE.rst
@@ -1,5 +1,5 @@
-CTEST_CUSTOM_TEST_IGNORE
-------------------------
+CTEST_CUSTOM_TESTS_IGNORE
+-------------------------
A list of regular expressions to use to exclude tests during the
:command:`ctest_test` command.
diff --git a/Help/variable/CTEST_SCP_COMMAND.rst b/Help/variable/CTEST_SCP_COMMAND.rst
index 0f128b14a..19ea8b33d 100644
--- a/Help/variable/CTEST_SCP_COMMAND.rst
+++ b/Help/variable/CTEST_SCP_COMMAND.rst
@@ -1,5 +1,4 @@
CTEST_SCP_COMMAND
-----------------
-Specify the CTest ``SCPCommand`` setting
-in a :manual:`ctest(1)` dashboard client script.
+Legacy option. Not used.
diff --git a/Help/variable/CTEST_SUBMIT_URL.rst b/Help/variable/CTEST_SUBMIT_URL.rst
new file mode 100644
index 000000000..7d84da4b4
--- /dev/null
+++ b/Help/variable/CTEST_SUBMIT_URL.rst
@@ -0,0 +1,5 @@
+CTEST_SUBMIT_URL
+----------------
+
+Specify the CTest ``SubmitURL`` setting
+in a :manual:`ctest(1)` dashboard client script.
diff --git a/Help/variable/CTEST_TRIGGER_SITE.rst b/Help/variable/CTEST_TRIGGER_SITE.rst
index de9242807..a50e405cc 100644
--- a/Help/variable/CTEST_TRIGGER_SITE.rst
+++ b/Help/variable/CTEST_TRIGGER_SITE.rst
@@ -1,5 +1,4 @@
CTEST_TRIGGER_SITE
------------------
-Specify the CTest ``TriggerSite`` setting
-in a :manual:`ctest(1)` dashboard client script.
+Legacy option. Not used.
diff --git a/Help/variable/ENV.rst b/Help/variable/ENV.rst
index 98677ddc9..2b439342e 100644
--- a/Help/variable/ENV.rst
+++ b/Help/variable/ENV.rst
@@ -1,8 +1,12 @@
ENV
---
-Read environment variables.
+Operator to read environment variables.
Use the syntax ``$ENV{VAR}`` to read environment variable ``VAR``.
-See the :command:`set` command to see how to write environment variables.
+To test whether an environment variable is defined, use the signature
+``if(DEFINED ENV{<name>})`` of the :command:`if` command.
+
+See the :command:`set` and :command:`unset` commands to see how to
+write or remove environment variables.
diff --git a/Help/variable/GHS-MULTI.rst b/Help/variable/GHS-MULTI.rst
index 0f91be8ad..fe3b17e18 100644
--- a/Help/variable/GHS-MULTI.rst
+++ b/Help/variable/GHS-MULTI.rst
@@ -1,4 +1,4 @@
GHS-MULTI
---------
-True when using Green Hills MULTI
+``True`` when using :generator:`Green Hills MULTI` generator.
diff --git a/Help/variable/IOS.rst b/Help/variable/IOS.rst
new file mode 100644
index 000000000..e5cc3f69c
--- /dev/null
+++ b/Help/variable/IOS.rst
@@ -0,0 +1,4 @@
+IOS
+---
+
+Set to ``1`` when the target system (:variable:`CMAKE_SYSTEM_NAME`) is ``iOS``.
diff --git a/Help/variable/MSVC_VERSION.rst b/Help/variable/MSVC_VERSION.rst
index 4ef43d831..45df37fa0 100644
--- a/Help/variable/MSVC_VERSION.rst
+++ b/Help/variable/MSVC_VERSION.rst
@@ -18,6 +18,7 @@ Known version numbers are::
1800 = VS 12.0 (v120 toolset)
1900 = VS 14.0 (v140 toolset)
1910-1919 = VS 15.0 (v141 toolset)
+ 1920-1929 = VS 16.0 (v142 toolset)
See also the :variable:`CMAKE_<LANG>_COMPILER_VERSION` and
:variable:`MSVC_TOOLSET_VERSION` variable.
diff --git a/Help/variable/MSYS.rst b/Help/variable/MSYS.rst
new file mode 100644
index 000000000..25ddc7f73
--- /dev/null
+++ b/Help/variable/MSYS.rst
@@ -0,0 +1,4 @@
+MSYS
+----
+
+``True`` when using the :generator:`MSYS Makefiles` generator.
diff --git a/Help/variable/PackageName_ROOT.rst b/Help/variable/PackageName_ROOT.rst
index 4f6c25b34..c5b07ae2b 100644
--- a/Help/variable/PackageName_ROOT.rst
+++ b/Help/variable/PackageName_ROOT.rst
@@ -9,6 +9,6 @@ prefixes specified in the ``Foo_ROOT`` CMake variable (if set).
See policy :policy:`CMP0074`.
This variable may hold a single prefix or a
-:ref:`;-list <CMake Language Lists>` of multiple prefixes.
+:ref:`semicolon-separated list <CMake Language Lists>` of multiple prefixes.
See also the :envvar:`<PackageName>_ROOT` environment variable.
diff --git a/Modules/AddFileDependencies.cmake b/Modules/AddFileDependencies.cmake
index fdd843266..4a4e645cd 100644
--- a/Modules/AddFileDependencies.cmake
+++ b/Modules/AddFileDependencies.cmake
@@ -1,13 +1,18 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# AddFileDependencies
-# -------------------
-#
-# ADD_FILE_DEPENDENCIES(source_file depend_files...)
-#
-# Adds the given files as dependencies to source_file
+#[=======================================================================[.rst:
+AddFileDependencies
+-------------------
+
+Add dependencies to a source file.
+
+.. code-block:: cmake
+
+ ADD_FILE_DEPENDENCIES(<source> <files>)
+
+Adds the given ``<files>`` to the dependencies of file ``<source>``.
+#]=======================================================================]
macro(ADD_FILE_DEPENDENCIES _file)
diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake
index 62d04f3ef..e333cdbc6 100644
--- a/Modules/AndroidTestUtilities.cmake
+++ b/Modules/AndroidTestUtilities.cmake
@@ -40,7 +40,7 @@ Module Functions
.. command:: android_add_test_data
- ::
+ .. code-block:: cmake
android_add_test_data(<test-name>
[FILES <files>...] [FILES_DEST <device-dir>]
diff --git a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
index bc78016df..afffc047f 100644
--- a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
+++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
@@ -18,6 +18,12 @@ else()
endif()
endif()
+
+# if the installed project requested no architecture check, don't perform the check
+if("@CVF_ARCH_INDEPENDENT@")
+ return()
+endif()
+
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
diff --git a/Modules/BasicConfigVersion-ExactVersion.cmake.in b/Modules/BasicConfigVersion-ExactVersion.cmake.in
index de4a23af0..fe5c2e5a8 100644
--- a/Modules/BasicConfigVersion-ExactVersion.cmake.in
+++ b/Modules/BasicConfigVersion-ExactVersion.cmake.in
@@ -34,6 +34,11 @@ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
endif()
+# if the installed project requested no architecture check, don't perform the check
+if("@CVF_ARCH_INDEPENDENT@")
+ return()
+endif()
+
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
index a32245dd5..d885c0f93 100644
--- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
+++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
@@ -33,6 +33,11 @@ else()
endif()
+# if the installed project requested no architecture check, don't perform the check
+if("@CVF_ARCH_INDEPENDENT@")
+ return()
+endif()
+
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
diff --git a/Modules/BasicConfigVersion-SameMinorVersion.cmake.in b/Modules/BasicConfigVersion-SameMinorVersion.cmake.in
index 59ca25376..bf055e8d4 100644
--- a/Modules/BasicConfigVersion-SameMinorVersion.cmake.in
+++ b/Modules/BasicConfigVersion-SameMinorVersion.cmake.in
@@ -37,6 +37,11 @@ else()
endif()
+# if the installed project requested no architecture check, don't perform the check
+if("@CVF_ARCH_INDEPENDENT@")
+ return()
+endif()
+
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
return()
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index 89ca918cb..8c7646e4d 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -12,7 +12,7 @@ bundles on the Mac and bundle-like directories on any OS.
The following functions are provided by this module:
-::
+.. code-block:: cmake
fixup_bundle
copy_and_fixup_bundle
@@ -39,9 +39,9 @@ DO NOT USE THESE FUNCTIONS AT CONFIGURE TIME (from ``CMakeLists.txt``)!
Instead, invoke them from an :command:`install(CODE)` or
:command:`install(SCRIPT)` rule.
-::
+.. code-block:: cmake
- FIXUP_BUNDLE(<app> <libs> <dirs>)
+ fixup_bundle(<app> <libs> <dirs>)
Fix up a bundle in-place and make it standalone, such that it can be
drag-n-drop copied to another machine and run on that machine as long
@@ -62,16 +62,16 @@ ensure that it is truly standalone.
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
-::
+.. code-block:: cmake
- COPY_AND_FIXUP_BUNDLE(<src> <dst> <libs> <dirs>)
+ copy_and_fixup_bundle(<src> <dst> <libs> <dirs>)
Makes a copy of the bundle <src> at location <dst> and then fixes up
the new copied bundle in-place at <dst>...
-::
+.. code-block:: cmake
- VERIFY_APP(<app>)
+ verify_app(<app>)
Verifies that an application <app> appears valid based on running
analysis tools on it. Calls "message(FATAL_ERROR" if the application
@@ -80,16 +80,16 @@ is not verified.
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
-::
+.. code-block:: cmake
- GET_BUNDLE_MAIN_EXECUTABLE(<bundle> <result_var>)
+ get_bundle_main_executable(<bundle> <result_var>)
The result will be the full path name of the bundle's main executable
file or an "error:" prefixed string if it could not be determined.
-::
+.. code-block:: cmake
- GET_DOTAPP_DIR(<exe> <dotapp_dir_var>)
+ get_dotapp_dir(<exe> <dotapp_dir_var>)
Returns the nearest parent dir whose name ends with ".app" given the
full path to an executable. If there is no such parent dir, then
@@ -97,25 +97,25 @@ simply return the dir containing the executable.
The returned directory may or may not exist.
-::
+.. code-block:: cmake
- GET_BUNDLE_AND_EXECUTABLE(<app> <bundle_var> <executable_var> <valid_var>)
+ get_bundle_and_executable(<app> <bundle_var> <executable_var> <valid_var>)
Takes either a ".app" directory name or the name of an executable
nested inside a ".app" directory and returns the path to the ".app"
directory in <bundle_var> and the path to its main executable in
<executable_var>
-::
+.. code-block:: cmake
- GET_BUNDLE_ALL_EXECUTABLES(<bundle> <exes_var>)
+ get_bundle_all_executables(<bundle> <exes_var>)
Scans the given bundle recursively for all executable files and
accumulates them into a variable.
-::
+.. code-block:: cmake
- GET_ITEM_KEY(<item> <key_var>)
+ get_item_key(<item> <key_var>)
Given a file (item) name, generate a key that should be unique
considering the set of libraries that need copying or fixing up to
@@ -125,9 +125,9 @@ extension with "." replaced by "_"
This key is used as a prefix for CMake variables so that we can
associate a set of variables with a given item based on its key.
-::
+.. code-block:: cmake
- CLEAR_BUNDLE_KEYS(<keys_var>)
+ clear_bundle_keys(<keys_var>)
Loop over the list of keys, clearing all the variables associated with
each key. After the loop, clear the list of keys itself.
@@ -135,17 +135,17 @@ each key. After the loop, clear the list of keys itself.
Caller of get_bundle_keys should call clear_bundle_keys when done with
list of keys.
-::
+.. code-block:: cmake
- SET_BUNDLE_KEY_VALUES(<keys_var> <context> <item> <exepath> <dirs>
+ set_bundle_key_values(<keys_var> <context> <item> <exepath> <dirs>
<copyflag> [<rpaths>])
Add a key to the list (if necessary) for the given item. If added,
also set all the variables associated with that key.
-::
+.. code-block:: cmake
- GET_BUNDLE_KEYS(<app> <libs> <dirs> <keys_var>)
+ get_bundle_keys(<app> <libs> <dirs> <keys_var>)
Loop over all the executable and library files within the bundle (and
given as extra <libs>) and accumulate a list of keys representing
@@ -156,17 +156,17 @@ appropriate install_name_tool fixups.
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
-::
+.. code-block:: cmake
- COPY_RESOLVED_ITEM_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
+ copy_resolved_item_into_bundle(<resolved_item> <resolved_embedded_item>)
Copy a resolved item into the bundle if necessary. Copy is not
necessary if the resolved_item is "the same as" the
resolved_embedded_item.
-::
+.. code-block:: cmake
- COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE(<resolved_item> <resolved_embedded_item>)
+ copy_resolved_framework_into_bundle(<resolved_item> <resolved_embedded_item>)
Copy a resolved framework into the bundle if necessary. Copy is not
necessary if the resolved_item is "the same as" the
@@ -178,9 +178,9 @@ BU_COPY_FULL_FRAMEWORK_CONTENTS to ON before calling fixup_bundle. By
default, COPY_RESOLVED_FRAMEWORK_INTO_BUNDLE copies the framework
dylib itself plus the framework Resources directory.
-::
+.. code-block:: cmake
- FIXUP_BUNDLE_ITEM(<resolved_embedded_item> <exepath> <dirs>)
+ fixup_bundle_item(<resolved_embedded_item> <exepath> <dirs>)
Get the direct/non-system prerequisites of the resolved embedded item.
For each prerequisite, change the way it is referenced to the value of
@@ -204,9 +204,9 @@ once.
If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items will be
marked writable before install_name_tool tries to change them.
-::
+.. code-block:: cmake
- VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
+ verify_bundle_prerequisites(<bundle> <result_var> <info_var>)
Verifies that the sum of all prerequisites of all files inside the
bundle are contained within the bundle or are "system" libraries,
@@ -215,9 +215,9 @@ presumed to exist everywhere.
As an optional parameter (IGNORE_ITEM) a list of file names can be passed,
which are then ignored (e.g. IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe")
-::
+.. code-block:: cmake
- VERIFY_BUNDLE_SYMLINKS(<bundle> <result_var> <info_var>)
+ verify_bundle_symlinks(<bundle> <result_var> <info_var>)
Verifies that any symlinks found in the bundle point to other files
that are already also in the bundle... Anything that points to an
@@ -225,11 +225,8 @@ external file causes this function to fail the verification.
#]=======================================================================]
function(_warn_cmp0080)
- message(AUTHOR_WARNING
- "Policy CMP0080 is not set: BundleUtilities prefers not to be included at configure time. "
- "Run \"cmake --help-policy CMP0080\" for policy details. "
- "Use the cmake_policy command to set the policy and suppress this warning."
- )
+ cmake_policy(GET_WARNING CMP0080 _cmp0080_warning)
+ message(AUTHOR_WARNING "${_cmp0080_warning}\n")
endfunction()
# Do not include this module at configure time!
@@ -883,9 +880,13 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
endif()
+ # CMAKE_INSTALL_NAME_TOOL may not be set if executed in script mode
+ # Duplicated from CMakeFindBinUtils.cmake
+ find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+
# Only if install_name_tool supports -delete_rpath:
#
- execute_process(COMMAND install_name_tool
+ execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL}
OUTPUT_VARIABLE install_name_tool_usage
ERROR_VARIABLE install_name_tool_usage
)
@@ -903,7 +904,7 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
# to install_name_tool:
#
if(changes)
- set(cmd install_name_tool ${changes} "${resolved_embedded_item}")
+ set(cmd ${CMAKE_INSTALL_NAME_TOOL} ${changes} "${resolved_embedded_item}")
execute_process(COMMAND ${cmd} RESULT_VARIABLE install_name_tool_result)
if(NOT install_name_tool_result EQUAL 0)
string(REPLACE ";" "' '" msg "'${cmd}'")
diff --git a/Modules/CMakeASMCompiler.cmake.in b/Modules/CMakeASMCompiler.cmake.in
index a6465f695..b8e09fefa 100644
--- a/Modules/CMakeASMCompiler.cmake.in
+++ b/Modules/CMakeASMCompiler.cmake.in
@@ -5,6 +5,7 @@ set(CMAKE_ASM@ASM_DIALECT@_COMPILER_AR "@_CMAKE_ASM_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_RANLIB "@_CMAKE_ASM_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_VERSION "@_CMAKE_ASM_COMPILER_VERSION@")
diff --git a/Modules/CMakeAddFortranSubdirectory.cmake b/Modules/CMakeAddFortranSubdirectory.cmake
index 4649f35a1..50b280721 100644
--- a/Modules/CMakeAddFortranSubdirectory.cmake
+++ b/Modules/CMakeAddFortranSubdirectory.cmake
@@ -1,46 +1,47 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeAddFortranSubdirectory
-# ---------------------------
-#
-# Use MinGW gfortran from VS if a fortran compiler is not found.
-#
-# The 'add_fortran_subdirectory' function adds a subdirectory to a
-# project that contains a fortran only sub-project. The module will
-# check the current compiler and see if it can support fortran. If no
-# fortran compiler is found and the compiler is MSVC, then this module
-# will find the MinGW gfortran. It will then use an external project to
-# build with the MinGW tools. It will also create imported targets for
-# the libraries created. This will only work if the fortran code is
-# built into a dll, so BUILD_SHARED_LIBS is turned on in the project.
-# In addition the CMAKE_GNUtoMS option is set to on, so that the MS .lib
-# files are created. Usage is as follows:
-#
-# ::
-#
-# cmake_add_fortran_subdirectory(
-# <subdir> # name of subdirectory
-# PROJECT <project_name> # project name in subdir top CMakeLists.txt
-# ARCHIVE_DIR <dir> # dir where project places .lib files
-# RUNTIME_DIR <dir> # dir where project places .dll files
-# LIBRARIES <lib>... # names of library targets to import
-# LINK_LIBRARIES # link interface libraries for LIBRARIES
-# [LINK_LIBS <lib> <dep>...]...
-# CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
-# NO_EXTERNAL_INSTALL # skip installation of external project
-# )
-#
-# Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with
-# respect to the build directory corresponding to the source directory
-# in which the function is invoked.
-#
-# Limitations:
-#
-# NO_EXTERNAL_INSTALL is required for forward compatibility with a
-# future version that supports installation of the external project
-# binaries during "make install".
+#[=======================================================================[.rst:
+CMakeAddFortranSubdirectory
+---------------------------
+
+Add a fortran-only subdirectory, find a fortran compiler, and build.
+
+The ``cmake_add_fortran_subdirectory`` function adds a subdirectory
+to a project that contains a fortran-only subproject. The module will
+check the current compiler and see if it can support fortran. If no
+fortran compiler is found and the compiler is MSVC, then this module
+will find the MinGW gfortran. It will then use an external project to
+build with the MinGW tools. It will also create imported targets for
+the libraries created. This will only work if the fortran code is
+built into a dll, so :variable:`BUILD_SHARED_LIBS` is turned on in
+the project. In addition the :variable:`CMAKE_GNUtoMS` option is set
+to on, so that Microsoft .lib files are created. Usage is as follows:
+
+::
+
+ cmake_add_fortran_subdirectory(
+ <subdir> # name of subdirectory
+ PROJECT <project_name> # project name in subdir top CMakeLists.txt
+ ARCHIVE_DIR <dir> # dir where project places .lib files
+ RUNTIME_DIR <dir> # dir where project places .dll files
+ LIBRARIES <lib>... # names of library targets to import
+ LINK_LIBRARIES # link interface libraries for LIBRARIES
+ [LINK_LIBS <lib> <dep>...]...
+ CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
+ NO_EXTERNAL_INSTALL # skip installation of external project
+ )
+
+Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with
+respect to the build directory corresponding to the source directory
+in which the function is invoked.
+
+Limitations:
+
+NO_EXTERNAL_INSTALL is required for forward compatibility with a
+future version that supports installation of the external project
+binaries during "make install".
+#]=======================================================================]
set(_MS_MINGW_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
include(CheckLanguage)
diff --git a/Modules/CMakeBackwardCompatibilityC.cmake b/Modules/CMakeBackwardCompatibilityC.cmake
index 5d86d7313..775a5137d 100644
--- a/Modules/CMakeBackwardCompatibilityC.cmake
+++ b/Modules/CMakeBackwardCompatibilityC.cmake
@@ -59,9 +59,6 @@ if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
"Use HP pthreads.")
- set (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
- "Use sproc libs.")
-
if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
@@ -72,7 +69,6 @@ mark_as_advanced(
CMAKE_HP_PTHREADS
CMAKE_THREAD_LIBS
CMAKE_USE_PTHREADS
-CMAKE_USE_SPROC
CMAKE_USE_WIN32_THREADS
CMAKE_X_CFLAGS
CMAKE_X_LIBS
diff --git a/Modules/CMakeBackwardCompatibilityCXX.cmake b/Modules/CMakeBackwardCompatibilityCXX.cmake
index cbd5ea76c..02744a985 100644
--- a/Modules/CMakeBackwardCompatibilityCXX.cmake
+++ b/Modules/CMakeBackwardCompatibilityCXX.cmake
@@ -1,29 +1,27 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeBackwardCompatibilityCXX
-# -----------------------------
-#
-# define a bunch of backwards compatibility variables
-#
-# ::
-#
-# CMAKE_ANSI_CXXFLAGS - flag for ansi c++
-# CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
-# include(TestForANSIStreamHeaders)
-# include(CheckIncludeFileCXX)
-# include(TestForSTDNamespace)
-# include(TestForANSIForScope)
+#[=======================================================================[.rst:
+CMakeBackwardCompatibilityCXX
+-----------------------------
+
+define a bunch of backwards compatibility variables
+
+::
+
+ CMAKE_ANSI_CXXFLAGS - flag for ansi c++
+ CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
+ include(TestForANSIStreamHeaders)
+ include(CheckIncludeFileCXX)
+ include(TestForSTDNamespace)
+ include(TestForANSIForScope)
+#]=======================================================================]
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# check for some ANSI flags in the CXX compiler if it is not gnu
if(NOT CMAKE_COMPILER_IS_GNUCXX)
include(TestCXXAcceptsFlag)
set(CMAKE_TRY_ANSI_CXX_FLAGS "")
- if(CMAKE_SYSTEM_NAME MATCHES "IRIX")
- set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
- endif()
if(CMAKE_SYSTEM_NAME MATCHES "OSF")
set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
endif()
diff --git a/Modules/CMakeCCompiler.cmake.in b/Modules/CMakeCCompiler.cmake.in
index 72144cf31..f473b0d1c 100644
--- a/Modules/CMakeCCompiler.cmake.in
+++ b/Modules/CMakeCCompiler.cmake.in
@@ -21,6 +21,7 @@ set(CMAKE_C_COMPILER_AR "@CMAKE_C_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_C_COMPILER_RANLIB "@CMAKE_C_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS @CMAKE_C_COMPILER_WORKS@)
@@ -68,6 +69,7 @@ endif()
@CMAKE_C_SYSROOT_FLAG_CODE@
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
+set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
diff --git a/Modules/CMakeCUDACompiler.cmake.in b/Modules/CMakeCUDACompiler.cmake.in
index 9761d8c12..711129a39 100644
--- a/Modules/CMakeCUDACompiler.cmake.in
+++ b/Modules/CMakeCUDACompiler.cmake.in
@@ -23,6 +23,10 @@ set(CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_LIBR
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
+set(CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES "@CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CUDA_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
+
+set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_MT "@CMAKE_MT@")
diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in
index 8da6a8c1d..a1be02b5c 100644
--- a/Modules/CMakeCXXCompiler.cmake.in
+++ b/Modules/CMakeCXXCompiler.cmake.in
@@ -23,6 +23,7 @@ set(CMAKE_CXX_COMPILER_AR "@CMAKE_CXX_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_CXX_COMPILER_RANLIB "@CMAKE_CXX_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
+set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS @CMAKE_CXX_COMPILER_WORKS@)
@@ -71,6 +72,7 @@ endif()
@CMAKE_CXX_SYSROOT_FLAG_CODE@
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
+set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index 2975874d8..a896b99b6 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -105,6 +105,12 @@ endif()
if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
endif()
+if(NOT CMAKE_CXX_LINK_OPTIONS_PIE)
+ set(CMAKE_CXX_LINK_OPTIONS_PIE ${CMAKE_C_LINK_OPTIONS_PIE})
+endif()
+if(NOT CMAKE_CXX_LINK_OPTIONS_NO_PIE)
+ set(CMAKE_CXX_LINK_OPTIONS_NO_PIE ${CMAKE_C_LINK_OPTIONS_NO_PIE})
+endif()
if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
@@ -269,4 +275,3 @@ CMAKE_VERBOSE_MAKEFILE
)
set(CMAKE_CXX_INFORMATION_LOADED 1)
-
diff --git a/Modules/CMakeCompilerABI.h b/Modules/CMakeCompilerABI.h
index 6f36b0303..45532afdb 100644
--- a/Modules/CMakeCompilerABI.h
+++ b/Modules/CMakeCompilerABI.h
@@ -10,16 +10,10 @@ const char info_sizeof_dptr[] = {
};
/* Application Binary Interface. */
-#if defined(__sgi) && defined(_ABIO32)
-# define ABI_ID "ELF O32"
-#elif defined(__sgi) && defined(_ABIN32)
-# define ABI_ID "ELF N32"
-#elif defined(__sgi) && defined(_ABI64)
-# define ABI_ID "ELF 64"
/* Check for (some) ARM ABIs.
* See e.g. http://wiki.debian.org/ArmEabiPort for some information on this. */
-#elif defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
+#if defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
# define ABI_ID "ELF ARMEABI"
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__)
# define ABI_ID "ELF ARM"
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake
index f2d43b687..6a22d2768 100644
--- a/Modules/CMakeCompilerIdDetection.cmake
+++ b/Modules/CMakeCompilerIdDetection.cmake
@@ -63,6 +63,7 @@ function(compiler_id_detection outvar lang)
Cray
TI
Fujitsu
+ GHS
)
if (lang STREQUAL C)
list(APPEND ordered_compilers
@@ -72,13 +73,13 @@ function(compiler_id_detection outvar lang)
endif()
list(APPEND ordered_compilers
SCO
+ ARMCC
AppleClang
Clang
GNU
MSVC
ADSP
IAR
- ARMCC
)
if (lang STREQUAL C)
list(APPEND ordered_compilers
@@ -135,9 +136,6 @@ function(compiler_id_detection outvar lang)
/* These compilers are either not known or too old to define an
identification macro. Try to identify the platform and guess that
it is the native compiler. */
-#elif defined(__sgi)
-# define ${CID_PREFIX}COMPILER_ID \"MIPSpro\"
-
#elif defined(__hpux) || defined(__hpua)
# define ${CID_PREFIX}COMPILER_ID \"HP\"
diff --git a/Modules/CMakeDependentOption.cmake b/Modules/CMakeDependentOption.cmake
index 21d3c96b3..6046d8585 100644
--- a/Modules/CMakeDependentOption.cmake
+++ b/Modules/CMakeDependentOption.cmake
@@ -1,27 +1,28 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeDependentOption
-# --------------------
-#
-# Macro to provide an option dependent on other options.
-#
-# This macro presents an option to the user only if a set of other
-# conditions are true. When the option is not presented a default value
-# is used, but any value set by the user is preserved for when the
-# option is presented again. Example invocation:
-#
-# ::
-#
-# CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
-# "USE_BAR;NOT USE_ZOT" OFF)
-#
-# If USE_BAR is true and USE_ZOT is false, this provides an option
-# called USE_FOO that defaults to ON. Otherwise, it sets USE_FOO to
-# OFF. If the status of USE_BAR or USE_ZOT ever changes, any value for
-# the USE_FOO option is saved so that when the option is re-enabled it
-# retains its old value.
+#[=======================================================================[.rst:
+CMakeDependentOption
+--------------------
+
+Macro to provide an option dependent on other options.
+
+This macro presents an option to the user only if a set of other
+conditions are true. When the option is not presented a default value
+is used, but any value set by the user is preserved for when the
+option is presented again. Example invocation:
+
+::
+
+ CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
+ "USE_BAR;NOT USE_ZOT" OFF)
+
+If USE_BAR is true and USE_ZOT is false, this provides an option
+called USE_FOO that defaults to ON. Otherwise, it sets USE_FOO to
+OFF. If the status of USE_BAR or USE_ZOT ever changes, any value for
+the USE_FOO option is saved so that when the option is re-enabled it
+retains its old value.
+#]=======================================================================]
macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
if(${option}_ISSET MATCHES "^${option}_ISSET$")
diff --git a/Modules/CMakeDetermineASMCompiler.cmake b/Modules/CMakeDetermineASMCompiler.cmake
index dbc41c8c7..b8c8c5d35 100644
--- a/Modules/CMakeDetermineASMCompiler.cmake
+++ b/Modules/CMakeDetermineASMCompiler.cmake
@@ -83,7 +83,7 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
- set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "-?")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI )
@@ -110,6 +110,10 @@ if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_ADSP "-version")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_ADSP "Analog Devices")
+ list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS QCC)
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_QCC "-V")
+ set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_QCC "gcc_nto")
+
include(CMakeDetermineCompilerId)
set(userflags)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT} "${userflags}")
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 17706ea50..d7f6f97d0 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -31,6 +31,7 @@ if(NOT CMAKE_C_COMPILER_NAMES)
endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c)
_cmake_find_compiler_path(C)
@@ -105,7 +106,7 @@ if(NOT CMAKE_C_COMPILER_ID_RUN)
# ...
# /path/to/cc ...CompilerIdC/...
# to extract the compiler front-end for the language.
- set(CMAKE_C_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdC/(\\./)?(CompilerIdC.xctest/)?CompilerIdC[ \t\n\\\"]")
+ set(CMAKE_C_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdC/(\\./)?(CompilerIdC.(framework|xctest)/)?CompilerIdC[ \t\n\\\"]")
set(CMAKE_C_COMPILER_ID_TOOL_MATCH_INDEX 2)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
@@ -136,7 +137,7 @@ endif ()
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
- if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|QCC")
get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)(clang|g?cc)(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
@@ -145,7 +146,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_C_COMPILER_TARGET}-)
endif()
elseif(COMPILER_BASENAME MATCHES "qcc(\\.exe)?$")
- if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
+ if(CMAKE_C_COMPILER_TARGET MATCHES "gcc_nto([a-z0-9]+_[0-9]+|[^_le]+)(le)?")
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)
endif()
endif ()
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 113b520a0..490d6592e 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -111,10 +111,15 @@ elseif(CMAKE_CUDA_COMPILER_ID STREQUAL NVIDIA)
if(_nvcc_libraries)
# Remove variable assignments.
string(REGEX REPLACE "#\\\$ *[^= ]+=[^\n]*\n" "" _nvcc_output "${_nvcc_output_orig}")
+ # Encode [] characters that break list expansion.
+ string(REPLACE "[" "{==={" _nvcc_output "${_nvcc_output}")
+ string(REPLACE "]" "}===}" _nvcc_output "${_nvcc_output}")
# Split lines.
string(REGEX REPLACE "\n+(#\\\$ )?" ";" _nvcc_output "${_nvcc_output}")
foreach(line IN LISTS _nvcc_output)
set(_nvcc_output_line "${line}")
+ string(REPLACE "{==={" "[" _nvcc_output_line "${_nvcc_output_line}")
+ string(REPLACE "}===}" "]" _nvcc_output_line "${_nvcc_output_line}")
string(APPEND _nvcc_log " considering line: [${_nvcc_output_line}]\n")
if("${_nvcc_output_line}" MATCHES "^ *nvlink")
string(APPEND _nvcc_log " ignoring nvlink line\n")
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 70d17a181..bd878b292 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -30,6 +30,7 @@ if(NOT CMAKE_CXX_COMPILER_NAMES)
endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
+elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp)
_cmake_find_compiler_path(CXX)
@@ -100,7 +101,7 @@ if(NOT CMAKE_CXX_COMPILER_ID_RUN)
# ...
# /path/to/cc ...CompilerIdCXX/...
# to extract the compiler front-end for the language.
- set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCXX/(\\./)?(CompilerIdCXX.xctest/)?CompilerIdCXX[ \t\n\\\"]")
+ set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_REGEX "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerIdCXX/(\\./)?(CompilerIdCXX.(framework|xctest)/)?CompilerIdCXX[ \t\n\\\"]")
set(CMAKE_CXX_COMPILER_ID_TOOL_MATCH_INDEX 2)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
@@ -133,7 +134,7 @@ endif ()
if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
- if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|QCC")
get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)(clan)?[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
@@ -142,7 +143,7 @@ if (CMAKE_CROSSCOMPILING AND NOT _CMAKE_TOOLCHAIN_PREFIX)
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_CXX_COMPILER_TARGET}-)
endif()
elseif(COMPILER_BASENAME MATCHES "QCC(\\.exe)?$")
- if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([^_le]+)(le)?")
+ if(CMAKE_CXX_COMPILER_TARGET MATCHES "gcc_nto([a-z0-9]+_[0-9]+|[^_le]+)(le)")
set(_CMAKE_TOOLCHAIN_PREFIX nto${CMAKE_MATCH_1}-)
endif()
endif ()
diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake
index 604ac27e6..06f3ba22d 100644
--- a/Modules/CMakeDetermineCompilerABI.cmake
+++ b/Modules/CMakeDetermineCompilerABI.cmake
@@ -6,7 +6,9 @@
# This is used internally by CMake and should not be included by user
# code.
+include(${CMAKE_ROOT}/Modules/CMakeParseImplicitIncludeInfo.cmake)
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+include(CMakeTestCompilerCommon)
function(CMAKE_DETERMINE_COMPILER_ABI lang src)
if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED)
@@ -15,23 +17,48 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
# Compile the ABI identification source.
set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin")
set(CMAKE_FLAGS )
+ set(COMPILE_DEFINITIONS )
if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
set(CMAKE_FLAGS "-DEXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
+ set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_FLAG}")
+ endif()
+ if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG)
+ set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}")
endif()
if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
# Avoid adding our own platform standard libraries for compilers
# from which we might detect implicit link libraries.
list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=")
endif()
+ __TestCompiler_setTryCompileTargetType()
+
+ # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables
+ # and set them to "C" that way GCC's "search starts here" text is in
+ # English and we can grok it.
+ set(_orig_lc_all $ENV{LC_ALL})
+ set(_orig_lc_messages $ENV{LC_MESSAGES})
+ set(_orig_lang $ENV{LANG})
+ set(ENV{LC_ALL} C)
+ set(ENV{LC_MESSAGES} C)
+ set(ENV{LANG} C)
+
try_compile(CMAKE_${lang}_ABI_COMPILED
${CMAKE_BINARY_DIR} ${src}
CMAKE_FLAGS ${CMAKE_FLAGS}
# Ignore unused flags when we are just determining the ABI.
"--no-warn-unused-cli"
+ COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS}
OUTPUT_VARIABLE OUTPUT
COPY_FILE "${BIN}"
COPY_FILE_ERROR _copy_error
+ __CMAKE_INTERNAL ABI
)
+
+ # Restore original LC_ALL, LC_MESSAGES, and LANG
+ set(ENV{LC_ALL} ${_orig_lc_all})
+ set(ENV{LC_MESSAGES} ${_orig_lc_messages})
+ set(ENV{LANG} ${_orig_lang})
+
# Move result from cache to normal variable.
set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED})
unset(CMAKE_${lang}_ABI_COMPILED CACHE)
@@ -62,6 +89,26 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src)
set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
endif()
+ # Parse implicit include directory for this language, if available.
+ if(CMAKE_${lang}_VERBOSE_FLAG)
+ set (implicit_incdirs "")
+ cmake_parse_implicit_include_info("${OUTPUT}" "${lang}"
+ implicit_incdirs log rv)
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Parsed ${lang} implicit include dir info from above output: rv=${rv}\n${log}\n\n")
+ if("${rv}" STREQUAL "done")
+ # Entries that we have been told to explicitly pass as standard include
+ # directories will not be implicitly added by the compiler.
+ if(CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES)
+ list(REMOVE_ITEM implicit_incdirs ${CMAKE_${lang}_STANDARD_INCLUDE_DIRECTORIES})
+ endif()
+
+ # We parsed implicit include directories, so override the default initializer.
+ set(_CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT "${implicit_incdirs}")
+ endif()
+ endif()
+ set(CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES "${_CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT}" PARENT_SCOPE)
+
# Parse implicit linker information for this language, if available.
set(implicit_dirs "")
set(implicit_libs "")
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index 5e2df26a6..59dab6de4 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -52,6 +52,13 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
endforeach()
endif()
+ # If the compiler is still unknown, fallback to GHS
+ if(NOT CMAKE_${lang}_COMPILER_ID AND "${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
+ set(CMAKE_${lang}_COMPILER_ID GHS)
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "The ${lang} compiler identification is falling back to GHS.\n\n")
+ endif()
+
# CUDA < 7.5 is missing version macros
if(lang STREQUAL "CUDA"
AND CMAKE_${lang}_COMPILER_ID STREQUAL "NVIDIA"
@@ -174,7 +181,10 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(vs_version ${CMAKE_MATCH_1})
set(id_platform ${CMAKE_VS_PLATFORM_NAME})
set(id_lang "${lang}")
- if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
+ set(id_PostBuildEvent_Command "")
+ if(CMAKE_VS_PLATFORM_TOOLSET MATCHES "^[Ll][Ll][Vv][Mm]$")
+ set(id_cl_var "ClangClExecutable")
+ elseif(CMAKE_VS_PLATFORM_TOOLSET MATCHES "v[0-9]+_clang_.*")
set(id_cl clang.exe)
else()
set(id_cl cl.exe)
@@ -261,7 +271,11 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
set(id_src "${src}")
set(id_compile "ClCompile")
- set(id_PostBuildEvent_Command "for %%i in (${id_cl}) do %40echo CMAKE_${lang}_COMPILER=%%~$PATH:i")
+ if(id_cl_var)
+ set(id_PostBuildEvent_Command "echo CMAKE_${lang}_COMPILER=$(${id_cl_var})")
+ else()
+ set(id_PostBuildEvent_Command "for %%i in (${id_cl}) do %40echo CMAKE_${lang}_COMPILER=%%~$PATH:i")
+ endif()
set(id_Import_props "")
set(id_Import_targets "")
set(id_ItemDefinitionGroup_entry "")
@@ -325,6 +339,8 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
if("${lang}" STREQUAL "Swift")
if(CMAKE_Swift_LANGUAGE_VERSION)
set(id_lang_version "SWIFT_VERSION = ${CMAKE_Swift_LANGUAGE_VERSION};")
+ elseif(XCODE_VERSION VERSION_GREATER_EQUAL 10.2)
+ set(id_lang_version "SWIFT_VERSION = 4.0;")
elseif(XCODE_VERSION VERSION_GREATER_EQUAL 8.3)
set(id_lang_version "SWIFT_VERSION = 3.0;")
else()
@@ -345,21 +361,20 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
if(CMAKE_OSX_SYSROOT MATCHES "(^|/)[Ii][Pp][Hh][Oo][Nn][Ee]" 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]")
+ set(id_product_type "com.apple.product-type.framework")
endif()
else()
set(id_sdkroot "")
endif()
- if(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM)
- set(id_development_team
- "DEVELOPMENT_TEAM = \"${CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM}\";")
- else()
- set(id_development_team "")
- endif()
- if(DEFINED CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY)
- set(id_code_sign_identity
- "CODE_SIGN_IDENTITY = \"${CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY}\";")
- else()
- set(id_code_sign_identity "")
+ set(id_clang_cxx_library "")
+ set(stdlib_regex "(^| )(-stdlib=)([^ ]+)( |$)")
+ string(REGEX MATCHALL "${stdlib_regex}" all_stdlib_matches "${CMAKE_CXX_FLAGS}")
+ if(all_stdlib_matches)
+ list(GET all_stdlib_matches "-1" last_stdlib_match)
+ if(last_stdlib_match MATCHES "${stdlib_regex}")
+ set(id_clang_cxx_library "CLANG_CXX_LIBRARY = \"${CMAKE_MATCH_3}\";")
+ endif()
endif()
configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in
${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY)
@@ -391,6 +406,40 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS}
separate_arguments(CMAKE_${lang}_XCODE_ARCHS)
set(CMAKE_${lang}_XCODE_ARCHS "${CMAKE_${lang}_XCODE_ARCHS}" PARENT_SCOPE)
endif()
+ elseif("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
+ set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
+ set(id_src "${src}")
+ if (GHS_PRIMARY_TARGET)
+ set(ghs_primary_target "${GHS_PRIMARY_TARGET}")
+ else()
+ set(ghs_primary_target "${CMAKE_GENERATOR_PLATFORM}_${GHS_TARGET_PLATFORM}.tgt")
+ endif()
+ if ("${GHS_TARGET_PLATFORM}" MATCHES "integrity")
+ set(bsp_name "macro GHS_BSP=${GHS_BSP_NAME}")
+ set(os_dir "macro GHS_OS=${GHS_OS_DIR}")
+ endif()
+ set(command "${CMAKE_MAKE_PROGRAM}" "-commands" "-top" "GHS_default.gpj")
+ configure_file(${CMAKE_ROOT}/Modules/CompilerId/GHS_default.gpj.in
+ ${id_dir}/GHS_default.gpj @ONLY)
+ configure_file(${CMAKE_ROOT}/Modules/CompilerId/GHS_lib.gpj.in
+ ${id_dir}/GHS_lib.gpj @ONLY)
+ execute_process(COMMAND ${command}
+ WORKING_DIRECTORY ${id_dir}
+ OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
+ RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
+ )
+ # Match the compiler location line printed out.
+ set(ghs_toolpath "${CMAKE_MAKE_PROGRAM}")
+ string(REPLACE "/gbuild.exe" "/" ghs_toolpath ${ghs_toolpath})
+ string(REPLACE / "\\\\" ghs_toolpath ${ghs_toolpath})
+ if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "(${ghs_toolpath}[^ ]*)")
+ set(_comp "${CMAKE_MATCH_1}.exe")
+ if(EXISTS "${_comp}")
+ file(TO_CMAKE_PATH "${_comp}" _comp)
+ set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
+ endif()
+ endif()
else()
execute_process(
COMMAND "${CMAKE_${lang}_COMPILER}"
@@ -450,6 +499,9 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
# com.apple.package-type.bundle.unit-test
${_glob_id_dir}/*.xctest/*
+
+ # com.apple.product-type.framework
+ ${_glob_id_dir}/*.framework/*
)
list(REMOVE_ITEM files "${src}")
set(COMPILER_${lang}_PRODUCED_FILES "")
@@ -523,7 +575,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
file(STRINGS ${file}
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 38
${CMAKE_${lang}_COMPILER_ID_STRINGS_PARAMETERS}
- REGEX "INFO:[A-Za-z0-9_]+\\[[^]]*\\]")
+ REGEX ".?I.?N.?F.?O.?:.?[A-Za-z0-9_]+\\[[^]]*\\]")
set(COMPILER_ID_TWICE)
# With the IAR Compiler, some strings are found twice, first time as incomplete
# list like "?<Constant "INFO:compiler[IAR]">". Remove the incomplete copies.
@@ -531,6 +583,12 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# In C# binaries, some strings are found more than once.
list(REMOVE_DUPLICATES CMAKE_${lang}_COMPILER_ID_STRINGS)
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
+ # The IAR-AVR compiler uses a binary format that places a '6'
+ # character (0x34) before each character in the string. Strip
+ # out these characters without removing any legitamate characters.
+ if("${info}" MATCHES "(.)I.N.F.O.:.")
+ string(REGEX REPLACE "${CMAKE_MATCH_1}(.)" "\\1" info "${info}")
+ endif()
if("${info}" MATCHES "INFO:compiler\\[([^]\"]*)\\]")
if(COMPILER_ID)
set(COMPILER_ID_TWICE 1)
@@ -544,7 +602,7 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
set(ARCHITECTURE_ID "${CMAKE_MATCH_1}")
endif()
if("${info}" MATCHES "INFO:compiler_version\\[([^]\"]*)\\]")
- string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}")
+ string(REGEX REPLACE "^0+([0-9]+)" "\\1" COMPILER_VERSION "${CMAKE_MATCH_1}")
string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
endif()
if("${info}" MATCHES "INFO:compiler_version_internal\\[([^]\"]*)\\]")
@@ -596,26 +654,28 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
if(WIN32)
# The offset to the PE signature is stored at 0x3c.
file(READ ${file} peoffsethex LIMIT 1 OFFSET 60 HEX)
- string(SUBSTRING "${peoffsethex}" 0 1 peoffsethex1)
- string(SUBSTRING "${peoffsethex}" 1 1 peoffsethex2)
- set(peoffsetexpression "${peoffsethex1} * 16 + ${peoffsethex2}")
- string(REPLACE "a" "10" peoffsetexpression "${peoffsetexpression}")
- string(REPLACE "b" "11" peoffsetexpression "${peoffsetexpression}")
- string(REPLACE "c" "12" peoffsetexpression "${peoffsetexpression}")
- string(REPLACE "d" "13" peoffsetexpression "${peoffsetexpression}")
- string(REPLACE "e" "14" peoffsetexpression "${peoffsetexpression}")
- string(REPLACE "f" "15" peoffsetexpression "${peoffsetexpression}")
- math(EXPR peoffset "${peoffsetexpression}")
-
- file(READ ${file} peheader LIMIT 6 OFFSET ${peoffset} HEX)
- if(peheader STREQUAL "50450000a201")
- set(ARCHITECTURE_ID "SH3")
- elseif(peheader STREQUAL "50450000a301")
- set(ARCHITECTURE_ID "SH3DSP")
- elseif(peheader STREQUAL "50450000a601")
- set(ARCHITECTURE_ID "SH4")
- elseif(peheader STREQUAL "50450000a801")
- set(ARCHITECTURE_ID "SH5")
+ if(NOT peoffsethex STREQUAL "")
+ string(SUBSTRING "${peoffsethex}" 0 1 peoffsethex1)
+ string(SUBSTRING "${peoffsethex}" 1 1 peoffsethex2)
+ set(peoffsetexpression "${peoffsethex1} * 16 + ${peoffsethex2}")
+ string(REPLACE "a" "10" peoffsetexpression "${peoffsetexpression}")
+ string(REPLACE "b" "11" peoffsetexpression "${peoffsetexpression}")
+ string(REPLACE "c" "12" peoffsetexpression "${peoffsetexpression}")
+ string(REPLACE "d" "13" peoffsetexpression "${peoffsetexpression}")
+ string(REPLACE "e" "14" peoffsetexpression "${peoffsetexpression}")
+ string(REPLACE "f" "15" peoffsetexpression "${peoffsetexpression}")
+ math(EXPR peoffset "${peoffsetexpression}")
+
+ file(READ ${file} peheader LIMIT 6 OFFSET ${peoffset} HEX)
+ if(peheader STREQUAL "50450000a201")
+ set(ARCHITECTURE_ID "SH3")
+ elseif(peheader STREQUAL "50450000a301")
+ set(ARCHITECTURE_ID "SH3DSP")
+ elseif(peheader STREQUAL "50450000a601")
+ set(ARCHITECTURE_ID "SH4")
+ elseif(peheader STREQUAL "50450000a801")
+ set(ARCHITECTURE_ID "SH5")
+ endif()
endif()
endif()
@@ -659,13 +719,10 @@ function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
# endif()
#
-# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
-# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
-# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-# endif()
-# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
-# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
-# endif()
+ # Mach-O files start with MH_MAGIC or MH_CIGAM
+ if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface|cefaedfe|feedfacf|cffaedfe")
+ set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
+ endif()
endif()
if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
@@ -774,7 +831,7 @@ function(CMAKE_DIAGNOSE_UNSUPPORTED_CLANG lang envvar)
endif()
# Test whether an MSVC-like command-line option works.
- execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" /?
+ execute_process(COMMAND "${CMAKE_${lang}_COMPILER}" -?
RESULT_VARIABLE _clang_result
OUTPUT_VARIABLE _clang_stdout
ERROR_VARIABLE _clang_stderr)
diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake
index 600d5580e..dc208c600 100644
--- a/Modules/CMakeDetermineSystem.cmake
+++ b/Modules/CMakeDetermineSystem.cmake
@@ -13,7 +13,6 @@
# BSD/OS BSD/OS
# FreeBSD FreeBSD
# HP-UX HP-UX
-# IRIX IRIX
# Linux Linux
# GNU/kFreeBSD GNU/kFreeBSD
# NetBSD NetBSD
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index 026462144..a3c4d9cf1 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -1,35 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeDetermineVSServicePack
-# ---------------------------
-#
-# Deprecated. Do not use.
-#
-# The functionality of this module has been superseded by the
-# :variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains
-# the compiler version number.
-#
-# Determine the Visual Studio service pack of the 'cl' in use.
-#
-# Usage::
-#
-# if(MSVC)
-# include(CMakeDetermineVSServicePack)
-# DetermineVSServicePack( my_service_pack )
-# if( my_service_pack )
-# message(STATUS "Detected: ${my_service_pack}")
-# endif()
-# endif()
-#
-# Function DetermineVSServicePack sets the given variable to one of the
-# following values or an empty string if unknown::
-#
-# vc80, vc80sp1
-# vc90, vc90sp1
-# vc100, vc100sp1
-# vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
+#[=======================================================================[.rst:
+CMakeDetermineVSServicePack
+---------------------------
+
+.. deprecated:: 3.0
+
+ Do not use.
+
+The functionality of this module has been superseded by the
+:variable:`CMAKE_<LANG>_COMPILER_VERSION` variable that contains
+the compiler version number.
+
+Determine the Visual Studio service pack of the 'cl' in use.
+
+Usage::
+
+ if(MSVC)
+ include(CMakeDetermineVSServicePack)
+ DetermineVSServicePack( my_service_pack )
+ if( my_service_pack )
+ message(STATUS "Detected: ${my_service_pack}")
+ endif()
+ endif()
+
+Function DetermineVSServicePack sets the given variable to one of the
+following values or an empty string if unknown::
+
+ vc80, vc80sp1
+ vc90, vc90sp1
+ vc100, vc100sp1
+ vc110, vc110sp1, vc110sp2, vc110sp3, vc110sp4
+#]=======================================================================]
if(NOT CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.8)
message(DEPRECATION
@@ -76,7 +79,7 @@ endfunction()
function(_DetermineVSServicePack_FastCheckVersionWithCompiler _SUCCESS_VAR _VERSION_VAR)
if(EXISTS ${CMAKE_CXX_COMPILER})
execute_process(
- COMMAND ${CMAKE_CXX_COMPILER} /?
+ COMMAND ${CMAKE_CXX_COMPILER} -?
ERROR_VARIABLE _output
OUTPUT_QUIET
)
@@ -169,4 +172,3 @@ function(DetermineVSServicePack _pack)
endif()
endif()
endfunction()
-
diff --git a/Modules/CMakeExpandImportedTargets.cmake b/Modules/CMakeExpandImportedTargets.cmake
index 21a3065fe..ae26cc26e 100644
--- a/Modules/CMakeExpandImportedTargets.cmake
+++ b/Modules/CMakeExpandImportedTargets.cmake
@@ -1,41 +1,44 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeExpandImportedTargets
-# --------------------------
-#
-# Deprecated. Do not use.
-#
-# This module was once needed to expand imported targets to the underlying
-# libraries they reference on disk for use with the :command:`try_compile`
-# and :command:`try_run` commands. These commands now support imported
-# libraries in their ``LINK_LIBRARIES`` options (since CMake 2.8.11
-# for :command:`try_compile` and since CMake 3.2 for :command:`try_run`).
-#
-# This module does not support the policy :policy:`CMP0022` ``NEW``
-# behavior or use of the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property
-# because :manual:`generator expressions <cmake-generator-expressions(7)>`
-# cannot be evaluated during configuration.
-#
-# ::
-#
-# CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
-# [CONFIGURATION <config>])
-#
-# CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
-# all imported targets contained in this list with their actual file
-# paths of the referenced libraries on disk, including the libraries
-# from their link interfaces. If a CONFIGURATION is given, it uses the
-# respective configuration of the imported targets if it exists. If no
-# CONFIGURATION is given, it uses the first configuration from
-# ${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
-#
-# ::
-#
-# cmake_expand_imported_targets(expandedLibs
-# LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
-# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+#[=======================================================================[.rst:
+CMakeExpandImportedTargets
+--------------------------
+
+.. deprecated:: 3.4
+
+ Do not use.
+
+This module was once needed to expand imported targets to the underlying
+libraries they reference on disk for use with the :command:`try_compile`
+and :command:`try_run` commands. These commands now support imported
+libraries in their ``LINK_LIBRARIES`` options (since CMake 2.8.11
+for :command:`try_compile` and since CMake 3.2 for :command:`try_run`).
+
+This module does not support the policy :policy:`CMP0022` ``NEW``
+behavior or use of the :prop_tgt:`INTERFACE_LINK_LIBRARIES` property
+because :manual:`generator expressions <cmake-generator-expressions(7)>`
+cannot be evaluated during configuration.
+
+::
+
+ CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
+ [CONFIGURATION <config>])
+
+CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
+all imported targets contained in this list with their actual file
+paths of the referenced libraries on disk, including the libraries
+from their link interfaces. If a CONFIGURATION is given, it uses the
+respective configuration of the imported targets if it exists. If no
+CONFIGURATION is given, it uses the first configuration from
+${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
+
+::
+
+ cmake_expand_imported_targets(expandedLibs
+ LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
+ CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
+#]=======================================================================]
function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 830639dff..35f75c938 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -14,29 +14,48 @@
# CMAKE_AR
# CMAKE_RANLIB
# CMAKE_LINKER
+# CMAKE_MT
# CMAKE_STRIP
# CMAKE_INSTALL_NAME_TOOL
# on UNIX, cygwin and mingw
-if(CMAKE_LINKER)
- # we only get here if CMAKE_LINKER was specified using -D or a pre-made CMakeCache.txt
- # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
- # find the linker in the PATH if necessary
- get_filename_component(_CMAKE_USER_LINKER_PATH "${CMAKE_LINKER}" PATH)
- if(NOT _CMAKE_USER_LINKER_PATH)
- find_program(CMAKE_LINKER_WITH_PATH NAMES ${CMAKE_LINKER} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- if(CMAKE_LINKER_WITH_PATH)
- set(CMAKE_LINKER ${CMAKE_LINKER_WITH_PATH})
- get_property(_CMAKE_LINKER_CACHED CACHE CMAKE_LINKER PROPERTY TYPE)
- if(_CMAKE_LINKER_CACHED)
- set(CMAKE_LINKER "${CMAKE_LINKER}" CACHE STRING "Default Linker" FORCE)
+# Resolve full path of CMAKE_TOOL from user-defined name and SEARCH_PATH.
+function(__resolve_tool_path CMAKE_TOOL SEARCH_PATH DOCSTRING)
+
+ if(${CMAKE_TOOL})
+ # We only get here if CMAKE_TOOL was
+ # specified using -D or a pre-made CMakeCache.txt (e.g. via ctest)
+ # or set in CMAKE_TOOLCHAIN_FILE.
+
+ get_filename_component(_CMAKE_USER_TOOL_PATH "${${CMAKE_TOOL}}" DIRECTORY)
+ # Is CMAKE_TOOL a user-defined name instead of a full path?
+ if(NOT _CMAKE_USER_TOOL_PATH)
+
+ # Find CMAKE_TOOL in the SEARCH_PATH directory by user-defined name.
+ find_program(_CMAKE_TOOL_WITH_PATH NAMES ${${CMAKE_TOOL}} HINTS ${SEARCH_PATH})
+ if(_CMAKE_TOOL_WITH_PATH)
+
+ # Overwrite CMAKE_TOOL with full path found in SEARCH_PATH.
+ set(${CMAKE_TOOL} ${_CMAKE_TOOL_WITH_PATH} PARENT_SCOPE)
+
+ get_property(_CMAKE_TOOL_CACHED CACHE ${CMAKE_TOOL} PROPERTY TYPE)
+ # If CMAKE_TOOL is present in the CMake Cache, then overwrit it as well.
+ if(_CMAKE_TOOL_CACHED)
+ set(${CMAKE_TOOL} "${_CMAKE_TOOL_WITH_PATH}" CACHE STRING ${DOCSTRING} FORCE)
+ endif()
+
endif()
- unset(_CMAKE_LINKER_CACHED)
+ unset(_CMAKE_TOOL_WITH_PATH CACHE)
+
endif()
- unset(CMAKE_LINKER_WITH_PATH CACHE)
+
endif()
-endif()
+
+endfunction()
+
+__resolve_tool_path(CMAKE_LINKER "${_CMAKE_TOOLCHAIN_LOCATION}" "Default Linker")
+__resolve_tool_path(CMAKE_MT "${_CMAKE_TOOLCHAIN_LOCATION}" "Default Manifest Tool")
set(_CMAKE_TOOL_VARS "")
@@ -44,12 +63,14 @@ set(_CMAKE_TOOL_VARS "")
if("x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_SIMULATE_ID}" STREQUAL "xMSVC"
OR "x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xMSVC"
OR (CMAKE_HOST_WIN32 AND "x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xPGI")
+ OR (CMAKE_HOST_WIN32 AND "x${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ID}" STREQUAL "xNVIDIA")
OR (CMAKE_GENERATOR MATCHES "Visual Studio"
AND NOT CMAKE_VS_PLATFORM_NAME STREQUAL "Tegra-Android"))
find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+ find_program(CMAKE_MT NAMES mt HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
- list(APPEND _CMAKE_TOOL_VARS CMAKE_LINKER)
+ list(APPEND _CMAKE_TOOL_VARS CMAKE_LINKER CMAKE_MT)
# in all other cases search for ar, ranlib, etc.
else()
diff --git a/Modules/CMakeFindFrameworks.cmake b/Modules/CMakeFindFrameworks.cmake
index 6c4c52729..06c05fb91 100644
--- a/Modules/CMakeFindFrameworks.cmake
+++ b/Modules/CMakeFindFrameworks.cmake
@@ -1,15 +1,16 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeFindFrameworks
-# -------------------
-#
-# helper module to find OSX frameworks
-#
-# This module reads hints about search locations from variables::
-#
-# CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS - Extra directories
+#[=======================================================================[.rst:
+CMakeFindFrameworks
+-------------------
+
+helper module to find OSX frameworks
+
+This module reads hints about search locations from variables::
+
+ CMAKE_FIND_FRAMEWORK_EXTRA_LOCATIONS - Extra directories
+#]=======================================================================]
if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
diff --git a/Modules/CMakeFindPackageMode.cmake b/Modules/CMakeFindPackageMode.cmake
index ec3652cfa..815dfc90d 100644
--- a/Modules/CMakeFindPackageMode.cmake
+++ b/Modules/CMakeFindPackageMode.cmake
@@ -1,33 +1,34 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeFindPackageMode
-# --------------------
-#
-#
-#
-# This file is executed by cmake when invoked with --find-package. It
-# expects that the following variables are set using -D:
-#
-# ``NAME``
-# name of the package
-# ``COMPILER_ID``
-# the CMake compiler ID for which the result is,
-# i.e. GNU/Intel/Clang/MSVC, etc.
-# ``LANGUAGE``
-# language for which the result will be used,
-# i.e. C/CXX/Fortran/ASM
-# ``MODE``
-# ``EXIST``
-# only check for existence of the given package
-# ``COMPILE``
-# print the flags needed for compiling an object file which uses
-# the given package
-# ``LINK``
-# print the flags needed for linking when using the given package
-# ``QUIET``
-# if TRUE, don't print anything
+#[=======================================================================[.rst:
+CMakeFindPackageMode
+--------------------
+
+
+
+This file is executed by cmake when invoked with --find-package. It
+expects that the following variables are set using -D:
+
+``NAME``
+ name of the package
+``COMPILER_ID``
+ the CMake compiler ID for which the result is,
+ i.e. GNU/Intel/Clang/MSVC, etc.
+``LANGUAGE``
+ language for which the result will be used,
+ i.e. C/CXX/Fortran/ASM
+``MODE``
+ ``EXIST``
+ only check for existence of the given package
+ ``COMPILE``
+ print the flags needed for compiling an object file which uses
+ the given package
+ ``LINK``
+ print the flags needed for linking when using the given package
+``QUIET``
+ if TRUE, don't print anything
+#]=======================================================================]
if(NOT NAME)
message(FATAL_ERROR "Name of the package to be searched not specified. Set the CMake variable NAME, e.g. -DNAME=JPEG .")
diff --git a/Modules/CMakeForceCompiler.cmake b/Modules/CMakeForceCompiler.cmake
index 1bc80fd75..7ac09dcaa 100644
--- a/Modules/CMakeForceCompiler.cmake
+++ b/Modules/CMakeForceCompiler.cmake
@@ -1,69 +1,72 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeForceCompiler
-# ------------------
-#
-# Deprecated. Do not use.
-#
-# The macros provided by this module were once intended for use by
-# cross-compiling toolchain files when CMake was not able to automatically
-# detect the compiler identification. Since the introduction of this module,
-# CMake's compiler identification capabilities have improved and can now be
-# taught to recognize any compiler. Furthermore, the suite of information
-# CMake detects from a compiler is now too extensive to be provided by
-# toolchain files using these macros.
-#
-# One common use case for this module was to skip CMake's checks for a
-# working compiler when using a cross-compiler that cannot link binaries
-# without special flags or custom linker scripts. This case is now supported
-# by setting the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable in the
-# toolchain file instead.
-#
-# -------------------------------------------------------------------------
-#
-# Macro CMAKE_FORCE_C_COMPILER has the following signature:
-#
-# ::
-#
-# CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
-#
-# It sets CMAKE_C_COMPILER to the given compiler and the cmake internal
-# variable CMAKE_C_COMPILER_ID to the given compiler-id. It also
-# bypasses the check for working compiler and basic compiler information
-# tests.
-#
-# Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
-#
-# ::
-#
-# CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
-#
-# It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
-# internal variable CMAKE_CXX_COMPILER_ID to the given compiler-id. It
-# also bypasses the check for working compiler and basic compiler
-# information tests.
-#
-# Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
-#
-# ::
-#
-# CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
-#
-# It sets CMAKE_Fortran_COMPILER to the given compiler and the cmake
-# internal variable CMAKE_Fortran_COMPILER_ID to the given compiler-id.
-# It also bypasses the check for working compiler and basic compiler
-# information tests.
-#
-# So a simple toolchain file could look like this:
-#
-# ::
-#
-# include (CMakeForceCompiler)
-# set(CMAKE_SYSTEM_NAME Generic)
-# CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
-# CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
+#[=======================================================================[.rst:
+CMakeForceCompiler
+------------------
+
+.. deprecated:: 3.6
+
+ Do not use.
+
+The macros provided by this module were once intended for use by
+cross-compiling toolchain files when CMake was not able to automatically
+detect the compiler identification. Since the introduction of this module,
+CMake's compiler identification capabilities have improved and can now be
+taught to recognize any compiler. Furthermore, the suite of information
+CMake detects from a compiler is now too extensive to be provided by
+toolchain files using these macros.
+
+One common use case for this module was to skip CMake's checks for a
+working compiler when using a cross-compiler that cannot link binaries
+without special flags or custom linker scripts. This case is now supported
+by setting the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable in the
+toolchain file instead.
+
+-------------------------------------------------------------------------
+
+Macro CMAKE_FORCE_C_COMPILER has the following signature:
+
+::
+
+ CMAKE_FORCE_C_COMPILER(<compiler> <compiler-id>)
+
+It sets CMAKE_C_COMPILER to the given compiler and the cmake internal
+variable CMAKE_C_COMPILER_ID to the given compiler-id. It also
+bypasses the check for working compiler and basic compiler information
+tests.
+
+Macro CMAKE_FORCE_CXX_COMPILER has the following signature:
+
+::
+
+ CMAKE_FORCE_CXX_COMPILER(<compiler> <compiler-id>)
+
+It sets CMAKE_CXX_COMPILER to the given compiler and the cmake
+internal variable CMAKE_CXX_COMPILER_ID to the given compiler-id. It
+also bypasses the check for working compiler and basic compiler
+information tests.
+
+Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
+
+::
+
+ CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
+
+It sets CMAKE_Fortran_COMPILER to the given compiler and the cmake
+internal variable CMAKE_Fortran_COMPILER_ID to the given compiler-id.
+It also bypasses the check for working compiler and basic compiler
+information tests.
+
+So a simple toolchain file could look like this:
+
+::
+
+ include (CMakeForceCompiler)
+ set(CMAKE_SYSTEM_NAME Generic)
+ CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
+ CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
+#]=======================================================================]
macro(CMAKE_FORCE_C_COMPILER compiler id)
message(DEPRECATION "The CMAKE_FORCE_C_COMPILER macro is deprecated. "
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index 9b951fc4e..ae7b73ac4 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -61,6 +61,7 @@ endif()
@CMAKE_Fortran_SYSROOT_FLAG_CODE@
@CMAKE_Fortran_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
+set(CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
diff --git a/Modules/CMakeFortranCompilerABI.F b/Modules/CMakeFortranCompilerABI.F
index b34c28484..f4a5489a1 100644
--- a/Modules/CMakeFortranCompilerABI.F
+++ b/Modules/CMakeFortranCompilerABI.F
@@ -33,13 +33,7 @@
#if 0
! Application Binary Interface
#endif
-#if defined(__sgi) && defined(_ABIO32)
- PRINT *, 'INFO:abi[ELF O32]'
-#elif defined(__sgi) && defined(_ABIN32)
- PRINT *, 'INFO:abi[ELF N32]'
-#elif defined(__sgi) && defined(_ABI64)
- PRINT *, 'INFO:abi[ELF 64]'
-#elif defined(__ELF__)
+#if defined(__ELF__)
PRINT *, 'INFO:abi[ELF]'
#endif
PRINT *, 'ABI Detection'
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index da3d9533d..59956944b 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -105,8 +105,6 @@
# endif
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
PRINT *, 'INFO:compiler[VisualAge]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
- PRINT *, 'INFO:compiler[MIPSpro]'
#elif defined(__hpux) || defined(__hpux__)
PRINT *, 'INFO:compiler[HP]'
#elif defined(NAGFOR)
@@ -114,11 +112,7 @@
#define COMPILER_VERSION_MAJOR DEC(__NAG_COMPILER_RELEASE/10)
#define COMPILER_VERSION_MINOR DEC(__NAG_COMPILER_RELEASE % 10)
#define COMPILER_VERSION_PATCH DEC(__NAG_COMPILER_BUILD)
-#elif 1
-# if 0
-! The above 'elif 1' instead of 'else' is to work around a bug in the
-! SGI preprocessor which produces both the __sgi and else blocks.
-# endif
+#else
PRINT *, 'INFO:compiler[]'
#endif
#if defined(__CRAYXE) || defined(__CRAYXC)
@@ -148,8 +142,6 @@
PRINT *, 'INFO:platform[SunOS]'
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
PRINT *, 'INFO:platform[AIX]'
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
- PRINT *, 'INFO:platform[IRIX]'
#elif defined(__hpux) || defined(__hpux__)
PRINT *, 'INFO:platform[HP-UX]'
#elif defined(__HAIKU__)
@@ -178,11 +170,7 @@
PRINT *, 'INFO:platform[ULTRIX]'
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
PRINT *, 'INFO:platform[Xenix]'
-#elif 1
-# if 0
-! The above 'elif 1' instead of 'else' is to work around a bug in the
-! SGI preprocessor which produces both the __sgi and else blocks.
-# endif
+#else
PRINT *, 'INFO:platform[]'
#endif
#if defined(_WIN32) && (defined(__INTEL_COMPILER) || defined(__ICC))
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index cceac83c6..ffa6a2471 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -74,6 +74,12 @@ endif()
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
endif()
+if(NOT CMAKE_Fortran_LINK_OPTIONS_PIE)
+ set(CMAKE_Fortran_LINK_OPTIONS_PIE ${CMAKE_C_LINK_OPTIONS_PIE})
+endif()
+if(NOT CMAKE_Fortran_LINK_OPTIONS_NO_PIE)
+ set(CMAKE_Fortran_LINK_OPTIONS_NO_PIE ${CMAKE_C_LINK_OPTIONS_NO_PIE})
+endif()
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 02cb46450..ddfc7bd23 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -23,6 +23,8 @@ set(CMAKE_DL_LIBS "dl")
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+
+set(CMAKE_AUTOGEN_ORIGIN_DEPENDS ON)
set(CMAKE_AUTOMOC_COMPILER_PREDEFINES ON)
set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE")
diff --git a/Modules/CMakeGraphVizOptions.cmake b/Modules/CMakeGraphVizOptions.cmake
index 0d7f1d979..1911e7392 100644
--- a/Modules/CMakeGraphVizOptions.cmake
+++ b/Modules/CMakeGraphVizOptions.cmake
@@ -1,122 +1,123 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeGraphVizOptions
-# --------------------
-#
-# The builtin graphviz support of CMake.
-#
-# Variables specific to the graphviz support
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# CMake
-# can generate `graphviz <http://www.graphviz.org/>`_ files, showing the dependencies between the
-# targets in a project and also external libraries which are linked
-# against. When CMake is run with the ``--graphviz=foo.dot`` option, it will
-# produce:
-#
-# * a ``foo.dot`` file showing all dependencies in the project
-# * a ``foo.dot.<target>`` file for each target, file showing on which other targets the respective target depends
-# * a ``foo.dot.<target>.dependers`` file, showing which other targets depend on the respective target
-#
-# The different dependency types ``PUBLIC``, ``PRIVATE`` and ``INTERFACE``
-# are represented as solid, dashed and dotted edges.
-#
-# This can result in huge graphs. Using the file
-# ``CMakeGraphVizOptions.cmake`` the look and content of the generated
-# graphs can be influenced. This file is searched first in
-# :variable:`CMAKE_BINARY_DIR` and then in :variable:`CMAKE_SOURCE_DIR`. If found, it is
-# read and the variables set in it are used to adjust options for the
-# generated graphviz files.
-#
-# .. variable:: GRAPHVIZ_GRAPH_TYPE
-#
-# The graph type.
-#
-# * Mandatory : NO
-# * Default : "digraph"
-#
-# Valid graph types are:
-#
-# * "graph" : Nodes are joined with lines
-# * "digraph" : Nodes are joined with arrows showing direction
-# * "strict graph" : Like "graph" but max one line between each node
-# * "strict digraph" : Like "graph" but max one line between each node in each direction
-#
-# .. variable:: GRAPHVIZ_GRAPH_NAME
-#
-# The graph name.
-#
-# * Mandatory : NO
-# * Default : "GG"
-#
-# .. variable:: GRAPHVIZ_GRAPH_HEADER
-#
-# The header written at the top of the graphviz file.
-#
-# * Mandatory : NO
-# * Default : "node [n fontsize = "12"];"
-#
-# .. variable:: GRAPHVIZ_NODE_PREFIX
-#
-# The prefix for each node in the graphviz file.
-#
-# * Mandatory : NO
-# * Default : "node"
-#
-# .. variable:: GRAPHVIZ_EXECUTABLES
-#
-# Set this to FALSE to exclude executables from the generated graphs.
-#
-# * Mandatory : NO
-# * Default : TRUE
-#
-# .. variable:: GRAPHVIZ_STATIC_LIBS
-#
-# Set this to FALSE to exclude static libraries from the generated graphs.
-#
-# * Mandatory : NO
-# * Default : TRUE
-#
-# .. variable:: GRAPHVIZ_SHARED_LIBS
-#
-# Set this to FALSE to exclude shared libraries from the generated graphs.
-#
-# * Mandatory : NO
-# * Default : TRUE
-#
-# .. variable:: GRAPHVIZ_MODULE_LIBS
-#
-# Set this to FALSE to exclude module libraries from the generated graphs.
-#
-# * Mandatory : NO
-# * Default : TRUE
-#
-# .. variable:: GRAPHVIZ_EXTERNAL_LIBS
-#
-# Set this to FALSE to exclude external libraries from the generated graphs.
-#
-# * Mandatory : NO
-# * Default : TRUE
-#
-# .. variable:: GRAPHVIZ_IGNORE_TARGETS
-#
-# A list of regular expressions for ignoring targets.
-#
-# * Mandatory : NO
-# * Default : empty
-#
-# .. variable:: GRAPHVIZ_GENERATE_PER_TARGET
-#
-# Set this to FALSE to exclude per target graphs ``foo.dot.<target>``.
-#
-# * Mandatory : NO
-# * Default : TRUE
-#
-# .. variable:: GRAPHVIZ_GENERATE_DEPENDERS
-#
-# Set this to FALSE to exclude depender graphs ``foo.dot.<target>.dependers``.
-#
-# * Mandatory : NO
-# * Default : TRUE
+#[=======================================================================[.rst:
+CMakeGraphVizOptions
+--------------------
+
+The builtin graphviz support of CMake.
+
+Variables specific to the graphviz support
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+CMake
+can generate `graphviz <http://www.graphviz.org/>`_ files, showing the dependencies between the
+targets in a project and also external libraries which are linked
+against. When CMake is run with the ``--graphviz=foo.dot`` option, it will
+produce:
+
+* a ``foo.dot`` file showing all dependencies in the project
+* a ``foo.dot.<target>`` file for each target, file showing on which other targets the respective target depends
+* a ``foo.dot.<target>.dependers`` file, showing which other targets depend on the respective target
+
+The different dependency types ``PUBLIC``, ``PRIVATE`` and ``INTERFACE``
+are represented as solid, dashed and dotted edges.
+
+This can result in huge graphs. Using the file
+``CMakeGraphVizOptions.cmake`` the look and content of the generated
+graphs can be influenced. This file is searched first in
+:variable:`CMAKE_BINARY_DIR` and then in :variable:`CMAKE_SOURCE_DIR`. If found, it is
+read and the variables set in it are used to adjust options for the
+generated graphviz files.
+
+.. variable:: GRAPHVIZ_GRAPH_TYPE
+
+ The graph type.
+
+ * Mandatory : NO
+ * Default : "digraph"
+
+ Valid graph types are:
+
+ * "graph" : Nodes are joined with lines
+ * "digraph" : Nodes are joined with arrows showing direction
+ * "strict graph" : Like "graph" but max one line between each node
+ * "strict digraph" : Like "graph" but max one line between each node in each direction
+
+.. variable:: GRAPHVIZ_GRAPH_NAME
+
+ The graph name.
+
+ * Mandatory : NO
+ * Default : "GG"
+
+.. variable:: GRAPHVIZ_GRAPH_HEADER
+
+ The header written at the top of the graphviz file.
+
+ * Mandatory : NO
+ * Default : "node [n fontsize = "12"];"
+
+.. variable:: GRAPHVIZ_NODE_PREFIX
+
+ The prefix for each node in the graphviz file.
+
+ * Mandatory : NO
+ * Default : "node"
+
+.. variable:: GRAPHVIZ_EXECUTABLES
+
+ Set this to FALSE to exclude executables from the generated graphs.
+
+ * Mandatory : NO
+ * Default : TRUE
+
+.. variable:: GRAPHVIZ_STATIC_LIBS
+
+ Set this to FALSE to exclude static libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default : TRUE
+
+.. variable:: GRAPHVIZ_SHARED_LIBS
+
+ Set this to FALSE to exclude shared libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default : TRUE
+
+.. variable:: GRAPHVIZ_MODULE_LIBS
+
+ Set this to FALSE to exclude module libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default : TRUE
+
+.. variable:: GRAPHVIZ_EXTERNAL_LIBS
+
+ Set this to FALSE to exclude external libraries from the generated graphs.
+
+ * Mandatory : NO
+ * Default : TRUE
+
+.. variable:: GRAPHVIZ_IGNORE_TARGETS
+
+ A list of regular expressions for ignoring targets.
+
+ * Mandatory : NO
+ * Default : empty
+
+.. variable:: GRAPHVIZ_GENERATE_PER_TARGET
+
+ Set this to FALSE to exclude per target graphs ``foo.dot.<target>``.
+
+ * Mandatory : NO
+ * Default : TRUE
+
+.. variable:: GRAPHVIZ_GENERATE_DEPENDERS
+
+ Set this to FALSE to exclude depender graphs ``foo.dot.<target>.dependers``.
+
+ * Mandatory : NO
+ * Default : TRUE
+#]=======================================================================]
diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake
index d5301d737..22fc95366 100644
--- a/Modules/CMakePackageConfigHelpers.cmake
+++ b/Modules/CMakePackageConfigHelpers.cmake
@@ -1,209 +1,223 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakePackageConfigHelpers
-# -------------------------
-#
-# Helpers functions for creating config files that can be included by other
-# projects to find and use a package.
-#
-# Adds the :command:`configure_package_config_file()` and
-# :command:`write_basic_package_version_file()` commands.
-#
-# Generating a Package Configuration File
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# .. command:: configure_package_config_file
-#
-# Create a config file for a project::
-#
-# configure_package_config_file(<input> <output>
-# INSTALL_DESTINATION <path>
-# [PATH_VARS <var1> <var2> ... <varN>]
-# [NO_SET_AND_CHECK_MACRO]
-# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
-# [INSTALL_PREFIX <path>]
-# )
-#
-# ``configure_package_config_file()`` should be used instead of the plain
-# :command:`configure_file()` command when creating the ``<PackageName>Config.cmake``
-# or ``<PackageName>-config.cmake`` file for installing a project or library.
-# It helps making the resulting package relocatable by avoiding hardcoded paths
-# in the installed ``Config.cmake`` file.
-#
-# In a ``FooConfig.cmake`` file there may be code like this to make the install
-# destinations know to the using project:
-#
-# .. code-block:: cmake
-#
-# set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
-# set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
-# set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
-# #...logic to determine installedPrefix from the own location...
-# set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
-#
-# All 4 options shown above are not sufficient, since the first 3 hardcode the
-# absolute directory locations, and the 4th case works only if the logic to
-# determine the ``installedPrefix`` is correct, and if ``CONFIG_INSTALL_DIR``
-# contains a relative path, which in general cannot be guaranteed. This has the
-# effect that the resulting ``FooConfig.cmake`` file would work poorly under
-# Windows and OSX, where users are used to choose the install location of a
-# binary package at install time, independent from how
-# :variable:`CMAKE_INSTALL_PREFIX` was set at build/cmake time.
-#
-# Using ``configure_package_config_file`` helps. If used correctly, it makes
-# the resulting ``FooConfig.cmake`` file relocatable. Usage:
-#
-# 1. write a ``FooConfig.cmake.in`` file as you are used to
-# 2. insert a line containing only the string ``@PACKAGE_INIT@``
-# 3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use
-# ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the
-# ``@PACKAGE_INIT@`` line)
-# 4. instead of using the normal :command:`configure_file()`, use
-# ``configure_package_config_file()``
-#
-#
-#
-# The ``<input>`` and ``<output>`` arguments are the input and output file, the
-# same way as in :command:`configure_file()`.
-#
-# The ``<path>`` given to ``INSTALL_DESTINATION`` must be the destination where
-# the ``FooConfig.cmake`` file will be installed to. This path can either be
-# absolute, or relative to the ``INSTALL_PREFIX`` path.
-#
-# The variables ``<var1>`` to ``<varN>`` given as ``PATH_VARS`` are the
-# variables which contain install destinations. For each of them the macro will
-# create a helper variable ``PACKAGE_<var...>``. These helper variables must be
-# used in the ``FooConfig.cmake.in`` file for setting the installed location.
-# They are calculated by ``configure_package_config_file`` so that they are
-# always relative to the installed location of the package. This works both for
-# relative and also for absolute locations. For absolute locations it works
-# only if the absolute location is a subdirectory of ``INSTALL_PREFIX``.
-#
-# If the ``INSTALL_PREFIX`` argument is passed, this is used as base path to
-# calculate all the relative paths. The ``<path>`` argument must be an absolute
-# path. If this argument is not passed, the :variable:`CMAKE_INSTALL_PREFIX`
-# variable will be used instead. The default value is good when generating a
-# FooConfig.cmake file to use your package from the install tree. When
-# generating a FooConfig.cmake file to use your package from the build tree this
-# option should be used.
-#
-# By default ``configure_package_config_file`` also generates two helper macros,
-# ``set_and_check()`` and ``check_required_components()`` into the
-# ``FooConfig.cmake`` file.
-#
-# ``set_and_check()`` should be used instead of the normal ``set()`` command for
-# setting directories and file locations. Additionally to setting the variable
-# it also checks that the referenced file or directory actually exists and fails
-# with a ``FATAL_ERROR`` otherwise. This makes sure that the created
-# ``FooConfig.cmake`` file does not contain wrong references.
-# When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated
-# into the ``FooConfig.cmake`` file.
-#
-# ``check_required_components(<PackageName>)`` should be called at the end of
-# the ``FooConfig.cmake`` file. This macro checks whether all requested,
-# non-optional components have been found, and if this is not the case, sets
-# the ``Foo_FOUND`` variable to ``FALSE``, so that the package is considered to
-# be not found. It does that by testing the ``Foo_<Component>_FOUND``
-# variables for all requested required components. This macro should be
-# called even if the package doesn't provide any components to make sure
-# users are not specifying components erroneously. When using the
-# ``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option, this macro is not generated
-# into the ``FooConfig.cmake`` file.
-#
-# For an example see below the documentation for
-# :command:`write_basic_package_version_file()`.
-#
-# Generating a Package Version File
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# .. command:: write_basic_package_version_file
-#
-# Create a version file for a project::
-#
-# write_basic_package_version_file(<filename>
-# [VERSION <major.minor.patch>]
-# COMPATIBILITY <AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion> )
-#
-#
-# Writes a file for use as ``<PackageName>ConfigVersion.cmake`` file to
-# ``<filename>``. See the documentation of :command:`find_package()` for
-# details on this.
-#
-# ``<filename>`` is the output filename, it should be in the build tree.
-# ``<major.minor.patch>`` is the version number of the project to be installed.
-#
-# If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable is used.
-# If this hasn't been set, it errors out.
-#
-# The ``COMPATIBILITY`` mode ``AnyNewerVersion`` means that the installed
-# package version will be considered compatible if it is newer or exactly the
-# same as the requested version. This mode should be used for packages which
-# are fully backward compatible, also across major versions.
-# If ``SameMajorVersion`` is used instead, then the behaviour differs from
-# ``AnyNewerVersion`` in that the major version number must be the same as
-# requested, e.g. version 2.0 will not be considered compatible if 1.0 is
-# requested. This mode should be used for packages which guarantee backward
-# compatibility within the same major version.
-# If ``SameMinorVersion`` is used, the behaviour is the same as
-# ``SameMajorVersion``, but both major and minor version must be the same as
-# requested, e.g version 0.2 will not be compatible if 0.1 is requested.
-# If ``ExactVersion`` is used, then the package is only considered compatible if
-# the requested version matches exactly its own version number (not considering
-# the tweak version). For example, version 1.2.3 of a package is only
-# considered compatible to requested version 1.2.3. This mode is for packages
-# without compatibility guarantees.
-# If your project has more elaborated version matching rules, you will need to
-# write your own custom ``ConfigVersion.cmake`` file instead of using this
-# macro.
-#
-# Internally, this macro executes :command:`configure_file()` to create the
-# resulting version file. Depending on the ``COMPATIBILITY``, the corresponding
-# ``BasicConfigVersion-<COMPATIBILITY>.cmake.in`` file is used.
-# Please note that these files are internal to CMake and you should not call
-# :command:`configure_file()` on them yourself, but they can be used as starting
-# point to create more sophisticted custom ``ConfigVersion.cmake`` files.
-#
-# Example Generating Package Files
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# Example using both :command:`configure_package_config_file` and
-# ``write_basic_package_version_file()``:
-#
-# ``CMakeLists.txt``:
-#
-# .. code-block:: cmake
-#
-# set(INCLUDE_INSTALL_DIR include/ ... CACHE )
-# set(LIB_INSTALL_DIR lib/ ... CACHE )
-# set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
-# #...
-# include(CMakePackageConfigHelpers)
-# configure_package_config_file(FooConfig.cmake.in
-# ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
-# INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
-# PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
-# write_basic_package_version_file(
-# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
-# VERSION 1.2.3
-# COMPATIBILITY SameMajorVersion )
-# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
-# ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
-# DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
-#
-# ``FooConfig.cmake.in``:
-#
-# ::
-#
-# set(FOO_VERSION x.y.z)
-# ...
-# @PACKAGE_INIT@
-# ...
-# set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
-# set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
-#
-# check_required_components(Foo)
+#[=======================================================================[.rst:
+CMakePackageConfigHelpers
+-------------------------
+
+Helpers functions for creating config files that can be included by other
+projects to find and use a package.
+
+Adds the :command:`configure_package_config_file()` and
+:command:`write_basic_package_version_file()` commands.
+
+Generating a Package Configuration File
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. command:: configure_package_config_file
+
+ Create a config file for a project::
+
+ configure_package_config_file(<input> <output>
+ INSTALL_DESTINATION <path>
+ [PATH_VARS <var1> <var2> ... <varN>]
+ [NO_SET_AND_CHECK_MACRO]
+ [NO_CHECK_REQUIRED_COMPONENTS_MACRO]
+ [INSTALL_PREFIX <path>]
+ )
+
+``configure_package_config_file()`` should be used instead of the plain
+:command:`configure_file()` command when creating the ``<PackageName>Config.cmake``
+or ``<PackageName>-config.cmake`` file for installing a project or library.
+It helps making the resulting package relocatable by avoiding hardcoded paths
+in the installed ``Config.cmake`` file.
+
+In a ``FooConfig.cmake`` file there may be code like this to make the install
+destinations know to the using project:
+
+.. code-block:: cmake
+
+ set(FOO_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@" )
+ set(FOO_DATA_DIR "@CMAKE_INSTALL_PREFIX@/@RELATIVE_DATA_INSTALL_DIR@" )
+ set(FOO_ICONS_DIR "@CMAKE_INSTALL_PREFIX@/share/icons" )
+ #...logic to determine installedPrefix from the own location...
+ set(FOO_CONFIG_DIR "${installedPrefix}/@CONFIG_INSTALL_DIR@" )
+
+All 4 options shown above are not sufficient, since the first 3 hardcode the
+absolute directory locations, and the 4th case works only if the logic to
+determine the ``installedPrefix`` is correct, and if ``CONFIG_INSTALL_DIR``
+contains a relative path, which in general cannot be guaranteed. This has the
+effect that the resulting ``FooConfig.cmake`` file would work poorly under
+Windows and OSX, where users are used to choose the install location of a
+binary package at install time, independent from how
+:variable:`CMAKE_INSTALL_PREFIX` was set at build/cmake time.
+
+Using ``configure_package_config_file`` helps. If used correctly, it makes
+the resulting ``FooConfig.cmake`` file relocatable. Usage:
+
+1. write a ``FooConfig.cmake.in`` file as you are used to
+2. insert a line containing only the string ``@PACKAGE_INIT@``
+3. instead of ``set(FOO_DIR "@SOME_INSTALL_DIR@")``, use
+ ``set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")`` (this must be after the
+ ``@PACKAGE_INIT@`` line)
+4. instead of using the normal :command:`configure_file()`, use
+ ``configure_package_config_file()``
+
+
+
+The ``<input>`` and ``<output>`` arguments are the input and output file, the
+same way as in :command:`configure_file()`.
+
+The ``<path>`` given to ``INSTALL_DESTINATION`` must be the destination where
+the ``FooConfig.cmake`` file will be installed to. This path can either be
+absolute, or relative to the ``INSTALL_PREFIX`` path.
+
+The variables ``<var1>`` to ``<varN>`` given as ``PATH_VARS`` are the
+variables which contain install destinations. For each of them the macro will
+create a helper variable ``PACKAGE_<var...>``. These helper variables must be
+used in the ``FooConfig.cmake.in`` file for setting the installed location.
+They are calculated by ``configure_package_config_file`` so that they are
+always relative to the installed location of the package. This works both for
+relative and also for absolute locations. For absolute locations it works
+only if the absolute location is a subdirectory of ``INSTALL_PREFIX``.
+
+If the ``INSTALL_PREFIX`` argument is passed, this is used as base path to
+calculate all the relative paths. The ``<path>`` argument must be an absolute
+path. If this argument is not passed, the :variable:`CMAKE_INSTALL_PREFIX`
+variable will be used instead. The default value is good when generating a
+FooConfig.cmake file to use your package from the install tree. When
+generating a FooConfig.cmake file to use your package from the build tree this
+option should be used.
+
+By default ``configure_package_config_file`` also generates two helper macros,
+``set_and_check()`` and ``check_required_components()`` into the
+``FooConfig.cmake`` file.
+
+``set_and_check()`` should be used instead of the normal ``set()`` command for
+setting directories and file locations. Additionally to setting the variable
+it also checks that the referenced file or directory actually exists and fails
+with a ``FATAL_ERROR`` otherwise. This makes sure that the created
+``FooConfig.cmake`` file does not contain wrong references.
+When using the ``NO_SET_AND_CHECK_MACRO``, this macro is not generated
+into the ``FooConfig.cmake`` file.
+
+``check_required_components(<PackageName>)`` should be called at the end of
+the ``FooConfig.cmake`` file. This macro checks whether all requested,
+non-optional components have been found, and if this is not the case, sets
+the ``Foo_FOUND`` variable to ``FALSE``, so that the package is considered to
+be not found. It does that by testing the ``Foo_<Component>_FOUND``
+variables for all requested required components. This macro should be
+called even if the package doesn't provide any components to make sure
+users are not specifying components erroneously. When using the
+``NO_CHECK_REQUIRED_COMPONENTS_MACRO`` option, this macro is not generated
+into the ``FooConfig.cmake`` file.
+
+For an example see below the documentation for
+:command:`write_basic_package_version_file()`.
+
+Generating a Package Version File
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. command:: write_basic_package_version_file
+
+ Create a version file for a project::
+
+ write_basic_package_version_file(<filename>
+ [VERSION <major.minor.patch>]
+ COMPATIBILITY <AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion>
+ [ARCH_INDEPENDENT] )
+
+
+Writes a file for use as ``<PackageName>ConfigVersion.cmake`` file to
+``<filename>``. See the documentation of :command:`find_package()` for
+details on this.
+
+``<filename>`` is the output filename, it should be in the build tree.
+``<major.minor.patch>`` is the version number of the project to be installed.
+
+If no ``VERSION`` is given, the :variable:`PROJECT_VERSION` variable is used.
+If this hasn't been set, it errors out.
+
+The ``COMPATIBILITY`` mode ``AnyNewerVersion`` means that the installed
+package version will be considered compatible if it is newer or exactly the
+same as the requested version. This mode should be used for packages which
+are fully backward compatible, also across major versions.
+If ``SameMajorVersion`` is used instead, then the behaviour differs from
+``AnyNewerVersion`` in that the major version number must be the same as
+requested, e.g. version 2.0 will not be considered compatible if 1.0 is
+requested. This mode should be used for packages which guarantee backward
+compatibility within the same major version.
+If ``SameMinorVersion`` is used, the behaviour is the same as
+``SameMajorVersion``, but both major and minor version must be the same as
+requested, e.g version 0.2 will not be compatible if 0.1 is requested.
+If ``ExactVersion`` is used, then the package is only considered compatible if
+the requested version matches exactly its own version number (not considering
+the tweak version). For example, version 1.2.3 of a package is only
+considered compatible to requested version 1.2.3. This mode is for packages
+without compatibility guarantees.
+If your project has more elaborated version matching rules, you will need to
+write your own custom ``ConfigVersion.cmake`` file instead of using this
+macro.
+
+If ``ARCH_INDEPENDENT`` is given, the installed package version will be
+considered compatible even if it was built for a different architecture than
+the requested architecture. Otherwise, an architecture check will be performed,
+and the package will be considered compatible only if the architecture matches
+exactly. For example, if the package is built for a 32-bit architecture, the
+package is only considered compatible if it is used on a 32-bit architecture,
+unless ``ARCH_INDEPENDENT`` is given, in which case the package is considered
+compatible on any architecture.
+
+.. note:: ``ARCH_INDEPENDENT`` is intended for header-only libraries or similar
+ packages with no binaries.
+
+Internally, this macro executes :command:`configure_file()` to create the
+resulting version file. Depending on the ``COMPATIBILITY``, the corresponding
+``BasicConfigVersion-<COMPATIBILITY>.cmake.in`` file is used.
+Please note that these files are internal to CMake and you should not call
+:command:`configure_file()` on them yourself, but they can be used as starting
+point to create more sophisticted custom ``ConfigVersion.cmake`` files.
+
+Example Generating Package Files
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Example using both :command:`configure_package_config_file` and
+``write_basic_package_version_file()``:
+
+``CMakeLists.txt``:
+
+.. code-block:: cmake
+
+ set(INCLUDE_INSTALL_DIR include/ ... CACHE )
+ set(LIB_INSTALL_DIR lib/ ... CACHE )
+ set(SYSCONFIG_INSTALL_DIR etc/foo/ ... CACHE )
+ #...
+ include(CMakePackageConfigHelpers)
+ configure_package_config_file(FooConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
+ INSTALL_DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake
+ PATH_VARS INCLUDE_INSTALL_DIR SYSCONFIG_INSTALL_DIR)
+ write_basic_package_version_file(
+ ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
+ VERSION 1.2.3
+ COMPATIBILITY SameMajorVersion )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FooConfig.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/FooConfigVersion.cmake
+ DESTINATION ${LIB_INSTALL_DIR}/Foo/cmake )
+
+``FooConfig.cmake.in``:
+
+::
+
+ set(FOO_VERSION x.y.z)
+ ...
+ @PACKAGE_INIT@
+ ...
+ set_and_check(FOO_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
+ set_and_check(FOO_SYSCONFIG_DIR "@PACKAGE_SYSCONFIG_INSTALL_DIR@")
+
+ check_required_components(Foo)
+#]=======================================================================]
include(WriteBasicConfigVersionFile)
diff --git a/Modules/CMakeParseArguments.cmake b/Modules/CMakeParseArguments.cmake
index 7ee2bbace..c753b7f51 100644
--- a/Modules/CMakeParseArguments.cmake
+++ b/Modules/CMakeParseArguments.cmake
@@ -1,11 +1,12 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeParseArguments
-# -------------------
-#
-# This module once implemented the :command:`cmake_parse_arguments` command
-# that is now implemented natively by CMake. It is now an empty placeholder
-# for compatibility with projects that include it to get the command from
-# CMake 3.4 and lower.
+#[=======================================================================[.rst:
+CMakeParseArguments
+-------------------
+
+This module once implemented the :command:`cmake_parse_arguments` command
+that is now implemented natively by CMake. It is now an empty placeholder
+for compatibility with projects that include it to get the command from
+CMake 3.4 and lower.
+#]=======================================================================]
diff --git a/Modules/CMakeParseImplicitIncludeInfo.cmake b/Modules/CMakeParseImplicitIncludeInfo.cmake
new file mode 100644
index 000000000..c8d4c5acd
--- /dev/null
+++ b/Modules/CMakeParseImplicitIncludeInfo.cmake
@@ -0,0 +1,237 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+# This is used internally by CMake and should not be included by user code.
+
+# helper function that parses implicit include dirs from a single line
+# for compilers that report them that way. on success we return the
+# list of dirs in id_var and set state_var to the 'done' state.
+function(cmake_parse_implicit_include_line line lang id_var log_var state_var)
+ # clear variables we append to (avoids possible polution from parent scopes)
+ unset(rv)
+ set(log "")
+
+ # Cray compiler (from cray wrapper, via PrgEnv-cray)
+ if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "Cray" AND
+ "${line}" MATCHES "^/" AND "${line}" MATCHES "/ccfe |/ftnfe " AND
+ "${line}" MATCHES " -isystem| -I")
+ string(REGEX MATCHALL " (-I ?|-isystem )([^ ]*)" incs "${line}")
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " (-I ?|-isystem )([^ ]*)" "\\2" idir "${inc}")
+ list(APPEND rv "${idir}")
+ endforeach()
+ if(rv)
+ string(APPEND log " got implicit includes via cray ccfe parser!\n")
+ else()
+ string(APPEND log " warning: cray ccfe parse failed!\n")
+ endif()
+ endif()
+
+ # PGI compiler
+ if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "PGI")
+ # pgc++ verbose output differs
+ if(("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "Fortran") AND
+ "${line}" MATCHES "^/" AND
+ "${line}" MATCHES "/pgc |/pgf901 |/pgftnc " AND
+ "${line}" MATCHES " -cmdline ")
+ # cmdline has unparsed cmdline, remove it
+ string(REGEX REPLACE "-cmdline .*" "" line "${line}")
+ if("${line}" MATCHES " -nostdinc ")
+ set(rv "") # defined, but empty
+ else()
+ string(REGEX MATCHALL " -stdinc ([^ ]*)" incs "${line}")
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " -stdinc ([^ ]*)" "\\1" idir "${inc}")
+ string(REPLACE ":" ";" idir "${idir}")
+ list(APPEND rv ${idir})
+ endforeach()
+ endif()
+ if(DEFINED rv)
+ string(APPEND log " got implicit includes via PGI C/F parser!\n")
+ else()
+ string(APPEND log " warning: PGI C/F parse failed!\n")
+ endif()
+ elseif("${lang}" STREQUAL "CXX" AND "${line}" MATCHES "^/" AND
+ "${line}" MATCHES "/pggpp1 " AND "${line}" MATCHES " -I")
+ # oddly, -Mnostdinc does not get rid of system -I's, at least in
+ # PGI 18.10.1 ...
+ string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}")
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}")
+ if(NOT "${idir}" STREQUAL "-") # filter out "-I-"
+ list(APPEND rv "${idir}")
+ endif()
+ endforeach()
+ if(DEFINED rv)
+ string(APPEND log " got implicit includes via PGI CXX parser!\n")
+ else()
+ string(APPEND log " warning: PGI CXX parse failed!\n")
+ endif()
+ endif()
+ endif()
+
+ # SunPro compiler
+ if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "SunPro" AND
+ ("${line}" MATCHES "-D__SUNPRO_C" OR "${line}" MATCHES "-D__SUNPRO_F") )
+ string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}")
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}")
+ if(NOT "${idir}" STREQUAL "-xbuiltin")
+ list(APPEND rv "${idir}")
+ endif()
+ endforeach()
+ if(rv)
+ if ("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "CXX")
+ # /usr/include appears to be hardwired in
+ list(APPEND rv "/usr/include")
+ endif()
+ string(APPEND log " got implicit includes via sunpro parser!\n")
+ else()
+ string(APPEND log " warning: sunpro parse failed!\n")
+ endif()
+ endif()
+
+ # XL compiler
+ if("${CMAKE_${lang}_COMPILER_ID}" STREQUAL "XL" AND "${line}" MATCHES "^/"
+ AND ( ("${lang}" STREQUAL "Fortran" AND
+ "${line}" MATCHES "/xl[fF]entry " AND
+ "${line}" MATCHES "OSVAR\\([^ ]+\\)")
+ OR
+ ( ("${lang}" STREQUAL "C" OR "${lang}" STREQUAL "CXX") AND
+ "${line}" MATCHES "/xl[cC]entry " AND
+ "${line}" MATCHES " -qosvar=")
+ ) )
+ # -qnostdinc cancels other stdinc flags, even if present
+ string(FIND "${line}" " -qnostdinc" nostd)
+ if(NOT ${nostd} EQUAL -1)
+ set(rv "") # defined but empty
+ string(APPEND log " got implicit includes via XL parser (nostdinc)\n")
+ else()
+ if("${lang}" STREQUAL "CXX")
+ string(REGEX MATCHALL " -qcpp_stdinc=([^ ]*)" std "${line}")
+ string(REGEX MATCHALL " -qgcc_cpp_stdinc=([^ ]*)" gcc_std "${line}")
+ else()
+ string(REGEX MATCHALL " -qc_stdinc=([^ ]*)" std "${line}")
+ string(REGEX MATCHALL " -qgcc_c_stdinc=([^ ]*)" gcc_std "${line}")
+ endif()
+ set(xlstd ${std} ${gcc_std})
+ foreach(inc IN LISTS xlstd)
+ string(REGEX REPLACE " -q(cpp|gcc_cpp|c|gcc_c)_stdinc=([^ ]*)" "\\2"
+ ipath "${inc}")
+ string(REPLACE ":" ";" ipath "${ipath}")
+ list(APPEND rv ${ipath})
+ endforeach()
+ endif()
+ # user can add -I flags via CMAKE_{C,CXX}_FLAGS, look for that too
+ string(REGEX MATCHALL " (-I ?)([^ ]*)" incs "${line}")
+ unset(urv)
+ foreach(inc IN LISTS incs)
+ string(REGEX REPLACE " (-I ?)([^ ]*)" "\\2" idir "${inc}")
+ list(APPEND urv "${idir}")
+ endforeach()
+ if(urv)
+ if ("${rv}" STREQUAL "")
+ set(rv ${urv})
+ else()
+ list(APPEND rv ${urv})
+ endif()
+ endif()
+
+ if(DEFINED rv)
+ string(APPEND log " got implicit includes via XL parser!\n")
+ else()
+ string(APPEND log " warning: XL parse failed!\n")
+ endif()
+ endif()
+
+ if(log)
+ set(${log_var} "${log}" PARENT_SCOPE)
+ else()
+ unset(${log_var} PARENT_SCOPE)
+ endif()
+ if(DEFINED rv)
+ set(${id_var} "${rv}" PARENT_SCOPE)
+ set(${state_var} "done" PARENT_SCOPE)
+ endif()
+endfunction()
+
+# top-level function to parse implicit include directory information
+# from verbose compiler output. sets state_var in parent to 'done' on success.
+function(cmake_parse_implicit_include_info text lang dir_var log_var state_var)
+ set(state start) # values: start, loading, done
+
+ # clear variables we append to (avoids possible polution from parent scopes)
+ set(implicit_dirs_tmp)
+ set(log "")
+
+ # go through each line of output...
+ string(REGEX REPLACE "\r?\n" ";" output_lines "${text}")
+ foreach(line IN LISTS output_lines)
+ if(state STREQUAL start)
+ string(FIND "${line}" "#include \"...\" search starts here:" rv)
+ if(rv GREATER -1)
+ set(state loading)
+ set(preload 1) # looking for include <...> now
+ string(APPEND log " found start of include info\n")
+ else()
+ cmake_parse_implicit_include_line("${line}" "${lang}" implicit_dirs_tmp
+ linelog state)
+ if(linelog)
+ string(APPEND log ${linelog})
+ endif()
+ if(state STREQUAL done)
+ break()
+ endif()
+ endif()
+ elseif(state STREQUAL loading)
+ string(FIND "${line}" "End of search list." rv)
+ if(rv GREATER -1)
+ set(state done)
+ string(APPEND log " end of search list found\n")
+ break()
+ endif()
+ if(preload)
+ string(FIND "${line}" "#include <...> search starts here:" rv)
+ if(rv GREATER -1)
+ set(preload 0)
+ string(APPEND log " found start of implicit include info\n")
+ endif()
+ continue()
+ endif()
+ if("${line}" MATCHES "^ ")
+ string(SUBSTRING "${line}" 1 -1 line) # remove leading space
+ endif()
+ if ("${line}" MATCHES " \\(framework directory\\)$")
+ continue() # frameworks are handled elsewhere, ignore them here
+ endif()
+ string(REPLACE "\\" "/" path "${line}")
+ list(APPEND implicit_dirs_tmp "${path}")
+ string(APPEND log " add: [${path}]\n")
+ endif()
+ endforeach()
+
+ set(implicit_dirs "")
+ foreach(d IN LISTS implicit_dirs_tmp)
+ if(IS_ABSOLUTE "${d}")
+ get_filename_component(dir "${d}" ABSOLUTE)
+ list(APPEND implicit_dirs "${dir}")
+ string(APPEND log " collapse include dir [${d}] ==> [${dir}]\n")
+ else()
+ string(APPEND log " skipping relative include dir [${d}]\n")
+ endif()
+ endforeach()
+ list(REMOVE_DUPLICATES implicit_dirs)
+
+ # Log results.
+ if(state STREQUAL done)
+ string(APPEND log " implicit include dirs: [${implicit_dirs}]\n")
+ else()
+ string(APPEND log " warn: unable to parse implicit include dirs!\n")
+ endif()
+
+ # Return results.
+ set(${dir_var} "${implicit_dirs}" PARENT_SCOPE)
+ set(${log_var} "${log}" PARENT_SCOPE)
+ set(${state_var} "${state}" PARENT_SCOPE)
+
+endfunction()
diff --git a/Modules/CMakePlatformId.h.in b/Modules/CMakePlatformId.h.in
index dd77379c3..3cb7f2474 100644
--- a/Modules/CMakePlatformId.h.in
+++ b/Modules/CMakePlatformId.h.in
@@ -32,9 +32,6 @@
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
# define PLATFORM_ID "AIX"
-#elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
-# define PLATFORM_ID "IRIX"
-
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
@@ -94,6 +91,14 @@
# define PLATFORM_ID
# endif
+#elif defined(__INTEGRITY)
+# if defined(INT_178B)
+# define PLATFORM_ID "Integrity178"
+
+# else /* regular Integrity */
+# define PLATFORM_ID "Integrity"
+# endif
+
#else /* unknown platform */
# define PLATFORM_ID
@@ -157,6 +162,26 @@
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif
+
+#elif defined(__ghs__)
+# if defined(__PPC64__)
+# define ARCHITECTURE_ID "PPC64"
+
+# elif defined(__ppc__)
+# define ARCHITECTURE_ID "PPC"
+
+# elif defined(__ARM__)
+# define ARCHITECTURE_ID "ARM"
+
+# elif defined(__x86_64__)
+# define ARCHITECTURE_ID "x64"
+
+# elif defined(__i386__)
+# define ARCHITECTURE_ID "X86"
+
+# else /* unknown architecture */
+# define ARCHITECTURE_ID ""
+# endif
#else
# define ARCHITECTURE_ID
#endif
diff --git a/Modules/CMakePrintHelpers.cmake b/Modules/CMakePrintHelpers.cmake
index 21c333e31..1af0bb730 100644
--- a/Modules/CMakePrintHelpers.cmake
+++ b/Modules/CMakePrintHelpers.cmake
@@ -1,45 +1,47 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakePrintHelpers
-# -----------------
-#
-# Convenience macros for printing properties and variables, useful e.g. for debugging.
-#
-# ::
-#
-# CMAKE_PRINT_PROPERTIES([TARGETS target1 .. targetN]
-# [SOURCES source1 .. sourceN]
-# [DIRECTORIES dir1 .. dirN]
-# [TESTS test1 .. testN]
-# [CACHE_ENTRIES entry1 .. entryN]
-# PROPERTIES prop1 .. propN )
-#
-# This macro prints the values of the properties of the given targets,
-# source files, directories, tests or cache entries. Exactly one of the
-# scope keywords must be used. Example::
-#
-# cmake_print_properties(TARGETS foo bar PROPERTIES
-# LOCATION INTERFACE_INCLUDE_DIRS)
-#
-# This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for
-# both targets foo and bar.
-#
-#
-#
-# CMAKE_PRINT_VARIABLES(var1 var2 .. varN)
-#
-# This macro will print the name of each variable followed by its value.
-# Example::
-#
-# cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION DOES_NOT_EXIST)
-#
-# Gives::
-#
-# -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; DOES_NOT_EXIST=""
-
-function(CMAKE_PRINT_VARIABLES)
+#[=======================================================================[.rst:
+CMakePrintHelpers
+-----------------
+
+Convenience functions for printing properties and variables, useful
+e.g. for debugging.
+
+::
+
+ cmake_print_properties([TARGETS target1 .. targetN]
+ [SOURCES source1 .. sourceN]
+ [DIRECTORIES dir1 .. dirN]
+ [TESTS test1 .. testN]
+ [CACHE_ENTRIES entry1 .. entryN]
+ PROPERTIES prop1 .. propN )
+
+This function prints the values of the properties of the given targets,
+source files, directories, tests or cache entries. Exactly one of the
+scope keywords must be used. Example::
+
+ cmake_print_properties(TARGETS foo bar PROPERTIES
+ LOCATION INTERFACE_INCLUDE_DIRS)
+
+This will print the LOCATION and INTERFACE_INCLUDE_DIRS properties for
+both targets foo and bar.
+
+::
+
+ cmake_print_variables(var1 var2 .. varN)
+
+This function will print the name of each variable followed by its value.
+Example::
+
+ cmake_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION DOES_NOT_EXIST)
+
+Gives::
+
+ -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; DOES_NOT_EXIST=""
+#]=======================================================================]
+
+function(cmake_print_variables)
set(msg "")
foreach(var ${ARGN})
if(msg)
@@ -51,7 +53,7 @@ function(CMAKE_PRINT_VARIABLES)
endfunction()
-function(CMAKE_PRINT_PROPERTIES )
+function(cmake_print_properties)
set(options )
set(oneValueArgs )
set(multiValueArgs TARGETS SOURCES TESTS DIRECTORIES CACHE_ENTRIES PROPERTIES )
diff --git a/Modules/CMakePrintSystemInformation.cmake b/Modules/CMakePrintSystemInformation.cmake
index e74c801db..f873a4d97 100644
--- a/Modules/CMakePrintSystemInformation.cmake
+++ b/Modules/CMakePrintSystemInformation.cmake
@@ -1,14 +1,15 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakePrintSystemInformation
-# ---------------------------
-#
-# print system information
-#
-# This file can be used for diagnostic purposes just include it in a
-# project to see various internal CMake variables.
+#[=======================================================================[.rst:
+CMakePrintSystemInformation
+---------------------------
+
+print system information
+
+This file can be used for diagnostic purposes just include it in a
+project to see various internal CMake variables.
+#]=======================================================================]
message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
message("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
diff --git a/Modules/CMakePushCheckState.cmake b/Modules/CMakePushCheckState.cmake
index 98eea0532..f6bfc120e 100644
--- a/Modules/CMakePushCheckState.cmake
+++ b/Modules/CMakePushCheckState.cmake
@@ -1,46 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakePushCheckState
-# -------------------
-#
-#
-#
-# This module defines three macros: CMAKE_PUSH_CHECK_STATE()
-# CMAKE_POP_CHECK_STATE() and CMAKE_RESET_CHECK_STATE() These macros can
-# be used to save, restore and reset (i.e., clear contents) the state of
-# the variables CMAKE_REQUIRED_FLAGS, CMAKE_REQUIRED_DEFINITIONS,
-# CMAKE_REQUIRED_LIBRARIES, CMAKE_REQUIRED_INCLUDES and CMAKE_EXTRA_INCLUDE_FILES
-# used by the various Check-files coming with CMake, like e.g.
-# check_function_exists() etc. The variable contents are pushed on a
-# stack, pushing multiple times is supported. This is useful e.g. when
-# executing such tests in a Find-module, where they have to be set, but
-# after the Find-module has been executed they should have the same
-# value as they had before.
-#
-# CMAKE_PUSH_CHECK_STATE() macro receives optional argument RESET.
-# Whether it's specified, CMAKE_PUSH_CHECK_STATE() will set all
-# CMAKE_REQUIRED_* variables to empty values, same as
-# CMAKE_RESET_CHECK_STATE() call will do.
-#
-# Usage:
-#
-# ::
-#
-# cmake_push_check_state(RESET)
-# set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
-# check_function_exists(...)
-# cmake_reset_check_state()
-# set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
-# check_function_exists(...)
-# cmake_pop_check_state()
+#[=======================================================================[.rst:
+CMakePushCheckState
+-------------------
+
+
+
+This module defines three macros: ``CMAKE_PUSH_CHECK_STATE()``
+``CMAKE_POP_CHECK_STATE()`` and ``CMAKE_RESET_CHECK_STATE()`` These macros can
+be used to save, restore and reset (i.e., clear contents) the state of
+the variables ``CMAKE_REQUIRED_FLAGS``, ``CMAKE_REQUIRED_DEFINITIONS``,
+``CMAKE_REQUIRED_LINK_OPTIONS``, ``CMAKE_REQUIRED_LIBRARIES``,
+``CMAKE_REQUIRED_INCLUDES`` and ``CMAKE_EXTRA_INCLUDE_FILES`` used by the
+various Check-files coming with CMake, like e.g. ``check_function_exists()``
+etc.
+The variable contents are pushed on a stack, pushing multiple times is
+supported. This is useful e.g. when executing such tests in a Find-module,
+where they have to be set, but after the Find-module has been executed they
+should have the same value as they had before.
+
+``CMAKE_PUSH_CHECK_STATE()`` macro receives optional argument ``RESET``.
+Whether it's specified, ``CMAKE_PUSH_CHECK_STATE()`` will set all
+``CMAKE_REQUIRED_*`` variables to empty values, same as
+``CMAKE_RESET_CHECK_STATE()`` call will do.
+
+Usage:
+
+.. code-block:: cmake
+
+ cmake_push_check_state(RESET)
+ set(CMAKE_REQUIRED_DEFINITIONS -DSOME_MORE_DEF)
+ check_function_exists(...)
+ cmake_reset_check_state()
+ set(CMAKE_REQUIRED_DEFINITIONS -DANOTHER_DEF)
+ check_function_exists(...)
+ cmake_pop_check_state()
+#]=======================================================================]
macro(CMAKE_RESET_CHECK_STATE)
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_DEFINITIONS)
+ set(CMAKE_REQUIRED_LINK_OPTIONS)
set(CMAKE_REQUIRED_LIBRARIES)
set(CMAKE_REQUIRED_FLAGS)
set(CMAKE_REQUIRED_QUIET)
@@ -55,12 +58,13 @@ macro(CMAKE_PUSH_CHECK_STATE)
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
- set(_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_EXTRA_INCLUDE_FILES})
- set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
- set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
- set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
- set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
- set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET})
+ set(_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_EXTRA_INCLUDE_FILES})
+ set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
+ set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
+ set(_CMAKE_REQUIRED_LINK_OPTIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LINK_OPTIONS})
+ set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
+ set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
+ set(_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_QUIET})
if (${ARGC} GREATER 0 AND "${ARGV0}" STREQUAL "RESET")
cmake_reset_check_state()
@@ -73,12 +77,13 @@ macro(CMAKE_POP_CHECK_STATE)
# don't pop more than we pushed
if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
- set(CMAKE_EXTRA_INCLUDE_FILES ${_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
- set(CMAKE_REQUIRED_QUIET ${_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_EXTRA_INCLUDE_FILES ${_CMAKE_EXTRA_INCLUDE_FILES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_LINK_OPTIONS ${_CMAKE_REQUIRED_LINK_OPTIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
+ set(CMAKE_REQUIRED_QUIET ${_CMAKE_REQUIRED_QUIET_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
endif()
diff --git a/Modules/CMakeTestCCompiler.cmake b/Modules/CMakeTestCCompiler.cmake
index e34ae756d..7bf6fde3b 100644
--- a/Modules/CMakeTestCCompiler.cmake
+++ b/Modules/CMakeTestCCompiler.cmake
@@ -11,6 +11,12 @@ endif()
include(CMakeTestCompilerCommon)
+# work around enforced code signing and / or missing exectuable target type
+set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
+if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
+ set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
+endif()
+
# Remove any cached result from an older CMake version.
# We now store this in CMakeCCompiler.cmake.
unset(CMAKE_C_COMPILER_WORKS CACHE)
@@ -22,6 +28,7 @@ unset(CMAKE_C_COMPILER_WORKS CACHE)
# any makefiles or projects.
if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C" "")
+ __TestCompiler_setTryCompileTargetType()
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
"#ifdef __cplusplus\n"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
@@ -41,6 +48,7 @@ if(NOT CMAKE_C_COMPILER_WORKS)
set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS})
unset(CMAKE_C_COMPILER_WORKS CACHE)
set(C_TEST_WAS_RUN 1)
+ __TestCompiler_restoreTryCompileTargetType()
endif()
if(NOT CMAKE_C_COMPILER_WORKS)
@@ -84,4 +92,6 @@ else()
endif()
endif()
+set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE})
+unset(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE)
unset(__CMAKE_C_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCXXCompiler.cmake b/Modules/CMakeTestCXXCompiler.cmake
index e4d49ae84..7e595b74f 100644
--- a/Modules/CMakeTestCXXCompiler.cmake
+++ b/Modules/CMakeTestCXXCompiler.cmake
@@ -11,6 +11,12 @@ endif()
include(CMakeTestCompilerCommon)
+# work around enforced code signing and / or missing exectuable target type
+set(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE ${CMAKE_TRY_COMPILE_TARGET_TYPE})
+if(_CMAKE_FEATURE_DETECTION_TARGET_TYPE)
+ set(CMAKE_TRY_COMPILE_TARGET_TYPE ${_CMAKE_FEATURE_DETECTION_TARGET_TYPE})
+endif()
+
# Remove any cached result from an older CMake version.
# We now store this in CMakeCXXCompiler.cmake.
unset(CMAKE_CXX_COMPILER_WORKS CACHE)
@@ -22,6 +28,7 @@ unset(CMAKE_CXX_COMPILER_WORKS CACHE)
# any makefiles or projects.
if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX" "")
+ __TestCompiler_setTryCompileTargetType()
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
"#ifndef __cplusplus\n"
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
@@ -34,6 +41,7 @@ if(NOT CMAKE_CXX_COMPILER_WORKS)
set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS})
unset(CMAKE_CXX_COMPILER_WORKS CACHE)
set(CXX_TEST_WAS_RUN 1)
+ __TestCompiler_restoreTryCompileTargetType()
endif()
if(NOT CMAKE_CXX_COMPILER_WORKS)
@@ -77,4 +85,6 @@ else()
endif()
endif()
+set(CMAKE_TRY_COMPILE_TARGET_TYPE ${__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE})
+unset(__CMAKE_SAVED_TRY_COMPILE_TARGET_TYPE)
unset(__CMAKE_CXX_COMPILER_OUTPUT)
diff --git a/Modules/CMakeTestCompilerCommon.cmake b/Modules/CMakeTestCompilerCommon.cmake
index f76076fe2..6ee5175dd 100644
--- a/Modules/CMakeTestCompilerCommon.cmake
+++ b/Modules/CMakeTestCompilerCommon.cmake
@@ -5,3 +5,23 @@
function(PrintTestCompilerStatus LANG MSG)
message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
endfunction()
+
+# if required set the target type if not already explicitly set
+macro(__TestCompiler_setTryCompileTargetType)
+ if(NOT CMAKE_TRY_COMPILE_TARGET_TYPE)
+ if("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
+ #prefer static libraries to avoid linking issues
+ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+ set(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE 1)
+ endif()
+ endif()
+endmacro()
+
+# restore the original value
+# -- not necessary if __TestCompiler_setTryCompileTargetType() was used in function scope
+macro(__TestCompiler_restoreTryCompileTargetType)
+ if(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE)
+ unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+ unset(__CMAKE_TEST_COMPILER_TARGET_TYPE_RESTORE)
+ endif()
+endmacro()
diff --git a/Modules/CMakeVerifyManifest.cmake b/Modules/CMakeVerifyManifest.cmake
index c477ab1c2..705ef8aa7 100644
--- a/Modules/CMakeVerifyManifest.cmake
+++ b/Modules/CMakeVerifyManifest.cmake
@@ -1,22 +1,23 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CMakeVerifyManifest
-# -------------------
-#
-#
-#
-# CMakeVerifyManifest.cmake
-#
-# This script is used to verify that embedded manifests and side by side
-# manifests for a project match. To run this script, cd to a directory
-# and run the script with cmake -P. On the command line you can pass in
-# versions that are OK even if not found in the .manifest files. For
-# example, cmake -Dallow_versions=8.0.50608.0
-# -PCmakeVerifyManifest.cmake could be used to allow an embedded manifest
-# of 8.0.50608.0 to be used in a project even if that version was not
-# found in the .manifest file.
+#[=======================================================================[.rst:
+CMakeVerifyManifest
+-------------------
+
+
+
+CMakeVerifyManifest.cmake
+
+This script is used to verify that embedded manifests and side by side
+manifests for a project match. To run this script, cd to a directory
+and run the script with cmake -P. On the command line you can pass in
+versions that are OK even if not found in the .manifest files. For
+example, cmake -Dallow_versions=8.0.50608.0
+-PCmakeVerifyManifest.cmake could be used to allow an embedded manifest
+of 8.0.50608.0 to be used in a project even if that version was not
+found in the .manifest file.
+#]=======================================================================]
# This script first recursively globs *.manifest files from
# the current directory. Then globs *.exe and *.dll. Each
diff --git a/Modules/CPack.background.png.in b/Modules/CPack.background.png.in
index 9339e7cad..a32ab3762 100644
--- a/Modules/CPack.background.png.in
+++ b/Modules/CPack.background.png.in
Binary files differ
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index f3e34233a..c9008dbf9 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -7,22 +7,28 @@ CPack
Build binary and source package installers.
-Variables common to all CPack generators
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Introduction
+^^^^^^^^^^^^
+
+The CPack module generates a file ``CPackConfig.cmake`` intended for
+use in a subsequent run of the :manual:`cpack <cpack(1)>` program
+where it steers the generation of installers or/and source packages.
-The CPack module generates binary and source installers in a variety of
-formats using the cpack program. Inclusion of the CPack module adds
-two new build targets, ``package`` and ``package_source``, which build
-the binary and source installers respectively. The generated binary
-installers contain everything installed via CMake's :command:`install`
-command (and the deprecated :command:`install_files`,
-:command:`install_programs` and :command:`install_targets` commands).
+Inclusion of the CPack module adds two new build targets, ``package``
+and ``package_source``, which build the binary and source installers
+respectively. The generated binary installers contain everything
+installed via CMake's :command:`install` command (and the deprecated
+commands :command:`install_files`, :command:`install_programs`, and
+:command:`install_targets`).
For certain kinds of binary installers (including the graphical
installers on macOS and Windows), CPack generates installers that
allow users to select individual application components to install.
See :module:`CPackComponent` module for further details.
+CPack Generators
+^^^^^^^^^^^^^^^^
+
The :variable:`CPACK_GENERATOR` variable has different meanings in different
contexts. In a ``CMakeLists.txt`` file, :variable:`CPACK_GENERATOR` is a
*list of generators*: and when :manual:`cpack <cpack(1)>` is run with no other
@@ -57,6 +63,9 @@ This is the key: For each generator listed in :variable:`CPACK_GENERATOR` in
internally to *the one currently being used* and then include the
:variable:`CPACK_PROJECT_CONFIG_FILE`.
+Variables common to all CPack Generators
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
Before including this CPack module in your ``CMakeLists.txt`` file, there
are a variety of variables that can be set to customize the resulting
installers. The most commonly-used variables are:
@@ -244,6 +253,9 @@ installers. The most commonly-used variables are:
received by the cpack program. Defaults to ``FALSE`` for backwards
compatibility.
+Variables for Source Package Generators
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
The following CPack variables are specific to source packages, and
will not affect binary packages:
@@ -278,6 +290,9 @@ will not affect binary packages:
must be properly escaped), e.g.,
``/CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*``
+Variables for Advanced Use
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
The following variables are for advanced uses of CPack:
.. variable:: CPACK_CMAKE_GENERATOR
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index a0d99354d..211d7673c 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -1,313 +1,314 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CPackComponent
-# --------------
-#
-# Build binary and source package installers
-#
-# Variables concerning CPack Components
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# The CPackComponent module is the module which handles the component
-# part of CPack. See CPack module for general information about CPack.
-#
-# For certain kinds of binary installers (including the graphical
-# installers on macOS and Windows), CPack generates installers that
-# allow users to select individual application components to install.
-# The contents of each of the components are identified by the COMPONENT
-# argument of CMake's INSTALL command. These components can be
-# annotated with user-friendly names and descriptions, inter-component
-# dependencies, etc., and grouped in various ways to customize the
-# resulting installer. See the cpack_add_* commands, described below,
-# for more information about component-specific installations.
-#
-# Component-specific installation allows users to select specific sets
-# of components to install during the install process. Installation
-# components are identified by the COMPONENT argument of CMake's INSTALL
-# commands, and should be further described by the following CPack
-# commands:
-#
-# .. variable:: CPACK_COMPONENTS_ALL
-#
-# The list of component to install.
-#
-# The default value of this variable is computed by CPack and contains all
-# components defined by the project. The user may set it to only include the
-# specified components.
-#
-# Instead of specifying all the desired components, it is possible to obtain a
-# list of all defined components and then remove the unwanted ones from the
-# list. The :command:`get_cmake_property` command can be used to obtain the
-# ``COMPONENTS`` property, then the :command:`list(REMOVE_ITEM)` command can be
-# used to remove the unwanted ones. For example, to use all defined components
-# except ``foo`` and ``bar``::
-#
-# get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
-# list(REMOVE_ITEM CPACK_COMPONENTS_ALL "foo" "bar")
-#
-# .. variable:: CPACK_<GENNAME>_COMPONENT_INSTALL
-#
-# Enable/Disable component install for CPack generator <GENNAME>.
-#
-# Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
-# default behavior. e.g. RPM builds monolithic whereas NSIS builds
-# component. One can change the default behavior by setting this variable to
-# 0/1 or OFF/ON.
-#
-# .. variable:: CPACK_COMPONENTS_GROUPING
-#
-# Specify how components are grouped for multi-package component-aware CPack
-# generators.
-#
-# Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates
-# several packages files when asked for component packaging. They group
-# the component differently depending on the value of this variable:
-#
-# * ONE_PER_GROUP (default): creates one package file per component group
-# * ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) components
-# * IGNORE : creates one package per component, i.e. IGNORE component group
-#
-# One can specify different grouping for different CPack generator by
-# using a CPACK_PROJECT_CONFIG_FILE.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DISPLAY_NAME
-#
-# The name to be displayed for a component.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DESCRIPTION
-#
-# The description of a component.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_GROUP
-#
-# The group of a component.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DEPENDS
-#
-# The dependencies (list of components) on which this component depends.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_HIDDEN
-#
-# True if this component is hidden from the user.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_REQUIRED
-#
-# True if this component is required.
-#
-# .. variable:: CPACK_COMPONENT_<compName>_DISABLED
-#
-# True if this component is not selected to be installed by default.
-#
-# .. command:: cpack_add_component
-#
-# Describes a CPack installation
-# component named by the COMPONENT argument to a CMake INSTALL command.
-#
-# ::
-#
-# cpack_add_component(compname
-# [DISPLAY_NAME name]
-# [DESCRIPTION description]
-# [HIDDEN | REQUIRED | DISABLED ]
-# [GROUP group]
-# [DEPENDS comp1 comp2 ... ]
-# [INSTALL_TYPES type1 type2 ... ]
-# [DOWNLOADED]
-# [ARCHIVE_FILE filename]
-# [PLIST filename])
-#
-#
-#
-# The cmake_add_component command describes an installation component,
-# which the user can opt to install or remove as part of the graphical
-# installation process. compname is the name of the component, as
-# provided to the COMPONENT argument of one or more CMake INSTALL
-# commands.
-#
-# DISPLAY_NAME is the displayed name of the component, used in graphical
-# installers to display the component name. This value can be any
-# string.
-#
-# DESCRIPTION is an extended description of the component, used in
-# graphical installers to give the user additional information about the
-# component. Descriptions can span multiple lines using ``\n`` as the
-# line separator. Typically, these descriptions should be no more than
-# a few lines long.
-#
-# HIDDEN indicates that this component will be hidden in the graphical
-# installer, so that the user cannot directly change whether it is
-# installed or not.
-#
-# REQUIRED indicates that this component is required, and therefore will
-# always be installed. It will be visible in the graphical installer,
-# but it cannot be unselected. (Typically, required components are
-# shown greyed out).
-#
-# DISABLED indicates that this component should be disabled (unselected)
-# by default. The user is free to select this component for
-# installation, unless it is also HIDDEN.
-#
-# DEPENDS lists the components on which this component depends. If this
-# component is selected, then each of the components listed must also be
-# selected. The dependency information is encoded within the installer
-# itself, so that users cannot install inconsistent sets of components.
-#
-# GROUP names the component group of which this component is a part. If
-# not provided, the component will be a standalone component, not part
-# of any component group. Component groups are described with the
-# cpack_add_component_group command, detailed below.
-#
-# INSTALL_TYPES lists the installation types of which this component is
-# a part. When one of these installations types is selected, this
-# component will automatically be selected. Installation types are
-# described with the cpack_add_install_type command, detailed below.
-#
-# DOWNLOADED indicates that this component should be downloaded
-# on-the-fly by the installer, rather than packaged in with the
-# installer itself. For more information, see the
-# cpack_configure_downloads command.
-#
-# ARCHIVE_FILE provides a name for the archive file created by CPack to
-# be used for downloaded components. If not supplied, CPack will create
-# a file with some name based on CPACK_PACKAGE_FILE_NAME and the name of
-# the component. See cpack_configure_downloads for more information.
-#
-# PLIST gives a filename that is passed to pkgbuild with the
-# ``--component-plist`` argument when using the productbuild generator.
-#
-# .. command:: cpack_add_component_group
-#
-# Describes a group of related CPack installation components.
-#
-# ::
-#
-# cpack_add_component_group(groupname
-# [DISPLAY_NAME name]
-# [DESCRIPTION description]
-# [PARENT_GROUP parent]
-# [EXPANDED]
-# [BOLD_TITLE])
-#
-#
-#
-# The cpack_add_component_group describes a group of installation
-# components, which will be placed together within the listing of
-# options. Typically, component groups allow the user to
-# select/deselect all of the components within a single group via a
-# single group-level option. Use component groups to reduce the
-# complexity of installers with many options. groupname is an arbitrary
-# name used to identify the group in the GROUP argument of the
-# cpack_add_component command, which is used to place a component in a
-# group. The name of the group must not conflict with the name of any
-# component.
-#
-# DISPLAY_NAME is the displayed name of the component group, used in
-# graphical installers to display the component group name. This value
-# can be any string.
-#
-# DESCRIPTION is an extended description of the component group, used in
-# graphical installers to give the user additional information about the
-# components within that group. Descriptions can span multiple lines
-# using ``\n`` as the line separator. Typically, these descriptions
-# should be no more than a few lines long.
-#
-# PARENT_GROUP, if supplied, names the parent group of this group.
-# Parent groups are used to establish a hierarchy of groups, providing
-# an arbitrary hierarchy of groups.
-#
-# EXPANDED indicates that, by default, the group should show up as
-# "expanded", so that the user immediately sees all of the components
-# within the group. Otherwise, the group will initially show up as a
-# single entry.
-#
-# BOLD_TITLE indicates that the group title should appear in bold, to
-# call the user's attention to the group.
-#
-# .. command:: cpack_add_install_type
-#
-# Add a new installation type containing
-# a set of predefined component selections to the graphical installer.
-#
-# ::
-#
-# cpack_add_install_type(typename
-# [DISPLAY_NAME name])
-#
-#
-#
-# The cpack_add_install_type command identifies a set of preselected
-# components that represents a common use case for an application. For
-# example, a "Developer" install type might include an application along
-# with its header and library files, while an "End user" install type
-# might just include the application's executable. Each component
-# identifies itself with one or more install types via the INSTALL_TYPES
-# argument to cpack_add_component.
-#
-# DISPLAY_NAME is the displayed name of the install type, which will
-# typically show up in a drop-down box within a graphical installer.
-# This value can be any string.
-#
-# .. command:: cpack_configure_downloads
-#
-# Configure CPack to download
-# selected components on-the-fly as part of the installation process.
-#
-# ::
-#
-# cpack_configure_downloads(site
-# [UPLOAD_DIRECTORY dirname]
-# [ALL]
-# [ADD_REMOVE|NO_ADD_REMOVE])
-#
-#
-#
-# The cpack_configure_downloads command configures installation-time
-# downloads of selected components. For each downloadable component,
-# CPack will create an archive containing the contents of that
-# component, which should be uploaded to the given site. When the user
-# selects that component for installation, the installer will download
-# and extract the component in place. This feature is useful for
-# creating small installers that only download the requested components,
-# saving bandwidth. Additionally, the installers are small enough that
-# they will be installed as part of the normal installation process, and
-# the "Change" button in Windows Add/Remove Programs control panel will
-# allow one to add or remove parts of the application after the original
-# installation. On Windows, the downloaded-components functionality
-# requires the ZipDLL plug-in for NSIS, available at:
-#
-# ::
-#
-# http://nsis.sourceforge.net/ZipDLL_plug-in
-#
-#
-#
-# On macOS, installers that download components on-the-fly can only
-# be built and installed on system using macOS 10.5 or later.
-#
-# The site argument is a URL where the archives for downloadable
-# components will reside, e.g.,
-# https://cmake.org/files/2.6.1/installer/ All of the archives
-# produced by CPack should be uploaded to that location.
-#
-# UPLOAD_DIRECTORY is the local directory where CPack will create the
-# various archives for each of the components. The contents of this
-# directory should be uploaded to a location accessible by the URL given
-# in the site argument. If omitted, CPack will use the directory
-# CPackUploads inside the CMake binary directory to store the generated
-# archives.
-#
-# The ALL flag indicates that all components be downloaded. Otherwise,
-# only those components explicitly marked as DOWNLOADED or that have a
-# specified ARCHIVE_FILE will be downloaded. Additionally, the ALL
-# option implies ADD_REMOVE (unless NO_ADD_REMOVE is specified).
-#
-# ADD_REMOVE indicates that CPack should install a copy of the installer
-# that can be called from Windows' Add/Remove Programs dialog (via the
-# "Modify" button) to change the set of installed components.
-# NO_ADD_REMOVE turns off this behavior. This option is ignored on Mac
-# OS X.
+#[=======================================================================[.rst:
+CPackComponent
+--------------
+
+Build binary and source package installers
+
+Variables concerning CPack Components
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The CPackComponent module is the module which handles the component
+part of CPack. See CPack module for general information about CPack.
+
+For certain kinds of binary installers (including the graphical
+installers on macOS and Windows), CPack generates installers that
+allow users to select individual application components to install.
+The contents of each of the components are identified by the COMPONENT
+argument of CMake's INSTALL command. These components can be
+annotated with user-friendly names and descriptions, inter-component
+dependencies, etc., and grouped in various ways to customize the
+resulting installer. See the cpack_add_* commands, described below,
+for more information about component-specific installations.
+
+Component-specific installation allows users to select specific sets
+of components to install during the install process. Installation
+components are identified by the COMPONENT argument of CMake's INSTALL
+commands, and should be further described by the following CPack
+commands:
+
+.. variable:: CPACK_COMPONENTS_ALL
+
+ The list of component to install.
+
+ The default value of this variable is computed by CPack and contains all
+ components defined by the project. The user may set it to only include the
+ specified components.
+
+ Instead of specifying all the desired components, it is possible to obtain a
+ list of all defined components and then remove the unwanted ones from the
+ list. The :command:`get_cmake_property` command can be used to obtain the
+ ``COMPONENTS`` property, then the :command:`list(REMOVE_ITEM)` command can be
+ used to remove the unwanted ones. For example, to use all defined components
+ except ``foo`` and ``bar``::
+
+ get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
+ list(REMOVE_ITEM CPACK_COMPONENTS_ALL "foo" "bar")
+
+.. variable:: CPACK_<GENNAME>_COMPONENT_INSTALL
+
+ Enable/Disable component install for CPack generator <GENNAME>.
+
+ Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
+ default behavior. e.g. RPM builds monolithic whereas NSIS builds
+ component. One can change the default behavior by setting this variable to
+ 0/1 or OFF/ON.
+
+.. variable:: CPACK_COMPONENTS_GROUPING
+
+ Specify how components are grouped for multi-package component-aware CPack
+ generators.
+
+ Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates
+ several packages files when asked for component packaging. They group
+ the component differently depending on the value of this variable:
+
+ * ONE_PER_GROUP (default): creates one package file per component group
+ * ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) components
+ * IGNORE : creates one package per component, i.e. IGNORE component group
+
+ One can specify different grouping for different CPack generator by
+ using a CPACK_PROJECT_CONFIG_FILE.
+
+.. variable:: CPACK_COMPONENT_<compName>_DISPLAY_NAME
+
+ The name to be displayed for a component.
+
+.. variable:: CPACK_COMPONENT_<compName>_DESCRIPTION
+
+ The description of a component.
+
+.. variable:: CPACK_COMPONENT_<compName>_GROUP
+
+ The group of a component.
+
+.. variable:: CPACK_COMPONENT_<compName>_DEPENDS
+
+ The dependencies (list of components) on which this component depends.
+
+.. variable:: CPACK_COMPONENT_<compName>_HIDDEN
+
+ True if this component is hidden from the user.
+
+.. variable:: CPACK_COMPONENT_<compName>_REQUIRED
+
+ True if this component is required.
+
+.. variable:: CPACK_COMPONENT_<compName>_DISABLED
+
+ True if this component is not selected to be installed by default.
+
+.. command:: cpack_add_component
+
+Describes a CPack installation
+component named by the COMPONENT argument to a CMake INSTALL command.
+
+::
+
+ cpack_add_component(compname
+ [DISPLAY_NAME name]
+ [DESCRIPTION description]
+ [HIDDEN | REQUIRED | DISABLED ]
+ [GROUP group]
+ [DEPENDS comp1 comp2 ... ]
+ [INSTALL_TYPES type1 type2 ... ]
+ [DOWNLOADED]
+ [ARCHIVE_FILE filename]
+ [PLIST filename])
+
+
+
+The cmake_add_component command describes an installation component,
+which the user can opt to install or remove as part of the graphical
+installation process. compname is the name of the component, as
+provided to the COMPONENT argument of one or more CMake INSTALL
+commands.
+
+DISPLAY_NAME is the displayed name of the component, used in graphical
+installers to display the component name. This value can be any
+string.
+
+DESCRIPTION is an extended description of the component, used in
+graphical installers to give the user additional information about the
+component. Descriptions can span multiple lines using ``\n`` as the
+line separator. Typically, these descriptions should be no more than
+a few lines long.
+
+HIDDEN indicates that this component will be hidden in the graphical
+installer, so that the user cannot directly change whether it is
+installed or not.
+
+REQUIRED indicates that this component is required, and therefore will
+always be installed. It will be visible in the graphical installer,
+but it cannot be unselected. (Typically, required components are
+shown greyed out).
+
+DISABLED indicates that this component should be disabled (unselected)
+by default. The user is free to select this component for
+installation, unless it is also HIDDEN.
+
+DEPENDS lists the components on which this component depends. If this
+component is selected, then each of the components listed must also be
+selected. The dependency information is encoded within the installer
+itself, so that users cannot install inconsistent sets of components.
+
+GROUP names the component group of which this component is a part. If
+not provided, the component will be a standalone component, not part
+of any component group. Component groups are described with the
+cpack_add_component_group command, detailed below.
+
+INSTALL_TYPES lists the installation types of which this component is
+a part. When one of these installations types is selected, this
+component will automatically be selected. Installation types are
+described with the cpack_add_install_type command, detailed below.
+
+DOWNLOADED indicates that this component should be downloaded
+on-the-fly by the installer, rather than packaged in with the
+installer itself. For more information, see the
+cpack_configure_downloads command.
+
+ARCHIVE_FILE provides a name for the archive file created by CPack to
+be used for downloaded components. If not supplied, CPack will create
+a file with some name based on CPACK_PACKAGE_FILE_NAME and the name of
+the component. See cpack_configure_downloads for more information.
+
+PLIST gives a filename that is passed to pkgbuild with the
+``--component-plist`` argument when using the productbuild generator.
+
+.. command:: cpack_add_component_group
+
+Describes a group of related CPack installation components.
+
+::
+
+ cpack_add_component_group(groupname
+ [DISPLAY_NAME name]
+ [DESCRIPTION description]
+ [PARENT_GROUP parent]
+ [EXPANDED]
+ [BOLD_TITLE])
+
+
+
+The cpack_add_component_group describes a group of installation
+components, which will be placed together within the listing of
+options. Typically, component groups allow the user to
+select/deselect all of the components within a single group via a
+single group-level option. Use component groups to reduce the
+complexity of installers with many options. groupname is an arbitrary
+name used to identify the group in the GROUP argument of the
+cpack_add_component command, which is used to place a component in a
+group. The name of the group must not conflict with the name of any
+component.
+
+DISPLAY_NAME is the displayed name of the component group, used in
+graphical installers to display the component group name. This value
+can be any string.
+
+DESCRIPTION is an extended description of the component group, used in
+graphical installers to give the user additional information about the
+components within that group. Descriptions can span multiple lines
+using ``\n`` as the line separator. Typically, these descriptions
+should be no more than a few lines long.
+
+PARENT_GROUP, if supplied, names the parent group of this group.
+Parent groups are used to establish a hierarchy of groups, providing
+an arbitrary hierarchy of groups.
+
+EXPANDED indicates that, by default, the group should show up as
+"expanded", so that the user immediately sees all of the components
+within the group. Otherwise, the group will initially show up as a
+single entry.
+
+BOLD_TITLE indicates that the group title should appear in bold, to
+call the user's attention to the group.
+
+.. command:: cpack_add_install_type
+
+Add a new installation type containing
+a set of predefined component selections to the graphical installer.
+
+::
+
+ cpack_add_install_type(typename
+ [DISPLAY_NAME name])
+
+
+
+The cpack_add_install_type command identifies a set of preselected
+components that represents a common use case for an application. For
+example, a "Developer" install type might include an application along
+with its header and library files, while an "End user" install type
+might just include the application's executable. Each component
+identifies itself with one or more install types via the INSTALL_TYPES
+argument to cpack_add_component.
+
+DISPLAY_NAME is the displayed name of the install type, which will
+typically show up in a drop-down box within a graphical installer.
+This value can be any string.
+
+.. command:: cpack_configure_downloads
+
+Configure CPack to download
+selected components on-the-fly as part of the installation process.
+
+::
+
+ cpack_configure_downloads(site
+ [UPLOAD_DIRECTORY dirname]
+ [ALL]
+ [ADD_REMOVE|NO_ADD_REMOVE])
+
+
+
+The cpack_configure_downloads command configures installation-time
+downloads of selected components. For each downloadable component,
+CPack will create an archive containing the contents of that
+component, which should be uploaded to the given site. When the user
+selects that component for installation, the installer will download
+and extract the component in place. This feature is useful for
+creating small installers that only download the requested components,
+saving bandwidth. Additionally, the installers are small enough that
+they will be installed as part of the normal installation process, and
+the "Change" button in Windows Add/Remove Programs control panel will
+allow one to add or remove parts of the application after the original
+installation. On Windows, the downloaded-components functionality
+requires the ZipDLL plug-in for NSIS, available at:
+
+::
+
+ http://nsis.sourceforge.net/ZipDLL_plug-in
+
+
+
+On macOS, installers that download components on-the-fly can only
+be built and installed on system using macOS 10.5 or later.
+
+The site argument is a URL where the archives for downloadable
+components will reside, e.g.,
+https://cmake.org/files/2.6.1/installer/ All of the archives
+produced by CPack should be uploaded to that location.
+
+UPLOAD_DIRECTORY is the local directory where CPack will create the
+various archives for each of the components. The contents of this
+directory should be uploaded to a location accessible by the URL given
+in the site argument. If omitted, CPack will use the directory
+CPackUploads inside the CMake binary directory to store the generated
+archives.
+
+The ALL flag indicates that all components be downloaded. Otherwise,
+only those components explicitly marked as DOWNLOADED or that have a
+specified ARCHIVE_FILE will be downloaded. Additionally, the ALL
+option implies ADD_REMOVE (unless NO_ADD_REMOVE is specified).
+
+ADD_REMOVE indicates that CPack should install a copy of the installer
+that can be called from Windows' Add/Remove Programs dialog (via the
+"Modify" button) to change the set of installed components.
+NO_ADD_REMOVE turns off this behavior. This option is ignored on Mac
+OS X.
+#]=======================================================================]
# Define var in order to avoid multiple inclusion
if(NOT CPackComponent_CMake_INCLUDED)
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 141e84254..42ef8c7b7 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -518,7 +518,7 @@ macro(_cpack_ifw_resolve_script _variable)
get_filename_component(${_ifw_script_macro} ${_ifw_script_file} ABSOLUTE)
set(_ifw_script_file ${${_ifw_script_macro}})
if(NOT EXISTS ${_ifw_script_file})
- message(WARNING "CPack IFW: script file \"${_ifw_script_file}\" is not exists")
+ message(WARNING "CPack IFW: script file \"${_ifw_script_file}\" does not exist")
set(${_ifw_script_macro})
endif()
endif()
@@ -616,6 +616,12 @@ macro(cpack_ifw_configure_component_group grpname)
set(_CPACK_IFWGRP_STR "\n# Configuration for IFW component group \"${grpname}\"\n")
+ foreach(_IFW_ARG_NAME ${_IFW_OPT})
+ cpack_append_option_set_command(
+ CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME}
+ _CPACK_IFWGRP_STR)
+ endforeach()
+
foreach(_IFW_ARG_NAME ${_IFW_ARGS})
cpack_append_string_variable_set_command(
CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME}
diff --git a/Modules/CPackIFWConfigureFile.cmake b/Modules/CPackIFWConfigureFile.cmake
index 790574a52..0abe0da37 100644
--- a/Modules/CPackIFWConfigureFile.cmake
+++ b/Modules/CPackIFWConfigureFile.cmake
@@ -1,32 +1,33 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CPackIFWConfigureFile
-# ---------------------
-#
-# The module defines :command:`configure_file` similar command to
-# configure file templates prepared in QtIFW/SDK/Creator style.
-#
-#
-# Commands
-# ^^^^^^^^
-#
-# The module defines the following commands:
-#
-# .. command:: cpack_ifw_configure_file
-#
-# Copy a file to another location and modify its contents.
-#
-# ::
-#
-# cpack_ifw_configure_file(<input> <output>)
-#
-# Copies an ``<input>`` file to an ``<output>`` file and substitutes variable
-# values referenced as ``%{VAR}`` or ``%VAR%`` in the input file content.
-# Each variable reference will be replaced with the current value of the
-# variable, or the empty string if the variable is not defined.
-#
+#[=======================================================================[.rst:
+CPackIFWConfigureFile
+---------------------
+
+The module defines :command:`configure_file` similar command to
+configure file templates prepared in QtIFW/SDK/Creator style.
+
+
+Commands
+^^^^^^^^
+
+The module defines the following commands:
+
+.. command:: cpack_ifw_configure_file
+
+ Copy a file to another location and modify its contents.
+
+ ::
+
+ cpack_ifw_configure_file(<input> <output>)
+
+ Copies an ``<input>`` file to an ``<output>`` file and substitutes variable
+ values referenced as ``%{VAR}`` or ``%VAR%`` in the input file content.
+ Each variable reference will be replaced with the current value of the
+ variable, or the empty string if the variable is not defined.
+
+#]=======================================================================]
# NOTE: This file used to himself packaging via CPack IFW generator and
# should be compatible with minimal CMake version defined in
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 2ea931d4a..d100704df 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -27,12 +27,8 @@ to creating tests when testing is enabled.
To enable submissions to a CDash server, create a ``CTestConfig.cmake``
file at the top of the project with content such as::
- set(CTEST_PROJECT_NAME "MyProject")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
- set(CTEST_DROP_METHOD "http")
- set(CTEST_DROP_SITE "my.cdash.org")
- set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
- set(CTEST_DROP_SITE_CDASH TRUE)
+ set(CTEST_SUBMIT_URL "http://my.cdash.org/submit.php?project=MyProject")
(the CDash server can provide the file to a project administrator who
configures ``MyProject``). Settings in the config file are shared by
@@ -90,6 +86,7 @@ if(BUILD_TESTING)
if(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
include("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}")
+ SET_IF_SET_AND_NOT_SET(SUBMIT_URL "${CTEST_SUBMIT_URL}")
SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}")
SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}")
SET_IF_SET_AND_NOT_SET(DROP_SITE_USER "${CTEST_DROP_SITE_USER}")
@@ -112,6 +109,18 @@ if(BUILD_TESTING)
endif()
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
+ if(NOT SUBMIT_URL)
+ set(SUBMIT_URL "${DROP_METHOD}://")
+ if(DROP_SITE_USER)
+ string(APPEND SUBMIT_URL "${DROP_SITE_USER}")
+ if(DROP_SITE_PASSWORD)
+ string(APPEND SUBMIT_URL ":${DROP_SITE_PASSWORD}")
+ endif()
+ string(APPEND SUBMIT_URL "@")
+ endif()
+ string(APPEND SUBMIT_URL "${DROP_SITE}${DROP_SITE_LOCATION}")
+ endif()
+
find_program(CVSCOMMAND cvs )
set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
"Options passed to the cvs update command.")
@@ -178,9 +187,6 @@ if(BUILD_TESTING)
)
set(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
"File that contains suppressions for the memory checker")
- find_program(SCPCOMMAND scp DOC
- "Path to scp command, used by CTest for submitting results to a Dart server"
- )
find_program(COVERAGE_COMMAND gcov DOC
"Path to the coverage program that CTest uses for performing coverage inspection"
)
diff --git a/Modules/CTestCoverageCollectGCOV.cmake b/Modules/CTestCoverageCollectGCOV.cmake
index 1203be4c2..2258271cc 100644
--- a/Modules/CTestCoverageCollectGCOV.cmake
+++ b/Modules/CTestCoverageCollectGCOV.cmake
@@ -1,69 +1,70 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CTestCoverageCollectGCOV
-# ------------------------
-#
-# This module provides the ``ctest_coverage_collect_gcov`` function.
-#
-# This function runs gcov on all .gcda files found in the binary tree
-# and packages the resulting .gcov files into a tar file.
-# This tarball also contains the following:
-#
-# * *data.json* defines the source and build directories for use by CDash.
-# * *Labels.json* indicates any :prop_sf:`LABELS` that have been set on the
-# source files.
-# * The *uncovered* directory holds any uncovered files found by
-# :variable:`CTEST_EXTRA_COVERAGE_GLOB`.
-#
-# After generating this tar file, it can be sent to CDash for display with the
-# :command:`ctest_submit(CDASH_UPLOAD)` command.
-#
-# .. command:: cdash_coverage_collect_gcov
-#
-# ::
-#
-# ctest_coverage_collect_gcov(TARBALL <tarfile>
-# [SOURCE <source_dir>][BUILD <build_dir>]
-# [GCOV_COMMAND <gcov_command>]
-# [GCOV_OPTIONS <options>...]
-# )
-#
-# Run gcov and package a tar file for CDash. The options are:
-#
-# ``TARBALL <tarfile>``
-# Specify the location of the ``.tar`` file to be created for later
-# upload to CDash. Relative paths will be interpreted with respect
-# to the top-level build directory.
-#
-# ``SOURCE <source_dir>``
-# Specify the top-level source directory for the build.
-# Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`.
-#
-# ``BUILD <build_dir>``
-# Specify the top-level build directory for the build.
-# Default is the value of :variable:`CTEST_BINARY_DIRECTORY`.
-#
-# ``GCOV_COMMAND <gcov_command>``
-# Specify the full path to the ``gcov`` command on the machine.
-# Default is the value of :variable:`CTEST_COVERAGE_COMMAND`.
-#
-# ``GCOV_OPTIONS <options>...``
-# Specify options to be passed to gcov. The ``gcov`` command
-# is run as ``gcov <options>... -o <gcov-dir> <file>.gcda``.
-# If not specified, the default option is just ``-b``.
-#
-# ``GLOB``
-# Recursively search for .gcda files in build_dir rather than
-# determining search locations by reading TargetDirectories.txt.
-#
-# ``DELETE``
-# Delete coverage files after they've been packaged into the .tar.
-#
-# ``QUIET``
-# Suppress non-error messages that otherwise would have been
-# printed out by this function.
+#[=======================================================================[.rst:
+CTestCoverageCollectGCOV
+------------------------
+
+This module provides the ``ctest_coverage_collect_gcov`` function.
+
+This function runs gcov on all .gcda files found in the binary tree
+and packages the resulting .gcov files into a tar file.
+This tarball also contains the following:
+
+* *data.json* defines the source and build directories for use by CDash.
+* *Labels.json* indicates any :prop_sf:`LABELS` that have been set on the
+ source files.
+* The *uncovered* directory holds any uncovered files found by
+ :variable:`CTEST_EXTRA_COVERAGE_GLOB`.
+
+After generating this tar file, it can be sent to CDash for display with the
+:command:`ctest_submit(CDASH_UPLOAD)` command.
+
+.. command:: cdash_coverage_collect_gcov
+
+ ::
+
+ ctest_coverage_collect_gcov(TARBALL <tarfile>
+ [SOURCE <source_dir>][BUILD <build_dir>]
+ [GCOV_COMMAND <gcov_command>]
+ [GCOV_OPTIONS <options>...]
+ )
+
+ Run gcov and package a tar file for CDash. The options are:
+
+ ``TARBALL <tarfile>``
+ Specify the location of the ``.tar`` file to be created for later
+ upload to CDash. Relative paths will be interpreted with respect
+ to the top-level build directory.
+
+ ``SOURCE <source_dir>``
+ Specify the top-level source directory for the build.
+ Default is the value of :variable:`CTEST_SOURCE_DIRECTORY`.
+
+ ``BUILD <build_dir>``
+ Specify the top-level build directory for the build.
+ Default is the value of :variable:`CTEST_BINARY_DIRECTORY`.
+
+ ``GCOV_COMMAND <gcov_command>``
+ Specify the full path to the ``gcov`` command on the machine.
+ Default is the value of :variable:`CTEST_COVERAGE_COMMAND`.
+
+ ``GCOV_OPTIONS <options>...``
+ Specify options to be passed to gcov. The ``gcov`` command
+ is run as ``gcov <options>... -o <gcov-dir> <file>.gcda``.
+ If not specified, the default option is just ``-b``.
+
+ ``GLOB``
+ Recursively search for .gcda files in build_dir rather than
+ determining search locations by reading TargetDirectories.txt.
+
+ ``DELETE``
+ Delete coverage files after they've been packaged into the .tar.
+
+ ``QUIET``
+ Suppress non-error messages that otherwise would have been
+ printed out by this function.
+#]=======================================================================]
function(ctest_coverage_collect_gcov)
set(options QUIET GLOB DELETE)
diff --git a/Modules/CTestScriptMode.cmake b/Modules/CTestScriptMode.cmake
index 5be78d5a3..7af3577e0 100644
--- a/Modules/CTestScriptMode.cmake
+++ b/Modules/CTestScriptMode.cmake
@@ -1,13 +1,14 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CTestScriptMode
-# ---------------
-#
-#
-#
-# This file is read by ctest in script mode (-S)
+#[=======================================================================[.rst:
+CTestScriptMode
+---------------
+
+
+
+This file is read by ctest in script mode (-S)
+#]=======================================================================]
# Determine the current system, so this information can be used
# in ctest scripts
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
index dc90513a9..3dff92605 100644
--- a/Modules/CTestUseLaunchers.cmake
+++ b/Modules/CTestUseLaunchers.cmake
@@ -1,32 +1,33 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CTestUseLaunchers
-# -----------------
-#
-# Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
-#
-# CTestUseLaunchers is automatically included when you include(CTest).
-# However, it is split out into its own module file so projects can use
-# the CTEST_USE_LAUNCHERS functionality independently.
-#
-# To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
-# dashboard script, and then also set it in the cache of the configured
-# project. Both cmake and ctest need to know the value of it for the
-# launchers to work properly. CMake needs to know in order to generate
-# proper build rules, and ctest, in order to produce the proper error
-# and warning analysis.
-#
-# For convenience, you may set the ENV variable
-# CTEST_USE_LAUNCHERS_DEFAULT in your ctest -S script, too. Then, as
-# long as your CMakeLists uses include(CTest) or
-# include(CTestUseLaunchers), it will use the value of the ENV variable
-# to initialize a CTEST_USE_LAUNCHERS cache variable. This cache
-# variable initialization only occurs if CTEST_USE_LAUNCHERS is not
-# already defined. If CTEST_USE_LAUNCHERS is on in a ctest -S script
-# the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
-# to the cmake command used to configure the project.
+#[=======================================================================[.rst:
+CTestUseLaunchers
+-----------------
+
+Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+
+CTestUseLaunchers is automatically included when you include(CTest).
+However, it is split out into its own module file so projects can use
+the CTEST_USE_LAUNCHERS functionality independently.
+
+To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
+dashboard script, and then also set it in the cache of the configured
+project. Both cmake and ctest need to know the value of it for the
+launchers to work properly. CMake needs to know in order to generate
+proper build rules, and ctest, in order to produce the proper error
+and warning analysis.
+
+For convenience, you may set the ENV variable
+CTEST_USE_LAUNCHERS_DEFAULT in your ctest -S script, too. Then, as
+long as your CMakeLists uses include(CTest) or
+include(CTestUseLaunchers), it will use the value of the ENV variable
+to initialize a CTEST_USE_LAUNCHERS cache variable. This cache
+variable initialization only occurs if CTEST_USE_LAUNCHERS is not
+already defined. If CTEST_USE_LAUNCHERS is on in a ctest -S script
+the ctest_configure command will add -DCTEST_USE_LAUNCHERS:BOOL=TRUE
+to the cmake command used to configure the project.
+#]=======================================================================]
if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
set(CTEST_USE_LAUNCHERS "$ENV{CTEST_USE_LAUNCHERS_DEFAULT}"
diff --git a/Modules/CheckCCompilerFlag.cmake b/Modules/CheckCCompilerFlag.cmake
index 9d2c74dbd..f5c112717 100644
--- a/Modules/CheckCCompilerFlag.cmake
+++ b/Modules/CheckCCompilerFlag.cmake
@@ -9,7 +9,7 @@ Check whether the C compiler supports a given flag.
.. command:: check_c_compiler_flag
- ::
+ .. code-block:: cmake
check_c_compiler_flag(<flag> <var>)
diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake
index 114213ac6..77ba0cc46 100644
--- a/Modules/CheckCSourceCompiles.cmake
+++ b/Modules/CheckCSourceCompiles.cmake
@@ -9,15 +9,16 @@ Check if given C source compiles and links into an executable.
.. command:: check_c_source_compiles
- ::
+ .. code-block:: cmake
- check_c_source_compiles(code resultVar [FAIL_REGEX regex1 [regex2...]])
+ check_c_source_compiles(<code> <resultVar>
+ [FAIL_REGEX <regex1> [<regex2>...]])
- Check that the source supplied in ``code`` can be compiled as a C source
+ Check that the source supplied in ``<code>`` can be compiled as a C source
file and linked as an executable (so it must contain at least a ``main()``
function). The result will be stored in the internal cache variable specified
- by ``resultVar``, with a boolean true value for success and boolean false for
- failure. If ``FAIL_REGEX`` is provided, then failure is determined by
+ by ``<resultVar>``, with a boolean true value for success and boolean false
+ for failure. If ``FAIL_REGEX`` is provided, then failure is determined by
checking if anything in the output matches any of the specified regular
expressions.
@@ -34,7 +35,7 @@ Check if given C source compiles and links into an executable.
``CMAKE_REQUIRED_DEFINITIONS``
A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
- ``resultVar`` will also be added automatically.
+ ``<resultVar>`` will also be added automatically.
``CMAKE_REQUIRED_INCLUDES``
A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
@@ -42,6 +43,10 @@ Check if given C source compiles and links into an executable.
``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
directory property will be ignored.
+ ``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_compile` for further details).
+
``CMAKE_REQUIRED_LIBRARIES``
A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
command. These can be the name of system libraries or they can be
@@ -53,10 +58,10 @@ Check if given C source compiles and links into an executable.
associated with the check will be suppressed.
The check is only performed once, with the result cached in the variable
- named by ``resultVar``. Every subsequent CMake run will re-use this cached
- value rather than performing the check again, even if the ``code`` changes.
+ named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``<code>`` changes.
In order to force the check to be re-evaluated, the variable named by
- ``resultVar`` must be manually removed from the cache.
+ ``<resultVar>`` must be manually removed from the cache.
#]=======================================================================]
@@ -77,6 +82,12 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
endforeach()
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -99,6 +110,7 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
@@ -131,4 +143,3 @@ macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
endif()
endif()
endmacro()
-
diff --git a/Modules/CheckCSourceRuns.cmake b/Modules/CheckCSourceRuns.cmake
index 7eb050cc6..eba70f2ba 100644
--- a/Modules/CheckCSourceRuns.cmake
+++ b/Modules/CheckCSourceRuns.cmake
@@ -10,16 +10,16 @@ subsequently be run.
.. command:: check_c_source_runs
- ::
+ .. code-block:: cmake
- check_c_source_runs(code resultVar)
+ check_c_source_runs(<code> <resultVar>)
- Check that the source supplied in ``code`` can be compiled as a C source
- file, linked as an executable and then run. The ``code`` must contain at
- least a ``main()`` function. If the code could be built and run successfully,
- the internal cache variable specified by ``resultVar`` will be set to 1,
- otherwise it will be set to an value that evaluates to boolean false (e.g.
- an empty string or an error message).
+ Check that the source supplied in ``<code>`` can be compiled as a C source
+ file, linked as an executable and then run. The ``<code>`` must contain at
+ least a ``main()`` function. If the ``<code>`` could be built and run
+ successfully, the internal cache variable specified by ``<resultVar>`` will
+ be set to 1, otherwise it will be set to an value that evaluates to boolean
+ false (e.g. an empty string or an error message).
The underlying check is performed by the :command:`try_run` command. The
compile and link commands can be influenced by setting any of the following
@@ -34,7 +34,7 @@ subsequently be run.
``CMAKE_REQUIRED_DEFINITIONS``
A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
- ``resultVar`` will also be added automatically.
+ ``<resultVar>`` will also be added automatically.
``CMAKE_REQUIRED_INCLUDES``
A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
@@ -42,6 +42,10 @@ subsequently be run.
``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
directory property will be ignored.
+ ``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_run` for further details).
+
``CMAKE_REQUIRED_LIBRARIES``
A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
command. These can be the name of system libraries or they can be
@@ -53,10 +57,10 @@ subsequently be run.
associated with the check will be suppressed.
The check is only performed once, with the result cached in the variable
- named by ``resultVar``. Every subsequent CMake run will re-use this cached
- value rather than performing the check again, even if the ``code`` changes.
+ named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``<code>`` changes.
In order to force the check to be re-evaluated, the variable named by
- ``resultVar`` must be manually removed from the cache.
+ ``<resultVar>`` must be manually removed from the cache.
#]=======================================================================]
@@ -66,6 +70,12 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
if(NOT DEFINED "${VAR}")
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -88,6 +98,7 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_C_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
@@ -132,4 +143,3 @@ macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
endif()
endif()
endmacro()
-
diff --git a/Modules/CheckCXXCompilerFlag.cmake b/Modules/CheckCXXCompilerFlag.cmake
index dd6083531..a01e142ab 100644
--- a/Modules/CheckCXXCompilerFlag.cmake
+++ b/Modules/CheckCXXCompilerFlag.cmake
@@ -9,7 +9,7 @@ Check whether the CXX compiler supports a given flag.
.. command:: check_cxx_compiler_flag
- ::
+ .. code-block:: cmake
check_cxx_compiler_flag(<flag> <var>)
@@ -61,4 +61,3 @@ macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
endmacro ()
-
diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake
index ed8661b11..cc457a565 100644
--- a/Modules/CheckCXXSourceCompiles.cmake
+++ b/Modules/CheckCXXSourceCompiles.cmake
@@ -9,15 +9,16 @@ Check if given C++ source compiles and links into an executable.
.. command:: check_cxx_source_compiles
- ::
+ .. code-block:: cmake
- check_cxx_source_compiles(code resultVar [FAIL_REGEX regex1 [regex2...]])
+ check_cxx_source_compiles(<code> <resultVar>
+ [FAIL_REGEX <regex1> [<regex2>...]])
- Check that the source supplied in ``code`` can be compiled as a C++ source
+ Check that the source supplied in ``<code>`` can be compiled as a C++ source
file and linked as an executable (so it must contain at least a ``main()``
function). The result will be stored in the internal cache variable specified
- by ``resultVar``, with a boolean true value for success and boolean false for
- failure. If ``FAIL_REGEX`` is provided, then failure is determined by
+ by ``<resultVar>``, with a boolean true value for success and boolean false
+ for failure. If ``FAIL_REGEX`` is provided, then failure is determined by
checking if anything in the output matches any of the specified regular
expressions.
@@ -34,7 +35,7 @@ Check if given C++ source compiles and links into an executable.
``CMAKE_REQUIRED_DEFINITIONS``
A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
- ``resultVar`` will also be added automatically.
+ ``<resultVar>`` will also be added automatically.
``CMAKE_REQUIRED_INCLUDES``
A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
@@ -42,6 +43,10 @@ Check if given C++ source compiles and links into an executable.
``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
directory property will be ignored.
+ ``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_compile` for further details).
+
``CMAKE_REQUIRED_LIBRARIES``
A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
command. These can be the name of system libraries or they can be
@@ -53,10 +58,10 @@ Check if given C++ source compiles and links into an executable.
associated with the check will be suppressed.
The check is only performed once, with the result cached in the variable
- named by ``resultVar``. Every subsequent CMake run will re-use this cached
- value rather than performing the check again, even if the ``code`` changes.
+ named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``<code>`` changes.
In order to force the check to be re-evaluated, the variable named by
- ``resultVar`` must be manually removed from the cache.
+ ``<resultVar>`` must be manually removed from the cache.
#]=======================================================================]
@@ -78,6 +83,12 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -100,6 +111,7 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
@@ -132,4 +144,3 @@ macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
endif()
endif()
endmacro()
-
diff --git a/Modules/CheckCXXSourceRuns.cmake b/Modules/CheckCXXSourceRuns.cmake
index 83bf2f23d..5e3f19581 100644
--- a/Modules/CheckCXXSourceRuns.cmake
+++ b/Modules/CheckCXXSourceRuns.cmake
@@ -10,16 +10,16 @@ subsequently be run.
.. command:: check_cxx_source_runs
- ::
+ .. code-block:: cmake
- check_cxx_source_runs(code resultVar)
+ check_cxx_source_runs(<code> <resultVar>)
- Check that the source supplied in ``code`` can be compiled as a C++ source
- file, linked as an executable and then run. The ``code`` must contain at
- least a ``main()`` function. If the code could be built and run successfully,
- the internal cache variable specified by ``resultVar`` will be set to 1,
- otherwise it will be set to an value that evaluates to boolean false (e.g.
- an empty string or an error message).
+ Check that the source supplied in ``<code>`` can be compiled as a C++ source
+ file, linked as an executable and then run. The ``<code>`` must contain at
+ least a ``main()`` function. If the ``<code>`` could be built and run
+ successfully, the internal cache variable specified by ``<resultVar>`` will
+ be set to 1, otherwise it will be set to an value that evaluates to boolean
+ false (e.g. an empty string or an error message).
The underlying check is performed by the :command:`try_run` command. The
compile and link commands can be influenced by setting any of the following
@@ -34,7 +34,7 @@ subsequently be run.
``CMAKE_REQUIRED_DEFINITIONS``
A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
- ``resultVar`` will also be added automatically.
+ ``<resultVar>`` will also be added automatically.
``CMAKE_REQUIRED_INCLUDES``
A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
@@ -42,6 +42,10 @@ subsequently be run.
``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
directory property will be ignored.
+ ``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_run` for further details).
+
``CMAKE_REQUIRED_LIBRARIES``
A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
command. These can be the name of system libraries or they can be
@@ -53,10 +57,10 @@ subsequently be run.
associated with the check will be suppressed.
The check is only performed once, with the result cached in the variable
- named by ``resultVar``. Every subsequent CMake run will re-use this cached
- value rather than performing the check again, even if the ``code`` changes.
+ named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``<code>`` changes.
In order to force the check to be re-evaluated, the variable named by
- ``resultVar`` must be manually removed from the cache.
+ ``<resultVar>`` must be manually removed from the cache.
#]=======================================================================]
@@ -66,6 +70,12 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
if(NOT DEFINED "${VAR}")
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -88,11 +98,13 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_CXX_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
- COMPILE_OUTPUT_VARIABLE OUTPUT)
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE RUN_OUTPUT)
# if it did not compile make the return value fail code of 1
if(NOT ${VAR}_COMPILED)
@@ -107,6 +119,8 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C++ SOURCE FILE Test ${VAR} succeeded with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
else()
@@ -122,9 +136,10 @@ macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")
endif()
endif()
endmacro()
-
diff --git a/Modules/CheckCXXSymbolExists.cmake b/Modules/CheckCXXSymbolExists.cmake
index 117a45808..970e301b4 100644
--- a/Modules/CheckCXXSymbolExists.cmake
+++ b/Modules/CheckCXXSymbolExists.cmake
@@ -1,36 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckCXXSymbolExists
-# --------------------
-#
-# Check if a symbol exists as a function, variable, or macro in C++
-#
-# CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
-#
-# Check that the <symbol> is available after including given header
-# <files> and store the result in a <variable>. Specify the list of
-# files in one argument as a semicolon-separated list.
-# CHECK_CXX_SYMBOL_EXISTS() can be used to check in C++ files, as
-# opposed to CHECK_SYMBOL_EXISTS(), which works only for C.
-#
-# If the header files define the symbol as a macro it is considered
-# available and assumed to work. If the header files declare the symbol
-# as a function or variable then the symbol must also be available for
-# linking. If the symbol is a type or enum value it will not be
-# recognized (consider using CheckTypeSize or CheckCSourceCompiles).
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckCXXSymbolExists
+--------------------
+
+Check if a symbol exists as a function, variable, or macro in C++
+
+.. command:: CHECK_CXX_SYMBOL_EXISTS
+
+ .. code-block:: cmake
+
+ CHECK_CXX_SYMBOL_EXISTS(<symbol> <files> <variable>)
+
+ Check that the ``<symbol>`` is available after including given header
+ ``<files>`` and store the result in a ``<variable>``. Specify the list of
+ files in one argument as a semicolon-separated list.
+ ``CHECK_CXX_SYMBOL_EXISTS()`` can be used to check in C++ files, as
+ opposed to ``CHECK_SYMBOL_EXISTS()``, which works only for ``C``.
+
+ If the header files define the symbol as a macro it is considered
+ available and assumed to work. If the header files declare the symbol
+ as a function or variable then the symbol must also be available for
+ linking. If the symbol is a type or enum value it will not be
+ recognized (consider using :module:`CheckTypeSize`
+ or :module:`CheckCSourceCompiles`).
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+ string of compile command line flags.
+``CMAKE_REQUIRED_DEFINITIONS``
+ a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar).
+``CMAKE_REQUIRED_INCLUDES``
+ a :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler.
+``CMAKE_REQUIRED_LINK_OPTIONS``
+ a :ref:`;-list <CMake Language Lists>` of options to add to the link command.
+``CMAKE_REQUIRED_LIBRARIES``
+ a :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+ execute quietly without messages.
+#]=======================================================================]
include_guard(GLOBAL)
include(CheckSymbolExists)
diff --git a/Modules/CheckFortranCompilerFlag.cmake b/Modules/CheckFortranCompilerFlag.cmake
index 2cb25321e..299cd8cfc 100644
--- a/Modules/CheckFortranCompilerFlag.cmake
+++ b/Modules/CheckFortranCompilerFlag.cmake
@@ -9,7 +9,7 @@ Check whether the Fortran compiler supports a given flag.
.. command:: check_fortran_compiler_flag
- ::
+ .. code-block:: cmake
check_fortran_compiler_flag(<flag> <var>)
diff --git a/Modules/CheckFortranFunctionExists.cmake b/Modules/CheckFortranFunctionExists.cmake
index f3ced93d7..7ca205a6d 100644
--- a/Modules/CheckFortranFunctionExists.cmake
+++ b/Modules/CheckFortranFunctionExists.cmake
@@ -1,34 +1,50 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckFortranFunctionExists
-# --------------------------
-#
-# macro which checks if the Fortran function exists
-#
-# CHECK_FORTRAN_FUNCTION_EXISTS(FUNCTION VARIABLE)
-#
-# ::
-#
-# FUNCTION - the name of the Fortran function
-# VARIABLE - variable to store the result
-# Will be created as an internal cache variable.
-#
-#
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+#[=======================================================================[.rst:
+CheckFortranFunctionExists
+--------------------------
+
+Check if a Fortran function exists.
+
+.. command:: CHECK_FORTRAN_FUNCTION_EXISTS
+
+ .. code-block:: cmake
+
+ CHECK_FORTRAN_FUNCTION_EXISTS(<function> <result>)
+
+ where
+
+ ``<function>``
+ the name of the Fortran function
+ ``<result>``
+ variable to store the result; will be created as an internal cache variable.
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_compile` for further details).
+
+``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_compile` for
+ further details).
+#]=======================================================================]
include_guard(GLOBAL)
macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
if(NOT DEFINED ${VARIABLE})
message(STATUS "Looking for Fortran ${FUNCTION}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -47,6 +63,7 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
try_compile(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
+ ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
OUTPUT_VARIABLE OUTPUT
)
diff --git a/Modules/CheckFortranSourceCompiles.cmake b/Modules/CheckFortranSourceCompiles.cmake
index d2b0ccaf4..f94b25468 100644
--- a/Modules/CheckFortranSourceCompiles.cmake
+++ b/Modules/CheckFortranSourceCompiles.cmake
@@ -9,23 +9,37 @@ Check if given Fortran source compiles and links into an executable.
.. command:: check_fortran_source_compiles
- ::
+ .. code-block:: cmake
- check_fortran_source_compiles(code resultVar
- [FAIL_REGEX regex1 [regex2...]]
- [SRC_EXT ext]
+ check_fortran_source_compiles(<code> <resultVar>
+ [FAIL_REGEX <regex>...]
+ [SRC_EXT <extension>]
)
- Check that the source supplied in ``code`` can be compiled as a Fortran
- source file and linked as an executable (so it must contain at least a
- ``PROGRAM`` entry point). The result will be stored in the internal cache
- variable specified by ``resultVar``, with a boolean true value for success
- and boolean false for failure. If ``FAIL_REGEX`` is provided, then failure is
- determined by checking if anything in the output matches any of the specified
- regular expressions.
+ Checks that the source supplied in ``<code>`` can be compiled as a Fortran
+ source file and linked as an executable. The ``<code>`` must be a Fortran program
+ containing at least an ``end`` statement--for example:
+
+ .. code-block:: cmake
+
+ check_fortran_source_compiles("character :: b; error stop b; end" F2018ESTOPOK SRC_EXT F90)
+
+ This command can help avoid costly build processes when a compiler lacks support
+ for a necessary feature, or a particular vendor library is not compatible with
+ the Fortran compiler version being used. This generate-time check may advise the
+ user of such before the main build process. See also the
+ :command:`check_fortran_source_runs` command to actually run the compiled code.
+
+ The result will be stored in the internal cache
+ variable ``<resultVar>``, with a boolean true value for success and boolean
+ false for failure.
+
+ If ``FAIL_REGEX`` is provided, then failure is determined by checking
+ if anything in the output matches any of the specified regular expressions.
By default, the test source file will be given a ``.F`` file extension. The
- ``SRC_EXT`` option can be used to override this with ``.ext`` instead.
+ ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead--
+ ``.F90`` is a typical choice.
The underlying check is performed by the :command:`try_compile` command. The
compile and link commands can be influenced by setting any of the following
@@ -40,7 +54,7 @@ Check if given Fortran source compiles and links into an executable.
``CMAKE_REQUIRED_DEFINITIONS``
A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
- ``resultVar`` will also be added automatically.
+ ``<resultVar>`` will also be added automatically.
``CMAKE_REQUIRED_INCLUDES``
A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
@@ -48,6 +62,10 @@ Check if given Fortran source compiles and links into an executable.
``try_compile()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
directory property will be ignored.
+ ``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_compile` for further details).
+
``CMAKE_REQUIRED_LIBRARIES``
A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
command. These can be the name of system libraries or they can be
@@ -59,10 +77,10 @@ Check if given Fortran source compiles and links into an executable.
associated with the check will be suppressed.
The check is only performed once, with the result cached in the variable
- named by ``resultVar``. Every subsequent CMake run will re-use this cached
- value rather than performing the check again, even if the ``code`` changes.
+ named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``<code>`` changes.
In order to force the check to be re-evaluated, the variable named by
- ``resultVar`` must be manually removed from the cache.
+ ``<resultVar>`` must be manually removed from the cache.
#]=======================================================================]
@@ -87,6 +105,12 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
endif()
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -109,6 +133,7 @@ macro(CHECK_Fortran_SOURCE_COMPILES SOURCE VAR)
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS}
${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
diff --git a/Modules/CheckFortranSourceRuns.cmake b/Modules/CheckFortranSourceRuns.cmake
new file mode 100644
index 000000000..a80c13d00
--- /dev/null
+++ b/Modules/CheckFortranSourceRuns.cmake
@@ -0,0 +1,175 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+CheckFortranSourceRuns
+----------------------
+
+Check if given Fortran source compiles and links into an executable and can
+subsequently be run.
+
+.. command:: check_fortran_source_runs
+
+ .. code-block:: cmake
+
+ check_fortran_source_runs(<code> <resultVar>
+ [SRC_EXT <extension>])
+
+ Check that the source supplied in ``<code>`` can be compiled as a Fortran source
+ file, linked as an executable and then run. The ``<code>`` must be a Fortran program
+ containing at least an ``end`` statement--for example:
+
+ .. code-block:: cmake
+
+ check_fortran_source_runs("real :: x[*]; call co_sum(x); end" F2018coarrayOK)
+
+ This command can help avoid costly build processes when a compiler lacks support
+ for a necessary feature, or a particular vendor library is not compatible with
+ the Fortran compiler version being used. Some of these failures only occur at runtime
+ instead of linktime, and a trivial runtime example can catch the issue before the
+ main build process.
+
+ If the ``<code>`` could be built and run
+ successfully, the internal cache variable specified by ``<resultVar>`` will
+ be set to 1, otherwise it will be set to an value that evaluates to boolean
+ false (e.g. an empty string or an error message).
+
+ By default, the test source file will be given a ``.F90`` file extension. The
+ ``SRC_EXT`` option can be used to override this with ``.<extension>`` instead.
+
+ The underlying check is performed by the :command:`try_run` command. The
+ compile and link commands can be influenced by setting any of the following
+ variables prior to calling ``check_fortran_source_runs()``:
+
+ ``CMAKE_REQUIRED_FLAGS``
+ Additional flags to pass to the compiler. Note that the contents of
+ :variable:`CMAKE_Fortran_FLAGS <CMAKE_<LANG>_FLAGS>` and its associated
+ configuration-specific variable are automatically added to the compiler
+ command before the contents of ``CMAKE_REQUIRED_FLAGS``.
+
+ ``CMAKE_REQUIRED_DEFINITIONS``
+ A :ref:`;-list <CMake Language Lists>` of compiler definitions of the form
+ ``-DFOO`` or ``-DFOO=bar``. A definition for the name specified by
+ ``<resultVar>`` will also be added automatically.
+
+ ``CMAKE_REQUIRED_INCLUDES``
+ A :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler. These will be the only header search paths used by
+ ``try_run()``, i.e. the contents of the :prop_dir:`INCLUDE_DIRECTORIES`
+ directory property will be ignored.
+
+ ``CMAKE_REQUIRED_LINK_OPTIONS``
+ A :ref:`;-list <CMake Language Lists>` of options to add to the link
+ command (see :command:`try_run` for further details).
+
+ ``CMAKE_REQUIRED_LIBRARIES``
+ A :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. These can be the name of system libraries or they can be
+ :ref:`Imported Targets <Imported Targets>` (see :command:`try_run` for
+ further details).
+
+ ``CMAKE_REQUIRED_QUIET``
+ If this variable evaluates to a boolean true value, all status messages
+ associated with the check will be suppressed.
+
+ The check is only performed once, with the result cached in the variable
+ named by ``<resultVar>``. Every subsequent CMake run will re-use this cached
+ value rather than performing the check again, even if the ``<code>`` changes.
+ In order to force the check to be re-evaluated, the variable named by
+ ``<resultVar>`` must be manually removed from the cache.
+
+#]=======================================================================]
+
+include_guard(GLOBAL)
+
+macro(CHECK_Fortran_SOURCE_RUNS SOURCE VAR)
+ if(NOT DEFINED "${VAR}")
+ set(_SRC_EXT)
+ set(_key)
+ foreach(arg ${ARGN})
+ if("${arg}" MATCHES "^(SRC_EXT)$")
+ set(_key "${arg}")
+ elseif(_key)
+ list(APPEND _${_key} "${arg}")
+ else()
+ message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
+ endif()
+ endforeach()
+ if(NOT _SRC_EXT)
+ set(_SRC_EXT F90)
+ endif()
+ set(MACRO_CHECK_FUNCTION_DEFINITIONS
+ "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS)
+ endif()
+ if(CMAKE_REQUIRED_LIBRARIES)
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES
+ LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+ else()
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES)
+ endif()
+ if(CMAKE_REQUIRED_INCLUDES)
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES
+ "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
+ else()
+ set(CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES)
+ endif()
+ file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}"
+ "${SOURCE}\n")
+
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR}")
+ endif()
+ try_run(${VAR}_EXITCODE ${VAR}_COMPILED
+ ${CMAKE_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.${_SRC_EXT}
+ COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_Fortran_SOURCE_COMPILES_ADD_LINK_OPTIONS}
+ ${CHECK_Fortran_SOURCE_COMPILES_ADD_LIBRARIES}
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
+ -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH}
+ "${CHECK_Fortran_SOURCE_COMPILES_ADD_INCLUDES}"
+ COMPILE_OUTPUT_VARIABLE OUTPUT
+ RUN_OUTPUT_VARIABLE RUN_OUTPUT)
+
+ # if it did not compile make the return value fail code of 1
+ if(NOT ${VAR}_COMPILED)
+ set(${VAR}_EXITCODE 1)
+ endif()
+ # if the return value was 0 then it worked
+ if("${${VAR}_EXITCODE}" EQUAL 0)
+ set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR} - Success")
+ endif()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ "Performing Fortran SOURCE FILE Test ${VAR} succeeded with the following output:\n"
+ "${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
+ "Return value: ${${VAR}}\n"
+ "Source file was:\n${SOURCE}\n")
+ else()
+ if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
+ set(${VAR} "${${VAR}_EXITCODE}")
+ else()
+ set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
+ endif()
+
+ if(NOT CMAKE_REQUIRED_QUIET)
+ message(STATUS "Performing Test ${VAR} - Failed")
+ endif()
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Performing Fortran SOURCE FILE Test ${VAR} failed with the following output:\n"
+ "${OUTPUT}\n"
+ "...and run output:\n"
+ "${RUN_OUTPUT}\n"
+ "Return value: ${${VAR}_EXITCODE}\n"
+ "Source file was:\n${SOURCE}\n")
+ endif()
+ endif()
+endmacro()
diff --git a/Modules/CheckFunctionExists.cmake b/Modules/CheckFunctionExists.cmake
index d00aa8ade..c39144fa8 100644
--- a/Modules/CheckFunctionExists.cmake
+++ b/Modules/CheckFunctionExists.cmake
@@ -1,42 +1,54 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckFunctionExists
-# -------------------
-#
-# Check if a C function can be linked::
-#
-# check_function_exists(<function> <variable>)
-#
-# Check that the ``<function>`` is provided by libraries on the system and store
-# the result in a ``<variable>``. ``<variable>`` will be created as an internal
-# cache variable.
-#
-# The following variables may be set before calling this macro to modify the
-# way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
-#
-# .. note::
-#
-# Prefer using :Module:`CheckSymbolExists` instead of this module,
-# for the following reasons:
-#
-# * ``check_function_exists()`` can't detect functions that are inlined
-# in headers or specified as a macro.
-#
-# * ``check_function_exists()`` can't detect anything in the 32-bit
-# versions of the Win32 API, because of a mismatch in calling conventions.
-#
-# * ``check_function_exists()`` only verifies linking, it does not verify
-# that the function is declared in system headers.
+#[=======================================================================[.rst:
+CheckFunctionExists
+-------------------
+
+Check if a C function can be linked
+
+.. command:: check_function_exists
+
+ .. code-block:: cmake
+
+ check_function_exists(<function> <variable>)
+
+ Checks that the ``<function>`` is provided by libraries on the system and store
+ the result in a ``<variable>``, which will be created as an internal
+ cache variable.
+
+The following variables may be set before calling this macro to modify the
+way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+ string of compile command line flags.
+``CMAKE_REQUIRED_DEFINITIONS``
+ a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar).
+``CMAKE_REQUIRED_INCLUDES``
+ a :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler.
+``CMAKE_REQUIRED_LINK_OPTIONS``
+ a :ref:`;-list <CMake Language Lists>` of options to add to the link command.
+``CMAKE_REQUIRED_LIBRARIES``
+ a :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+ execute quietly without messages.
+
+.. note::
+
+ Prefer using :Module:`CheckSymbolExists` instead of this module,
+ for the following reasons:
+
+ * ``check_function_exists()`` can't detect functions that are inlined
+ in headers or specified as a macro.
+
+ * ``check_function_exists()`` can't detect anything in the 32-bit
+ versions of the Win32 API, because of a mismatch in calling conventions.
+
+ * ``check_function_exists()`` only verifies linking, it does not verify
+ that the function is declared in system headers.
+#]=======================================================================]
include_guard(GLOBAL)
@@ -47,6 +59,12 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION}")
endif()
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -73,6 +91,7 @@ macro(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
${CMAKE_BINARY_DIR}
${_cfe_source}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_FUNCTION_EXISTS_ADD_LINK_OPTIONS}
${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
"${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}"
diff --git a/Modules/CheckIPOSupported.cmake b/Modules/CheckIPOSupported.cmake
index ad8852c06..0d6ad20ae 100644
--- a/Modules/CheckIPOSupported.cmake
+++ b/Modules/CheckIPOSupported.cmake
@@ -51,8 +51,6 @@ Examples
#]=======================================================================]
-include(CMakeParseArguments) # cmake_parse_arguments
-
# X_RESULT - name of the final result variable
# X_OUTPUT - name of the variable with information about error
macro(_ipo_not_supported output)
diff --git a/Modules/CheckIncludeFile.cmake b/Modules/CheckIncludeFile.cmake
index 24bc34964..d7b9481da 100644
--- a/Modules/CheckIncludeFile.cmake
+++ b/Modules/CheckIncludeFile.cmake
@@ -1,40 +1,45 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckIncludeFile
-# ----------------
-#
-# Provides a macro to check if a header file can be included in ``C``.
-#
-# .. command:: CHECK_INCLUDE_FILE
-#
-# ::
-#
-# CHECK_INCLUDE_FILE(<include> <variable> [<flags>])
-#
-# Check if the given ``<include>`` file may be included in a ``C``
-# source file and store the result in an internal cache entry named
-# ``<variable>``. The optional third argument may be used to add
-# compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-# string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-# list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-# list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-# A list of libraries to link. See policy :policy:`CMP0075`.
-# ``CMAKE_REQUIRED_QUIET``
-# execute quietly without messages
-#
-# See the :module:`CheckIncludeFiles` module to check for multiple headers
-# at once. See the :module:`CheckIncludeFileCXX` module to check for headers
-# using the ``CXX`` language.
+#[=======================================================================[.rst:
+CheckIncludeFile
+----------------
+
+Provides a macro to check if a header file can be included in ``C``.
+
+.. command:: CHECK_INCLUDE_FILE
+
+ .. code-block:: cmake
+
+ CHECK_INCLUDE_FILE(<include> <variable> [<flags>])
+
+ Check if the given ``<include>`` file may be included in a ``C``
+ source file and store the result in an internal cache entry named
+ ``<variable>``. The optional third argument may be used to add
+ compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+ string of compile command line flags.
+``CMAKE_REQUIRED_DEFINITIONS``
+ a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar).
+``CMAKE_REQUIRED_INCLUDES``
+ a :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler.
+``CMAKE_REQUIRED_LINK_OPTIONS``
+ a :ref:`;-list <CMake Language Lists>` of options to add to the link command.
+``CMAKE_REQUIRED_LIBRARIES``
+ a :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+ execute quietly without messages.
+
+See the :module:`CheckIncludeFiles` module to check for multiple headers
+at once. See the :module:`CheckIncludeFileCXX` module to check for headers
+using the ``CXX`` language.
+#]=======================================================================]
include_guard(GLOBAL)
@@ -57,6 +62,11 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
string(APPEND CMAKE_C_FLAGS " ${ARGV2}")
endif()
+ set(_CIF_LINK_OPTIONS)
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(_CIF_LINK_OPTIONS LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ endif()
+
set(_CIF_LINK_LIBRARIES "")
if(CMAKE_REQUIRED_LIBRARIES)
cmake_policy(GET CMP0075 _CIF_CMP0075
@@ -84,11 +94,13 @@ macro(CHECK_INCLUDE_FILE INCLUDE VARIABLE)
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${_CIF_LINK_OPTIONS}
${_CIF_LINK_LIBRARIES}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
"${CHECK_INCLUDE_FILE_C_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT)
+ unset(_CIF_LINK_OPTIONS)
unset(_CIF_LINK_LIBRARIES)
if(${ARGC} EQUAL 3)
diff --git a/Modules/CheckIncludeFileCXX.cmake b/Modules/CheckIncludeFileCXX.cmake
index f13d983b6..de5a83b35 100644
--- a/Modules/CheckIncludeFileCXX.cmake
+++ b/Modules/CheckIncludeFileCXX.cmake
@@ -1,39 +1,44 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckIncludeFileCXX
-# -------------------
-#
-# Provides a macro to check if a header file can be included in ``CXX``.
-#
-# .. command:: CHECK_INCLUDE_FILE_CXX
-#
-# ::
-#
-# CHECK_INCLUDE_FILE_CXX(<include> <variable> [<flags>])
-#
-# Check if the given ``<include>`` file may be included in a ``CXX``
-# source file and store the result in an internal cache entry named
-# ``<variable>``. The optional third argument may be used to add
-# compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-# string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-# list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-# list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-# A list of libraries to link. See policy :policy:`CMP0075`.
-# ``CMAKE_REQUIRED_QUIET``
-# execute quietly without messages
-#
-# See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFiles`
-# to check for one or more ``C`` headers.
+#[=======================================================================[.rst:
+CheckIncludeFileCXX
+-------------------
+
+Provides a macro to check if a header file can be included in ``CXX``.
+
+.. command:: CHECK_INCLUDE_FILE_CXX
+
+ .. code-block:: cmake
+
+ CHECK_INCLUDE_FILE_CXX(<include> <variable> [<flags>])
+
+ Check if the given ``<include>`` file may be included in a ``CXX``
+ source file and store the result in an internal cache entry named
+ ``<variable>``. The optional third argument may be used to add
+ compilation flags to the check (or use ``CMAKE_REQUIRED_FLAGS`` below).
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+ string of compile command line flags.
+``CMAKE_REQUIRED_DEFINITIONS``
+ a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar).
+``CMAKE_REQUIRED_INCLUDES``
+ a :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler.
+``CMAKE_REQUIRED_LINK_OPTIONS``
+ a :ref:`;-list <CMake Language Lists>` of options to add to the link command.
+``CMAKE_REQUIRED_LIBRARIES``
+ a :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+ execute quietly without messages.
+
+See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFiles`
+to check for one or more ``C`` headers.
+#]=======================================================================]
include_guard(GLOBAL)
@@ -56,6 +61,11 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
string(APPEND CMAKE_CXX_FLAGS " ${ARGV2}")
endif()
+ set(_CIF_LINK_OPTIONS)
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(_CIF_LINK_OPTIONS LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ endif()
+
set(_CIF_LINK_LIBRARIES "")
if(CMAKE_REQUIRED_LIBRARIES)
cmake_policy(GET CMP0075 _CIF_CMP0075
@@ -83,11 +93,13 @@ macro(CHECK_INCLUDE_FILE_CXX INCLUDE VARIABLE)
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFile.cxx
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${_CIF_LINK_OPTIONS}
${_CIF_LINK_LIBRARIES}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILE_FLAGS}
"${CHECK_INCLUDE_FILE_CXX_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT)
+ unset(_CIF_LINK_OPTIONS)
unset(_CIF_LINK_LIBRARIES)
if(${ARGC} EQUAL 3)
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index c689f05e9..f52ab55fb 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -1,45 +1,50 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckIncludeFiles
-# -----------------
-#
-# Provides a macro to check if a list of one or more header files can
-# be included together.
-#
-# .. command:: CHECK_INCLUDE_FILES
-#
-# ::
-#
-# CHECK_INCLUDE_FILES("<includes>" <variable> [LANGUAGE <language>])
-#
-# Check if the given ``<includes>`` list may be included together
-# in a source file and store the result in an internal cache
-# entry named ``<variable>``. Specify the ``<includes>`` argument
-# as a :ref:`;-list <CMake Language Lists>` of header file names.
-#
-# If LANGUAGE is set, the specified compiler will be used to perform the
-# check. Acceptable values are ``C`` and ``CXX``. If not set, the C compiler
-# will be used if enabled. If the C compiler is not enabled, the C++
-# compiler will be used if enabled.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ``CMAKE_REQUIRED_FLAGS``
-# string of compile command line flags
-# ``CMAKE_REQUIRED_DEFINITIONS``
-# list of macros to define (-DFOO=bar)
-# ``CMAKE_REQUIRED_INCLUDES``
-# list of include directories
-# ``CMAKE_REQUIRED_LIBRARIES``
-# A list of libraries to link. See policy :policy:`CMP0075`.
-# ``CMAKE_REQUIRED_QUIET``
-# execute quietly without messages
-#
-# See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX`
-# to check for a single header file in ``C`` or ``CXX`` languages.
+#[=======================================================================[.rst:
+CheckIncludeFiles
+-----------------
+
+Provides a macro to check if a list of one or more header files can
+be included together.
+
+.. command:: CHECK_INCLUDE_FILES
+
+ .. code-block:: cmake
+
+ CHECK_INCLUDE_FILES("<includes>" <variable> [LANGUAGE <language>])
+
+ Check if the given ``<includes>`` list may be included together
+ in a source file and store the result in an internal cache
+ entry named ``<variable>``. Specify the ``<includes>`` argument
+ as a :ref:`;-list <CMake Language Lists>` of header file names.
+
+ If ``LANGUAGE`` is set, the specified compiler will be used to perform the
+ check. Acceptable values are ``C`` and ``CXX``. If not set, the C compiler
+ will be used if enabled. If the C compiler is not enabled, the C++
+ compiler will be used if enabled.
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+``CMAKE_REQUIRED_FLAGS``
+ string of compile command line flags.
+``CMAKE_REQUIRED_DEFINITIONS``
+ a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar).
+``CMAKE_REQUIRED_INCLUDES``
+ a :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler.
+``CMAKE_REQUIRED_LINK_OPTIONS``
+ a :ref:`;-list <CMake Language Lists>` of options to add to the link command.
+``CMAKE_REQUIRED_LIBRARIES``
+ a :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. See policy :policy:`CMP0075`.
+``CMAKE_REQUIRED_QUIET``
+ execute quietly without messages.
+
+See modules :module:`CheckIncludeFile` and :module:`CheckIncludeFileCXX`
+to check for a single header file in ``C`` or ``CXX`` languages.
+#]=======================================================================]
include_guard(GLOBAL)
@@ -97,6 +102,11 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
set(_description "include file ${_INCLUDE}")
endif()
+ set(_CIF_LINK_OPTIONS)
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(_CIF_LINK_OPTIONS LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ endif()
+
set(_CIF_LINK_LIBRARIES "")
if(CMAKE_REQUIRED_LIBRARIES)
cmake_policy(GET CMP0075 _CIF_CMP0075
@@ -127,11 +137,13 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
${CMAKE_BINARY_DIR}
${src}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${_CIF_LINK_OPTIONS}
${_CIF_LINK_LIBRARIES}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_INCLUDE_FILES_FLAGS}
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT)
+ unset(_CIF_LINK_OPTIONS)
unset(_CIF_LINK_LIBRARIES)
if(${VARIABLE})
if(NOT CMAKE_REQUIRED_QUIET)
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake
index ce92bfe6d..efa88bdab 100644
--- a/Modules/CheckLanguage.cmake
+++ b/Modules/CheckLanguage.cmake
@@ -1,35 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckLanguage
-# -------------
-#
-# Check if a language can be enabled
-#
-# Usage:
-#
-# ::
-#
-# check_language(<lang>)
-#
-# where <lang> is a language that may be passed to enable_language()
-# such as "Fortran". If CMAKE_<lang>_COMPILER is already defined the
-# check does nothing. Otherwise it tries enabling the language in a
-# test project. The result is cached in CMAKE_<lang>_COMPILER as the
-# compiler that was found, or NOTFOUND if the language cannot be
-# enabled.
-#
-# Example:
-#
-# ::
-#
-# check_language(Fortran)
-# if(CMAKE_Fortran_COMPILER)
-# enable_language(Fortran)
-# else()
-# message(STATUS "No Fortran support")
-# endif()
+#[=======================================================================[.rst:
+CheckLanguage
+-------------
+
+Check if a language can be enabled
+
+Usage:
+
+::
+
+ check_language(<lang>)
+
+where <lang> is a language that may be passed to enable_language()
+such as "Fortran". If CMAKE_<lang>_COMPILER is already defined the
+check does nothing. Otherwise it tries enabling the language in a
+test project. The result is cached in CMAKE_<lang>_COMPILER as the
+compiler that was found, or NOTFOUND if the language cannot be
+enabled.
+
+Example:
+
+::
+
+ check_language(Fortran)
+ if(CMAKE_Fortran_COMPILER)
+ enable_language(Fortran)
+ else()
+ message(STATUS "No Fortran support")
+ endif()
+#]=======================================================================]
include_guard(GLOBAL)
diff --git a/Modules/CheckLibraryExists.cmake b/Modules/CheckLibraryExists.cmake
index 487cc592a..6504df5d7 100644
--- a/Modules/CheckLibraryExists.cmake
+++ b/Modules/CheckLibraryExists.cmake
@@ -1,33 +1,39 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckLibraryExists
-# ------------------
-#
-# Check if the function exists.
-#
-# CHECK_LIBRARY_EXISTS (LIBRARY FUNCTION LOCATION VARIABLE)
-#
-# ::
-#
-# LIBRARY - the name of the library you are looking for
-# FUNCTION - the name of the function
-# LOCATION - location where the library should be found
-# VARIABLE - variable to store the result
-# Will be created as an internal cache variable.
-#
-#
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckLibraryExists
+------------------
+
+Check if the function exists.
+
+.. command:: CHECK_LIBRARY_EXISTS
+
+ .. code-block:: cmake
+
+ CHECK_LIBRARY_EXISTS(LIBRARY FUNCTION LOCATION VARIABLE)
+
+ ::
+
+ LIBRARY - the name of the library you are looking for
+ FUNCTION - the name of the function
+ LOCATION - location where the library should be found
+ VARIABLE - variable to store the result
+ Will be created as an internal cache variable.
+
+
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+ CMAKE_REQUIRED_FLAGS = string of compile command line flags
+ CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+ CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command
+ CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+ CMAKE_REQUIRED_QUIET = execute quietly without messages
+#]=======================================================================]
include_guard(GLOBAL)
@@ -38,6 +44,11 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
endif()
+ set(CHECK_LIBRARY_EXISTS_LINK_OPTIONS)
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_LIBRARY_EXISTS_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ endif()
set(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_LIBRARY_EXISTS_LIBRARIES
@@ -57,6 +68,7 @@ macro(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
${CMAKE_BINARY_DIR}
${_cle_source}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_LIBRARY_EXISTS_LINK_OPTIONS}
LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_LIBRARY_EXISTS_DEFINITION}
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
new file mode 100644
index 000000000..720217db6
--- /dev/null
+++ b/Modules/CheckPIESupported.cmake
@@ -0,0 +1,134 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+CheckPIESupported
+-----------------
+
+Check whether the linker supports position independent code (PIE) or no
+position independent code (NO_PIE) for executables.
+Use this to ensure that the :prop_tgt:`POSITION_INDEPENDENT_CODE` target
+property for executables will be honored at link time.
+
+.. command:: check_pie_supported
+
+ ::
+
+ check_pie_supported([OUTPUT_VARIABLE <output>]
+ [LANGUAGES <lang>...])
+
+ Options are:
+
+ ``OUTPUT_VARIABLE <output>``
+ Set ``<output>`` variable with details about any error.
+ ``LANGUAGES <lang>...``
+ Check the linkers used for each of the specified languages.
+ Supported languages are ``C``, ``CXX``, and ``Fortran``.
+
+It makes no sense to use this module when :policy:`CMP0083` is set to ``OLD``,
+so the command will return an error in this case. See policy :policy:`CMP0083`
+for details.
+
+Variables
+^^^^^^^^^
+
+For each language checked, two boolean cache variables are defined.
+
+ ``CMAKE_<lang>_LINK_PIE_SUPPORTED``
+ Set to ``YES`` if ``PIE`` is supported by the linker and ``NO`` otherwise.
+ ``CMAKE_<lang>_LINK_NO_PIE_SUPPORTED``
+ Set to ``YES`` if ``NO_PIE`` is supported by the linker and ``NO`` otherwise.
+
+Examples
+^^^^^^^^
+
+.. code-block:: cmake
+
+ check_pie_supported()
+ set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+
+.. code-block:: cmake
+
+ # Retrieve any error message.
+ check_pie_supported(OUTPUT_VARIABLE output LANGUAGES C)
+ set_property(TARGET foo PROPERTY POSITION_INDEPENDENT_CODE TRUE)
+ if(NOT CMAKE_C_LINK_PIE_SUPPORTED)
+ message(WARNING "PIE is not supported at link time: ${output}.\n"
+ "PIE link options will not be passed to linker.")
+ endif()
+
+#]=======================================================================]
+
+
+include (Internal/CMakeCheckCompilerFlag)
+
+function (check_pie_supported)
+ cmake_policy(GET CMP0083 cmp0083)
+
+ if (NOT cmp0083)
+ message(FATAL_ERROR "check_pie_supported: Policy CMP0083 is not set")
+ endif()
+
+ if(cmp0083 STREQUAL "OLD")
+ message(FATAL_ERROR "check_pie_supported: Policy CMP0083 set to OLD")
+ endif()
+
+ set(optional)
+ set(one OUTPUT_VARIABLE)
+ set(multiple LANGUAGES)
+
+ cmake_parse_arguments(CHECK_PIE "${optional}" "${one}" "${multiple}" "${ARGN}")
+ if(CHECK_PIE_UNPARSED_ARGUMENTS)
+ message(FATAL_ERROR "check_pie_supported: Unparsed arguments: ${CHECK_PIE_UNPARSED_ARGUMENTS}")
+ endif()
+
+ if (CHECK_PIE_LANGUAGES)
+ set (unsupported_languages "${CHECK_PIE_LANGUAGES}")
+ list (REMOVE_ITEM unsupported_languages "C" "CXX" "Fortran")
+ if(unsupported_languages)
+ message(FATAL_ERROR "check_pie_supported: language(s) '${unsupported_languages}' not supported")
+ endif()
+ else()
+ # User did not set any languages, use defaults
+ get_property (enabled_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+ if (NOT enabled_languages)
+ return()
+ endif()
+
+ list (FILTER enabled_languages INCLUDE REGEX "^(C|CXX|Fortran)$")
+ if (NOT enabled_languages)
+ return()
+ endif()
+
+ set (CHECK_PIE_LANGUAGES ${enabled_languages})
+ endif()
+
+ set (outputs)
+
+ foreach(lang IN LISTS CHECK_PIE_LANGUAGES)
+ if(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER)
+ cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_PIE}"
+ CMAKE_${lang}_LINK_PIE_SUPPORTED
+ OUTPUT_VARIABLE output)
+ if (NOT CMAKE_${lang}_LINK_PIE_SUPPORTED)
+ string (APPEND outputs "PIE (${lang}): ${output}\n")
+ endif()
+
+ cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}"
+ CMAKE_${lang}_LINK_NO_PIE_SUPPORTED
+ OUTPUT_VARIABLE output)
+ if (NOT CMAKE_${lang}_LINK_NO_PIE_SUPPORTED)
+ string (APPEND outputs "NO_PIE (${lang}): ${output}\n")
+ endif()
+ else()
+ # no support at link time. Set cache variables to NO
+ set(CMAKE_${lang}_LINK_PIE_SUPPORTED NO CACHE INTERNAL "PIE (${lang})")
+ set(CMAKE_${lang}_LINK_NO_PIE_SUPPORTED NO CACHE INTERNAL "NO_PIE (${lang})")
+ string (APPEND outputs "PIE and NO_PIE are not supported by linker for ${lang}")
+ endif()
+ endforeach()
+
+ if (CHECK_PIE_OUTPUT_VARIABLE)
+ set (${CHECK_PIE_OUTPUT_VARIABLE} "${outputs}" PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/Modules/CheckPrototypeDefinition.cmake b/Modules/CheckPrototypeDefinition.cmake
index dde077513..a7b020c06 100644
--- a/Modules/CheckPrototypeDefinition.cmake
+++ b/Modules/CheckPrototypeDefinition.cmake
@@ -1,43 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckPrototypeDefinition
-# ------------------------
-#
-# Check if the prototype we expect is correct.
-#
-# check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
-#
-# ::
-#
-# FUNCTION - The name of the function (used to check if prototype exists)
-# PROTOTYPE- The prototype to check.
-# RETURN - The return value of the function.
-# HEADER - The header files required.
-# VARIABLE - The variable to store the result.
-# Will be created as an internal cache variable.
-#
-# Example:
-#
-# ::
-#
-# check_prototype_definition(getpwent_r
-# "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
-# "NULL"
-# "unistd.h;pwd.h"
-# SOLARIS_GETPWENT_R)
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckPrototypeDefinition
+------------------------
+
+Check if the prototype we expect is correct.
+
+.. command:: check_prototype_definition
+
+ .. code-block:: cmake
+
+ check_prototype_definition(FUNCTION PROTOTYPE RETURN HEADER VARIABLE)
+
+ ::
+
+ FUNCTION - The name of the function (used to check if prototype exists)
+ PROTOTYPE- The prototype to check.
+ RETURN - The return value of the function.
+ HEADER - The header files required.
+ VARIABLE - The variable to store the result.
+ Will be created as an internal cache variable.
+
+ Example:
+
+ .. code-block:: cmake
+
+ check_prototype_definition(getpwent_r
+ "struct passwd *getpwent_r(struct passwd *src, char *buf, int buflen)"
+ "NULL"
+ "unistd.h;pwd.h"
+ SOLARIS_GETPWENT_R)
+
+The following variables may be set before calling this function to modify
+the way the check is run:
+
+::
+
+ CMAKE_REQUIRED_FLAGS = string of compile command line flags
+ CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+ CMAKE_REQUIRED_INCLUDES = list of include directories
+ CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command
+ CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+ CMAKE_REQUIRED_QUIET = execute quietly without messages
+#]=======================================================================]
#
@@ -45,12 +51,18 @@ get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
include_guard(GLOBAL)
-function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
+function(check_prototype_definition _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
if (NOT DEFINED ${_VARIABLE})
set(CHECK_PROTOTYPE_DEFINITION_CONTENT "/* */\n")
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ if (CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_PROTOTYPE_DEFINITION_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_PROTOTYPE_DEFINITION_LINK_OPTIONS)
+ endif()
if (CMAKE_REQUIRED_LIBRARIES)
set(CHECK_PROTOTYPE_DEFINITION_LIBS
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -82,6 +94,7 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckPrototypeDefinition.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_PROTOTYPE_DEFINITION_LINK_OPTIONS}
${CHECK_PROTOTYPE_DEFINITION_LIBS}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CHECK_PROTOTYPE_DEFINITION_FLAGS}
"${CMAKE_SYMBOL_EXISTS_INCLUDES}"
diff --git a/Modules/CheckStructHasMember.cmake b/Modules/CheckStructHasMember.cmake
index 8689a5cb9..7fef85770 100644
--- a/Modules/CheckStructHasMember.cmake
+++ b/Modules/CheckStructHasMember.cmake
@@ -1,42 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckStructHasMember
-# --------------------
-#
-# Check if the given struct or class has the specified member variable
-#
-# ::
-#
-# CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable>
-# [LANGUAGE <language>])
-#
-# ::
-#
-# <struct> - the name of the struct or class you are interested in
-# <member> - the member which existence you want to check
-# <header> - the header(s) where the prototype should be declared
-# <variable> - variable to store the result
-# <language> - the compiler to use (C or CXX)
-#
-#
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
-#
-#
-#
-# Example: CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec sys/select.h
-# HAVE_TIMEVAL_TV_SEC LANGUAGE C)
+#[=======================================================================[.rst:
+CheckStructHasMember
+--------------------
+
+Check if the given struct or class has the specified member variable
+
+.. command:: CHECK_STRUCT_HAS_MEMBER
+
+ .. code-block:: cmake
+
+ CHECK_STRUCT_HAS_MEMBER(<struct> <member> <header> <variable>
+ [LANGUAGE <language>])
+
+ ::
+
+ <struct> - the name of the struct or class you are interested in
+ <member> - the member which existence you want to check
+ <header> - the header(s) where the prototype should be declared
+ <variable> - variable to store the result
+ <language> - the compiler to use (C or CXX)
+
+
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+ CMAKE_REQUIRED_FLAGS = string of compile command line flags
+ CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+ CMAKE_REQUIRED_INCLUDES = list of include directories
+ CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command
+ CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+ CMAKE_REQUIRED_QUIET = execute quietly without messages
+
+
+Example:
+
+.. code-block:: cmake
+
+ CHECK_STRUCT_HAS_MEMBER("struct timeval" tv_sec sys/select.h
+ HAVE_TIMEVAL_TV_SEC LANGUAGE C)
+#]=======================================================================]
include_guard(GLOBAL)
include(CheckCSourceCompiles)
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 3483121dc..b9ef8088f 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -10,7 +10,7 @@ or macro in ``C``.
.. command:: check_symbol_exists
- ::
+ .. code-block:: cmake
check_symbol_exists(<symbol> <files> <variable>)
@@ -32,15 +32,19 @@ The following variables may be set before calling this macro to modify
the way the check is run:
``CMAKE_REQUIRED_FLAGS``
- string of compile command line flags
+ string of compile command line flags.
``CMAKE_REQUIRED_DEFINITIONS``
- list of macros to define (-DFOO=bar)
+ a :ref:`;-list <CMake Language Lists>` of macros to define (-DFOO=bar).
``CMAKE_REQUIRED_INCLUDES``
- list of include directories
+ a :ref:`;-list <CMake Language Lists>` of header search paths to pass to
+ the compiler.
+``CMAKE_REQUIRED_LINK_OPTIONS``
+ a :ref:`;-list <CMake Language Lists>` of options to add to the link command.
``CMAKE_REQUIRED_LIBRARIES``
- list of libraries to link
+ a :ref:`;-list <CMake Language Lists>` of libraries to add to the link
+ command. See policy :policy:`CMP0075`.
``CMAKE_REQUIRED_QUIET``
- execute quietly without messages
+ execute quietly without messages.
#]=======================================================================]
include_guard(GLOBAL)
@@ -62,6 +66,12 @@ macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}")
set(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
set(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_SYMBOL_EXISTS_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_SYMBOL_EXISTS_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_SYMBOL_EXISTS_LIBS
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -91,6 +101,7 @@ macro(__CHECK_SYMBOL_EXISTS_IMPL SOURCEFILE SYMBOL FILES VARIABLE)
${CMAKE_BINARY_DIR}
"${SOURCEFILE}"
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_SYMBOL_EXISTS_LINK_OPTIONS}
${CHECK_SYMBOL_EXISTS_LIBS}
CMAKE_FLAGS
-DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_SYMBOL_EXISTS_FLAGS}
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 2b5deec81..372737307 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -1,72 +1,76 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckTypeSize
-# -------------
-#
-# Check sizeof a type
-#
-# ::
-#
-# CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
-# [LANGUAGE <language>])
-#
-# Check if the type exists and determine its size. On return,
-# "HAVE_${VARIABLE}" holds the existence of the type, and "${VARIABLE}"
-# holds one of the following:
-#
-# ::
-#
-# <size> = type has non-zero size <size>
-# "0" = type has arch-dependent size (see below)
-# "" = type does not exist
-#
-# Both ``HAVE_${VARIABLE}`` and ``${VARIABLE}`` will be created as internal
-# cache variables.
-#
-# Furthermore, the variable "${VARIABLE}_CODE" holds C preprocessor code
-# to define the macro "${VARIABLE}" to the size of the type, or leave
-# the macro undefined if the type does not exist.
-#
-# The variable "${VARIABLE}" may be "0" when CMAKE_OSX_ARCHITECTURES has
-# multiple architectures for building OS X universal binaries. This
-# indicates that the type size varies across architectures. In this
-# case "${VARIABLE}_CODE" contains C preprocessor tests mapping from
-# each architecture macro to the corresponding type size. The list of
-# architecture macros is stored in "${VARIABLE}_KEYS", and the value for
-# each key is stored in "${VARIABLE}-${KEY}".
-#
-# If the BUILTIN_TYPES_ONLY option is not given, the macro checks for
-# headers <sys/types.h>, <stdint.h>, and <stddef.h>, and saves results
-# in HAVE_SYS_TYPES_H, HAVE_STDINT_H, and HAVE_STDDEF_H. The type size
-# check automatically includes the available headers, thus supporting
-# checks of types defined in the headers.
-#
-# If LANGUAGE is set, the specified compiler will be used to perform the
-# check. Acceptable values are C and CXX
-#
-# Despite the name of the macro you may use it to check the size of more
-# complex expressions, too. To check e.g. for the size of a struct
-# member you can do something like this:
-#
-# ::
-#
-# check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
-#
-#
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
-# CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
+#[=======================================================================[.rst:
+CheckTypeSize
+-------------
+
+Check sizeof a type
+
+.. command:: CHECK_TYPE_SIZE
+
+ .. code-block:: cmake
+
+ CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]
+ [LANGUAGE <language>])
+
+ Check if the type exists and determine its size. On return,
+ ``HAVE_${VARIABLE}`` holds the existence of the type, and ``${VARIABLE}``
+ holds one of the following:
+
+ ::
+
+ <size> = type has non-zero size <size>
+ "0" = type has arch-dependent size (see below)
+ "" = type does not exist
+
+ Both ``HAVE_${VARIABLE}`` and ``${VARIABLE}`` will be created as internal
+ cache variables.
+
+ Furthermore, the variable ``${VARIABLE}_CODE`` holds C preprocessor code
+ to define the macro ``${VARIABLE}`` to the size of the type, or leave
+ the macro undefined if the type does not exist.
+
+ The variable ``${VARIABLE}`` may be ``0`` when
+ :variable:`CMAKE_OSX_ARCHITECTURES` has multiple architectures for building
+ OS X universal binaries. This indicates that the type size varies across
+ architectures. In this case ``${VARIABLE}_CODE`` contains C preprocessor
+ tests mapping from each architecture macro to the corresponding type size.
+ The list of architecture macros is stored in ``${VARIABLE}_KEYS``, and the
+ value for each key is stored in ``${VARIABLE}-${KEY}``.
+
+ If the ``BUILTIN_TYPES_ONLY`` option is not given, the macro checks for
+ headers ``<sys/types.h>``, ``<stdint.h>``, and ``<stddef.h>``, and saves
+ results in ``HAVE_SYS_TYPES_H``, ``HAVE_STDINT_H``, and ``HAVE_STDDEF_H``.
+ The type size check automatically includes the available headers, thus
+ supporting checks of types defined in the headers.
+
+ If ``LANGUAGE`` is set, the specified compiler will be used to perform the
+ check. Acceptable values are ``C`` and ``CXX``.
+
+Despite the name of the macro you may use it to check the size of more
+complex expressions, too. To check e.g. for the size of a struct
+member you can do something like this:
+
+.. code-block:: cmake
+
+ check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
+
+
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+ CMAKE_REQUIRED_FLAGS = string of compile command line flags
+ CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+ CMAKE_REQUIRED_INCLUDES = list of include directories
+ CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command
+ CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+ CMAKE_REQUIRED_QUIET = execute quietly without messages
+ CMAKE_EXTRA_INCLUDE_FILES = list of extra headers to include
+#]=======================================================================]
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
@@ -115,6 +119,7 @@ function(__check_type_size_impl type var map builtin language)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
try_compile(HAVE_${var} ${CMAKE_BINARY_DIR} ${src}
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS}
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}"
diff --git a/Modules/CheckVariableExists.cmake b/Modules/CheckVariableExists.cmake
index ab456d14d..f4953a349 100644
--- a/Modules/CheckVariableExists.cmake
+++ b/Modules/CheckVariableExists.cmake
@@ -1,36 +1,39 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# CheckVariableExists
-# -------------------
-#
-# Check if the variable exists.
-#
-# ::
-#
-# CHECK_VARIABLE_EXISTS(VAR VARIABLE)
-#
-#
-#
-# ::
-#
-# VAR - the name of the variable
-# VARIABLE - variable to store the result
-# Will be created as an internal cache variable.
-#
-#
-# This macro is only for C variables.
-#
-# The following variables may be set before calling this macro to modify
-# the way the check is run:
-#
-# ::
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-# CMAKE_REQUIRED_QUIET = execute quietly without messages
+#[=======================================================================[.rst:
+CheckVariableExists
+-------------------
+
+Check if the variable exists.
+
+.. command:: CHECK_VARIABLE_EXISTS
+
+ .. code-block:: cmake
+
+ CHECK_VARIABLE_EXISTS(VAR VARIABLE)
+
+
+ ::
+
+ VAR - the name of the variable
+ VARIABLE - variable to store the result
+ Will be created as an internal cache variable.
+
+
+ This macro is only for ``C`` variables.
+
+The following variables may be set before calling this macro to modify
+the way the check is run:
+
+::
+
+ CMAKE_REQUIRED_FLAGS = string of compile command line flags
+ CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
+ CMAKE_REQUIRED_LINK_OPTIONS = list of options to pass to link command
+ CMAKE_REQUIRED_LIBRARIES = list of libraries to link
+ CMAKE_REQUIRED_QUIET = execute quietly without messages
+#]=======================================================================]
include_guard(GLOBAL)
@@ -41,6 +44,12 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
if(NOT CMAKE_REQUIRED_QUIET)
message(STATUS "Looking for ${VAR}")
endif()
+ if(CMAKE_REQUIRED_LINK_OPTIONS)
+ set(CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS
+ LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
+ else()
+ set(CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS)
+ endif()
if(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
@@ -51,6 +60,7 @@ macro(CHECK_VARIABLE_EXISTS VAR VARIABLE)
${CMAKE_BINARY_DIR}
${CMAKE_ROOT}/Modules/CheckVariableExists.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
+ ${CHECK_VARIABLE_EXISTS_ADD_LINK_OPTIONS}
${CHECK_VARIABLE_EXISTS_ADD_LIBRARIES}
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_VARIABLE_DEFINITIONS}
OUTPUT_VARIABLE OUTPUT)
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
index e23470b14..c3f13f3a4 100644
--- a/Modules/Compiler/Clang.cmake
+++ b/Modules/Compiler/Clang.cmake
@@ -21,6 +21,12 @@ else()
macro(__compiler_clang lang)
__compiler_gnu(${lang})
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
+ # Link options for PIE are already set in 'Compiler/GNU.cmake'
+ # but clang may require alternate syntax on some platforms
+ if (APPLE)
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} -Xlinker -pie)
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE -Xlinker -no_pie)
+ endif()
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-isystem ")
set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
if(CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4.0)
diff --git a/Modules/Compiler/Cray-CXX.cmake b/Modules/Compiler/Cray-CXX.cmake
index ff97e92aa..85a316793 100644
--- a/Modules/Compiler/Cray-CXX.cmake
+++ b/Modules/Compiler/Cray-CXX.cmake
@@ -2,7 +2,7 @@
# file Copyright.txt or https://cmake.org/licensing for details.
include(Compiler/Cray)
-__compiler_cray(C)
+__compiler_cray(CXX)
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
diff --git a/Modules/Compiler/CrayPrgEnv-C.cmake b/Modules/Compiler/CrayPrgEnv-C.cmake
index 6b461ce06..76aa93b95 100644
--- a/Modules/Compiler/CrayPrgEnv-C.cmake
+++ b/Modules/Compiler/CrayPrgEnv-C.cmake
@@ -4,8 +4,4 @@ endif()
set(__craylinux_crayprgenv_c 1)
include(Compiler/CrayPrgEnv)
-macro(__CrayPrgEnv_setup_C compiler_cmd link_cmd)
- __CrayPrgEnv_setup(C
- ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c
- ${compiler_cmd} ${link_cmd})
-endmacro()
+__CrayPrgEnv_setup(C)
diff --git a/Modules/Compiler/CrayPrgEnv-CXX.cmake b/Modules/Compiler/CrayPrgEnv-CXX.cmake
index aad85b67e..442370ecc 100644
--- a/Modules/Compiler/CrayPrgEnv-CXX.cmake
+++ b/Modules/Compiler/CrayPrgEnv-CXX.cmake
@@ -4,8 +4,4 @@ endif()
set(__craylinux_crayprgenv_cxx 1)
include(Compiler/CrayPrgEnv)
-macro(__CrayPrgEnv_setup_CXX compiler_cmd link_cmd)
- __CrayPrgEnv_setup(CXX
- ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp
- ${compiler_cmd} ${link_cmd})
-endmacro()
+__CrayPrgEnv_setup(CXX)
diff --git a/Modules/Compiler/CrayPrgEnv-Cray-C.cmake b/Modules/Compiler/CrayPrgEnv-Cray-C.cmake
deleted file mode 100644
index 547a4b4d5..000000000
--- a/Modules/Compiler/CrayPrgEnv-Cray-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_cray_c)
- return()
-endif()
-set(__craylinux_crayprgenv_cray_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake b/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake
deleted file mode 100644
index df8452c15..000000000
--- a/Modules/Compiler/CrayPrgEnv-Cray-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_cray_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_cray_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/cray/cce/.*/ccfe" "/opt/cray/cce/.*/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake
deleted file mode 100644
index 9f46a04c8..000000000
--- a/Modules/Compiler/CrayPrgEnv-Cray-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_cray_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_cray_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/cray/cce/.*/ftnfe" "/opt/cray/cce/.*/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-Fortran.cmake
index 9c4d2694a..85f82d3f7 100644
--- a/Modules/Compiler/CrayPrgEnv-Fortran.cmake
+++ b/Modules/Compiler/CrayPrgEnv-Fortran.cmake
@@ -4,8 +4,4 @@ endif()
set(__craylinux_crayprgenv_fortran 1)
include(Compiler/CrayPrgEnv)
-macro(__CrayPrgEnv_setup_Fortran compiler_cmd link_cmd)
- __CrayPrgEnv_setup(Fortran
- ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F
- ${compiler_cmd} ${link_cmd})
-endmacro()
+__CrayPrgEnv_setup(Fortran)
diff --git a/Modules/Compiler/CrayPrgEnv-GNU-C.cmake b/Modules/Compiler/CrayPrgEnv-GNU-C.cmake
deleted file mode 100644
index 248081b87..000000000
--- a/Modules/Compiler/CrayPrgEnv-GNU-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_gnu_c)
- return()
-endif()
-set(__craylinux_crayprgenv_gnu_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/gcc/.*/cc1" "/opt/gcc/.*/collect2")
diff --git a/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake b/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake
deleted file mode 100644
index be4eb6d54..000000000
--- a/Modules/Compiler/CrayPrgEnv-GNU-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_gnu_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_gnu_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/gcc/.*/cc1plus" "/opt/gcc/.*/collect2")
diff --git a/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake
deleted file mode 100644
index 8bd23ff88..000000000
--- a/Modules/Compiler/CrayPrgEnv-GNU-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_gnu_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_gnu_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/gcc/.*/f951" "/opt/gcc/.*/collect2")
diff --git a/Modules/Compiler/CrayPrgEnv-Intel-C.cmake b/Modules/Compiler/CrayPrgEnv-Intel-C.cmake
deleted file mode 100644
index 83c4e3801..000000000
--- a/Modules/Compiler/CrayPrgEnv-Intel-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_intel_c)
- return()
-endif()
-set(__craylinux_crayprgenv_intel_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/intel/.*/mcpcom" "^ld ")
diff --git a/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake b/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake
deleted file mode 100644
index 3c3c3e63f..000000000
--- a/Modules/Compiler/CrayPrgEnv-Intel-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_intel_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_intel_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/intel/.*/mcpcom" "^ld ")
diff --git a/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake
deleted file mode 100644
index 08a316d2c..000000000
--- a/Modules/Compiler/CrayPrgEnv-Intel-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_intel_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_intel_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/intel/.*/fortcom" "^ld ")
diff --git a/Modules/Compiler/CrayPrgEnv-PGI-C.cmake b/Modules/Compiler/CrayPrgEnv-PGI-C.cmake
deleted file mode 100644
index f45767caf..000000000
--- a/Modules/Compiler/CrayPrgEnv-PGI-C.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_pgi_c)
- return()
-endif()
-set(__craylinux_crayprgenv_pgi_c 1)
-
-include(Compiler/CrayPrgEnv-C)
-__CrayPrgEnv_setup_C("/opt/pgi/[^ ]*/pgc" "/usr/bin/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake b/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake
deleted file mode 100644
index a2a286f8c..000000000
--- a/Modules/Compiler/CrayPrgEnv-PGI-CXX.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_pgi_cxx)
- return()
-endif()
-set(__craylinux_crayprgenv_pgi_cxx 1)
-
-include(Compiler/CrayPrgEnv-CXX)
-__CrayPrgEnv_setup_CXX("/opt/pgi/[^ ]*/pgcpp" "/usr/bin/ld")
diff --git a/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake b/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake
deleted file mode 100644
index f6ba7c0fa..000000000
--- a/Modules/Compiler/CrayPrgEnv-PGI-Fortran.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-if(__craylinux_crayprgenv_pgi_fortran)
- return()
-endif()
-set(__craylinux_crayprgenv_pgi_fortran 1)
-
-include(Compiler/CrayPrgEnv-Fortran)
-__CrayPrgEnv_setup_Fortran("/opt/pgi/[^ ]*/pgf" "/usr/bin/ld")
diff --git a/Modules/Compiler/CrayPrgEnv.cmake b/Modules/Compiler/CrayPrgEnv.cmake
index 05e3fc763..6c1c77016 100644
--- a/Modules/Compiler/CrayPrgEnv.cmake
+++ b/Modules/Compiler/CrayPrgEnv.cmake
@@ -4,54 +4,7 @@ if(__craylinux_crayprgenv)
endif()
set(__craylinux_crayprgenv 1)
-macro(__cray_extract_args cmd tag_regex out_var make_absolute)
- string(REGEX MATCHALL "${tag_regex}" args "${cmd}")
- foreach(arg IN LISTS args)
- string(REGEX REPLACE "^${tag_regex}$" "\\2" param "${arg}")
- if(make_absolute)
- get_filename_component(param "${param}" ABSOLUTE)
- endif()
- list(APPEND ${out_var} ${param})
- endforeach()
-endmacro()
-
-function(__cray_extract_implicit src compiler_cmd link_cmd lang include_dirs_var link_dirs_var link_libs_var)
- set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CrayExtractImplicit_${lang}.bin")
- execute_process(
- COMMAND ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_VERBOSE_FLAG} -o ${BIN}
- RESULT_VARIABLE result
- OUTPUT_VARIABLE output
- ERROR_VARIABLE error
- )
- if(EXISTS "${BIN}")
- file(REMOVE "${BIN}")
- endif()
- set(include_dirs)
- set(link_dirs)
- set(link_libs)
- string(REGEX REPLACE "\r?\n" ";" output_lines "${output}\n${error}")
- foreach(line IN LISTS output_lines)
- if("${line}" MATCHES "${compiler_cmd}")
- __cray_extract_args("${line}" " -(I ?|isystem )([^ ]*)" include_dirs 1)
- set(processed_include 1)
- endif()
- if("${line}" MATCHES "${link_cmd}")
- __cray_extract_args("${line}" " -(L ?)([^ ]*)" link_dirs 1)
- __cray_extract_args("${line}" " -(l ?)([^ ]*)" link_libs 0)
- set(processed_link 1)
- endif()
- if(processed_include AND processed_link)
- break()
- endif()
- endforeach()
-
- set(${include_dirs_var} "${include_dirs}" PARENT_SCOPE)
- set(${link_dirs_var} "${link_dirs}" PARENT_SCOPE)
- set(${link_libs_var} "${link_libs}" PARENT_SCOPE)
- set(CRAY_${lang}_EXTRACTED_IMPLICIT 1 CACHE INTERNAL "" FORCE)
-endfunction()
-
-macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
+macro(__CrayPrgEnv_setup lang)
if(DEFINED ENV{CRAYPE_VERSION})
message(STATUS "Cray Programming Environment $ENV{CRAYPE_VERSION} ${lang}")
elseif(DEFINED ENV{ASYNCPE_VERSION})
@@ -81,12 +34,4 @@ macro(__CrayPrgEnv_setup lang test_src compiler_cmd link_cmd)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(CMAKE_LINK_SEARCH_START_STATIC TRUE)
endif()
- if(NOT CRAY_${lang}_EXTRACTED_IMPLICIT)
- __cray_extract_implicit(
- ${test_src} ${compiler_cmd} ${link_cmd} ${lang}
- CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES
- CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES
- CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES
- )
- endif()
endmacro()
diff --git a/Modules/Compiler/Flang-Fortran.cmake b/Modules/Compiler/Flang-Fortran.cmake
index d52273947..f0e61d824 100644
--- a/Modules/Compiler/Flang-Fortran.cmake
+++ b/Modules/Compiler/Flang-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/Clang)
__compiler_clang(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "-")
+set(CMAKE_Fortran_SUBMODULE_EXT ".mod")
+
set(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/GHS-C.cmake b/Modules/Compiler/GHS-C.cmake
index c30bdecaf..a825b0bba 100644
--- a/Modules/Compiler/GHS-C.cmake
+++ b/Modules/Compiler/GHS-C.cmake
@@ -8,23 +8,3 @@ string(APPEND CMAKE_C_FLAGS_DEBUG_INIT " -Odebug -g")
string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -Ospace")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -O")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -O -g")
-
-set(CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT "-ldebug ${CMAKE_C_FLAGS_DEBUG_INIT}")
-set(CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT "${CMAKE_C_FLAGS_MINSIZEREL_INIT}")
-set(CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT "${CMAKE_C_FLAGS_RELEASE_INIT}")
-set(CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT
- "-ldebug ${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}")
-
-if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
- set (CMAKE_C_GHS_KERNEL_FLAGS_DEBUG "${CMAKE_C_GHS_KERNEL_FLAGS_DEBUG_INIT}"
- CACHE STRING "Kernel flags used by the compiler during debug builds.")
- set (CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL
- "${CMAKE_C_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING
- "Kernel flags used by the compiler during release builds for minimum size.")
- set (CMAKE_C_GHS_KERNEL_FLAGS_RELEASE
- "${CMAKE_C_GHS_KERNEL_FLAGS_RELEASE_INIT}"
- CACHE STRING "Kernel flags used by the compiler during release builds.")
- set (CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO
- "${CMAKE_C_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
- "Kernel flags used by the compiler during release builds with debug info.")
-endif()
diff --git a/Modules/Compiler/GHS-CXX.cmake b/Modules/Compiler/GHS-CXX.cmake
index b3018a7b6..07b504424 100644
--- a/Modules/Compiler/GHS-CXX.cmake
+++ b/Modules/Compiler/GHS-CXX.cmake
@@ -8,27 +8,3 @@ string(APPEND CMAKE_CXX_FLAGS_DEBUG_INIT " -Odebug -g")
string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -Ospace")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -O")
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -O -g")
-
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT
- "-ldebug ${CMAKE_CXX_FLAGS_DEBUG_INIT}")
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT
- "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}")
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT
- "${CMAKE_CXX_FLAGS_RELEASE_INIT}")
-set(CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT
- "-ldebug ${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}")
-
-if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
- set (CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG
- "${CMAKE_CXX_GHS_KERNEL_FLAGS_DEBUG_INIT}"
- CACHE STRING "Kernel flags used by the compiler during debug builds.")
- set (CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL
- "${CMAKE_CXX_GHS_KERNEL_FLAGS_MINSIZEREL_INIT}" CACHE STRING
- "Kernel flags used by the compiler during release builds for minimum size.")
- set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE
- "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELEASE_INIT}"
- CACHE STRING "Kernel flags used by the compiler during release builds.")
- set (CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO
- "${CMAKE_CXX_GHS_KERNEL_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
- "Kernel flags used by the compiler during release builds with debug info.")
-endif()
diff --git a/Modules/Compiler/GHS-DetermineCompiler.cmake b/Modules/Compiler/GHS-DetermineCompiler.cmake
index 56d24e266..368b3759d 100644
--- a/Modules/Compiler/GHS-DetermineCompiler.cmake
+++ b/Modules/Compiler/GHS-DetermineCompiler.cmake
@@ -1,6 +1,9 @@
-set(_compiler_id_pp_test "defined(__INTEGRITY)")
+set(_compiler_id_pp_test "defined(__ghs__)")
set(_compiler_id_version_compute "
-# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__INTEGRITY_MAJOR_VERSION)
-# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__INTEGRITY_MINOR_VERSION)
-# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__INTEGRITY_PATCH_VERSION)")
+/* __GHS_VERSION_NUMBER = VVVVRP */
+# ifdef __GHS_VERSION_NUMBER
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(__GHS_VERSION_NUMBER / 10 % 10)
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__GHS_VERSION_NUMBER % 10)
+# endif")
diff --git a/Modules/Compiler/GHS.cmake b/Modules/Compiler/GHS.cmake
index e6a867d04..b41c3ebf8 100644
--- a/Modules/Compiler/GHS.cmake
+++ b/Modules/Compiler/GHS.cmake
@@ -3,6 +3,6 @@ if(__COMPILER_GHS)
endif()
set(__COMPILER_GHS 1)
-set(CMAKE_EXECUTABLE_SUFFIX ".as")
-set(CMAKE_LIBRARY_PATH_TERMINATOR "\n")
-set(CMAKE_LIBRARY_PATH_FLAG " -L")
+set(CMAKE_EXECUTABLE_SUFFIX "")
+set(CMAKE_LIBRARY_PATH_TERMINATOR "")
+set(CMAKE_LIBRARY_PATH_FLAG "")
diff --git a/Modules/Compiler/GNU-Fortran.cmake b/Modules/Compiler/GNU-Fortran.cmake
index c333d500b..6413769cf 100644
--- a/Modules/Compiler/GNU-Fortran.cmake
+++ b/Modules/Compiler/GNU-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/GNU)
__compiler_gnu(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "@")
+set(CMAKE_Fortran_SUBMODULE_EXT ".smod")
+
set(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 4491d4b39..6b1bd3a13 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -9,13 +9,20 @@ endif()
set(__COMPILER_GNU 1)
include(Compiler/CMakeCommonCompilerMacros)
+include(Internal/CMakeCheckCompilerFlag)
macro(__compiler_gnu lang)
# Feature flags.
set(CMAKE_${lang}_VERBOSE_FLAG "-v")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
+ set (_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
+ # Support of PIE at link stage depends on various elements : platform, compiler, linker
+ # so to activate it, module CheckPIESupported must be used.
+ set (_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie")
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie")
endif()
if(NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_${lang}_COMPILE_OPTIONS_VISIBILITY "-fvisibility=")
diff --git a/Modules/Compiler/IAR-C.cmake b/Modules/Compiler/IAR-C.cmake
index 2ed88188c..b5e61f070 100644
--- a/Modules/Compiler/IAR-C.cmake
+++ b/Modules/Compiler/IAR-C.cmake
@@ -29,7 +29,19 @@ if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
__compiler_check_default_language_standard(C 1.10 90 6.10 99 8.10 11)
elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+ if(NOT CMAKE_C_COMPILER_VERSION)
+ message(FATAL_ERROR "CMAKE_C_COMPILER_VERSION not detected. This should be automatic.")
+ endif()
+
+ set(CMAKE_C_EXTENSION_COMPILE_OPTION -e)
+
+ set(CMAKE_C90_STANDARD_COMPILE_OPTION --c89)
+ set(CMAKE_C90_EXTENSION_COMPILE_OPTION -e)
+ set(CMAKE_C99_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_C99_EXTENSION_COMPILE_OPTION -e)
+
__compiler_iar_AVR(C)
+ __compiler_check_default_language_standard(C 7.10 99)
set(CMAKE_C_OUTPUT_EXTENSION ".r90")
if(NOT CMAKE_C_LINK_FLAGS)
@@ -43,6 +55,7 @@ elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
get_filename_component(_compilerDir "${_compilerDir}" PATH)
include_directories("${_compilerDir}/inc" )
+ include_directories("${_compilerDir}/inc/Atmel" )
else()
message(FATAL_ERROR "CMAKE_C_COMPILER_ARCHITECTURE_ID not detected as \"AVR\" or \"ARM\". This should be automatic.")
diff --git a/Modules/Compiler/IAR-CXX.cmake b/Modules/Compiler/IAR-CXX.cmake
index 5b783b29f..b7076f5cc 100644
--- a/Modules/Compiler/IAR-CXX.cmake
+++ b/Modules/Compiler/IAR-CXX.cmake
@@ -38,7 +38,27 @@ if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
__compiler_check_default_language_standard(CXX 6.10 98 8.10 14)
elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
+ # "embedded C++" --EC++ is probably closest to CXX98 but with no support for:
+ # Templates, multiple inheritance, virtual inheritance, exceptions, RTTI, C++ style casts,
+ # Namespaces, the mutable attribute, no STL, any library features related to the above features.
+ #
+ # "(extended) embedded C++" --EEC++ Mode but DOES NOT support any normal C++ standard
+ # probably closest to CXX98 but with no RTTI and no exceptions, and the library
+ # provided is not in the standard namespace
+ if(NOT CMAKE_IAR_CXX_FLAG)
+ if(NOT CMAKE_CXX_COMPILER_VERSION)
+ message(FATAL_ERROR "CMAKE_CXX_COMPILER_VERSION not detected. This should be automatic.")
+ endif()
+ set(CMAKE_IAR_CXX_FLAG --eec++)
+ endif()
+
+ set(CMAKE_CXX_EXTENSION_COMPILE_OPTION -e)
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION -e)
+
__compiler_iar_AVR(CXX)
+ __compiler_check_default_language_standard(CXX 7.10 98)
+
set(CMAKE_CXX_OUTPUT_EXTENSION ".r90")
if(NOT CMAKE_CXX_LINK_FLAGS)
set(CMAKE_CXX_LINK_FLAGS "-Fmotorola")
@@ -51,6 +71,7 @@ elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR")
get_filename_component(_compilerDir "${CMAKE_C_COMPILER}" PATH)
get_filename_component(_compilerDir "${_compilerDir}" PATH)
include_directories("${_compilerDir}/inc")
+ include_directories("${_compilerDir}/inc/Atmel")
else()
message(FATAL_ERROR "CMAKE_CXX_COMPILER_ARCHITECTURE_ID not detected as \"AVR\" or \"ARM\". This should be automatic." )
diff --git a/Modules/Compiler/IAR-DetermineCompiler.cmake b/Modules/Compiler/IAR-DetermineCompiler.cmake
index a1bffebdb..43477acb1 100644
--- a/Modules/Compiler/IAR-DetermineCompiler.cmake
+++ b/Modules/Compiler/IAR-DetermineCompiler.cmake
@@ -1,4 +1,4 @@
-# IAR Systems compiler for embedded systems.
+# IAR Systems compiler for ARM embedded systems.
# http://www.iar.com
# http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdf
#
@@ -9,13 +9,31 @@
# __ICCARM__ An integer that is set to 1 when the code is compiled with the IAR C/C++ Compiler for ARM
# __VER__ An integer that identifies the version number of the IAR compiler in use. For example,
# version 5.11.3 is returned as 5011003.
+#
+# IAR Systems Compiler for AVR embedded systems
+# http://supp.iar.com/FilesPublic/UPDINFO/007051/ew/doc/EWAVR_CompilerReference.pdf
+#
+# __IAR_SYSTEMS_ICC__ An integer that identifies the IAR compiler platform.
+# __ICCAVR__ An integer that is set to 1 when the code is compiled with the IAR C/C++ Compiler for AVR
+# __VER__ An integer that identifies the version number of the IAR compiler in use.
+# The value is calculated by (100 * VERSION_MAJOR + VERSION_MINOR). For example the version
+# 3.34 is given as 334
+# __SUBVERSION__ An integer that identifies the subversion number of the compiler version number
+# for example 3 in 1.2.3.4. THis is used as the patch version, as seen when running iccavr
+# from the command line
+#
set(_compiler_id_pp_test "defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC)")
set(_compiler_id_version_compute "
-# if defined(__VER__)
+# if defined(__VER__) && defined(__ICCARM__)
# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 1000000)
# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@(((__VER__) / 1000) % 1000)
# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@((__VER__) % 1000)
# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__)
+# elif defined(__VER__) && defined(__ICCAVR__)
+# define @PREFIX@COMPILER_VERSION_MAJOR @MACRO_DEC@((__VER__) / 100)
+# define @PREFIX@COMPILER_VERSION_MINOR @MACRO_DEC@((__VER__) - (((__VER__) / 100)*100))
+# define @PREFIX@COMPILER_VERSION_PATCH @MACRO_DEC@(__SUBVERSION__)
+# define @PREFIX@COMPILER_VERSION_INTERNAL @MACRO_DEC@(__IAR_SYSTEMS_ICC__)
# endif")
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index 43243b9d6..bbcdea235 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -68,6 +68,27 @@ endmacro()
macro(__compiler_iar_AVR lang)
set(CMAKE_EXECUTABLE_SUFFIX ".bin")
+ if (${lang} STREQUAL "C" OR ${lang} STREQUAL "CXX")
+
+ set(CMAKE_${lang}_COMPILE_OBJECT "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT>")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> --preprocess=cnl <PREPROCESSED_SOURCE>")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
+
+ set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ns <DEPFILE>")
+
+ string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
+ string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -r")
+ string(APPEND CMAKE_${lang}_FLAGS_MINSIZEREL_INIT " -Ohz -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELEASE_INIT " -Oh -DNDEBUG")
+ string(APPEND CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT " -Oh -r -DNDEBUG")
+ endif()
+
+ set(CMAKE_${lang}_LINK_EXECUTABLE "\"${CMAKE_IAR_LINKER}\" -S <OBJECTS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> -o <TARGET>")
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "\"${CMAKE_IAR_AR}\" <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_CREATE "\"${CMAKE_IAR_AR}\" <TARGET> <LINK_FLAGS> <OBJECTS>")
+ set(CMAKE_${lang}_ARCHIVE_APPEND "")
+ set(CMAKE_${lang}_ARCHIVE_FINISH "")
set(CMAKE_LIBRARY_PATH_FLAG "-I")
diff --git a/Modules/Compiler/Intel-Fortran.cmake b/Modules/Compiler/Intel-Fortran.cmake
index a1320555a..5275ddf64 100644
--- a/Modules/Compiler/Intel-Fortran.cmake
+++ b/Modules/Compiler/Intel-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/Intel)
__compiler_intel(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "@")
+set(CMAKE_Fortran_SUBMODULE_EXT ".smod")
+
set(CMAKE_Fortran_MODDIR_FLAG "-module ")
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index 05db548f5..de9dd99ba 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -1,4 +1,5 @@
set(CMAKE_CUDA_VERBOSE_FLAG "-v")
+set(CMAKE_CUDA_VERBOSE_COMPILE_FLAG "-Xcompiler=-v")
if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
set(CMAKE_CUDA_COMPILE_OPTIONS_PIE -Xcompiler=-fPIE)
diff --git a/Modules/Compiler/PGI-Fortran.cmake b/Modules/Compiler/PGI-Fortran.cmake
index a183c339b..3daf7987e 100644
--- a/Modules/Compiler/PGI-Fortran.cmake
+++ b/Modules/Compiler/PGI-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/PGI)
__compiler_pgi(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "-")
+set(CMAKE_Fortran_SUBMODULE_EXT ".mod")
+
set(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -Mpreprocess <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
diff --git a/Modules/Compiler/QCC-ASM.cmake b/Modules/Compiler/QCC-ASM.cmake
new file mode 100644
index 000000000..9a9935b27
--- /dev/null
+++ b/Modules/Compiler/QCC-ASM.cmake
@@ -0,0 +1,2 @@
+include(Compiler/QCC)
+__compiler_qcc(ASM)
diff --git a/Modules/Compiler/QCC-C-FeatureTests.cmake b/Modules/Compiler/QCC-C-FeatureTests.cmake
new file mode 100644
index 000000000..68f41970d
--- /dev/null
+++ b/Modules/Compiler/QCC-C-FeatureTests.cmake
@@ -0,0 +1 @@
+include(Compiler/GNU-C-FeatureTests)
diff --git a/Modules/Compiler/QCC-C.cmake b/Modules/Compiler/QCC-C.cmake
index ae4a2f491..6db619e57 100644
--- a/Modules/Compiler/QCC-C.cmake
+++ b/Modules/Compiler/QCC-C.cmake
@@ -1,2 +1,5 @@
+# To include compiler feature detection
+include(Compiler/GNU-C)
+
include(Compiler/QCC)
__compiler_qcc(C)
diff --git a/Modules/Compiler/QCC-CXX-FeatureTests.cmake b/Modules/Compiler/QCC-CXX-FeatureTests.cmake
new file mode 100644
index 000000000..c836b9416
--- /dev/null
+++ b/Modules/Compiler/QCC-CXX-FeatureTests.cmake
@@ -0,0 +1 @@
+include(Compiler/GNU-CXX-FeatureTests)
diff --git a/Modules/Compiler/QCC-CXX.cmake b/Modules/Compiler/QCC-CXX.cmake
index e86d1fa47..0e7314ae5 100644
--- a/Modules/Compiler/QCC-CXX.cmake
+++ b/Modules/Compiler/QCC-CXX.cmake
@@ -1,3 +1,6 @@
+# To include compiler feature detection
+include(Compiler/GNU-CXX)
+
include(Compiler/QCC)
__compiler_qcc(CXX)
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 047de43f0..c4aba8eca 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -6,6 +6,10 @@ include(Compiler/SunPro)
set(CMAKE_C_VERBOSE_FLAG "-#")
set(CMAKE_C_COMPILE_OPTIONS_PIC -KPIC)
+set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+set(CMAKE_C_LINK_OPTIONS_PIE "")
+set(CMAKE_C_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-KPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-R")
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index 4c1ac5be6..5ce58b221 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -6,6 +6,10 @@ include(Compiler/SunPro)
set(CMAKE_CXX_VERBOSE_FLAG "-v")
set(CMAKE_CXX_COMPILE_OPTIONS_PIC -KPIC)
+set(CMAKE_CXX_COMPILE_OPTIONS_PIE "")
+set(_CMAKE_CXX_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+set(CMAKE_CXX_LINK_OPTIONS_PIE "")
+set(CMAKE_CXX_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-KPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G")
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-R")
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index 2247dd085..0c93c94a8 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -3,6 +3,10 @@ set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-fixed")
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-free")
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC "-KPIC")
+set(CMAKE_Fortran_COMPILE_OPTIONS_PIE "")
+set(_CMAKE_Fortran_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+set(CMAKE_Fortran_LINK_OPTIONS_PIE "")
+set(CMAKE_Fortran_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G")
set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-R")
diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake
index 6bab6f69e..c4fb09712 100644
--- a/Modules/Compiler/XL-Fortran.cmake
+++ b/Modules/Compiler/XL-Fortran.cmake
@@ -1,6 +1,9 @@
include(Compiler/XL)
__compiler_xl(Fortran)
+set(CMAKE_Fortran_SUBMODULE_SEP "_")
+set(CMAKE_Fortran_SUBMODULE_EXT ".smod")
+
set(CMAKE_Fortran_FORMAT_FIXED_FLAG "-qfixed") # [=<right_margin>]
set(CMAKE_Fortran_FORMAT_FREE_FLAG "-qfree") # [=f90|ibm]
diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake
index 21fe5e8c3..68dc28a92 100644
--- a/Modules/Compiler/XL.cmake
+++ b/Modules/Compiler/XL.cmake
@@ -48,7 +48,7 @@ macro(__compiler_xl lang)
# files so that we export only the symbols actually provided by the sources.
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"${CMAKE_XL_CreateExportList} <OBJECT_DIR>/objects.exp <OBJECTS>"
- "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
+ "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> -Wl,-bE:<OBJECT_DIR>/objects.exp <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>"
)
endif()
endmacro()
diff --git a/Modules/CompilerId/GHS_default.gpj.in b/Modules/CompilerId/GHS_default.gpj.in
new file mode 100644
index 000000000..b5cea5cf8
--- /dev/null
+++ b/Modules/CompilerId/GHS_default.gpj.in
@@ -0,0 +1,8 @@
+#!gbuild
+@bsp_name@
+@os_dir@
+primaryTarget=@ghs_primary_target@
+[Project]
+ {isdefined(GHS_BSP)} -bsp $GHS_BSP
+ {isdefined(GHS_OS)} -os_dir $GHS_OS
+GHS_lib.gpj [Library]
diff --git a/Modules/CompilerId/GHS_lib.gpj.in b/Modules/CompilerId/GHS_lib.gpj.in
new file mode 100644
index 000000000..149b98144
--- /dev/null
+++ b/Modules/CompilerId/GHS_lib.gpj.in
@@ -0,0 +1,3 @@
+#!gbuild
+[Library]
+@id_src@
diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in
index 4686b645b..672044e13 100644
--- a/Modules/CompilerId/Xcode-3.pbxproj.in
+++ b/Modules/CompilerId/Xcode-3.pbxproj.in
@@ -72,8 +72,7 @@
1DEB928608733DD80010E9CD = {
isa = XCBuildConfiguration;
buildSettings = {
- @id_development_team@
- @id_code_sign_identity@
+ CODE_SIGN_IDENTITY = "";
PRODUCT_NAME = CompilerId@id_lang@;
};
name = Debug;
@@ -87,6 +86,7 @@
SYMROOT = .;
@id_toolset@
@id_lang_version@
+ @id_clang_cxx_library@
@id_deployment_target@
@id_sdkroot@
};
diff --git a/Modules/Dart.cmake b/Modules/Dart.cmake
index e003cd5cc..154fe9d7d 100644
--- a/Modules/Dart.cmake
+++ b/Modules/Dart.cmake
@@ -1,27 +1,28 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# Dart
-# ----
-#
-# Configure a project for testing with CTest or old Dart Tcl Client
-#
-# This file is the backwards-compatibility version of the CTest module.
-# It supports using the old Dart 1 Tcl client for driving dashboard
-# submissions as well as testing with CTest. This module should be
-# included in the CMakeLists.txt file at the top of a project. Typical
-# usage:
-#
-# ::
-#
-# include(Dart)
-# if(BUILD_TESTING)
-# # ... testing related CMake code ...
-# endif()
-#
-# The BUILD_TESTING option is created by the Dart module to determine
-# whether testing support should be enabled. The default is ON.
+#[=======================================================================[.rst:
+Dart
+----
+
+Configure a project for testing with CTest or old Dart Tcl Client
+
+This file is the backwards-compatibility version of the CTest module.
+It supports using the old Dart 1 Tcl client for driving dashboard
+submissions as well as testing with CTest. This module should be
+included in the CMakeLists.txt file at the top of a project. Typical
+usage:
+
+::
+
+ include(Dart)
+ if(BUILD_TESTING)
+ # ... testing related CMake code ...
+ endif()
+
+The BUILD_TESTING option is created by the Dart module to determine
+whether testing support should be enabled. The default is ON.
+#]=======================================================================]
# This file configures a project to use the Dart testing/dashboard process.
# It is broken into 3 sections.
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index b86a5a9a8..e4513b363 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -20,17 +20,7 @@ BuildName: @BUILDNAME@
LabelsForSubprojects: @CTEST_LABELS_FOR_SUBPROJECTS@
# Submission information
-IsCDash: @CTEST_DROP_SITE_CDASH@
-CDashVersion: @CTEST_CDASH_VERSION@
-QueryCDashVersion: @CTEST_CDASH_QUERY_VERSION@
-DropSite: @DROP_SITE@
-DropLocation: @DROP_LOCATION@
-DropSiteUser: @DROP_SITE_USER@
-DropSitePassword: @DROP_SITE_PASSWORD@
-DropSiteMode: @DROP_SITE_MODE@
-DropMethod: @DROP_METHOD@
-TriggerSite: @TRIGGER_SITE@
-ScpCommand: @SCPCOMMAND@
+SubmitURL: @SUBMIT_URL@
# Dashboard start time
NightlyStartTime: @NIGHTLY_START_TIME@
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
index c69cd3885..4a18927c2 100644
--- a/Modules/DeployQt4.cmake
+++ b/Modules/DeployQt4.cmake
@@ -26,13 +26,13 @@ PARENT_SCOPE. Also depends on BundleUtilities.cmake.
::
- WRITE_QT4_CONF(<qt_conf_dir> <qt_conf_contents>)
+ write_qt4_conf(<qt_conf_dir> <qt_conf_contents>)
Writes a qt.conf file with the <qt_conf_contents> into <qt_conf_dir>.
::
- RESOLVE_QT4_PATHS(<paths_var> [<executable_path>])
+ resolve_qt4_paths(<paths_var> [<executable_path>])
Loop through <paths_var> list and if any don't exist resolve them
relative to the <executable_path> (if supplied) or the
@@ -40,7 +40,7 @@ CMAKE_INSTALL_PREFIX.
::
- FIXUP_QT4_EXECUTABLE(<executable>
+ fixup_qt4_executable(<executable>
[<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf>])
Copies Qt plugins, writes a Qt configuration file (if needed) and
@@ -67,7 +67,7 @@ needed.
::
- INSTALL_QT4_PLUGIN_PATH(plugin executable copy installed_plugin_path_var
+ install_qt4_plugin_path(plugin executable copy installed_plugin_path_var
<plugins_dir> <component> <configurations>)
Install (or copy) a resolved <plugin> to the default plugins directory
@@ -82,7 +82,7 @@ If <component> is set then anything installed will use this COMPONENT.
::
- INSTALL_QT4_PLUGIN(plugin executable copy installed_plugin_path_var
+ install_qt4_plugin(plugin executable copy installed_plugin_path_var
<plugins_dir> <component>)
Install (or copy) an unresolved <plugin> to the default plugins
@@ -92,7 +92,7 @@ INSTALL_QT4_PLUGIN_PATH.
::
- INSTALL_QT4_EXECUTABLE(<executable>
+ install_qt4_executable(<executable>
[<qtplugins> <libs> <dirs> <plugins_dir> <request_qt_conf> <component>])
Installs Qt plugins, writes a Qt configuration file (if needed) and
diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake
index 6e212490e..aaf24f656 100644
--- a/Modules/Documentation.cmake
+++ b/Modules/Documentation.cmake
@@ -1,14 +1,13 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# Documentation
-# -------------
-#
-# DocumentationVTK.cmake
-#
-# This file provides support for the VTK documentation framework. It
-# relies on several tools (Doxygen, Perl, etc).
+#[=======================================================================[.rst:
+Documentation
+-------------
+
+This module provides support for the VTK documentation framework. It
+relies on several tools (Doxygen, Perl, etc).
+#]=======================================================================]
#
# Build the documentation ?
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index f987d2d8f..22e052334 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -16,7 +16,9 @@ External Project Definition
The ``ExternalProject_Add()`` function creates a custom target to drive
download, update/patch, configure, build, install and test steps of an
- external project::
+ external project:
+
+ .. code-block:: cmake
ExternalProject_Add(<name> [<option>...])
@@ -47,7 +49,11 @@ External Project Definition
``STAMP_DIR <dir>``
Directory in which to store the timestamps of each step. Log files from
- individual steps are also created in here (see *Logging Options* below).
+ individual steps are also created in here unless overriden by LOG_DIR
+ (see *Logging Options* below).
+
+ ``LOG_DIR <dir>``
+ Directory in which to store the logs of each step.
``DOWNLOAD_DIR <dir>``
Directory in which to store downloaded files before unpacking them. This
@@ -90,6 +96,7 @@ External Project Definition
SOURCE_DIR = <prefix>/src/<name>
BINARY_DIR = <prefix>/src/<name>-build
INSTALL_DIR = <prefix>
+ LOG_DIR = <STAMP_DIR>
Otherwise, if the ``EP_BASE`` directory property is set then components
of an external project are stored under the specified base::
@@ -100,6 +107,7 @@ External Project Definition
SOURCE_DIR = <base>/Source/<name>
BINARY_DIR = <base>/Build/<name>
INSTALL_DIR = <base>/Install/<name>
+ LOG_DIR = <STAMP_DIR>
If no ``PREFIX``, ``EP_PREFIX``, or ``EP_BASE`` is specified, then the
default is to set ``PREFIX`` to ``<name>-prefix``. Relative paths are
@@ -417,7 +425,9 @@ External Project Definition
can be used to point to an alternative directory within the source tree
to use as the top of the CMake source tree instead. This must be a
relative path and it will be interpreted as being relative to
- ``SOURCE_DIR``.
+ ``SOURCE_DIR``. When ``BUILD_IN_SOURCE 1`` is specified, the
+ ``BUILD_COMMAND`` is used to point to an alternative directory within the
+ source tree.
**Build Step Options:**
If the configure step assumed the external project uses CMake as its build
@@ -515,7 +525,8 @@ External Project Definition
**Output Logging Options:**
Each of the following ``LOG_...`` options can be used to wrap the relevant
step in a script to capture its output to files. The log files will be
- created in the ``STAMP_DIR`` directory with step-specific file names.
+ created in ``LOG_DIR`` if supplied or otherwise the ``STAMP_DIR``
+ directory with step-specific file names.
``LOG_DOWNLOAD <bool>``
When enabled, the output of the download step is logged to files.
@@ -523,6 +534,9 @@ External Project Definition
``LOG_UPDATE <bool>``
When enabled, the output of the update step is logged to files.
+ ``LOG_PATCH <bool>``
+ When enabled, the output of the patch step is logged to files.
+
``LOG_CONFIGURE <bool>``
When enabled, the output of the configure step is logged to files.
@@ -535,6 +549,18 @@ External Project Definition
``LOG_TEST <bool>``
When enabled, the output of the test step is logged to files.
+ ``LOG_MERGED_STDOUTERR <bool>``
+ When enabled, stdout and stderr will be merged for any step whose
+ output is being logged to files.
+
+ ``LOG_OUTPUT_ON_FAILURE <bool>``
+ This option only has an effect if at least one of the other ``LOG_<step>``
+ options is enabled. If an error occurs for a step which has logging to
+ file enabled, that step's output will be printed to the console if
+ ``LOG_OUTPUT_ON_FAILURE`` is set to true. For cases where a large amount
+ of output is recorded, just the end of that output may be printed to the
+ console.
+
**Terminal Access Options:**
Steps can be given direct access to the terminal in some cases. Giving a
step access to the terminal may allow it to receive terminal input if
@@ -608,7 +634,9 @@ External Project Definition
appended to them by following them with as many ``COMMAND ...`` options
as needed
(:manual:`generator expressions <cmake-generator-expressions(7)>` are
- supported). For example::
+ supported). For example:
+
+ .. code-block:: cmake
ExternalProject_Add(example
... # Download options, etc.
@@ -627,7 +655,9 @@ Obtaining Project Properties
.. command:: ExternalProject_Get_Property
The ``ExternalProject_Get_Property()`` function retrieves external project
- target properties::
+ target properties:
+
+ .. code-block:: cmake
ExternalProject_Get_Property(<name> <prop1> [<prop2>...])
@@ -655,7 +685,9 @@ control needed to implement such step-level capabilities.
The ``ExternalProject_Add_Step()`` function specifies an additional custom
step for an external project defined by an earlier call to
- :command:`ExternalProject_Add`::
+ :command:`ExternalProject_Add`:
+
+ .. code-block:: cmake
ExternalProject_Add_Step(<name> <step> [<option>...])
@@ -705,7 +737,7 @@ control needed to implement such step-level capabilities.
``LOG <bool>``
If set, this causes the output from the custom step to be captured to files
- in the external project's ``STAMP_DIR``.
+ in the external project's ``LOG_DIR`` if supplied or ``STAMP_DIR``.
``USES_TERMINAL <bool>``
If enabled, this gives the custom step direct access to the terminal if
@@ -722,7 +754,9 @@ control needed to implement such step-level capabilities.
The ``ExternalProject_Add_StepTargets()`` function generates targets for the
steps listed. The name of each created target will be of the form
- ``<name>-<step>``::
+ ``<name>-<step>``:
+
+ .. code-block:: cmake
ExternalProject_Add_StepTargets(<name> [NO_DEPENDS] <step1> [<step2>...])
@@ -773,7 +807,9 @@ control needed to implement such step-level capabilities.
The ``ExternalProject_Add_StepDependencies()`` function can be used to add
dependencies to a step. The dependencies added must be targets CMake already
knows about (these can be ordinary executable or library targets, custom
- targets or even step targets of another external project)::
+ targets or even step targets of another external project):
+
+ .. code-block:: cmake
ExternalProject_Add_StepDependencies(<name> <step> <target1> [<target2>...])
@@ -1617,6 +1653,8 @@ function(_ep_set_directories name)
endif()
endif()
set(top "${CMAKE_CURRENT_BINARY_DIR}")
+
+ # Apply defaults and convert to absolute paths.
set(places stamp download source binary install tmp)
foreach(var ${places})
string(TOUPPER "${var}" VAR)
@@ -1629,6 +1667,17 @@ function(_ep_set_directories name)
endif()
set_property(TARGET ${name} PROPERTY _EP_${VAR}_DIR "${${var}_dir}")
endforeach()
+
+ # Special case for default log directory based on stamp directory.
+ get_property(log_dir TARGET ${name} PROPERTY _EP_LOG_DIR)
+ if(NOT log_dir)
+ get_property(log_dir TARGET ${name} PROPERTY _EP_STAMP_DIR)
+ endif()
+ if(NOT IS_ABSOLUTE "${log_dir}")
+ get_filename_component(log_dir "${top}/${log_dir}" ABSOLUTE)
+ endif()
+ set_property(TARGET ${name} PROPERTY _EP_LOG_DIR "${log_dir}")
+
get_property(source_subdir TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR)
if(NOT source_subdir)
set_property(TARGET ${name} PROPERTY _EP_SOURCE_SUBDIR "")
@@ -1642,7 +1691,11 @@ function(_ep_set_directories name)
endif()
if(build_in_source)
get_property(source_dir TARGET ${name} PROPERTY _EP_SOURCE_DIR)
- set_property(TARGET ${name} PROPERTY _EP_BINARY_DIR "${source_dir}")
+ if(source_subdir)
+ set_property(TARGET ${name} PROPERTY _EP_BINARY_DIR "${source_dir}/${source_subdir}")
+ else()
+ set_property(TARGET ${name} PROPERTY _EP_BINARY_DIR "${source_dir}")
+ endif()
endif()
# Make the directories at CMake configure time *and* add a custom command
@@ -1671,7 +1724,7 @@ macro(_ep_replace_location_tags target_name)
set(vars ${ARGN})
foreach(var ${vars})
if(${var})
- foreach(dir SOURCE_DIR SOURCE_SUBDIR BINARY_DIR INSTALL_DIR TMP_DIR DOWNLOAD_DIR DOWNLOADED_FILE)
+ foreach(dir SOURCE_DIR SOURCE_SUBDIR BINARY_DIR INSTALL_DIR TMP_DIR DOWNLOAD_DIR DOWNLOADED_FILE LOG_DIR)
get_property(val TARGET ${target_name} PROPERTY _EP_${dir})
string(REPLACE "<${dir}>" "${val}" ${var} "${${var}}")
endforeach()
@@ -1853,6 +1906,7 @@ function(_ep_get_build_command name step cmd_var)
endfunction()
function(_ep_write_log_script name step cmd_var)
+ ExternalProject_Get_Property(${name} log_dir)
ExternalProject_Get_Property(${name} stamp_dir)
set(command "${${cmd_var}}")
@@ -1924,23 +1978,66 @@ endif()
# Wrap the command in a script to log output to files.
set(script ${stamp_dir}/${name}-${step}-$<CONFIG>.cmake)
- set(logbase ${stamp_dir}/${name}-${step})
+ set(logbase ${log_dir}/${name}-${step})
+ get_property(log_merged TARGET ${name} PROPERTY _EP_LOG_MERGED_STDOUTERR)
+ get_property(log_output_on_failure TARGET ${name} PROPERTY _EP_LOG_OUTPUT_ON_FAILURE)
+ if (log_merged)
+ set(stdout_log "${logbase}.log")
+ set(stderr_log "${logbase}.log")
+ else()
+ set(stdout_log "${logbase}-out.log")
+ set(stderr_log "${logbase}-err.log")
+ endif()
set(code "
+cmake_minimum_required(VERSION 3.13)
${code_cygpath_make}
set(command \"${command}\")
+set(log_merged \"${log_merged}\")
+set(log_output_on_failure \"${log_output_on_failure}\")
+set(stdout_log \"${stdout_log}\")
+set(stderr_log \"${stderr_log}\")
execute_process(
COMMAND \${command}
RESULT_VARIABLE result
- OUTPUT_FILE \"${logbase}-out.log\"
- ERROR_FILE \"${logbase}-err.log\"
+ OUTPUT_FILE \"\${stdout_log}\"
+ ERROR_FILE \"\${stderr_log}\"
)
+macro(read_up_to_max_size log_file output_var)
+ file(SIZE \${log_file} determined_size)
+ set(max_size 10240)
+ if (determined_size GREATER max_size)
+ math(EXPR seek_position \"\${determined_size} - \${max_size}\")
+ file(READ \${log_file} \${output_var} OFFSET \${seek_position})
+ set(\${output_var} \"...skipping to end...\\n\${\${output_var}}\")
+ else()
+ file(READ \${log_file} \${output_var})
+ endif()
+endmacro()
if(result)
set(msg \"Command failed: \${result}\\n\")
foreach(arg IN LISTS command)
set(msg \"\${msg} '\${arg}'\")
endforeach()
- set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\")
- message(FATAL_ERROR \"\${msg}\")
+ if (\${log_merged})
+ set(msg \"\${msg}\\nSee also\\n \${stderr_log}\")
+ else()
+ set(msg \"\${msg}\\nSee also\\n ${logbase}-*.log\")
+ endif()
+ if (\${log_output_on_failure})
+ message(SEND_ERROR \"\${msg}\")
+ if (\${log_merged})
+ read_up_to_max_size(\"\${stderr_log}\" error_log_contents)
+ message(STATUS \"Log output is:\\n\${error_log_contents}\")
+ else()
+ read_up_to_max_size(\"\${stdout_log}\" out_log_contents)
+ read_up_to_max_size(\"\${stderr_log}\" err_log_contents)
+ message(STATUS \"stdout output is:\\n\${out_log_contents}\")
+ message(STATUS \"stderr output is:\\n\${err_log_contents}\")
+ endif()
+ message(FATAL_ERROR \"Stopping after outputting logs.\")
+ else()
+ message(FATAL_ERROR \"\${msg}\")
+ endif()
else()
set(msg \"${name} ${step} command succeeded. See also ${logbase}-*.log\")
message(STATUS \"\${msg}\")
@@ -2212,7 +2309,7 @@ endfunction()
function(_ep_add_mkdir_command name)
ExternalProject_Get_Property(${name}
- source_dir binary_dir install_dir stamp_dir download_dir tmp_dir)
+ source_dir binary_dir install_dir stamp_dir download_dir tmp_dir log_dir)
_ep_get_configuration_subdir_suffix(cfgdir)
@@ -2224,6 +2321,7 @@ function(_ep_add_mkdir_command name)
COMMAND ${CMAKE_COMMAND} -E make_directory ${tmp_dir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${stamp_dir}${cfgdir}
COMMAND ${CMAKE_COMMAND} -E make_directory ${download_dir}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${log_dir}
)
endfunction()
@@ -2727,10 +2825,18 @@ function(_ep_add_patch_command name)
set(work_dir ${source_dir})
endif()
+ get_property(log TARGET ${name} PROPERTY _EP_LOG_PATCH)
+ if(log)
+ set(log LOG 1)
+ else()
+ set(log "")
+ endif()
+
ExternalProject_Add_Step(${name} patch
COMMAND ${cmd}
WORKING_DIRECTORY ${work_dir}
DEPENDEES download
+ ${log}
)
endfunction()
diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake
index fbce235f5..4a3e83af3 100644
--- a/Modules/FeatureSummary.cmake
+++ b/Modules/FeatureSummary.cmake
@@ -97,8 +97,6 @@ Functions
#]=======================================================================]
-include(CMakeParseArguments)
-
function(_FS_GET_FEATURE_SUMMARY _property _var _includeQuiet)
get_property(_fsPkgTypes GLOBAL PROPERTY FeatureSummary_PKG_TYPES)
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index 98cdf6cb9..5716b0112 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -20,9 +20,12 @@ configure step to use the content in commands like :command:`add_subdirectory`,
:command:`include` or :command:`file` operations.
Content population details would normally be defined separately from the
-command that performs the actual population. Projects should also
-check whether the content has already been populated somewhere else in the
-project hierarchy. Typical usage would look something like this:
+command that performs the actual population. This separation ensures that
+all of the dependency details are defined before anything may try to use those
+details to populate content. This is particularly important in more complex
+project hierarchies where dependencies may be shared between multiple projects.
+
+The following shows a typical example of declaring content details:
.. code-block:: cmake
@@ -32,21 +35,37 @@ project hierarchy. Typical usage would look something like this:
GIT_TAG release-1.8.0
)
+For most typical cases, populating the content can then be done with a single
+command like so:
+
+.. code-block:: cmake
+
+ FetchContent_MakeAvailable(googletest)
+
+The above command not only populates the content, it also adds it to the main
+build (if possible) so that the main build can use the populated project's
+targets, etc. In some cases, the main project may need to have more precise
+control over the population or may be required to explicitly define the
+population steps (e.g. if CMake versions earlier than 3.14 need to be
+supported). The typical pattern of such custom steps looks like this:
+
+.. code-block:: cmake
+
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
endif()
-When using the above pattern with a hierarchical project arrangement,
-projects at higher levels in the hierarchy are able to define or override
-the population details of content specified anywhere lower in the project
-hierarchy. The ability to detect whether content has already been
-populated ensures that even if multiple child projects want certain content
-to be available, the first one to populate it wins. The other child project
-can simply make use of the already available content instead of repeating
-the population for itself. See the
-:ref:`Examples <fetch-content-examples>` section which demonstrates
+Regardless of which population method is used, when using the
+declare-populate pattern with a hierarchical project arrangement, projects at
+higher levels in the hierarchy are able to override the population details of
+content specified anywhere lower in the project hierarchy. The ability to
+detect whether content has already been populated ensures that even if
+multiple child projects want certain content to be available, the first one
+to populate it wins. The other child project can simply make use of the
+already available content instead of repeating the population for itself.
+See the :ref:`Examples <fetch-content-examples>` section which demonstrates
this scenario.
The ``FetchContent`` module also supports defining and populating
@@ -113,6 +132,38 @@ Declaring Content Details
Populating The Content
^^^^^^^^^^^^^^^^^^^^^^
+For most common scenarios, population means making content available to the
+main build according to previously declared details for that dependency.
+There are two main patterns for populating content, one based on calling
+:command:`FetchContent_GetProperties` and
+:command:`FetchContent_Populate` for more precise control and the other on
+calling :command:`FetchContent_MakeAvailable` for a simpler, more automated
+approach. The former generally follows this canonical pattern:
+
+.. _`fetch-content-canonical-pattern`:
+
+.. code-block:: cmake
+
+ # Check if population has already been performed
+ FetchContent_GetProperties(<name>)
+ string(TOLOWER "<name>" lcName)
+ if(NOT ${lcName}_POPULATED)
+ # Fetch the content using previously declared details
+ FetchContent_Populate(<name>)
+
+ # Set custom variables, policies, etc.
+ # ...
+
+ # Bring the populated content into the build
+ add_subdirectory(${${lcName}_SOURCE_DIR} ${${lcName}_BINARY_DIR})
+ endif()
+
+The above is such a common pattern that, where no custom steps are needed
+between the calls to :command:`FetchContent_Populate` and
+:command:`add_subdirectory`, equivalent logic can be obtained by calling
+:command:`FetchContent_MakeAvailable` instead (and should be preferred where
+it meets the needs of the project).
+
.. command:: FetchContent_Populate
.. code-block:: cmake
@@ -309,9 +360,6 @@ Populating The Content
on the command line invoking the script.
-Retrieve Population Properties
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
.. command:: FetchContent_GetProperties
When using saved content details, a call to :command:`FetchContent_Populate`
@@ -343,28 +391,65 @@ Retrieve Population Properties
FetchContent_GetProperties(foobar)
if(NOT foobar_POPULATED)
FetchContent_Populate(foobar)
-
- # Set any custom variables, etc. here, then
- # populate the content as part of this build
-
- add_subdirectory(${foobar_SOURCE_DIR} ${foobar_BINARY_DIR})
+ ...
endif()
The above pattern allows other parts of the overall project hierarchy to
re-use the same content and ensure that it is only populated once.
+.. command:: FetchContent_MakeAvailable
+
+ .. code-block:: cmake
+
+ FetchContent_MakeAvailable( <name1> [<name2>...] )
+
+ This command implements the common pattern typically needed for most
+ dependencies. It iterates over each of the named dependencies in turn
+ and for each one it loosely follows the same
+ :ref:`canonical pattern <fetch-content-canonical-pattern>` as
+ presented at the beginning of this section. One small difference to
+ that pattern is that it will only call :command:`add_subdirectory` on the
+ populated content if there is a ``CMakeLists.txt`` file in its top level
+ source directory. This allows the command to be used for dependencies
+ that make downloaded content available at a known location but which do
+ not need or support being added directly to the build.
+
+
.. _`fetch-content-examples`:
Examples
^^^^^^^^
-Consider a project hierarchy where ``projA`` is the top level project and it
-depends on projects ``projB`` and ``projC``. Both ``projB`` and ``projC``
-can be built standalone and they also both depend on another project
-``projD``. For simplicity, this example will assume that all four projects
-are available on a company git server. The ``CMakeLists.txt`` of each project
-might have sections like the following:
+This first fairly straightforward example ensures that some popular testing
+frameworks are available to the main build:
+
+.. code-block:: cmake
+
+ include(FetchContent)
+ FetchContent_Declare(
+ googletest
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG release-1.8.0
+ )
+ FetchContent_Declare(
+ Catch2
+ GIT_REPOSITORY https://github.com/catchorg/Catch2.git
+ GIT_TAG v2.5.0
+ )
+
+ # After the following call, the CMake targets defined by googletest and
+ # Catch2 will be defined and available to the rest of the build
+ FetchContent_MakeAvailable(googletest Catch2)
+
+
+In more complex project hierarchies, the dependency relationships can be more
+complicated. Consider a hierarchy where ``projA`` is the top level project and
+it depends directly on projects ``projB`` and ``projC``. Both ``projB`` and
+``projC`` can be built standalone and they also both depend on another project
+``projD``. ``projB`` additionally depends on ``projE``. This example assumes
+that all five projects are available on a company git server. The
+``CMakeLists.txt`` of each project might have sections like the following:
*projA*:
@@ -373,31 +458,27 @@ might have sections like the following:
include(FetchContent)
FetchContent_Declare(
projB
- GIT_REPOSITORY git@mycompany.com/git/projB.git
+ GIT_REPOSITORY git@mycompany.com:git/projB.git
GIT_TAG 4a89dc7e24ff212a7b5167bef7ab079d
)
FetchContent_Declare(
projC
- GIT_REPOSITORY git@mycompany.com/git/projC.git
+ GIT_REPOSITORY git@mycompany.com:git/projC.git
GIT_TAG 4ad4016bd1d8d5412d135cf8ceea1bb9
)
FetchContent_Declare(
projD
- GIT_REPOSITORY git@mycompany.com/git/projD.git
+ GIT_REPOSITORY git@mycompany.com:git/projD.git
GIT_TAG origin/integrationBranch
)
+ FetchContent_Declare(
+ projE
+ GIT_REPOSITORY git@mycompany.com:git/projE.git
+ GIT_TAG origin/release/2.3-rc1
+ )
- FetchContent_GetProperties(projB)
- if(NOT projb_POPULATED)
- FetchContent_Populate(projB)
- add_subdirectory(${projb_SOURCE_DIR} ${projb_BINARY_DIR})
- endif()
-
- FetchContent_GetProperties(projC)
- if(NOT projc_POPULATED)
- FetchContent_Populate(projC)
- add_subdirectory(${projc_SOURCE_DIR} ${projc_BINARY_DIR})
- endif()
+ # Order is important, see notes in the discussion further below
+ FetchContent_MakeAvailable(projD projB projC)
*projB*:
@@ -406,16 +487,16 @@ might have sections like the following:
include(FetchContent)
FetchContent_Declare(
projD
- GIT_REPOSITORY git@mycompany.com/git/projD.git
+ GIT_REPOSITORY git@mycompany.com:git/projD.git
GIT_TAG 20b415f9034bbd2a2e8216e9a5c9e632
)
+ FetchContent_Declare(
+ projE
+ GIT_REPOSITORY git@mycompany.com:git/projE.git
+ GIT_TAG 68e20f674a48be38d60e129f600faf7d
+ )
- FetchContent_GetProperties(projD)
- if(NOT projd_POPULATED)
- FetchContent_Populate(projD)
- add_subdirectory(${projd_SOURCE_DIR} ${projd_BINARY_DIR})
- endif()
-
+ FetchContent_MakeAvailable(projD projE)
*projC*:
@@ -424,48 +505,77 @@ might have sections like the following:
include(FetchContent)
FetchContent_Declare(
projD
- GIT_REPOSITORY git@mycompany.com/git/projD.git
+ GIT_REPOSITORY git@mycompany.com:git/projD.git
GIT_TAG 7d9a17ad2c962aa13e2fbb8043fb6b8a
)
+ # This particular version of projD requires workarounds
FetchContent_GetProperties(projD)
if(NOT projd_POPULATED)
FetchContent_Populate(projD)
+
+ # Copy an additional/replacement file into the populated source
+ file(COPY someFile.c DESTINATION ${projd_SOURCE_DIR}/src)
+
add_subdirectory(${projd_SOURCE_DIR} ${projd_BINARY_DIR})
endif()
A few key points should be noted in the above:
- ``projB`` and ``projC`` define different content details for ``projD``,
- but ``projA`` also defines a set of content details for ``projD`` and
- because ``projA`` will define them first, the details from ``projB`` and
+ but ``projA`` also defines a set of content details for ``projD``.
+ Because ``projA`` will define them first, the details from ``projB`` and
``projC`` will not be used. The override details defined by ``projA``
are not required to match either of those from ``projB`` or ``projC``, but
it is up to the higher level project to ensure that the details it does
define still make sense for the child projects.
-- While ``projA`` defined content details for ``projD``, it did not need
- to explicitly call ``FetchContent_Populate(projD)`` itself. Instead, it
- leaves that to a child project to do (in this case it will be ``projB``
- since it is added to the build ahead of ``projC``). If ``projA`` needed to
- customize how the ``projD`` content was brought into the build as well
- (e.g. define some CMake variables before calling
- :command:`add_subdirectory` after populating), it would do the call to
- ``FetchContent_Populate()``, etc. just as it did for the ``projB`` and
- ``projC`` content. For higher level projects, it is usually enough to
- just define the override content details and leave the actual population
- to the child projects. This saves repeating the same thing at each level
- of the project hierarchy unnecessarily.
-- Even though ``projA`` is the top level project in this example, it still
- checks whether ``projB`` and ``projC`` have already been populated before
- going ahead to do those populations. This makes ``projA`` able to be more
- easily incorporated as a child of some other higher level project in the
- future if required. Always protect a call to
- :command:`FetchContent_Populate` with a check to
- :command:`FetchContent_GetProperties`, even in what may be considered a top
- level project at the time.
-
-
-The following example demonstrates how one might download and unpack a
+- In the ``projA`` call to :command:`FetchContent_MakeAvailable`, ``projD``
+ is listed ahead of ``projB`` and ``projC`` to ensure that ``projA`` is in
+ control of how ``projD`` is populated.
+- While ``projA`` defines content details for ``projE``, it does not need
+ to explicitly call ``FetchContent_MakeAvailable(projE)`` or
+ ``FetchContent_Populate(projD)`` itself. Instead, it leaves that to the
+ child ``projB``. For higher level projects, it is often enough to just
+ define the override content details and leave the actual population to the
+ child projects. This saves repeating the same thing at each level of the
+ project hierarchy unnecessarily.
+
+
+Projects don't always need to add the populated content to the build.
+Sometimes the project just wants to make the downloaded content available at
+a predictable location. The next example ensures that a set of standard
+company toolchain files (and potentially even the toolchain binaries
+themselves) is available early enough to be used for that same build.
+
+.. code-block:: cmake
+
+ cmake_minimum_required(VERSION 3.14)
+
+ include(FetchContent)
+ FetchContent_Declare(
+ mycom_toolchains
+ URL https://intranet.mycompany.com//toolchains_1.3.2.tar.gz
+ )
+ FetchContent_MakeAvailable(mycom_toolchains)
+
+ project(CrossCompileExample)
+
+The project could be configured to use one of the downloaded toolchains like
+so:
+
+.. code-block:: shell
+
+ cmake -DCMAKE_TOOLCHAIN_FILE=_deps/mycom_toolchains-src/toolchain_arm.cmake /path/to/src
+
+When CMake processes the ``CMakeLists.txt`` file, it will download and unpack
+the tarball into ``_deps/mycompany_toolchains-src`` relative to the build
+directory. The :variable:`CMAKE_TOOLCHAIN_FILE` variable is not used until
+the :command:`project` command is reached, at which point CMake looks for the
+named toolchain file relative to the build directory. Because the tarball has
+already been downloaded and unpacked by then, the toolchain file will be in
+place, even the very first time that ``cmake`` is run in the build directory.
+
+Lastly, the following example demonstrates how one might download and unpack a
firmware tarball using CMake's :manual:`script mode <cmake(1)>`. The call to
:command:`FetchContent_Populate` specifies all the content details and the
unpacked firmware will be placed in a ``firmware`` directory below the
@@ -691,6 +801,13 @@ function(__FetchContent_directPopulate contentName)
BUILD_COMMAND
INSTALL_COMMAND
TEST_COMMAND
+ # We force both of these to be ON since we are always executing serially
+ # and we want all steps to have access to the terminal in case they
+ # need input from the command line (e.g. ask for a private key password)
+ # or they want to provide timely progress. We silently absorb and
+ # discard these if they are set by the caller.
+ USES_TERMINAL_DOWNLOAD
+ USES_TERMINAL_UPDATE
)
set(multiValueArgs "")
@@ -914,3 +1031,31 @@ function(FetchContent_Populate contentName)
set(${contentNameLower}_POPULATED True PARENT_SCOPE)
endfunction()
+
+# Arguments are assumed to be the names of dependencies that have been
+# declared previously and should be populated. It is not an error if
+# any of them have already been populated (they will just be skipped in
+# that case). The command is implemented as a macro so that the variables
+# defined by the FetchContent_GetProperties() and FetchContent_Populate()
+# calls will be available to the caller.
+macro(FetchContent_MakeAvailable)
+
+ foreach(contentName IN ITEMS ${ARGV})
+ string(TOLOWER ${contentName} contentNameLower)
+ FetchContent_GetProperties(${contentName})
+ if(NOT ${contentNameLower}_POPULATED)
+ FetchContent_Populate(${contentName})
+
+ # Only try to call add_subdirectory() if the populated content
+ # can be treated that way. Protecting the call with the check
+ # allows this function to be used for projects that just want
+ # to ensure the content exists, such as to provide content at
+ # a known location.
+ if(EXISTS ${${contentNameLower}_SOURCE_DIR}/CMakeLists.txt)
+ add_subdirectory(${${contentNameLower}_SOURCE_DIR}
+ ${${contentNameLower}_BINARY_DIR})
+ endif()
+ endif()
+ endforeach()
+
+endmacro()
diff --git a/Modules/FetchContent/CMakeLists.cmake.in b/Modules/FetchContent/CMakeLists.cmake.in
index 9a7a7715a..0095b111b 100644
--- a/Modules/FetchContent/CMakeLists.cmake.in
+++ b/Modules/FetchContent/CMakeLists.cmake.in
@@ -18,4 +18,6 @@ ExternalProject_Add(${contentName}-populate
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
+ USES_TERMINAL_DOWNLOAD YES
+ USES_TERMINAL_UPDATE YES
)
diff --git a/Modules/FindALSA.cmake b/Modules/FindALSA.cmake
index c9cfd60ff..f27d7fe97 100644
--- a/Modules/FindALSA.cmake
+++ b/Modules/FindALSA.cmake
@@ -1,44 +1,45 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindALSA
-# --------
-#
-# Find alsa
-#
-# Find the alsa libraries (asound)
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if
-# ALSA has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``ALSA_FOUND``
-# True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
-#
-# ``ALSA_LIBRARIES``
-# List of libraries when using ALSA.
-#
-# ``ALSA_INCLUDE_DIRS``
-# Where to find the ALSA headers.
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``ALSA_INCLUDE_DIR``
-# the ALSA include directory
-#
-# ``ALSA_LIBRARY``
-# the absolute path of the asound library
+#[=======================================================================[.rst:
+FindALSA
+--------
+
+Find alsa
+
+Find the alsa libraries (asound)
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``ALSA::ALSA``, if
+ALSA has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``ALSA_FOUND``
+ True if ALSA_INCLUDE_DIR & ALSA_LIBRARY are found
+
+``ALSA_LIBRARIES``
+ List of libraries when using ALSA.
+
+``ALSA_INCLUDE_DIRS``
+ Where to find the ALSA headers.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``ALSA_INCLUDE_DIR``
+ the ALSA include directory
+
+``ALSA_LIBRARY``
+ the absolute path of the asound library
+#]=======================================================================]
find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
DOC "The ALSA (asound) include directory"
diff --git a/Modules/FindASPELL.cmake b/Modules/FindASPELL.cmake
index 6944ac192..c2d29e295 100644
--- a/Modules/FindASPELL.cmake
+++ b/Modules/FindASPELL.cmake
@@ -1,21 +1,22 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindASPELL
-# ----------
-#
-# Try to find ASPELL
-#
-# Once done this will define
-#
-# ::
-#
-# ASPELL_FOUND - system has ASPELL
-# ASPELL_EXECUTABLE - the ASPELL executable
-# ASPELL_INCLUDE_DIR - the ASPELL include directory
-# ASPELL_LIBRARIES - The libraries needed to use ASPELL
-# ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
+#[=======================================================================[.rst:
+FindASPELL
+----------
+
+Try to find ASPELL
+
+Once done this will define
+
+::
+
+ ASPELL_FOUND - system has ASPELL
+ ASPELL_EXECUTABLE - the ASPELL executable
+ ASPELL_INCLUDE_DIR - the ASPELL include directory
+ ASPELL_LIBRARIES - The libraries needed to use ASPELL
+ ASPELL_DEFINITIONS - Compiler switches required for using ASPELL
+#]=======================================================================]
find_path(ASPELL_INCLUDE_DIR aspell.h )
diff --git a/Modules/FindAVIFile.cmake b/Modules/FindAVIFile.cmake
index 2df29cacb..c12512f15 100644
--- a/Modules/FindAVIFile.cmake
+++ b/Modules/FindAVIFile.cmake
@@ -1,23 +1,24 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindAVIFile
-# -----------
-#
-# Locate AVIFILE library and include paths
-#
-# AVIFILE (http://avifile.sourceforge.net/)is a set of libraries for
-# i386 machines to use various AVI codecs. Support is limited beyond
-# Linux. Windows provides native AVI support, and so doesn't need this
-# library. This module defines
-#
-# ::
-#
-# AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
-# AVIFILE_LIBRARIES, the libraries to link against
-# AVIFILE_DEFINITIONS, definitions to use when compiling
-# AVIFILE_FOUND, If false, don't try to use AVIFILE
+#[=======================================================================[.rst:
+FindAVIFile
+-----------
+
+Locate AVIFILE library and include paths
+
+AVIFILE (http://avifile.sourceforge.net/)is a set of libraries for
+i386 machines to use various AVI codecs. Support is limited beyond
+Linux. Windows provides native AVI support, and so doesn't need this
+library. This module defines
+
+::
+
+ AVIFILE_INCLUDE_DIR, where to find avifile.h , etc.
+ AVIFILE_LIBRARIES, the libraries to link against
+ AVIFILE_DEFINITIONS, definitions to use when compiling
+ AVIFILE_FOUND, If false, don't try to use AVIFILE
+#]=======================================================================]
if (UNIX)
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index 95f0c5629..ce76c99df 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -1,35 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindArmadillo
-# -------------
-#
-# Find Armadillo
-#
-# Find the Armadillo C++ library
-#
-# Using Armadillo:
-#
-# ::
-#
-# find_package(Armadillo REQUIRED)
-# include_directories(${ARMADILLO_INCLUDE_DIRS})
-# add_executable(foo foo.cc)
-# target_link_libraries(foo ${ARMADILLO_LIBRARIES})
-#
-# This module sets the following variables:
-#
-# ::
-#
-# ARMADILLO_FOUND - set to true if the library is found
-# ARMADILLO_INCLUDE_DIRS - list of required include directories
-# ARMADILLO_LIBRARIES - list of libraries to be linked
-# ARMADILLO_VERSION_MAJOR - major version number
-# ARMADILLO_VERSION_MINOR - minor version number
-# ARMADILLO_VERSION_PATCH - patch version number
-# ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
-# ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
+#[=======================================================================[.rst:
+FindArmadillo
+-------------
+
+Find Armadillo
+
+Find the Armadillo C++ library
+
+Using Armadillo:
+
+::
+
+ find_package(Armadillo REQUIRED)
+ include_directories(${ARMADILLO_INCLUDE_DIRS})
+ add_executable(foo foo.cc)
+ target_link_libraries(foo ${ARMADILLO_LIBRARIES})
+
+This module sets the following variables:
+
+::
+
+ ARMADILLO_FOUND - set to true if the library is found
+ ARMADILLO_INCLUDE_DIRS - list of required include directories
+ ARMADILLO_LIBRARIES - list of libraries to be linked
+ ARMADILLO_VERSION_MAJOR - major version number
+ ARMADILLO_VERSION_MINOR - minor version number
+ ARMADILLO_VERSION_PATCH - patch version number
+ ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
+ ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
+#]=======================================================================]
# UNIX paths are standard, no need to write.
find_library(ARMADILLO_LIBRARY
diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake
index 2000f7ff6..06ac2d93f 100644
--- a/Modules/FindBISON.cmake
+++ b/Modules/FindBISON.cmake
@@ -1,85 +1,86 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindBISON
-# ---------
-#
-# Find ``bison`` executable and provide a macro to generate custom build rules.
-#
-# The module defines the following variables:
-#
-# ``BISON_EXECUTABLE``
-# path to the ``bison`` program
-#
-# ``BISON_VERSION``
-# version of ``bison``
-#
-# ``BISON_FOUND``
-# true if the program was found
-#
-# The minimum required version of ``bison`` can be specified using the
-# standard CMake syntax, e.g. ``find_package(BISON 2.1.3)``.
-#
-# If ``bison`` is found, the module defines the macro::
-#
-# BISON_TARGET(<Name> <YaccInput> <CodeOutput>
-# [COMPILE_FLAGS <flags>]
-# [DEFINES_FILE <file>]
-# [VERBOSE [<file>]]
-# [REPORT_FILE <file>]
-# )
-#
-# which will create a custom rule to generate a parser. ``<YaccInput>`` is
-# the path to a yacc file. ``<CodeOutput>`` is the name of the source file
-# generated by bison. A header file is also be generated, and contains
-# the token list.
-#
-# The options are:
-#
-# ``COMPILE_FLAGS <flags>``
-# Specify flags to be added to the ``bison`` command line.
-#
-# ``DEFINES_FILE <file>``
-# Specify a non-default header ``<file>`` to be generated by ``bison``.
-#
-# ``VERBOSE [<file>]``
-# Tell ``bison`` to write a report file of the grammar and parser.
-# If ``<file>`` is given, it specifies path the report file is copied to.
-# ``[<file>]`` is left for backward compatibility of this module.
-# Use ``VERBOSE REPORT_FILE <file>``.
-#
-# ``REPORT_FILE <file>``
-# Specify a non-default report ``<file>``, if generated.
-#
-# The macro defines the following variables:
-#
-# ``BISON_<Name>_DEFINED``
-# true is the macro ran successfully
-#
-# ``BISON_<Name>_INPUT``
-# The input source file, an alias for <YaccInput>
-#
-# ``BISON_<Name>_OUTPUT_SOURCE``
-# The source file generated by bison
-#
-# ``BISON_<Name>_OUTPUT_HEADER``
-# The header file generated by bison
-#
-# ``BISON_<Name>_OUTPUTS``
-# All files generated by bison including the source, the header and the report
-#
-# ``BISON_<Name>_COMPILE_FLAGS``
-# Options used in the ``bison`` command line
-#
-# Example usage:
-#
-# .. code-block:: cmake
-#
-# find_package(BISON)
-# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
-# DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h)
-# add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
+#[=======================================================================[.rst:
+FindBISON
+---------
+
+Find ``bison`` executable and provide a macro to generate custom build rules.
+
+The module defines the following variables:
+
+``BISON_EXECUTABLE``
+ path to the ``bison`` program
+
+``BISON_VERSION``
+ version of ``bison``
+
+``BISON_FOUND``
+ true if the program was found
+
+The minimum required version of ``bison`` can be specified using the
+standard CMake syntax, e.g. ``find_package(BISON 2.1.3)``.
+
+If ``bison`` is found, the module defines the macro::
+
+ BISON_TARGET(<Name> <YaccInput> <CodeOutput>
+ [COMPILE_FLAGS <flags>]
+ [DEFINES_FILE <file>]
+ [VERBOSE [<file>]]
+ [REPORT_FILE <file>]
+ )
+
+which will create a custom rule to generate a parser. ``<YaccInput>`` is
+the path to a yacc file. ``<CodeOutput>`` is the name of the source file
+generated by bison. A header file is also be generated, and contains
+the token list.
+
+The options are:
+
+``COMPILE_FLAGS <flags>``
+ Specify flags to be added to the ``bison`` command line.
+
+``DEFINES_FILE <file>``
+ Specify a non-default header ``<file>`` to be generated by ``bison``.
+
+``VERBOSE [<file>]``
+ Tell ``bison`` to write a report file of the grammar and parser.
+ If ``<file>`` is given, it specifies path the report file is copied to.
+ ``[<file>]`` is left for backward compatibility of this module.
+ Use ``VERBOSE REPORT_FILE <file>``.
+
+``REPORT_FILE <file>``
+ Specify a non-default report ``<file>``, if generated.
+
+The macro defines the following variables:
+
+``BISON_<Name>_DEFINED``
+ true is the macro ran successfully
+
+``BISON_<Name>_INPUT``
+ The input source file, an alias for <YaccInput>
+
+``BISON_<Name>_OUTPUT_SOURCE``
+ The source file generated by bison
+
+``BISON_<Name>_OUTPUT_HEADER``
+ The header file generated by bison
+
+``BISON_<Name>_OUTPUTS``
+ All files generated by bison including the source, the header and the report
+
+``BISON_<Name>_COMPILE_FLAGS``
+ Options used in the ``bison`` command line
+
+Example usage:
+
+.. code-block:: cmake
+
+ find_package(BISON)
+ BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp
+ DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/parser.h)
+ add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
+#]=======================================================================]
find_program(BISON_EXECUTABLE NAMES bison win_bison DOC "path to the bison executable")
mark_as_advanced(BISON_EXECUTABLE)
@@ -150,7 +151,15 @@ if(BISON_EXECUTABLE)
list(APPEND BISON_TARGET_cmdopt "--report-file=${BISON_TARGET_verbose_file}")
endif()
if(NOT IS_ABSOLUTE "${BISON_TARGET_verbose_file}")
- set(BISON_TARGET_verbose_file "${CMAKE_CURRENT_SOURCE_DIR}/${BISON_TARGET_verbose_file}")
+ cmake_policy(GET CMP0088 _BISON_CMP0088
+ PARENT_SCOPE # undocumented, do not use outside of CMake
+ )
+ if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
+ set(BISON_TARGET_verbose_file "${CMAKE_CURRENT_BINARY_DIR}/${BISON_TARGET_verbose_file}")
+ else()
+ set(BISON_TARGET_verbose_file "${CMAKE_CURRENT_SOURCE_DIR}/${BISON_TARGET_verbose_file}")
+ endif()
+ unset(_BISON_CMP0088)
endif()
endmacro()
@@ -158,6 +167,15 @@ if(BISON_EXECUTABLE)
# adds a custom command and sets
# BISON_TARGET_cmdopt, BISON_TARGET_extraoutputs
macro(BISON_TARGET_option_verbose Name BisonOutput filename)
+ cmake_policy(GET CMP0088 _BISON_CMP0088
+ PARENT_SCOPE # undocumented, do not use outside of CMake
+ )
+ set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
+ set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+ unset(_BISON_CMP0088)
+
list(APPEND BISON_TARGET_cmdopt "--verbose")
list(APPEND BISON_TARGET_outputs
"${BISON_TARGET_verbose_file}")
@@ -165,8 +183,9 @@ if(BISON_EXECUTABLE)
if(IS_ABSOLUTE "${filename}")
set(BISON_TARGET_verbose_extra_file "${filename}")
else()
- set(BISON_TARGET_verbose_extra_file "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
+ set(BISON_TARGET_verbose_extra_file "${_BISON_WORKING_DIRECTORY}/${filename}")
endif()
+
add_custom_command(OUTPUT ${BISON_TARGET_verbose_extra_file}
COMMAND ${CMAKE_COMMAND} -E copy
"${BISON_TARGET_verbose_file}"
@@ -175,10 +194,11 @@ if(BISON_EXECUTABLE)
DEPENDS
"${BISON_TARGET_verbose_file}"
COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY})
list(APPEND BISON_TARGET_extraoutputs
"${BISON_TARGET_verbose_extra_file}")
unset(BISON_TARGET_verbose_extra_file)
+ unset(_BISON_WORKING_DIRECTORY)
endif()
endmacro()
@@ -233,12 +253,23 @@ if(BISON_EXECUTABLE)
list(APPEND BISON_TARGET_outputs "${BISON_TARGET_output_header}")
+ cmake_policy(GET CMP0088 _BISON_CMP0088
+ PARENT_SCOPE # undocumented, do not use outside of CMake
+ )
+ set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ if("x${_BISON_CMP0088}x" STREQUAL "xNEWx")
+ set(_BISON_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+ unset(_BISON_CMP0088)
+
add_custom_command(OUTPUT ${BISON_TARGET_outputs}
COMMAND ${BISON_EXECUTABLE} ${BISON_TARGET_cmdopt} -o ${BisonOutput} ${BisonInput}
VERBATIM
DEPENDS ${BisonInput}
COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY})
+
+ unset(_BISON_WORKING_DIRECTORY)
# define target variables
set(BISON_${Name}_DEFINED TRUE)
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index b5546e094..0aa4f5035 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -1,74 +1,89 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindBLAS
-# --------
-#
-# Find BLAS library
-#
-# This module finds an installed fortran library that implements the
-# BLAS linear-algebra interface (see http://www.netlib.org/blas/). The
-# list of libraries searched for is taken from the autoconf macro file,
-# acx_blas.m4 (distributed at
-# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
-#
-# This module sets the following variables:
-#
-# ::
-#
-# BLAS_FOUND - set to true if a library implementing the BLAS interface
-# is found
-# BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l
-# and -L).
-# BLAS_LIBRARIES - uncached list of libraries (using full path name) to
-# link against to use BLAS (may be empty if compiler implicitly links
-# BLAS)
-# BLAS95_LIBRARIES - uncached list of libraries (using full path name)
-# to link against to use BLAS95 interface
-# BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface
-# is found
-#
-# The following variables can be used to control this module:
-#
-# ::
-#
-# BLA_STATIC if set on this determines what kind of linkage we do (static)
-# BLA_VENDOR if set checks only the specified vendor, if not set checks
-# all the possibilities
-# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
-# BLA_PREFER_PKGCONFIG if set pkg-config will be used to search for a BLAS
-# library first and if one is found that is preferred
-#
-# List of vendors (BLA_VENDOR) valid in this module:
-#
-# * Goto
-# * OpenBLAS
-# * FLAME
-# * ATLAS PhiPACK
-# * CXML
-# * DXML
-# * SunPerf
-# * SCSL
-# * SGIMATH
-# * IBMESSL
-# * Intel10_32 (intel mkl v10 32 bit)
-# * Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model)
-# * Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model)
-# * Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model)
-# * Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model)
-# * Intel (older versions of mkl 32 and 64 bit)
-# * ACML
-# * ACML_MP
-# * ACML_GPU
-# * Apple
-# * NAS
-# * Generic
-#
-# .. note::
-#
-# C/CXX should be enabled to use Intel mkl
-#
+#[=======================================================================[.rst:
+FindBLAS
+--------
+
+Find BLAS library
+
+This module finds an installed fortran library that implements the
+BLAS linear-algebra interface (see http://www.netlib.org/blas/). The
+list of libraries searched for is taken from the autoconf macro file,
+acx_blas.m4 (distributed at
+http://ac-archive.sourceforge.net/ac-archive/acx_blas.html).
+
+Input Variables
+^^^^^^^^^^^^^^^
+
+The following variables may be set to influence this module's behavior:
+
+``BLA_STATIC``
+ if ``ON`` use static linkage
+
+``BLA_VENDOR``
+ If set, checks only the specified vendor, if not set checks all the
+ possibilities. List of vendors valid in this module:
+
+ * Goto
+ * OpenBLAS
+ * FLAME
+ * ATLAS PhiPACK
+ * CXML
+ * DXML
+ * SunPerf
+ * SCSL
+ * SGIMATH
+ * IBMESSL
+ * Intel10_32 (intel mkl v10 32 bit)
+ * Intel10_64lp (intel mkl v10+ 64 bit, threaded code, lp64 model)
+ * Intel10_64lp_seq (intel mkl v10+ 64 bit, sequential code, lp64 model)
+ * Intel10_64ilp (intel mkl v10+ 64 bit, threaded code, ilp64 model)
+ * Intel10_64ilp_seq (intel mkl v10+ 64 bit, sequential code, ilp64 model)
+ * Intel (obsolete versions of mkl 32 and 64 bit)
+ * ACML
+ * ACML_MP
+ * ACML_GPU
+ * Apple
+ * NAS
+ * Generic
+
+``BLA_F95``
+ if ``ON`` tries to find the BLAS95 interfaces
+
+``BLA_PREFER_PKGCONFIG``
+ if set pkg-config will be used to search for a BLAS library first
+ and if one is found that is preferred
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``BLAS_FOUND``
+ library implementing the BLAS interface is found
+``BLAS_LINKER_FLAGS``
+ uncached list of required linker flags (excluding -l and -L).
+``BLAS_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use BLAS (may be empty if compiler implicitly links BLAS)
+``BLAS95_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use BLAS95 interface
+``BLAS95_FOUND``
+ library implementing the BLAS95 interface is found
+
+.. note::
+
+ C or CXX must be enabled to use Intel MKL
+
+ For example, to use Intel MKL libraries and/or Intel compiler:
+
+ .. code-block:: cmake
+
+ set(BLA_VENDOR Intel10_64lp)
+ find_package(BLAS)
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFortranFunctionExists.cmake)
@@ -126,6 +141,8 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
endif ()
endif ()
+ list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
+
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
@@ -164,12 +181,13 @@ macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread)
check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS)
endif()
set(CMAKE_REQUIRED_LIBRARIES)
- mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
endif()
if(_libraries_work)
if("${_list}" STREQUAL "")
set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES")
+ else()
+ set(${LIBRARIES} ${${LIBRARIES}} ${_thread}) # for static link
endif()
else()
set(${LIBRARIES} FALSE)
@@ -205,14 +223,34 @@ endif ()
#BLAS in intel mkl 10+ library? (em64t 64bit)
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (NOT BLAS_LIBRARIES)
+
+ # System-specific settings
+ if (WIN32)
+ if (BLA_STATIC)
+ set(BLAS_mkl_DLL_SUFFIX "")
+ else()
+ set(BLAS_mkl_DLL_SUFFIX "_dll")
+ endif()
+ else()
+ if(CMAKE_Fortran_COMPILER_LOADED AND CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+ set(BLAS_mkl_INTFACE "gf")
+ set(BLAS_mkl_THREADING "gnu")
+ set(BLAS_mkl_OMP "gomp")
+ else()
+ set(BLAS_mkl_INTFACE "intel")
+ set(BLAS_mkl_THREADING "intel")
+ set(BLAS_mkl_OMP "iomp5")
+ endif()
+ set(BLAS_mkl_LM "-lm")
+ set(BLAS_mkl_LDL "-ldl")
+ endif()
+
if (BLA_VENDOR MATCHES "_64ilp")
set(BLAS_mkl_ILP_MODE "ilp64")
else ()
set(BLAS_mkl_ILP_MODE "lp64")
endif ()
- if (NOT WIN32)
- set(LM "-lm")
- endif ()
+
if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads)
@@ -226,12 +264,6 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
set(BLAS_mkl_SEARCH_SYMBOL sgemm_f95)
set(_LIBRARIES BLAS95_LIBRARIES)
if (WIN32)
- if (BLA_STATIC)
- set(BLAS_mkl_DLL_SUFFIX "")
- else()
- set(BLAS_mkl_DLL_SUFFIX "_dll")
- endif()
-
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
@@ -267,38 +299,32 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endforeach()
else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
+ # old version
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
+
+ # mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
+ "mkl_blas95 mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95 mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core guide")
+ "mkl_blas95 mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
# mkl >= 10.3
- if (CMAKE_C_COMPILER MATCHES ".+gcc")
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_gnu_thread mkl_core gomp")
- else ()
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core iomp5")
- endif ()
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
- "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_intel_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
+ "mkl_blas95_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
endif ()
endif ()
else ()
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
set(_LIBRARIES BLAS_LIBRARIES)
if (WIN32)
- if (BLA_STATIC)
- set(BLAS_mkl_DLL_SUFFIX "")
- else()
- set(BLAS_mkl_DLL_SUFFIX "_dll")
- endif()
-
# Find the main file (32-bit or 64-bit)
set(BLAS_SEARCH_LIBS_WIN_MAIN "")
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
@@ -334,27 +360,26 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endforeach()
else ()
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
+ # old version
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
+
+ # mkl >= 10.3
list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel mkl_intel_thread mkl_core guide")
+ "mkl_${BLAS_mkl_INTFACE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp$" OR BLA_VENDOR STREQUAL "All")
-
# old version
list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core guide")
+ "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core guide")
# mkl >= 10.3
- if (CMAKE_C_COMPILER MATCHES ".+gcc")
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_gnu_thread mkl_core gomp")
- else ()
- list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_intel_thread mkl_core iomp5")
- endif ()
+ list(APPEND BLAS_SEARCH_LIBS
+ "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_${BLAS_mkl_THREADING}_thread mkl_core ${BLAS_mkl_OMP}")
endif ()
if (BLA_VENDOR MATCHES "^Intel10_64i?lp_seq$" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
- "mkl_intel_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
+ "mkl_${BLAS_mkl_INTFACE}_${BLAS_mkl_ILP_MODE} mkl_sequential mkl_core")
endif ()
#older vesions of intel mkl libs
@@ -378,16 +403,30 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
${BLAS_mkl_SEARCH_SYMBOL}
""
"${SEARCH_LIBS}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
+ "${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}"
)
endif ()
endforeach ()
endif ()
unset(BLAS_mkl_ILP_MODE)
+ unset(BLAS_mkl_INTFACE)
+ unset(BLAS_mkl_THREADING)
+ unset(BLAS_mkl_OMP)
+ unset(BLAS_mkl_DLL_SUFFIX)
+ unset(BLAS_mkl_LM)
+ unset(BLAS_mkl_LDL)
endif ()
endif ()
+if(BLA_F95)
+ find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS95_LIBRARIES)
+ set(BLAS95_FOUND ${BLAS_FOUND})
+ if(BLAS_FOUND)
+ set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
+ endif()
+endif()
+
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES)
# gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2)
@@ -723,13 +762,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All")
endif()
endif ()
-if(BLA_F95)
- find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS95_LIBRARIES)
- set(BLAS95_FOUND ${BLAS_FOUND})
- if(BLAS_FOUND)
- set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}")
- endif()
-else()
+if(NOT BLA_F95)
find_package_handle_standard_args(BLAS REQUIRED_VARS BLAS_LIBRARIES)
endif()
diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake
index 4d7123dd5..249514864 100644
--- a/Modules/FindBZip2.cmake
+++ b/Modules/FindBZip2.cmake
@@ -1,41 +1,42 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindBZip2
-# ---------
-#
-# Try to find BZip2
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``BZip2::BZip2``, if
-# BZip2 has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``BZIP2_FOUND``
-# system has BZip2
-# ``BZIP2_INCLUDE_DIRS``
-# the BZip2 include directories
-# ``BZIP2_LIBRARIES``
-# Link these to use BZip2
-# ``BZIP2_NEED_PREFIX``
-# this is set if the functions are prefixed with ``BZ2_``
-# ``BZIP2_VERSION_STRING``
-# the version of BZip2 found
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``BZIP2_INCLUDE_DIR``
-# the BZip2 include directory
+#[=======================================================================[.rst:
+FindBZip2
+---------
+
+Try to find BZip2
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``BZip2::BZip2``, if
+BZip2 has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``BZIP2_FOUND``
+ system has BZip2
+``BZIP2_INCLUDE_DIRS``
+ the BZip2 include directories
+``BZIP2_LIBRARIES``
+ Link these to use BZip2
+``BZIP2_NEED_PREFIX``
+ this is set if the functions are prefixed with ``BZ2_``
+``BZIP2_VERSION_STRING``
+ the version of BZip2 found
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``BZIP2_INCLUDE_DIR``
+ the BZip2 include directory
+#]=======================================================================]
set(_BZIP2_PATHS PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Bzip2;InstallPath]"
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake
index 59ebdc26d..e1f45f7d4 100644
--- a/Modules/FindBacktrace.cmake
+++ b/Modules/FindBacktrace.cmake
@@ -1,41 +1,42 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindBacktrace
-# -------------
-#
-# Find provider for backtrace(3).
-#
-# Checks if OS supports backtrace(3) via either libc or custom library.
-# This module defines the following variables:
-#
-# ``Backtrace_HEADER``
-# The header file needed for backtrace(3). Cached.
-# Could be forcibly set by user.
-# ``Backtrace_INCLUDE_DIRS``
-# The include directories needed to use backtrace(3) header.
-# ``Backtrace_LIBRARIES``
-# The libraries (linker flags) needed to use backtrace(3), if any.
-# ``Backtrace_FOUND``
-# Is set if and only if backtrace(3) support detected.
-#
-# The following cache variables are also available to set or use:
-#
-# ``Backtrace_LIBRARY``
-# The external library providing backtrace, if any.
-# ``Backtrace_INCLUDE_DIR``
-# The directory holding the backtrace(3) header.
-#
-# Typical usage is to generate of header file using configure_file() with the
-# contents like the following::
-#
-# #cmakedefine01 Backtrace_FOUND
-# #if Backtrace_FOUND
-# # include <${Backtrace_HEADER}>
-# #endif
-#
-# And then reference that generated header file in actual source.
+#[=======================================================================[.rst:
+FindBacktrace
+-------------
+
+Find provider for backtrace(3).
+
+Checks if OS supports backtrace(3) via either libc or custom library.
+This module defines the following variables:
+
+``Backtrace_HEADER``
+ The header file needed for backtrace(3). Cached.
+ Could be forcibly set by user.
+``Backtrace_INCLUDE_DIRS``
+ The include directories needed to use backtrace(3) header.
+``Backtrace_LIBRARIES``
+ The libraries (linker flags) needed to use backtrace(3), if any.
+``Backtrace_FOUND``
+ Is set if and only if backtrace(3) support detected.
+
+The following cache variables are also available to set or use:
+
+``Backtrace_LIBRARY``
+ The external library providing backtrace, if any.
+``Backtrace_INCLUDE_DIR``
+ The directory holding the backtrace(3) header.
+
+Typical usage is to generate of header file using configure_file() with the
+contents like the following::
+
+ #cmakedefine01 Backtrace_FOUND
+ #if Backtrace_FOUND
+ # include <${Backtrace_HEADER}>
+ #endif
+
+And then reference that generated header file in actual source.
+#]=======================================================================]
include(CMakePushCheckState)
include(CheckSymbolExists)
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index bfab4ca43..7882c4bdf 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -1,240 +1,242 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindBoost
-# ---------
-#
-# Find Boost include dirs and libraries
-#
-# Use this module by invoking find_package with the form::
-#
-# find_package(Boost
-# [version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
-# [REQUIRED] # Fail with error if Boost is not found
-# [COMPONENTS <libs>...] # Boost libraries by their canonical name
-# # e.g. "date_time" for "libboost_date_time"
-# [OPTIONAL_COMPONENTS <libs>...]
-# # Optional Boost libraries by their canonical name)
-# ) # e.g. "date_time" for "libboost_date_time"
-#
-# This module finds headers and requested component libraries OR a CMake
-# package configuration file provided by a "Boost CMake" build. For the
-# latter case skip to the "Boost CMake" section below. For the former
-# case results are reported in variables::
-#
-# Boost_FOUND - True if headers and requested libraries were found
-# Boost_INCLUDE_DIRS - Boost include directories
-# Boost_LIBRARY_DIRS - Link directories for Boost libraries
-# Boost_LIBRARIES - Boost component libraries to be linked
-# Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
-# Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
-# target_link_libraries debug/optimized keywords)
-# Boost_VERSION - BOOST_VERSION value from boost/version.hpp
-# Boost_LIB_VERSION - Version string appended to library filenames
-# Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
-# Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
-# Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
-# Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
-# - Pass to add_definitions() to have diagnostic
-# information about Boost's automatic linking
-# displayed during compilation
-#
-# Note that Boost Python components require a Python version suffix
-# (Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
-# versions built against Python 3.6 and 2.7, respectively. This also
-# applies to additional components using Python including
-# ``mpi_python`` and ``numpy``. Earlier Boost releases may use
-# distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
-# These may also be used as suffixes, but note that they are not
-# portable.
-#
-# This module reads hints about search locations from variables::
-#
-# BOOST_ROOT - Preferred installation prefix
-# (or BOOSTROOT)
-# BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
-# BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
-# Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
-# specified by these hint variables. Default is OFF.
-# Boost_ADDITIONAL_VERSIONS
-# - List of Boost versions not known to this module
-# (Boost install locations may contain the version)
-#
-# and saves search results persistently in CMake cache entries::
-#
-# Boost_INCLUDE_DIR - Directory containing Boost headers
-# Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
-# Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
-# Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
-# Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
-#
-# The following :prop_tgt:`IMPORTED` targets are also defined::
-#
-# Boost::boost - Target for header-only dependencies
-# (Boost include directory)
-# Boost::<C> - Target for specific component dependency
-# (shared or static library); <C> is lower-
-# case
-# Boost::diagnostic_definitions - interface target to enable diagnostic
-# information about Boost's automatic linking
-# during compilation (adds BOOST_LIB_DIAGNOSTIC)
-# Boost::disable_autolinking - interface target to disable automatic
-# linking with MSVC (adds BOOST_ALL_NO_LIB)
-# Boost::dynamic_linking - interface target to enable dynamic linking
-# linking with MSVC (adds BOOST_ALL_DYN_LINK)
-#
-# Implicit dependencies such as Boost::filesystem requiring
-# Boost::system will be automatically detected and satisfied, even
-# if system is not specified when using find_package and if
-# Boost::system is not added to target_link_libraries. If using
-# Boost::thread, then Threads::Threads will also be added automatically.
-#
-# It is important to note that the imported targets behave differently
-# than variables created by this module: multiple calls to
-# find_package(Boost) in the same directory or sub-directories with
-# different options (e.g. static or shared) will not override the
-# values of the targets created by the first call.
-#
-# Users may set these hints or results as cache entries. Projects
-# should not read these entries directly but instead use the above
-# result variables. Note that some hint names start in upper-case
-# "BOOST". One may specify these as environment variables if they are
-# not specified as CMake variables or cache entries.
-#
-# This module first searches for the Boost header files using the above
-# hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
-# Boost_INCLUDE_DIR. Then it searches for requested component libraries
-# using the above hints (excluding BOOST_INCLUDEDIR and
-# Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
-# and the library name configuration settings below. It saves the
-# library directories in Boost_LIBRARY_DIR_DEBUG and
-# Boost_LIBRARY_DIR_RELEASE and individual library
-# locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
-# When one changes settings used by previous searches in the same build
-# tree (excluding environment variables) this module discards previous
-# search results affected by the changes and searches again.
-#
-# Boost libraries come in many variants encoded in their file name.
-# Users or projects may tell this module which variant to find by
-# setting variables::
-#
-# Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
-# and use the debug libraries. Default is ON.
-# Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
-# and use the release libraries. Default is ON.
-# Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
-# libraries ('mt' tag). Default is ON.
-# Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
-# libraries. Default is OFF.
-# Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
-# libraries linked statically to the C++ runtime
-# ('s' tag). Default is platform dependent.
-# Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
-# libraries linked to the MS debug C++ runtime
-# ('g' tag). Default is ON.
-# Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
-# debug Python build ('y' tag). Default is OFF.
-# Boost_USE_STLPORT - Set to ON to use libraries compiled with
-# STLPort ('p' tag). Default is OFF.
-# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
-# - Set to ON to use libraries compiled with
-# STLPort deprecated "native iostreams"
-# ('n' tag). Default is OFF.
-# Boost_COMPILER - Set to the compiler-specific library suffix
-# (e.g. "-gcc43"). Default is auto-computed
-# for the C++ compiler in use. A list may be
-# used if multiple compatible suffixes should
-# be tested for, in decreasing order of
-# preference.
-# Boost_ARCHITECTURE - Set to the architecture-specific library suffix
-# (e.g. "-x64"). Default is auto-computed for the
-# C++ compiler in use.
-# Boost_THREADAPI - Suffix for "thread" component library name,
-# such as "pthread" or "win32". Names with
-# and without this suffix will both be tried.
-# Boost_NAMESPACE - Alternate namespace used to build boost with
-# e.g. if set to "myboost", will search for
-# myboost_thread instead of boost_thread.
-#
-# Other variables one may set to control this module are::
-#
-# Boost_DEBUG - Set to ON to enable debug output from FindBoost.
-# Please enable this before filing any bug report.
-# Boost_DETAILED_FAILURE_MSG
-# - Set to ON to add detailed information to the
-# failure message even when the REQUIRED option
-# is not given to the find_package call.
-# Boost_REALPATH - Set to ON to resolve symlinks for discovered
-# libraries to assist with packaging. For example,
-# the "system" component library may be resolved to
-# "/usr/lib/libboost_system.so.1.67.0" instead of
-# "/usr/lib/libboost_system.so". This does not
-# affect linking and should not be enabled unless
-# the user needs this information.
-# Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
-# Boost_LIBRARY_DIR_DEBUG.
-#
-# On Visual Studio and Borland compilers Boost headers request automatic
-# linking to corresponding libraries. This requires matching libraries
-# to be linked explicitly or available in the link library search path.
-# In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
-# dynamic linking. Boost automatic linking typically requests static
-# libraries with a few exceptions (such as Boost.Python). Use::
-#
-# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
-#
-# to ask Boost to report information about automatic linking requests.
-#
-# Example to find Boost headers only::
-#
-# find_package(Boost 1.36.0)
-# if(Boost_FOUND)
-# include_directories(${Boost_INCLUDE_DIRS})
-# add_executable(foo foo.cc)
-# endif()
-#
-# Example to find Boost libraries and use imported targets::
-#
-# find_package(Boost 1.56 REQUIRED COMPONENTS
-# date_time filesystem iostreams)
-# add_executable(foo foo.cc)
-# target_link_libraries(foo Boost::date_time Boost::filesystem
-# Boost::iostreams)
-#
-# Example to find Boost Python 3.6 libraries and use imported targets::
-#
-# find_package(Boost 1.67 REQUIRED COMPONENTS
-# python36 numpy36)
-# add_executable(foo foo.cc)
-# target_link_libraries(foo Boost::python36 Boost::numpy36)
-#
-# Example to find Boost headers and some *static* (release only) libraries::
-#
-# set(Boost_USE_STATIC_LIBS ON) # only find static libs
-# set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
-# set(Boost_USE_RELEASE_LIBS ON) # only find release libs
-# set(Boost_USE_MULTITHREADED ON)
-# set(Boost_USE_STATIC_RUNTIME OFF)
-# find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
-# if(Boost_FOUND)
-# include_directories(${Boost_INCLUDE_DIRS})
-# add_executable(foo foo.cc)
-# target_link_libraries(foo ${Boost_LIBRARIES})
-# endif()
-#
-# Boost CMake
-# ^^^^^^^^^^^
-#
-# If Boost was built using the boost-cmake project it provides a package
-# configuration file for use with find_package's Config mode. This
-# module looks for the package configuration file called
-# BoostConfig.cmake or boost-config.cmake and stores the result in cache
-# entry "Boost_DIR". If found, the package configuration file is loaded
-# and this module returns with no further action. See documentation of
-# the Boost CMake package configuration for details on what it provides.
-#
-# Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
+#[=======================================================================[.rst:
+FindBoost
+---------
+
+Find Boost include dirs and libraries
+
+Use this module by invoking find_package with the form::
+
+ find_package(Boost
+ [version] [EXACT] # Minimum or EXACT version e.g. 1.67.0
+ [REQUIRED] # Fail with error if Boost is not found
+ [COMPONENTS <libs>...] # Boost libraries by their canonical name
+ # e.g. "date_time" for "libboost_date_time"
+ [OPTIONAL_COMPONENTS <libs>...]
+ # Optional Boost libraries by their canonical name)
+ ) # e.g. "date_time" for "libboost_date_time"
+
+This module finds headers and requested component libraries OR a CMake
+package configuration file provided by a "Boost CMake" build. For the
+latter case skip to the "Boost CMake" section below. For the former
+case results are reported in variables::
+
+ Boost_FOUND - True if headers and requested libraries were found
+ Boost_INCLUDE_DIRS - Boost include directories
+ Boost_LIBRARY_DIRS - Link directories for Boost libraries
+ Boost_LIBRARIES - Boost component libraries to be linked
+ Boost_<C>_FOUND - True if component <C> was found (<C> is upper-case)
+ Boost_<C>_LIBRARY - Libraries to link for component <C> (may include
+ target_link_libraries debug/optimized keywords)
+ Boost_VERSION - BOOST_VERSION value from boost/version.hpp
+ Boost_LIB_VERSION - Version string appended to library filenames
+ Boost_MAJOR_VERSION - Boost major version number (X in X.y.z)
+ Boost_MINOR_VERSION - Boost minor version number (Y in x.Y.z)
+ Boost_SUBMINOR_VERSION - Boost subminor version number (Z in x.y.Z)
+ Boost_VERSION_STRING - Boost version number in x.y.z format
+ Boost_LIB_DIAGNOSTIC_DEFINITIONS (Windows)
+ - Pass to add_definitions() to have diagnostic
+ information about Boost's automatic linking
+ displayed during compilation
+
+Note that Boost Python components require a Python version suffix
+(Boost 1.67 and later), e.g. ``python36`` or ``python27`` for the
+versions built against Python 3.6 and 2.7, respectively. This also
+applies to additional components using Python including
+``mpi_python`` and ``numpy``. Earlier Boost releases may use
+distribution-specific suffixes such as ``2``, ``3`` or ``2.7``.
+These may also be used as suffixes, but note that they are not
+portable.
+
+This module reads hints about search locations from variables::
+
+ BOOST_ROOT - Preferred installation prefix
+ (or BOOSTROOT)
+ BOOST_INCLUDEDIR - Preferred include directory e.g. <prefix>/include
+ BOOST_LIBRARYDIR - Preferred library directory e.g. <prefix>/lib
+ Boost_NO_SYSTEM_PATHS - Set to ON to disable searching in locations not
+ specified by these hint variables. Default is OFF.
+ Boost_ADDITIONAL_VERSIONS
+ - List of Boost versions not known to this module
+ (Boost install locations may contain the version)
+
+and saves search results persistently in CMake cache entries::
+
+ Boost_INCLUDE_DIR - Directory containing Boost headers
+ Boost_LIBRARY_DIR_RELEASE - Directory containing release Boost libraries
+ Boost_LIBRARY_DIR_DEBUG - Directory containing debug Boost libraries
+ Boost_<C>_LIBRARY_DEBUG - Component <C> library debug variant
+ Boost_<C>_LIBRARY_RELEASE - Component <C> library release variant
+
+The following :prop_tgt:`IMPORTED` targets are also defined::
+
+ Boost::boost - Target for header-only dependencies
+ (Boost include directory)
+ Boost::<C> - Target for specific component dependency
+ (shared or static library); <C> is lower-
+ case
+ Boost::diagnostic_definitions - interface target to enable diagnostic
+ information about Boost's automatic linking
+ during compilation (adds BOOST_LIB_DIAGNOSTIC)
+ Boost::disable_autolinking - interface target to disable automatic
+ linking with MSVC (adds BOOST_ALL_NO_LIB)
+ Boost::dynamic_linking - interface target to enable dynamic linking
+ linking with MSVC (adds BOOST_ALL_DYN_LINK)
+
+Implicit dependencies such as Boost::filesystem requiring
+Boost::system will be automatically detected and satisfied, even
+if system is not specified when using find_package and if
+Boost::system is not added to target_link_libraries. If using
+Boost::thread, then Threads::Threads will also be added automatically.
+
+It is important to note that the imported targets behave differently
+than variables created by this module: multiple calls to
+find_package(Boost) in the same directory or sub-directories with
+different options (e.g. static or shared) will not override the
+values of the targets created by the first call.
+
+Users may set these hints or results as cache entries. Projects
+should not read these entries directly but instead use the above
+result variables. Note that some hint names start in upper-case
+"BOOST". One may specify these as environment variables if they are
+not specified as CMake variables or cache entries.
+
+This module first searches for the Boost header files using the above
+hint variables (excluding BOOST_LIBRARYDIR) and saves the result in
+Boost_INCLUDE_DIR. Then it searches for requested component libraries
+using the above hints (excluding BOOST_INCLUDEDIR and
+Boost_ADDITIONAL_VERSIONS), "lib" directories near Boost_INCLUDE_DIR,
+and the library name configuration settings below. It saves the
+library directories in Boost_LIBRARY_DIR_DEBUG and
+Boost_LIBRARY_DIR_RELEASE and individual library
+locations in Boost_<C>_LIBRARY_DEBUG and Boost_<C>_LIBRARY_RELEASE.
+When one changes settings used by previous searches in the same build
+tree (excluding environment variables) this module discards previous
+search results affected by the changes and searches again.
+
+Boost libraries come in many variants encoded in their file name.
+Users or projects may tell this module which variant to find by
+setting variables::
+
+ Boost_USE_DEBUG_LIBS - Set to ON or OFF to specify whether to search
+ and use the debug libraries. Default is ON.
+ Boost_USE_RELEASE_LIBS - Set to ON or OFF to specify whether to search
+ and use the release libraries. Default is ON.
+ Boost_USE_MULTITHREADED - Set to OFF to use the non-multithreaded
+ libraries ('mt' tag). Default is ON.
+ Boost_USE_STATIC_LIBS - Set to ON to force the use of the static
+ libraries. Default is OFF.
+ Boost_USE_STATIC_RUNTIME - Set to ON or OFF to specify whether to use
+ libraries linked statically to the C++ runtime
+ ('s' tag). Default is platform dependent.
+ Boost_USE_DEBUG_RUNTIME - Set to ON or OFF to specify whether to use
+ libraries linked to the MS debug C++ runtime
+ ('g' tag). Default is ON.
+ Boost_USE_DEBUG_PYTHON - Set to ON to use libraries compiled with a
+ debug Python build ('y' tag). Default is OFF.
+ Boost_USE_STLPORT - Set to ON to use libraries compiled with
+ STLPort ('p' tag). Default is OFF.
+ Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS
+ - Set to ON to use libraries compiled with
+ STLPort deprecated "native iostreams"
+ ('n' tag). Default is OFF.
+ Boost_COMPILER - Set to the compiler-specific library suffix
+ (e.g. "-gcc43"). Default is auto-computed
+ for the C++ compiler in use. A list may be
+ used if multiple compatible suffixes should
+ be tested for, in decreasing order of
+ preference.
+ Boost_ARCHITECTURE - Set to the architecture-specific library suffix
+ (e.g. "-x64"). Default is auto-computed for the
+ C++ compiler in use.
+ Boost_THREADAPI - Suffix for "thread" component library name,
+ such as "pthread" or "win32". Names with
+ and without this suffix will both be tried.
+ Boost_NAMESPACE - Alternate namespace used to build boost with
+ e.g. if set to "myboost", will search for
+ myboost_thread instead of boost_thread.
+
+Other variables one may set to control this module are::
+
+ Boost_DEBUG - Set to ON to enable debug output from FindBoost.
+ Please enable this before filing any bug report.
+ Boost_DETAILED_FAILURE_MSG
+ - Set to ON to add detailed information to the
+ failure message even when the REQUIRED option
+ is not given to the find_package call.
+ Boost_REALPATH - Set to ON to resolve symlinks for discovered
+ libraries to assist with packaging. For example,
+ the "system" component library may be resolved to
+ "/usr/lib/libboost_system.so.1.67.0" instead of
+ "/usr/lib/libboost_system.so". This does not
+ affect linking and should not be enabled unless
+ the user needs this information.
+ Boost_LIBRARY_DIR - Default value for Boost_LIBRARY_DIR_RELEASE and
+ Boost_LIBRARY_DIR_DEBUG.
+
+On Visual Studio and Borland compilers Boost headers request automatic
+linking to corresponding libraries. This requires matching libraries
+to be linked explicitly or available in the link library search path.
+In this case setting Boost_USE_STATIC_LIBS to OFF may not achieve
+dynamic linking. Boost automatic linking typically requests static
+libraries with a few exceptions (such as Boost.Python). Use::
+
+ add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
+
+to ask Boost to report information about automatic linking requests.
+
+Example to find Boost headers only::
+
+ find_package(Boost 1.36.0)
+ if(Boost_FOUND)
+ include_directories(${Boost_INCLUDE_DIRS})
+ add_executable(foo foo.cc)
+ endif()
+
+Example to find Boost libraries and use imported targets::
+
+ find_package(Boost 1.56 REQUIRED COMPONENTS
+ date_time filesystem iostreams)
+ add_executable(foo foo.cc)
+ target_link_libraries(foo Boost::date_time Boost::filesystem
+ Boost::iostreams)
+
+Example to find Boost Python 3.6 libraries and use imported targets::
+
+ find_package(Boost 1.67 REQUIRED COMPONENTS
+ python36 numpy36)
+ add_executable(foo foo.cc)
+ target_link_libraries(foo Boost::python36 Boost::numpy36)
+
+Example to find Boost headers and some *static* (release only) libraries::
+
+ set(Boost_USE_STATIC_LIBS ON) # only find static libs
+ set(Boost_USE_DEBUG_LIBS OFF) # ignore debug libs and
+ set(Boost_USE_RELEASE_LIBS ON) # only find release libs
+ set(Boost_USE_MULTITHREADED ON)
+ set(Boost_USE_STATIC_RUNTIME OFF)
+ find_package(Boost 1.66.0 COMPONENTS date_time filesystem system ...)
+ if(Boost_FOUND)
+ include_directories(${Boost_INCLUDE_DIRS})
+ add_executable(foo foo.cc)
+ target_link_libraries(foo ${Boost_LIBRARIES})
+ endif()
+
+Boost CMake
+^^^^^^^^^^^
+
+If Boost was built using the boost-cmake project it provides a package
+configuration file for use with find_package's Config mode. This
+module looks for the package configuration file called
+BoostConfig.cmake or boost-config.cmake and stores the result in cache
+entry "Boost_DIR". If found, the package configuration file is loaded
+and this module returns with no further action. See documentation of
+the Boost CMake package configuration for details on what it provides.
+
+Set Boost_NO_BOOST_CMAKE to ON to disable the search for boost-cmake.
+#]=======================================================================]
# Save project's policies
cmake_policy(PUSH)
@@ -860,8 +862,22 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_TIMER_DEPENDENCIES chrono system)
set(_Boost_WAVE_DEPENDENCIES filesystem system serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
+ elseif(NOT Boost_VERSION VERSION_LESS 106900 AND Boost_VERSION VERSION_LESS 107000)
+ set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
+ set(_Boost_COROUTINE_DEPENDENCIES context)
+ set(_Boost_FIBER_DEPENDENCIES context)
+ set(_Boost_IOSTREAMS_DEPENDENCIES regex)
+ set(_Boost_LOG_DEPENDENCIES date_time log_setup filesystem thread regex chrono atomic)
+ set(_Boost_MATH_DEPENDENCIES math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l atomic)
+ set(_Boost_MPI_DEPENDENCIES serialization)
+ set(_Boost_MPI_PYTHON_DEPENDENCIES python${component_python_version} mpi serialization)
+ set(_Boost_NUMPY_DEPENDENCIES python${component_python_version})
+ set(_Boost_THREAD_DEPENDENCIES chrono date_time atomic)
+ set(_Boost_TIMER_DEPENDENCIES chrono system)
+ set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
+ set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
else()
- if(NOT Boost_VERSION VERSION_LESS 106900)
+ if(NOT Boost_VERSION VERSION_LESS 107000)
set(_Boost_CONTRACT_DEPENDENCIES thread chrono date_time)
set(_Boost_COROUTINE_DEPENDENCIES context)
set(_Boost_FIBER_DEPENDENCIES context)
@@ -876,7 +892,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret)
set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono date_time atomic)
set(_Boost_WSERIALIZATION_DEPENDENCIES serialization)
endif()
- if(NOT Boost_VERSION VERSION_LESS 107000)
+ if(NOT Boost_VERSION VERSION_LESS 107100)
message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets")
endif()
endif()
@@ -1124,7 +1140,7 @@ else()
# _Boost_COMPONENT_HEADERS. See the instructions at the top of
# _Boost_COMPONENT_DEPENDENCIES.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
- "1.69.0" "1.69"
+ "1.70.0" "1.70" "1.69.0" "1.69"
"1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65"
"1.64.0" "1.64" "1.63.0" "1.63" "1.62.0" "1.62" "1.61.0" "1.61" "1.60.0" "1.60"
"1.59.0" "1.59" "1.58.0" "1.58" "1.57.0" "1.57" "1.56.0" "1.56" "1.55.0" "1.55"
@@ -1282,7 +1298,7 @@ if(NOT Boost_INCLUDE_DIR)
list(APPEND _boost_INCLUDE_SEARCH_DIRS NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
else()
if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
- foreach(ver ${_Boost_KNOWN_VERSIONS})
+ foreach(ver ${_boost_TEST_VERSIONS})
string(REPLACE "." "_" ver "${ver}")
list(APPEND _boost_INCLUDE_SEARCH_DIRS PATHS "C:/local/boost_${ver}")
endforeach()
@@ -1367,6 +1383,7 @@ if(Boost_INCLUDE_DIR)
math(EXPR Boost_MAJOR_VERSION "${Boost_VERSION} / 100000")
math(EXPR Boost_MINOR_VERSION "${Boost_VERSION} / 100 % 1000")
math(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")
+ set(Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
string(APPEND Boost_ERROR_REASON
"Boost version: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}\nBoost include path: ${Boost_INCLUDE_DIR}")
@@ -1426,6 +1443,13 @@ if ( NOT Boost_NAMESPACE )
set(Boost_NAMESPACE "boost")
endif()
+if(Boost_DEBUG)
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Boost_LIB_PREFIX = ${Boost_LIB_PREFIX}")
+ message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
+ "Boost_NAMESPACE = ${Boost_NAMESPACE}")
+endif()
+
# ------------------------------------------------------------------------
# Suffix initialization and compiler suffix detection.
# ------------------------------------------------------------------------
@@ -1601,7 +1625,7 @@ foreach(c DEBUG RELEASE)
if( Boost_NO_SYSTEM_PATHS )
list(APPEND _boost_LIBRARY_SEARCH_DIRS_${c} NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
else()
- foreach(ver ${_Boost_KNOWN_VERSIONS})
+ foreach(ver ${_boost_TEST_VERSIONS})
string(REPLACE "." "_" ver "${ver}")
_Boost_UPDATE_WINDOWS_LIBRARY_SEARCH_DIRS_WITH_PREBUILT_PATHS(_boost_LIBRARY_SEARCH_DIRS_${c} "C:/local/boost_${ver}")
endforeach()
@@ -1783,10 +1807,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} )
endforeach()
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
@@ -1795,10 +1821,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
endforeach()
list(APPEND _boost_RELEASE_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} )
endif()
endforeach()
@@ -1836,10 +1864,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} )
endforeach()
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component} )
@@ -1848,10 +1878,12 @@ foreach(COMPONENT ${Boost_FIND_COMPONENTS})
foreach(compiler IN LISTS _boost_COMPILER)
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${compiler}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
endforeach()
list(APPEND _boost_DEBUG_NAMES
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}-${Boost_LIB_VERSION}
+ ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}${_boost_ARCHITECTURE_TAG}
${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${component}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} )
endif()
endforeach()
diff --git a/Modules/FindBullet.cmake b/Modules/FindBullet.cmake
index fc6695c35..a3c9fc6d1 100644
--- a/Modules/FindBullet.cmake
+++ b/Modules/FindBullet.cmake
@@ -1,39 +1,40 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindBullet
-# ----------
-#
-# Try to find the Bullet physics engine
-#
-#
-#
-# ::
-#
-# This module defines the following variables
-#
-#
-#
-# ::
-#
-# BULLET_FOUND - Was bullet found
-# BULLET_INCLUDE_DIRS - the Bullet include directories
-# BULLET_LIBRARIES - Link to this, by default it includes
-# all bullet components (Dynamics,
-# Collision, LinearMath, & SoftBody)
-#
-#
-#
-# ::
-#
-# This module accepts the following variables
-#
-#
-#
-# ::
-#
-# BULLET_ROOT - Can be set to bullet install path or Windows build path
+#[=======================================================================[.rst:
+FindBullet
+----------
+
+Try to find the Bullet physics engine
+
+
+
+::
+
+ This module defines the following variables
+
+
+
+::
+
+ BULLET_FOUND - Was bullet found
+ BULLET_INCLUDE_DIRS - the Bullet include directories
+ BULLET_LIBRARIES - Link to this, by default it includes
+ all bullet components (Dynamics,
+ Collision, LinearMath, & SoftBody)
+
+
+
+::
+
+ This module accepts the following variables
+
+
+
+::
+
+ BULLET_ROOT - Can be set to bullet install path or Windows build path
+#]=======================================================================]
macro(_FIND_BULLET_LIBRARY _var)
find_library(${_var}
diff --git a/Modules/FindCABLE.cmake b/Modules/FindCABLE.cmake
index 450e32237..1f4ae7633 100644
--- a/Modules/FindCABLE.cmake
+++ b/Modules/FindCABLE.cmake
@@ -1,27 +1,28 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCABLE
-# ---------
-#
-# Find CABLE
-#
-# This module finds if CABLE is installed and determines where the
-# include files and libraries are. This code sets the following
-# variables:
-#
-# ::
-#
-# CABLE the path to the cable executable
-# CABLE_TCL_LIBRARY the path to the Tcl wrapper library
-# CABLE_INCLUDE_DIR the path to the include directory
-#
-#
-#
-# To build Tcl wrappers, you should add shared library and link it to
-# ${CABLE_TCL_LIBRARY}. You should also add ${CABLE_INCLUDE_DIR} as an
-# include directory.
+#[=======================================================================[.rst:
+FindCABLE
+---------
+
+Find CABLE
+
+This module finds if CABLE is installed and determines where the
+include files and libraries are. This code sets the following
+variables:
+
+::
+
+ CABLE the path to the cable executable
+ CABLE_TCL_LIBRARY the path to the Tcl wrapper library
+ CABLE_INCLUDE_DIR the path to the include directory
+
+
+
+To build Tcl wrappers, you should add shared library and link it to
+${CABLE_TCL_LIBRARY}. You should also add ${CABLE_INCLUDE_DIR} as an
+include directory.
+#]=======================================================================]
if(NOT CABLE)
find_path(CABLE_BUILD_DIR cableVersion.h)
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 3527979e7..228eed4f7 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1,378 +1,382 @@
-#.rst:
-# FindCUDA
-# --------
-#
-# .. note::
-#
-# The FindCUDA module has been superseded by first-class support
-# for the CUDA language in CMake. It is no longer necessary to
-# use this module or call ``find_package(CUDA)``. This module
-# now exists only for compatibility with projects that have not
-# been ported.
-#
-# Instead, list ``CUDA`` among the languages named in the top-level
-# call to the :command:`project` command, or call the
-# :command:`enable_language` command with ``CUDA``.
-# Then one can add CUDA (``.cu``) sources to programs directly
-# in calls to :command:`add_library` and :command:`add_executable`.
-#
-# Tools for building CUDA C files: libraries and build dependencies.
-#
-# This script locates the NVIDIA CUDA C tools. It should work on Linux,
-# Windows, and macOS and should be reasonably up to date with CUDA C
-# releases.
-#
-# This script makes use of the standard :command:`find_package` arguments of
-# ``<VERSION>``, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an
-# acceptable version of CUDA was found.
-#
-# The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if
-# the prefix cannot be determined by the location of nvcc in the system
-# path and ``REQUIRED`` is specified to :command:`find_package`. To use
-# a different installed version of the toolkit set the environment variable
-# ``CUDA_BIN_PATH`` before running cmake (e.g.
-# ``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default
-# ``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If
-# you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that
-# depend on the path will be relocated.
-#
-# It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain
-# platforms, or to use a CUDA runtime not installed in the default
-# location. In newer versions of the toolkit the CUDA library is
-# included with the graphics driver -- be sure that the driver version
-# matches what is needed by the CUDA runtime version.
-#
-# The following variables affect the behavior of the macros in the
-# script (in alphabetical order). Note that any of these flags can be
-# changed multiple times in the same directory before calling
-# ``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``,
-# ``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN``
-# or ``CUDA_WRAP_SRCS``::
-#
-# CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
-# -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
-# Note that making this different from the host code when generating object
-# or C files from CUDA code just won't work, because size_t gets defined by
-# nvcc in the generated source. If you compile to PTX and then load the
-# file yourself, you can mix bit sizes between device and host.
-#
-# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
-# -- Set to ON if you want the custom build rule to be attached to the source
-# file in Visual Studio. Turn OFF if you add the same cuda file to multiple
-# targets.
-#
-# This allows the user to build the target from the CUDA file; however, bad
-# things can happen if the CUDA source file is added to multiple targets.
-# When performing parallel builds it is possible for the custom build
-# command to be run more than once and in parallel causing cryptic build
-# errors. VS runs the rules for every source file in the target, and a
-# source can have only one rule no matter how many projects it is added to.
-# When the rule is run from multiple targets race conditions can occur on
-# the generated file. Eventually everything will get built, but if the user
-# is unaware of this behavior, there may be confusion. It would be nice if
-# this script could detect the reuse of source files across multiple targets
-# and turn the option off for the user, but no good solution could be found.
-#
-# CUDA_BUILD_CUBIN (Default OFF)
-# -- Set to ON to enable and extra compilation pass with the -cubin option in
-# Device mode. The output is parsed and register, shared memory usage is
-# printed during build.
-#
-# CUDA_BUILD_EMULATION (Default OFF for device mode)
-# -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
-# when CUDA_BUILD_EMULATION is TRUE.
-#
-# CUDA_LINK_LIBRARIES_KEYWORD (Default "")
-# -- The <PRIVATE|PUBLIC|INTERFACE> keyword to use for internal
-# target_link_libraries calls. The default is to use no keyword which
-# uses the old "plain" form of target_link_libraries. Note that is matters
-# because whatever is used inside the FindCUDA module must also be used
-# outside - the two forms of target_link_libraries cannot be mixed.
-#
-# CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
-# -- Set to the path you wish to have the generated files placed. If it is
-# blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
-# Intermediate files will always be placed in
-# CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
-#
-# CUDA_HOST_COMPILATION_CPP (Default ON)
-# -- Set to OFF for C compilation of host code.
-#
-# CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER)
-# -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
-# --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
-# CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets,
-# the host compiler is constructed with one or more visual studio macros
-# such as $(VCInstallDir), that expands out to the path when
-# the command is run from within VS.
-# If the CUDAHOSTCXX environment variable is set it will
-# be used as the default.
-#
-# CUDA_NVCC_FLAGS
-# CUDA_NVCC_FLAGS_<CONFIG>
-# -- Additional NVCC command line arguments. NOTE: multiple arguments must be
-# semi-colon delimited (e.g. --compiler-options;-Wall)
-#
-# CUDA_PROPAGATE_HOST_FLAGS (Default ON)
-# -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
-# dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
-# host compiler through nvcc's -Xcompiler flag. This helps make the
-# generated host code match the rest of the system better. Sometimes
-# certain flags give nvcc problems, and this will help you turn the flag
-# propagation off. This does not affect the flags supplied directly to nvcc
-# via CUDA_NVCC_FLAGS or through the OPTION flags specified through
-# CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
-# shared library compilation are not affected by this flag.
-#
-# CUDA_SEPARABLE_COMPILATION (Default OFF)
-# -- If set this will enable separable compilation for all CUDA runtime object
-# files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
-# (e.g. calling CUDA_WRAP_SRCS directly),
-# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
-# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
-#
-# CUDA_SOURCE_PROPERTY_FORMAT
-# -- If this source file property is set, it can override the format specified
-# to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file
-# is not a .cu file, setting this file will cause it to be treated as a .cu
-# file. See documentation for set_source_files_properties on how to set
-# this property.
-#
-# CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
-# -- When enabled the static version of the CUDA runtime library will be used
-# in CUDA_LIBRARIES. If the version of CUDA configured doesn't support
-# this option, then it will be silently disabled.
-#
-# CUDA_VERBOSE_BUILD (Default OFF)
-# -- Set to ON to see all the commands used when building the CUDA file. When
-# using a Makefile generator the value defaults to VERBOSE (run make
-# VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
-# always print the output.
-#
-# The script creates the following macros (in alphabetical order)::
-#
-# CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
-# -- Adds the cufft library to the target (can be any target). Handles whether
-# you are in emulation mode or not.
-#
-# CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
-# -- Adds the cublas library to the target (can be any target). Handles
-# whether you are in emulation mode or not.
-#
-# CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
-# [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
-# -- Creates an executable "cuda_target" which is made up of the files
-# specified. All of the non CUDA C files are compiled using the standard
-# build rules specified by CMAKE and the cuda files are compiled to object
-# files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
-# added automatically to include_directories(). Some standard CMake target
-# calls can be used on the target after calling this macro
-# (e.g. set_target_properties and target_link_libraries), but setting
-# properties that adjust compilation flags will not affect code compiled by
-# nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
-# CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
-#
-# CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
-# [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
-# -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
-#
-# CUDA_BUILD_CLEAN_TARGET()
-# -- Creates a convenience target that deletes all the dependency files
-# generated. You should make clean after running this target to ensure the
-# dependency files get regenerated.
-#
-# CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
-# [OPTIONS ...] )
-# -- Returns a list of generated files from the input source files to be used
-# with ADD_LIBRARY or ADD_EXECUTABLE.
-#
-# CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
-# -- Returns a list of PTX files generated from the input source files.
-#
-# CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
-# -- Returns a list of FATBIN files generated from the input source files.
-#
-# CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
-# -- Returns a list of CUBIN files generated from the input source files.
-#
-# CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
-# cuda_target
-# object_files )
-# -- Compute the name of the intermediate link file used for separable
-# compilation. This file name is typically passed into
-# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced
-# based on cuda_target the list of objects files that need separable
-# compilation as specified by object_files. If the object_files list is
-# empty, then output_file_var will be empty. This function is called
-# automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
-# this is a function and not a macro.
-#
-# CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
-# -- Sets the directories that should be passed to nvcc
-# (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
-# files.
-#
-#
-# CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
-# nvcc_flags object_files)
-# -- Generates the link object required by separable compilation from the given
-# object files. This is called automatically for CUDA_ADD_EXECUTABLE and
-# CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
-# directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
-# nvcc_flags passed in are the same as the flags passed in via the OPTIONS
-# argument. The only nvcc flag added automatically is the bitness flag as
-# specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
-# instead of a macro.
-#
-# CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures])
-# -- Selects GPU arch flags for nvcc based on target_CUDA_architectures
-# target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...)
-# - "Auto" detects local machine GPU compute arch at runtime.
-# - "Common" and "All" cover common and entire subsets of architectures
-# ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
-# NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal
-# NUM: Any number. Only those pairs are currently accepted by NVCC though:
-# 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2
-# Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
-# Additionally, sets ${out_variable}_readable to the resulting numeric list
-# Example:
-# CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell)
-# LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
-#
-# More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA
-# Note that this is a function instead of a macro.
-#
-# CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
-# [STATIC | SHARED | MODULE] [OPTIONS ...] )
-# -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
-# CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
-# function under the hood.
-#
-# Given the list of files (file0 file1 ... fileN) this macro generates
-# custom commands that generate either PTX or linkable objects (use "PTX" or
-# "OBJ" for the format argument to switch). Files that don't end with .cu
-# or have the HEADER_FILE_ONLY property are ignored.
-#
-# The arguments passed in after OPTIONS are extra command line options to
-# give to nvcc. You can also specify per configuration options by
-# specifying the name of the configuration followed by the options. General
-# options must precede configuration specific options. Not all
-# configurations need to be specified, only the ones provided will be used.
-#
-# OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
-# DEBUG -g
-# RELEASE --use_fast_math
-# RELWITHDEBINFO --use_fast_math;-g
-# MINSIZEREL --use_fast_math
-#
-# For certain configurations (namely VS generating object files with
-# CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
-# be produced for the given cuda file. This is because when you add the
-# cuda file to Visual Studio it knows that this file produces an object file
-# and will link in the resulting object file automatically.
-#
-# This script will also generate a separate cmake script that is used at
-# build time to invoke nvcc. This is for several reasons.
-#
-# 1. nvcc can return negative numbers as return values which confuses
-# Visual Studio into thinking that the command succeeded. The script now
-# checks the error codes and produces errors when there was a problem.
-#
-# 2. nvcc has been known to not delete incomplete results when it
-# encounters problems. This confuses build systems into thinking the
-# target was generated when in fact an unusable file exists. The script
-# now deletes the output files if there was an error.
-#
-# 3. By putting all the options that affect the build into a file and then
-# make the build rule dependent on the file, the output files will be
-# regenerated when the options change.
-#
-# This script also looks at optional arguments STATIC, SHARED, or MODULE to
-# determine when to target the object compilation for a shared library.
-# BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
-# CUDA_ADD_LIBRARY. On some systems special flags are added for building
-# objects intended for shared libraries. A preprocessor macro,
-# <target_name>_EXPORTS is defined when a shared library compilation is
-# detected.
-#
-# Flags passed into add_definitions with -D or /D are passed along to nvcc.
-#
-#
-#
-# The script defines the following variables::
-#
-# CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
-# CUDA_VERSION_MINOR -- The minor version.
-# CUDA_VERSION
-# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
-# CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported.
-#
-# CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
-# CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
-# SDK. This script will not directly support finding
-# specific libraries or headers, as that isn't
-# supported by NVIDIA. If you want to change
-# libraries when the path changes see the
-# FindCUDA.cmake script for an example of how to clear
-# these variables. There are also examples of how to
-# use the CUDA_SDK_ROOT_DIR to locate headers or
-# libraries, if you so choose (at your own risk).
-# CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically
-# for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
-# CUDA_LIBRARIES -- Cuda RT library.
-# CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT
-# implementation (alternative to:
-# CUDA_ADD_CUFFT_TO_TARGET macro)
-# CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
-# implementation (alternative to:
-# CUDA_ADD_CUBLAS_TO_TARGET macro).
-# CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library.
-# Only available for CUDA version 5.5+
-# CUDA_cudadevrt_LIBRARY -- Device runtime library.
-# Required for separable compilation.
-# CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library.
-# Only available for CUDA version 4.0+.
-# CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
-# Only available for CUDA version 3.2+.
-# CUDA_cusolver_LIBRARY -- CUDA Direct Solver library.
-# Only available for CUDA version 7.0+.
-# CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
-# Only available for CUDA version 3.2+.
-# CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib.
-# Only available for CUDA version 4.0+.
-# CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
-# Only available for CUDA version 5.5+.
-# CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 5.5 - 8.0.
-# CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
-# Only available for CUDA version 9.0.
-# CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing).
-# Only available for CUDA version 5.5+.
-# CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
-# Only available for CUDA version 3.2+.
-# Windows only.
-# CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
-# Only available for CUDA version 3.2+.
-# Windows only.
-#
+#[=======================================================================[.rst:
+FindCUDA
+--------
+
+.. deprecated:: 3.10
+
+ Superseded by first-class support for the CUDA language in CMake.
+
+Replacement
+^^^^^^^^^^^
+
+It is no longer necessary to use this module or call ``find_package(CUDA)``.
+Instead, list ``CUDA`` among the languages named in the top-level
+call to the :command:`project` command, or call the
+:command:`enable_language` command with ``CUDA``.
+Then one can add CUDA (``.cu``) sources to programs directly
+in calls to :command:`add_library` and :command:`add_executable`.
+
+Documentation of Deprecated Usage
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Tools for building CUDA C files: libraries and build dependencies.
+
+This script locates the NVIDIA CUDA C tools. It should work on Linux,
+Windows, and macOS and should be reasonably up to date with CUDA C
+releases.
+
+This script makes use of the standard :command:`find_package` arguments of
+``<VERSION>``, ``REQUIRED`` and ``QUIET``. ``CUDA_FOUND`` will report if an
+acceptable version of CUDA was found.
+
+The script will prompt the user to specify ``CUDA_TOOLKIT_ROOT_DIR`` if
+the prefix cannot be determined by the location of nvcc in the system
+path and ``REQUIRED`` is specified to :command:`find_package`. To use
+a different installed version of the toolkit set the environment variable
+``CUDA_BIN_PATH`` before running cmake (e.g.
+``CUDA_BIN_PATH=/usr/local/cuda1.0`` instead of the default
+``/usr/local/cuda``) or set ``CUDA_TOOLKIT_ROOT_DIR`` after configuring. If
+you change the value of ``CUDA_TOOLKIT_ROOT_DIR``, various components that
+depend on the path will be relocated.
+
+It might be necessary to set ``CUDA_TOOLKIT_ROOT_DIR`` manually on certain
+platforms, or to use a CUDA runtime not installed in the default
+location. In newer versions of the toolkit the CUDA library is
+included with the graphics driver -- be sure that the driver version
+matches what is needed by the CUDA runtime version.
+
+The following variables affect the behavior of the macros in the
+script (in alphabetical order). Note that any of these flags can be
+changed multiple times in the same directory before calling
+``CUDA_ADD_EXECUTABLE``, ``CUDA_ADD_LIBRARY``, ``CUDA_COMPILE``,
+``CUDA_COMPILE_PTX``, ``CUDA_COMPILE_FATBIN``, ``CUDA_COMPILE_CUBIN``
+or ``CUDA_WRAP_SRCS``::
+
+ CUDA_64_BIT_DEVICE_CODE (Default matches host bit size)
+ -- Set to ON to compile for 64 bit device code, OFF for 32 bit device code.
+ Note that making this different from the host code when generating object
+ or C files from CUDA code just won't work, because size_t gets defined by
+ nvcc in the generated source. If you compile to PTX and then load the
+ file yourself, you can mix bit sizes between device and host.
+
+ CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)
+ -- Set to ON if you want the custom build rule to be attached to the source
+ file in Visual Studio. Turn OFF if you add the same cuda file to multiple
+ targets.
+
+ This allows the user to build the target from the CUDA file; however, bad
+ things can happen if the CUDA source file is added to multiple targets.
+ When performing parallel builds it is possible for the custom build
+ command to be run more than once and in parallel causing cryptic build
+ errors. VS runs the rules for every source file in the target, and a
+ source can have only one rule no matter how many projects it is added to.
+ When the rule is run from multiple targets race conditions can occur on
+ the generated file. Eventually everything will get built, but if the user
+ is unaware of this behavior, there may be confusion. It would be nice if
+ this script could detect the reuse of source files across multiple targets
+ and turn the option off for the user, but no good solution could be found.
+
+ CUDA_BUILD_CUBIN (Default OFF)
+ -- Set to ON to enable and extra compilation pass with the -cubin option in
+ Device mode. The output is parsed and register, shared memory usage is
+ printed during build.
+
+ CUDA_BUILD_EMULATION (Default OFF for device mode)
+ -- Set to ON for Emulation mode. -D_DEVICEEMU is defined for CUDA C files
+ when CUDA_BUILD_EMULATION is TRUE.
+
+ CUDA_LINK_LIBRARIES_KEYWORD (Default "")
+ -- The <PRIVATE|PUBLIC|INTERFACE> keyword to use for internal
+ target_link_libraries calls. The default is to use no keyword which
+ uses the old "plain" form of target_link_libraries. Note that is matters
+ because whatever is used inside the FindCUDA module must also be used
+ outside - the two forms of target_link_libraries cannot be mixed.
+
+ CUDA_GENERATED_OUTPUT_DIR (Default CMAKE_CURRENT_BINARY_DIR)
+ -- Set to the path you wish to have the generated files placed. If it is
+ blank output files will be placed in CMAKE_CURRENT_BINARY_DIR.
+ Intermediate files will always be placed in
+ CMAKE_CURRENT_BINARY_DIR/CMakeFiles.
+
+ CUDA_HOST_COMPILATION_CPP (Default ON)
+ -- Set to OFF for C compilation of host code.
+
+ CUDA_HOST_COMPILER (Default CMAKE_C_COMPILER)
+ -- Set the host compiler to be used by nvcc. Ignored if -ccbin or
+ --compiler-bindir is already present in the CUDA_NVCC_FLAGS or
+ CUDA_NVCC_FLAGS_<CONFIG> variables. For Visual Studio targets,
+ the host compiler is constructed with one or more visual studio macros
+ such as $(VCInstallDir), that expands out to the path when
+ the command is run from within VS.
+ If the CUDAHOSTCXX environment variable is set it will
+ be used as the default.
+
+ CUDA_NVCC_FLAGS
+ CUDA_NVCC_FLAGS_<CONFIG>
+ -- Additional NVCC command line arguments. NOTE: multiple arguments must be
+ semi-colon delimited (e.g. --compiler-options;-Wall)
+
+ CUDA_PROPAGATE_HOST_FLAGS (Default ON)
+ -- Set to ON to propagate CMAKE_{C,CXX}_FLAGS and their configuration
+ dependent counterparts (e.g. CMAKE_C_FLAGS_DEBUG) automatically to the
+ host compiler through nvcc's -Xcompiler flag. This helps make the
+ generated host code match the rest of the system better. Sometimes
+ certain flags give nvcc problems, and this will help you turn the flag
+ propagation off. This does not affect the flags supplied directly to nvcc
+ via CUDA_NVCC_FLAGS or through the OPTION flags specified through
+ CUDA_ADD_LIBRARY, CUDA_ADD_EXECUTABLE, or CUDA_WRAP_SRCS. Flags used for
+ shared library compilation are not affected by this flag.
+
+ CUDA_SEPARABLE_COMPILATION (Default OFF)
+ -- If set this will enable separable compilation for all CUDA runtime object
+ files. If used outside of CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY
+ (e.g. calling CUDA_WRAP_SRCS directly),
+ CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME and
+ CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS should be called.
+
+ CUDA_SOURCE_PROPERTY_FORMAT
+ -- If this source file property is set, it can override the format specified
+ to CUDA_WRAP_SRCS (OBJ, PTX, CUBIN, or FATBIN). If an input source file
+ is not a .cu file, setting this file will cause it to be treated as a .cu
+ file. See documentation for set_source_files_properties on how to set
+ this property.
+
+ CUDA_USE_STATIC_CUDA_RUNTIME (Default ON)
+ -- When enabled the static version of the CUDA runtime library will be used
+ in CUDA_LIBRARIES. If the version of CUDA configured doesn't support
+ this option, then it will be silently disabled.
+
+ CUDA_VERBOSE_BUILD (Default OFF)
+ -- Set to ON to see all the commands used when building the CUDA file. When
+ using a Makefile generator the value defaults to VERBOSE (run make
+ VERBOSE=1 to see output), although setting CUDA_VERBOSE_BUILD to ON will
+ always print the output.
+
+The script creates the following macros (in alphabetical order)::
+
+ CUDA_ADD_CUFFT_TO_TARGET( cuda_target )
+ -- Adds the cufft library to the target (can be any target). Handles whether
+ you are in emulation mode or not.
+
+ CUDA_ADD_CUBLAS_TO_TARGET( cuda_target )
+ -- Adds the cublas library to the target (can be any target). Handles
+ whether you are in emulation mode or not.
+
+ CUDA_ADD_EXECUTABLE( cuda_target file0 file1 ...
+ [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
+ -- Creates an executable "cuda_target" which is made up of the files
+ specified. All of the non CUDA C files are compiled using the standard
+ build rules specified by CMAKE and the cuda files are compiled to object
+ files using nvcc and the host compiler. In addition CUDA_INCLUDE_DIRS is
+ added automatically to include_directories(). Some standard CMake target
+ calls can be used on the target after calling this macro
+ (e.g. set_target_properties and target_link_libraries), but setting
+ properties that adjust compilation flags will not affect code compiled by
+ nvcc. Such flags should be modified before calling CUDA_ADD_EXECUTABLE,
+ CUDA_ADD_LIBRARY or CUDA_WRAP_SRCS.
+
+ CUDA_ADD_LIBRARY( cuda_target file0 file1 ...
+ [STATIC | SHARED | MODULE] [EXCLUDE_FROM_ALL] [OPTIONS ...] )
+ -- Same as CUDA_ADD_EXECUTABLE except that a library is created.
+
+ CUDA_BUILD_CLEAN_TARGET()
+ -- Creates a convenience target that deletes all the dependency files
+ generated. You should make clean after running this target to ensure the
+ dependency files get regenerated.
+
+ CUDA_COMPILE( generated_files file0 file1 ... [STATIC | SHARED | MODULE]
+ [OPTIONS ...] )
+ -- Returns a list of generated files from the input source files to be used
+ with ADD_LIBRARY or ADD_EXECUTABLE.
+
+ CUDA_COMPILE_PTX( generated_files file0 file1 ... [OPTIONS ...] )
+ -- Returns a list of PTX files generated from the input source files.
+
+ CUDA_COMPILE_FATBIN( generated_files file0 file1 ... [OPTIONS ...] )
+ -- Returns a list of FATBIN files generated from the input source files.
+
+ CUDA_COMPILE_CUBIN( generated_files file0 file1 ... [OPTIONS ...] )
+ -- Returns a list of CUBIN files generated from the input source files.
+
+ CUDA_COMPUTE_SEPARABLE_COMPILATION_OBJECT_FILE_NAME( output_file_var
+ cuda_target
+ object_files )
+ -- Compute the name of the intermediate link file used for separable
+ compilation. This file name is typically passed into
+ CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS. output_file_var is produced
+ based on cuda_target the list of objects files that need separable
+ compilation as specified by object_files. If the object_files list is
+ empty, then output_file_var will be empty. This function is called
+ automatically for CUDA_ADD_LIBRARY and CUDA_ADD_EXECUTABLE. Note that
+ this is a function and not a macro.
+
+ CUDA_INCLUDE_DIRECTORIES( path0 path1 ... )
+ -- Sets the directories that should be passed to nvcc
+ (e.g. nvcc -Ipath0 -Ipath1 ... ). These paths usually contain other .cu
+ files.
+
+
+ CUDA_LINK_SEPARABLE_COMPILATION_OBJECTS( output_file_var cuda_target
+ nvcc_flags object_files)
+ -- Generates the link object required by separable compilation from the given
+ object files. This is called automatically for CUDA_ADD_EXECUTABLE and
+ CUDA_ADD_LIBRARY, but can be called manually when using CUDA_WRAP_SRCS
+ directly. When called from CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE the
+ nvcc_flags passed in are the same as the flags passed in via the OPTIONS
+ argument. The only nvcc flag added automatically is the bitness flag as
+ specified by CUDA_64_BIT_DEVICE_CODE. Note that this is a function
+ instead of a macro.
+
+ CUDA_SELECT_NVCC_ARCH_FLAGS(out_variable [target_CUDA_architectures])
+ -- Selects GPU arch flags for nvcc based on target_CUDA_architectures
+ target_CUDA_architectures : Auto | Common | All | LIST(ARCH_AND_PTX ...)
+ - "Auto" detects local machine GPU compute arch at runtime.
+ - "Common" and "All" cover common and entire subsets of architectures
+ ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
+ NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal
+ NUM: Any number. Only those pairs are currently accepted by NVCC though:
+ 2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2
+ Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
+ Additionally, sets ${out_variable}_readable to the resulting numeric list
+ Example:
+ CUDA_SELECT_NVCC_ARCH_FLAGS(ARCH_FLAGS 3.0 3.5+PTX 5.2(5.0) Maxwell)
+ LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
+
+ More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA
+ Note that this is a function instead of a macro.
+
+ CUDA_WRAP_SRCS ( cuda_target format generated_files file0 file1 ...
+ [STATIC | SHARED | MODULE] [OPTIONS ...] )
+ -- This is where all the magic happens. CUDA_ADD_EXECUTABLE,
+ CUDA_ADD_LIBRARY, CUDA_COMPILE, and CUDA_COMPILE_PTX all call this
+ function under the hood.
+
+ Given the list of files (file0 file1 ... fileN) this macro generates
+ custom commands that generate either PTX or linkable objects (use "PTX" or
+ "OBJ" for the format argument to switch). Files that don't end with .cu
+ or have the HEADER_FILE_ONLY property are ignored.
+
+ The arguments passed in after OPTIONS are extra command line options to
+ give to nvcc. You can also specify per configuration options by
+ specifying the name of the configuration followed by the options. General
+ options must precede configuration specific options. Not all
+ configurations need to be specified, only the ones provided will be used.
+
+ OPTIONS -DFLAG=2 "-DFLAG_OTHER=space in flag"
+ DEBUG -g
+ RELEASE --use_fast_math
+ RELWITHDEBINFO --use_fast_math;-g
+ MINSIZEREL --use_fast_math
+
+ For certain configurations (namely VS generating object files with
+ CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE set to ON), no generated file will
+ be produced for the given cuda file. This is because when you add the
+ cuda file to Visual Studio it knows that this file produces an object file
+ and will link in the resulting object file automatically.
+
+ This script will also generate a separate cmake script that is used at
+ build time to invoke nvcc. This is for several reasons.
+
+ 1. nvcc can return negative numbers as return values which confuses
+ Visual Studio into thinking that the command succeeded. The script now
+ checks the error codes and produces errors when there was a problem.
+
+ 2. nvcc has been known to not delete incomplete results when it
+ encounters problems. This confuses build systems into thinking the
+ target was generated when in fact an unusable file exists. The script
+ now deletes the output files if there was an error.
+
+ 3. By putting all the options that affect the build into a file and then
+ make the build rule dependent on the file, the output files will be
+ regenerated when the options change.
+
+ This script also looks at optional arguments STATIC, SHARED, or MODULE to
+ determine when to target the object compilation for a shared library.
+ BUILD_SHARED_LIBS is ignored in CUDA_WRAP_SRCS, but it is respected in
+ CUDA_ADD_LIBRARY. On some systems special flags are added for building
+ objects intended for shared libraries. A preprocessor macro,
+ <target_name>_EXPORTS is defined when a shared library compilation is
+ detected.
+
+ Flags passed into add_definitions with -D or /D are passed along to nvcc.
+
+
+
+The script defines the following variables::
+
+ CUDA_VERSION_MAJOR -- The major version of cuda as reported by nvcc.
+ CUDA_VERSION_MINOR -- The minor version.
+ CUDA_VERSION
+ CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
+ CUDA_HAS_FP16 -- Whether a short float (float16,fp16) is supported.
+
+ CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
+ CUDA_SDK_ROOT_DIR -- Path to the CUDA SDK. Use this to find files in the
+ SDK. This script will not directly support finding
+ specific libraries or headers, as that isn't
+ supported by NVIDIA. If you want to change
+ libraries when the path changes see the
+ FindCUDA.cmake script for an example of how to clear
+ these variables. There are also examples of how to
+ use the CUDA_SDK_ROOT_DIR to locate headers or
+ libraries, if you so choose (at your own risk).
+ CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically
+ for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
+ CUDA_LIBRARIES -- Cuda RT library.
+ CUDA_CUFFT_LIBRARIES -- Device or emulation library for the Cuda FFT
+ implementation (alternative to:
+ CUDA_ADD_CUFFT_TO_TARGET macro)
+ CUDA_CUBLAS_LIBRARIES -- Device or emulation library for the Cuda BLAS
+ implementation (alternative to:
+ CUDA_ADD_CUBLAS_TO_TARGET macro).
+ CUDA_cudart_static_LIBRARY -- Statically linkable cuda runtime library.
+ Only available for CUDA version 5.5+
+ CUDA_cudadevrt_LIBRARY -- Device runtime library.
+ Required for separable compilation.
+ CUDA_cupti_LIBRARY -- CUDA Profiling Tools Interface library.
+ Only available for CUDA version 4.0+.
+ CUDA_curand_LIBRARY -- CUDA Random Number Generation library.
+ Only available for CUDA version 3.2+.
+ CUDA_cusolver_LIBRARY -- CUDA Direct Solver library.
+ Only available for CUDA version 7.0+.
+ CUDA_cusparse_LIBRARY -- CUDA Sparse Matrix library.
+ Only available for CUDA version 3.2+.
+ CUDA_npp_LIBRARY -- NVIDIA Performance Primitives lib.
+ Only available for CUDA version 4.0+.
+ CUDA_nppc_LIBRARY -- NVIDIA Performance Primitives lib (core).
+ Only available for CUDA version 5.5+.
+ CUDA_nppi_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 5.5 - 8.0.
+ CUDA_nppial_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppicc_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppicom_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppidei_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppif_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppig_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppim_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppist_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppisu_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_nppitc_LIBRARY -- NVIDIA Performance Primitives lib (image processing).
+ Only available for CUDA version 9.0.
+ CUDA_npps_LIBRARY -- NVIDIA Performance Primitives lib (signal processing).
+ Only available for CUDA version 5.5+.
+ CUDA_nvcuvenc_LIBRARY -- CUDA Video Encoder library.
+ Only available for CUDA version 3.2+.
+ Windows only.
+ CUDA_nvcuvid_LIBRARY -- CUDA Video Decoder library.
+ Only available for CUDA version 3.2+.
+ Windows only.
+
+#]=======================================================================]
# James Bigler, NVIDIA Corp (nvidia.com - jbigler)
# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html
@@ -871,11 +875,7 @@ endif()
if(CUDA_USE_STATIC_CUDA_RUNTIME)
if(UNIX)
- # Check for the dependent libraries. Here we look for pthreads.
- if (DEFINED CMAKE_THREAD_PREFER_PTHREAD)
- set(_cuda_cmake_thread_prefer_pthread ${CMAKE_THREAD_PREFER_PTHREAD})
- endif()
- set(CMAKE_THREAD_PREFER_PTHREAD 1)
+ # Check for the dependent libraries.
# Many of the FindXYZ CMake comes with makes use of try_compile with int main(){return 0;}
# as the source file. Unfortunately this causes a warning with -Wstrict-prototypes and
@@ -886,13 +886,6 @@ if(CUDA_USE_STATIC_CUDA_RUNTIME)
find_package(Threads REQUIRED)
set(CMAKE_C_FLAGS ${_cuda_cmake_c_flags})
- if (DEFINED _cuda_cmake_thread_prefer_pthread)
- set(CMAKE_THREAD_PREFER_PTHREAD ${_cuda_cmake_thread_prefer_pthread})
- unset(_cuda_cmake_thread_prefer_pthread)
- else()
- unset(CMAKE_THREAD_PREFER_PTHREAD)
- endif()
-
if(NOT APPLE)
#On Linux, you must link against librt when using the static cuda runtime.
find_library(CUDA_rt_LIBRARY rt)
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index 60ddf7b8f..b1989b10e 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -1,37 +1,58 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCURL
-# --------
-#
-# Find the native CURL headers and libraries.
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
-# curl has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``CURL_FOUND``
-# True if curl found.
-#
-# ``CURL_INCLUDE_DIRS``
-# where to find curl/curl.h, etc.
-#
-# ``CURL_LIBRARIES``
-# List of libraries when using curl.
-#
-# ``CURL_VERSION_STRING``
-# The version of curl found.
+#[=======================================================================[.rst:
+FindCURL
+--------
+
+Find the native CURL headers and libraries.
+
+This module accept optional COMPONENTS to check supported features and
+protocols::
+
+ PROTOCOLS: ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3
+ POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP
+ FEATURES: SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO
+ Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
+curl has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``CURL_FOUND``
+ True if curl found.
+
+``CURL_INCLUDE_DIRS``
+ where to find curl/curl.h, etc.
+
+``CURL_LIBRARIES``
+ List of libraries when using curl.
+
+``CURL_VERSION_STRING``
+ The version of curl found.
+#]=======================================================================]
+
+find_package(PkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(PC_CURL QUIET libcurl)
+ if(PC_CURL_FOUND)
+ set(CURL_VERSION_STRING ${PC_CURL_VERSION})
+ pkg_get_variable(CURL_SUPPORTED_PROTOCOLS libcurl supported_protocols)
+ pkg_get_variable(CURL_SUPPORTED_FEATURES libcurl supported_features)
+ endif()
+endif()
# Look for the header file.
-find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
+find_path(CURL_INCLUDE_DIR
+ NAMES curl/curl.h
+ HINTS ${PC_CURL_INCLUDE_DIRS})
mark_as_advanced(CURL_INCLUDE_DIR)
if(NOT CURL_LIBRARY)
@@ -44,6 +65,7 @@ if(NOT CURL_LIBRARY)
curllib_static
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
libcurl
+ HINTS ${PC_CURL_LIBRARY_DIRS}
)
mark_as_advanced(CURL_LIBRARY_RELEASE)
@@ -51,6 +73,7 @@ if(NOT CURL_LIBRARY)
# Windows MSVC CMake builds in debug configuration on vcpkg:
libcurl-d_imp
libcurl-d
+ HINTS ${PC_CURL_LIBRARY_DIRS}
)
mark_as_advanced(CURL_LIBRARY_DEBUG)
@@ -58,7 +81,7 @@ if(NOT CURL_LIBRARY)
select_library_configurations(CURL)
endif()
-if(CURL_INCLUDE_DIR)
+if(CURL_INCLUDE_DIR AND NOT CURL_VERSION_STRING)
foreach(_curl_version_header curlver.h curl.h)
if(EXISTS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}")
file(STRINGS "${CURL_INCLUDE_DIR}/curl/${_curl_version_header}" curl_version_str REGEX "^#define[\t ]+LIBCURL_VERSION[\t ]+\".*\"")
@@ -70,10 +93,57 @@ if(CURL_INCLUDE_DIR)
endforeach()
endif()
+if(CURL_FIND_COMPONENTS)
+ set(CURL_KNOWN_PROTOCOLS ICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTMP RTSP SCP SFTP SMB SMBS SMTP SMTPS TELNET TFTP)
+ set(CURL_KNOWN_FEATURES SSL IPv6 UnixSockets libz AsynchDNS IDN GSS-API PSL SPNEGO Kerberos NTLM NTLM_WB TLS-SRP HTTP2 HTTPS-proxy)
+ foreach(component IN LISTS CURL_KNOWN_PROTOCOLS CURL_KNOWN_FEATURES)
+ set(CURL_${component}_FOUND FALSE)
+ endforeach()
+ if(NOT PC_CURL_FOUND)
+ find_program(CURL_CONFIG_EXECUTABLE NAMES curl-config)
+ if(CURL_CONFIG_EXECUTABLE)
+ execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --version
+ OUTPUT_VARIABLE CURL_CONFIG_VERSION_STRING
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --feature
+ OUTPUT_VARIABLE CURL_CONFIG_FEATURES_STRING
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(REPLACE "\n" ";" CURL_SUPPORTED_FEATURES "${CURL_CONFIG_FEATURES_STRING}")
+ execute_process(COMMAND ${CURL_CONFIG_EXECUTABLE} --protocols
+ OUTPUT_VARIABLE CURL_CONFIG_PROTOCOLS_STRING
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ string(REPLACE "\n" ";" CURL_SUPPORTED_PROTOCOLS "${CURL_CONFIG_PROTOCOLS_STRING}")
+ endif()
+
+ endif()
+ foreach(component IN LISTS CURL_FIND_COMPONENTS)
+ list(FIND CURL_KNOWN_PROTOCOLS ${component} _found)
+ if(_found)
+ list(FIND CURL_SUPPORTED_PROTOCOLS ${component} _found)
+ if(_found)
+ set(CURL_${component}_FOUND TRUE)
+ elseif(CURL_FIND_REQUIRED)
+ message(FATAL_ERROR "CURL: Required protocol ${component} is not found")
+ endif()
+ else()
+ list(FIND CURL_SUPPORTED_FEATURES ${component} _found)
+ if(_found)
+ set(CURL_${component}_FOUND TRUE)
+ elseif(CURL_FIND_REQUIRED)
+ message(FATAL_ERROR "CURL: Required feature ${component} is not found")
+ endif()
+ endif()
+ endforeach()
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL
+find_package_handle_standard_args(CURL
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
- VERSION_VAR CURL_VERSION_STRING)
+ VERSION_VAR CURL_VERSION_STRING
+ HANDLE_COMPONENTS)
if(CURL_FOUND)
set(CURL_LIBRARIES ${CURL_LIBRARY})
diff --git a/Modules/FindCVS.cmake b/Modules/FindCVS.cmake
index d59dfb097..89dbc0e10 100644
--- a/Modules/FindCVS.cmake
+++ b/Modules/FindCVS.cmake
@@ -1,27 +1,28 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCVS
-# -------
-#
-#
-#
-# The module defines the following variables:
-#
-# ::
-#
-# CVS_EXECUTABLE - path to cvs command line client
-# CVS_FOUND - true if the command line client was found
-#
-# Example usage:
-#
-# ::
-#
-# find_package(CVS)
-# if(CVS_FOUND)
-# message("CVS found: ${CVS_EXECUTABLE}")
-# endif()
+#[=======================================================================[.rst:
+FindCVS
+-------
+
+
+
+The module defines the following variables:
+
+::
+
+ CVS_EXECUTABLE - path to cvs command line client
+ CVS_FOUND - true if the command line client was found
+
+Example usage:
+
+::
+
+ find_package(CVS)
+ if(CVS_FOUND)
+ message("CVS found: ${CVS_EXECUTABLE}")
+ endif()
+#]=======================================================================]
# CVSNT
diff --git a/Modules/FindCoin3D.cmake b/Modules/FindCoin3D.cmake
index f11903d6a..301e70bd6 100644
--- a/Modules/FindCoin3D.cmake
+++ b/Modules/FindCoin3D.cmake
@@ -1,22 +1,23 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCoin3D
-# ----------
-#
-# Find Coin3D (Open Inventor)
-#
-# Coin3D is an implementation of the Open Inventor API. It provides
-# data structures and algorithms for 3D visualization.
-#
-# This module defines the following variables
-#
-# ::
-#
-# COIN3D_FOUND - system has Coin3D - Open Inventor
-# COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
-# COIN3D_LIBRARIES - Link to this to use Coin3D
+#[=======================================================================[.rst:
+FindCoin3D
+----------
+
+Find Coin3D (Open Inventor)
+
+Coin3D is an implementation of the Open Inventor API. It provides
+data structures and algorithms for 3D visualization.
+
+This module defines the following variables
+
+::
+
+ COIN3D_FOUND - system has Coin3D - Open Inventor
+ COIN3D_INCLUDE_DIRS - where the Inventor include directory can be found
+ COIN3D_LIBRARIES - Link to this to use Coin3D
+#]=======================================================================]
if (WIN32)
if (CYGWIN)
diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake
index 13d3b98d6..10ce22968 100644
--- a/Modules/FindCups.cmake
+++ b/Modules/FindCups.cmake
@@ -1,22 +1,23 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCups
-# --------
-#
-# Try to find the Cups printing system
-#
-# Once done this will define
-#
-# ::
-#
-# CUPS_FOUND - system has Cups
-# CUPS_INCLUDE_DIR - the Cups include directory
-# CUPS_LIBRARIES - Libraries needed to use Cups
-# CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
-# Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
-# features this function (i.e. at least 1.1.19)
+#[=======================================================================[.rst:
+FindCups
+--------
+
+Try to find the Cups printing system
+
+Once done this will define
+
+::
+
+ CUPS_FOUND - system has Cups
+ CUPS_INCLUDE_DIR - the Cups include directory
+ CUPS_LIBRARIES - Libraries needed to use Cups
+ CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8)
+ Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which
+ features this function (i.e. at least 1.1.19)
+#]=======================================================================]
find_path(CUPS_INCLUDE_DIR cups/cups.h )
diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake
index 4f59d2c1e..c22584782 100644
--- a/Modules/FindCurses.cmake
+++ b/Modules/FindCurses.cmake
@@ -1,46 +1,47 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCurses
-# ----------
-#
-# Find the curses or ncurses include file and library.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``CURSES_FOUND``
-# True if Curses is found.
-# ``CURSES_INCLUDE_DIRS``
-# The include directories needed to use Curses.
-# ``CURSES_LIBRARIES``
-# The libraries needed to use Curses.
-# ``CURSES_HAVE_CURSES_H``
-# True if curses.h is available.
-# ``CURSES_HAVE_NCURSES_H``
-# True if ncurses.h is available.
-# ``CURSES_HAVE_NCURSES_NCURSES_H``
-# True if ``ncurses/ncurses.h`` is available.
-# ``CURSES_HAVE_NCURSES_CURSES_H``
-# True if ``ncurses/curses.h`` is available.
-#
-# Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
-# ``find_package(Curses)`` call if NCurses functionality is required.
-# Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
-# ``find_package(Curses)`` call if unicode functionality is required.
-#
-# Backward Compatibility
-# ^^^^^^^^^^^^^^^^^^^^^^
-#
-# The following variable are provided for backward compatibility:
-#
-# ``CURSES_INCLUDE_DIR``
-# Path to Curses include. Use ``CURSES_INCLUDE_DIRS`` instead.
-# ``CURSES_LIBRARY``
-# Path to Curses library. Use ``CURSES_LIBRARIES`` instead.
+#[=======================================================================[.rst:
+FindCurses
+----------
+
+Find the curses or ncurses include file and library.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``CURSES_FOUND``
+ True if Curses is found.
+``CURSES_INCLUDE_DIRS``
+ The include directories needed to use Curses.
+``CURSES_LIBRARIES``
+ The libraries needed to use Curses.
+``CURSES_HAVE_CURSES_H``
+ True if curses.h is available.
+``CURSES_HAVE_NCURSES_H``
+ True if ncurses.h is available.
+``CURSES_HAVE_NCURSES_NCURSES_H``
+ True if ``ncurses/ncurses.h`` is available.
+``CURSES_HAVE_NCURSES_CURSES_H``
+ True if ``ncurses/curses.h`` is available.
+
+Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
+``find_package(Curses)`` call if NCurses functionality is required.
+Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
+``find_package(Curses)`` call if unicode functionality is required.
+
+Backward Compatibility
+^^^^^^^^^^^^^^^^^^^^^^
+
+The following variable are provided for backward compatibility:
+
+``CURSES_INCLUDE_DIR``
+ Path to Curses include. Use ``CURSES_INCLUDE_DIRS`` instead.
+``CURSES_LIBRARY``
+ Path to Curses library. Use ``CURSES_LIBRARIES`` instead.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake
index 25454fd9e..4eec5fcec 100644
--- a/Modules/FindCxxTest.cmake
+++ b/Modules/FindCxxTest.cmake
@@ -1,142 +1,143 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCxxTest
-# -----------
-#
-# Find CxxTest
-#
-# Find the CxxTest suite and declare a helper macro for creating unit
-# tests and integrating them with CTest. For more details on CxxTest
-# see http://cxxtest.tigris.org
-#
-# INPUT Variables
-#
-# ::
-#
-# CXXTEST_USE_PYTHON [deprecated since 1.3]
-# Only used in the case both Python & Perl
-# are detected on the system to control
-# which CxxTest code generator is used.
-# Valid only for CxxTest version 3.
-#
-#
-#
-# ::
-#
-# NOTE: In older versions of this Find Module,
-# this variable controlled if the Python test
-# generator was used instead of the Perl one,
-# regardless of which scripting language the
-# user had installed.
-#
-#
-#
-# ::
-#
-# CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
-# Specify a list of options to pass to the CxxTest code
-# generator. If not defined, --error-printer is
-# passed.
-#
-#
-#
-# OUTPUT Variables
-#
-# ::
-#
-# CXXTEST_FOUND
-# True if the CxxTest framework was found
-# CXXTEST_INCLUDE_DIRS
-# Where to find the CxxTest include directory
-# CXXTEST_PERL_TESTGEN_EXECUTABLE
-# The perl-based test generator
-# CXXTEST_PYTHON_TESTGEN_EXECUTABLE
-# The python-based test generator
-# CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
-# The test generator that is actually used (chosen using user preferences
-# and interpreters found in the system)
-# CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
-# The full path to the Perl or Python executable on the system, on
-# platforms where the script cannot be executed using its shebang line.
-#
-#
-#
-# MACROS for optional use by CMake users:
-#
-# ::
-#
-# CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
-# Creates a CxxTest runner and adds it to the CTest testing suite
-# Parameters:
-# test_name The name of the test
-# gen_source_file The generated source filename to be
-# generated by CxxTest
-# input_files_to_testgen The list of header files containing the
-# CxxTest::TestSuite's to be included in
-# this runner
-#
-#
-#
-# ::
-#
-# #==============
-# Example Usage:
-#
-#
-#
-# ::
-#
-# find_package(CxxTest)
-# if(CXXTEST_FOUND)
-# include_directories(${CXXTEST_INCLUDE_DIR})
-# enable_testing()
-#
-#
-#
-# ::
-#
-# CXXTEST_ADD_TEST(unittest_foo foo_test.cc
-# ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
-# target_link_libraries(unittest_foo foo) # as needed
-# endif()
-#
-#
-#
-# ::
-#
-# This will (if CxxTest is found):
-# 1. Invoke the testgen executable to autogenerate foo_test.cc in the
-# binary tree from "foo_test.h" in the current source directory.
-# 2. Create an executable and test called unittest_foo.
-#
-#
-#
-# ::
-#
-# #=============
-# Example foo_test.h:
-#
-#
-#
-# ::
-#
-# #include <cxxtest/TestSuite.h>
-#
-#
-#
-# ::
-#
-# class MyTestSuite : public CxxTest::TestSuite
-# {
-# public:
-# void testAddition( void )
-# {
-# TS_ASSERT( 1 + 1 > 1 );
-# TS_ASSERT_EQUALS( 1 + 1, 2 );
-# }
-# };
+#[=======================================================================[.rst:
+FindCxxTest
+-----------
+
+Find CxxTest
+
+Find the CxxTest suite and declare a helper macro for creating unit
+tests and integrating them with CTest. For more details on CxxTest
+see http://cxxtest.tigris.org
+
+INPUT Variables
+
+::
+
+ CXXTEST_USE_PYTHON [deprecated since 1.3]
+ Only used in the case both Python & Perl
+ are detected on the system to control
+ which CxxTest code generator is used.
+ Valid only for CxxTest version 3.
+
+
+
+::
+
+ NOTE: In older versions of this Find Module,
+ this variable controlled if the Python test
+ generator was used instead of the Perl one,
+ regardless of which scripting language the
+ user had installed.
+
+
+
+::
+
+ CXXTEST_TESTGEN_ARGS (since CMake 2.8.3)
+ Specify a list of options to pass to the CxxTest code
+ generator. If not defined, --error-printer is
+ passed.
+
+
+
+OUTPUT Variables
+
+::
+
+ CXXTEST_FOUND
+ True if the CxxTest framework was found
+ CXXTEST_INCLUDE_DIRS
+ Where to find the CxxTest include directory
+ CXXTEST_PERL_TESTGEN_EXECUTABLE
+ The perl-based test generator
+ CXXTEST_PYTHON_TESTGEN_EXECUTABLE
+ The python-based test generator
+ CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3)
+ The test generator that is actually used (chosen using user preferences
+ and interpreters found in the system)
+ CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3)
+ The full path to the Perl or Python executable on the system, on
+ platforms where the script cannot be executed using its shebang line.
+
+
+
+MACROS for optional use by CMake users:
+
+::
+
+ CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
+ Creates a CxxTest runner and adds it to the CTest testing suite
+ Parameters:
+ test_name The name of the test
+ gen_source_file The generated source filename to be
+ generated by CxxTest
+ input_files_to_testgen The list of header files containing the
+ CxxTest::TestSuite's to be included in
+ this runner
+
+
+
+::
+
+ #==============
+ Example Usage:
+
+
+
+::
+
+ find_package(CxxTest)
+ if(CXXTEST_FOUND)
+ include_directories(${CXXTEST_INCLUDE_DIR})
+ enable_testing()
+
+
+
+::
+
+ CXXTEST_ADD_TEST(unittest_foo foo_test.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h)
+ target_link_libraries(unittest_foo foo) # as needed
+ endif()
+
+
+
+::
+
+ This will (if CxxTest is found):
+ 1. Invoke the testgen executable to autogenerate foo_test.cc in the
+ binary tree from "foo_test.h" in the current source directory.
+ 2. Create an executable and test called unittest_foo.
+
+
+
+::
+
+ #=============
+ Example foo_test.h:
+
+
+
+::
+
+ #include <cxxtest/TestSuite.h>
+
+
+
+::
+
+ class MyTestSuite : public CxxTest::TestSuite
+ {
+ public:
+ void testAddition( void )
+ {
+ TS_ASSERT( 1 + 1 > 1 );
+ TS_ASSERT_EQUALS( 1 + 1, 2 );
+ }
+ };
+#]=======================================================================]
# Version 1.4 (11/18/10) (CMake 2.8.4)
# Issue 11384: Added support to the CXX_ADD_TEST macro so header
diff --git a/Modules/FindCygwin.cmake b/Modules/FindCygwin.cmake
index 092a3bd49..8811623a2 100644
--- a/Modules/FindCygwin.cmake
+++ b/Modules/FindCygwin.cmake
@@ -1,11 +1,12 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCygwin
-# ----------
-#
-# this module looks for Cygwin
+#[=======================================================================[.rst:
+FindCygwin
+----------
+
+this module looks for Cygwin
+#]=======================================================================]
if (WIN32)
if(CYGWIN_INSTALL_PATH)
diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake
index 39c1a5b34..111e0ff2f 100644
--- a/Modules/FindDCMTK.cmake
+++ b/Modules/FindDCMTK.cmake
@@ -1,82 +1,83 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindDCMTK
-# ---------
-#
-# Find DCMTK libraries and applications
-#
-# The module defines the following variables::
-#
-# DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
-# DCMTK_LIBRARIES - Files to link against to use DCMTK
-# DCMTK_FOUND - If false, don't try to use DCMTK
-# DCMTK_DIR - (optional) Source directory for DCMTK
-#
-# Compatibility
-# ^^^^^^^^^^^^^
-#
-# This module is able to find a version of DCMTK that does or does not export
-# a *DCMTKConfig.cmake* file. It applies a two step process:
-#
-# * Step 1: Attempt to find DCMTK version providing a *DCMTKConfig.cmake* file.
-# * Step 2: If step 1 failed, rely on *FindDCMTK.cmake* to set `DCMTK_*` variables details below.
-#
-#
-# `Recent DCMTK
-# <http://git.dcmtk.org/web?p=dcmtk.git;a=commit;h=662ae187c493c6b9a73dd5e3875372cebd0c11fe>`_
-# provides a *DCMTKConfig.cmake* :manual:`package configuration file
-# <cmake-packages(7)>`. To exclusively use the package configuration file
-# (recommended when possible), pass the `NO_MODULE` option to
-# :command:`find_package`. For example, `find_package(DCMTK NO_MODULE)`.
-# This requires official DCMTK snapshot *3.6.1_20140617* or newer.
-#
-#
-# Until all clients update to the more recent DCMTK, build systems will need
-# to support different versions of DCMTK.
-#
-# On any given system, the following combinations of DCMTK versions could be
-# considered:
-#
-# +--------+---------------------+-----------------------+-------------------+
-# | | SYSTEM DCMTK | LOCAL DCMTK | Supported ? |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case A | NA | [ ] DCMTKConfig | YES |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case B | NA | [X] DCMTKConfig | YES |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case C | [ ] DCMTKConfig | NA | YES |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case D | [X] DCMTKConfig | NA | YES |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case E | [ ] DCMTKConfig | [ ] DCMTKConfig | YES (*) |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case F | [X] DCMTKConfig | [ ] DCMTKConfig | NO |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case G | [ ] DCMTKConfig | [X] DCMTKConfig | YES |
-# +--------+---------------------+-----------------------+-------------------+
-# | Case H | [X] DCMTKConfig | [X] DCMTKConfig | YES |
-# +--------+---------------------+-----------------------+-------------------+
-#
-# (*) See Troubleshooting section.
-#
-# Legend:
-#
-# NA ...............: Means that no System or Local DCMTK is available
-#
-# [ ] DCMTKConfig ..: Means that the version of DCMTK does NOT export a DCMTKConfig.cmake file.
-#
-# [X] DCMTKConfig ..: Means that the version of DCMTK exports a DCMTKConfig.cmake file.
-#
-#
-# Troubleshooting
-# ^^^^^^^^^^^^^^^
-#
-# What to do if my project finds a different version of DCMTK?
-#
-# Remove DCMTK entry from the CMake cache per :command:`find_package`
-# documentation.
+#[=======================================================================[.rst:
+FindDCMTK
+---------
+
+Find DCMTK libraries and applications
+
+The module defines the following variables::
+
+ DCMTK_INCLUDE_DIRS - Directories to include to use DCMTK
+ DCMTK_LIBRARIES - Files to link against to use DCMTK
+ DCMTK_FOUND - If false, don't try to use DCMTK
+ DCMTK_DIR - (optional) Source directory for DCMTK
+
+Compatibility
+^^^^^^^^^^^^^
+
+This module is able to find a version of DCMTK that does or does not export
+a *DCMTKConfig.cmake* file. It applies a two step process:
+
+* Step 1: Attempt to find DCMTK version providing a *DCMTKConfig.cmake* file.
+* Step 2: If step 1 failed, rely on *FindDCMTK.cmake* to set `DCMTK_*` variables details below.
+
+
+`Recent DCMTK
+<http://git.dcmtk.org/web?p=dcmtk.git;a=commit;h=662ae187c493c6b9a73dd5e3875372cebd0c11fe>`_
+provides a *DCMTKConfig.cmake* :manual:`package configuration file
+<cmake-packages(7)>`. To exclusively use the package configuration file
+(recommended when possible), pass the `NO_MODULE` option to
+:command:`find_package`. For example, `find_package(DCMTK NO_MODULE)`.
+This requires official DCMTK snapshot *3.6.1_20140617* or newer.
+
+
+Until all clients update to the more recent DCMTK, build systems will need
+to support different versions of DCMTK.
+
+On any given system, the following combinations of DCMTK versions could be
+considered:
+
++--------+---------------------+-----------------------+-------------------+
+| | SYSTEM DCMTK | LOCAL DCMTK | Supported ? |
++--------+---------------------+-----------------------+-------------------+
+| Case A | NA | [ ] DCMTKConfig | YES |
++--------+---------------------+-----------------------+-------------------+
+| Case B | NA | [X] DCMTKConfig | YES |
++--------+---------------------+-----------------------+-------------------+
+| Case C | [ ] DCMTKConfig | NA | YES |
++--------+---------------------+-----------------------+-------------------+
+| Case D | [X] DCMTKConfig | NA | YES |
++--------+---------------------+-----------------------+-------------------+
+| Case E | [ ] DCMTKConfig | [ ] DCMTKConfig | YES (*) |
++--------+---------------------+-----------------------+-------------------+
+| Case F | [X] DCMTKConfig | [ ] DCMTKConfig | NO |
++--------+---------------------+-----------------------+-------------------+
+| Case G | [ ] DCMTKConfig | [X] DCMTKConfig | YES |
++--------+---------------------+-----------------------+-------------------+
+| Case H | [X] DCMTKConfig | [X] DCMTKConfig | YES |
++--------+---------------------+-----------------------+-------------------+
+
+ (*) See Troubleshooting section.
+
+Legend:
+
+ NA ...............: Means that no System or Local DCMTK is available
+
+ [ ] DCMTKConfig ..: Means that the version of DCMTK does NOT export a DCMTKConfig.cmake file.
+
+ [X] DCMTKConfig ..: Means that the version of DCMTK exports a DCMTKConfig.cmake file.
+
+
+Troubleshooting
+^^^^^^^^^^^^^^^
+
+What to do if my project finds a different version of DCMTK?
+
+Remove DCMTK entry from the CMake cache per :command:`find_package`
+documentation.
+#]=======================================================================]
#
# Written for VXL by Amitha Perera.
@@ -199,7 +200,6 @@ if(DCMTK_oflog_LIBRARY_RELEASE OR DCMTK_oflog_LIBRARY_DEBUG)
# Hack - Not having a DCMTKConfig.cmake file to read the settings from, we will attempt to
# find the library in all cases.
# Ideally, pthread library should be discovered only if DCMTK_WITH_THREADS is enabled.
- set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads)
endif()
diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake
index acd4ef62d..04925783b 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -1,14 +1,15 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindDart
-# --------
-#
-# Find DART
-#
-# This module looks for the dart testing software and sets DART_ROOT to
-# point to where it found it.
+#[=======================================================================[.rst:
+FindDart
+--------
+
+Find DART
+
+This module looks for the dart testing software and sets DART_ROOT to
+point to where it found it.
+#]=======================================================================]
find_path(DART_ROOT README.INSTALL
HINTS
diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake
index e904a30fc..998494365 100644
--- a/Modules/FindDevIL.cmake
+++ b/Modules/FindDevIL.cmake
@@ -1,35 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindDevIL
-# ---------
-#
-#
-#
-# This module locates the developer's image library.
-# http://openil.sourceforge.net/
-#
-# This module sets:
-#
-# ::
-#
-# IL_LIBRARIES - the name of the IL library. These include the full path to
-# the core DevIL library. This one has to be linked into the
-# application.
-# ILU_LIBRARIES - the name of the ILU library. Again, the full path. This
-# library is for filters and effects, not actual loading. It
-# doesn't have to be linked if the functionality it provides
-# is not used.
-# ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
-# library interfaces with OpenGL. It is not strictly needed
-# in applications.
-# IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
-# DevIL_FOUND - this is set to TRUE if all the above variables were set.
-# This will be set to false if ILU or ILUT are not found,
-# even if they are not needed. In most systems, if one
-# library is found all the others are as well. That's the
-# way the DevIL developers release it.
+#[=======================================================================[.rst:
+FindDevIL
+---------
+
+
+
+This module locates the developer's image library.
+http://openil.sourceforge.net/
+
+This module sets:
+
+::
+
+ IL_LIBRARIES - the name of the IL library. These include the full path to
+ the core DevIL library. This one has to be linked into the
+ application.
+ ILU_LIBRARIES - the name of the ILU library. Again, the full path. This
+ library is for filters and effects, not actual loading. It
+ doesn't have to be linked if the functionality it provides
+ is not used.
+ ILUT_LIBRARIES - the name of the ILUT library. Full path. This part of the
+ library interfaces with OpenGL. It is not strictly needed
+ in applications.
+ IL_INCLUDE_DIR - where to find the il.h, ilu.h and ilut.h files.
+ DevIL_FOUND - this is set to TRUE if all the above variables were set.
+ This will be set to false if ILU or ILUT are not found,
+ even if they are not needed. In most systems, if one
+ library is found all the others are as well. That's the
+ way the DevIL developers release it.
+#]=======================================================================]
# TODO: Add version support.
# Tested under Linux and Windows (MSVC)
diff --git a/Modules/FindDoxygen.cmake b/Modules/FindDoxygen.cmake
index cb4738bab..32b4aa2c8 100644
--- a/Modules/FindDoxygen.cmake
+++ b/Modules/FindDoxygen.cmake
@@ -485,12 +485,18 @@ endmacro()
# Find Graphviz Dot...
#
macro(_Doxygen_find_dot)
- set(_x86 "(x86)")
- file(
- GLOB _Doxygen_GRAPHVIZ_BIN_DIRS
- "$ENV{ProgramFiles}/Graphviz*/bin"
- "$ENV{ProgramFiles${_x86}}/Graphviz*/bin"
- )
+ if(WIN32)
+ set(_x86 "(x86)")
+ file(
+ GLOB _Doxygen_GRAPHVIZ_BIN_DIRS
+ "$ENV{ProgramFiles}/Graphviz*/bin"
+ "$ENV{ProgramFiles${_x86}}/Graphviz*/bin"
+ )
+ unset(_x86)
+ else()
+ set(_Doxygen_GRAPHVIZ_BIN_DIRS "")
+ endif()
+
find_program(
DOXYGEN_DOT_EXECUTABLE
NAMES dot
@@ -529,7 +535,6 @@ macro(_Doxygen_find_dot)
endif()
unset(_Doxygen_GRAPHVIZ_BIN_DIRS)
- unset(_x86)
endmacro()
#
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 39086e499..58e08418c 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -1,32 +1,33 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindEXPAT
-# ---------
-#
-# Find the native Expat headers and library.
-#
-# Imported Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``EXPAT::EXPAT``
-# The Expat ``expat`` library, if found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``EXPAT_INCLUDE_DIRS``
-# where to find expat.h, etc.
-# ``EXPAT_LIBRARIES``
-# the libraries to link against to use Expat.
-# ``EXPAT_FOUND``
-# true if the Expat headers and libraries were found.
-#
+#[=======================================================================[.rst:
+FindEXPAT
+---------
+
+Find the native Expat headers and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``EXPAT::EXPAT``
+ The Expat ``expat`` library, if found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``EXPAT_INCLUDE_DIRS``
+ where to find expat.h, etc.
+``EXPAT_LIBRARIES``
+ the libraries to link against to use Expat.
+``EXPAT_FOUND``
+ true if the Expat headers and libraries were found.
+
+#]=======================================================================]
find_package(PkgConfig QUIET)
diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake
index 3945b7884..edebe755c 100644
--- a/Modules/FindFLEX.cmake
+++ b/Modules/FindFLEX.cmake
@@ -1,100 +1,101 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindFLEX
-# --------
-#
-# Find flex executable and provides a macro to generate custom build rules
-#
-#
-#
-# The module defines the following variables:
-#
-# ::
-#
-# FLEX_FOUND - true is flex executable is found
-# FLEX_EXECUTABLE - the path to the flex executable
-# FLEX_VERSION - the version of flex
-# FLEX_LIBRARIES - The flex libraries
-# FLEX_INCLUDE_DIRS - The path to the flex headers
-#
-#
-#
-# The minimum required version of flex can be specified using the
-# standard syntax, e.g. find_package(FLEX 2.5.13)
-#
-#
-#
-# If flex is found on the system, the module provides the macro:
-#
-# ::
-#
-# FLEX_TARGET(Name FlexInput FlexOutput
-# [COMPILE_FLAGS <string>]
-# [DEFINES_FILE <string>]
-# )
-#
-# which creates a custom command to generate the <FlexOutput> file from
-# the <FlexInput> file. If COMPILE_FLAGS option is specified, the next
-# parameter is added to the flex command line. If flex is configured to
-# output a header file, the DEFINES_FILE option may be used to specify its
-# name. Name is an alias used to get details of this custom command.
-# Indeed the macro defines the following variables:
-#
-# ::
-#
-# FLEX_${Name}_DEFINED - true is the macro ran successfully
-# FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
-# alias for FlexOutput
-# FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
-# FLEX_${Name}_OUTPUT_HEADER - the header flex output, if any.
-#
-#
-#
-# Flex scanners often use tokens defined by Bison: the code generated
-# by Flex depends of the header generated by Bison. This module also
-# defines a macro:
-#
-# ::
-#
-# ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
-#
-# which adds the required dependency between a scanner and a parser
-# where <FlexTarget> and <BisonTarget> are the first parameters of
-# respectively FLEX_TARGET and BISON_TARGET macros.
-#
-# ::
-#
-# ====================================================================
-# Example:
-#
-#
-#
-# ::
-#
-# find_package(BISON)
-# find_package(FLEX)
-#
-#
-#
-# ::
-#
-# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
-# FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
-# ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
-#
-#
-#
-# ::
-#
-# include_directories(${CMAKE_CURRENT_BINARY_DIR})
-# add_executable(Foo
-# Foo.cc
-# ${BISON_MyParser_OUTPUTS}
-# ${FLEX_MyScanner_OUTPUTS}
-# )
-# ====================================================================
+#[=======================================================================[.rst:
+FindFLEX
+--------
+
+Find flex executable and provides a macro to generate custom build rules
+
+
+
+The module defines the following variables:
+
+::
+
+ FLEX_FOUND - true is flex executable is found
+ FLEX_EXECUTABLE - the path to the flex executable
+ FLEX_VERSION - the version of flex
+ FLEX_LIBRARIES - The flex libraries
+ FLEX_INCLUDE_DIRS - The path to the flex headers
+
+
+
+The minimum required version of flex can be specified using the
+standard syntax, e.g. find_package(FLEX 2.5.13)
+
+
+
+If flex is found on the system, the module provides the macro:
+
+::
+
+ FLEX_TARGET(Name FlexInput FlexOutput
+ [COMPILE_FLAGS <string>]
+ [DEFINES_FILE <string>]
+ )
+
+which creates a custom command to generate the <FlexOutput> file from
+the <FlexInput> file. If COMPILE_FLAGS option is specified, the next
+parameter is added to the flex command line. If flex is configured to
+output a header file, the DEFINES_FILE option may be used to specify its
+name. Name is an alias used to get details of this custom command.
+Indeed the macro defines the following variables:
+
+::
+
+ FLEX_${Name}_DEFINED - true is the macro ran successfully
+ FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
+ alias for FlexOutput
+ FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
+ FLEX_${Name}_OUTPUT_HEADER - the header flex output, if any.
+
+
+
+Flex scanners often use tokens defined by Bison: the code generated
+by Flex depends of the header generated by Bison. This module also
+defines a macro:
+
+::
+
+ ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
+
+which adds the required dependency between a scanner and a parser
+where <FlexTarget> and <BisonTarget> are the first parameters of
+respectively FLEX_TARGET and BISON_TARGET macros.
+
+::
+
+ ====================================================================
+ Example:
+
+
+
+::
+
+ find_package(BISON)
+ find_package(FLEX)
+
+
+
+::
+
+ BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
+ FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
+ ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
+
+
+
+::
+
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ add_executable(Foo
+ Foo.cc
+ ${BISON_MyParser_OUTPUTS}
+ ${FLEX_MyScanner_OUTPUTS}
+ )
+ ====================================================================
+#]=======================================================================]
find_program(FLEX_EXECUTABLE NAMES flex win_flex DOC "path to the flex executable")
mark_as_advanced(FLEX_EXECUTABLE)
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index 82c63efd4..89122c045 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -1,82 +1,83 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindFLTK
-# --------
-#
-# Find the FLTK library
-#
-# Input Variables
-# ^^^^^^^^^^^^^^^
-#
-# By default this module will search for all of the FLTK components and
-# add them to the FLTK_LIBRARIES variable. You can limit the components
-# which get placed in FLTK_LIBRARIES by defining one or more of the
-# following three options:
-#
-# ``FLTK_SKIP_OPENGL``
-# Set to true to disable searching for the FLTK GL library
-#
-# ``FLTK_SKIP_FORMS``
-# Set to true to disable searching for the FLTK Forms library
-#
-# ``FLTK_SKIP_IMAGES``
-# Set to true to disable searching for the FLTK Images library
-#
-# FLTK is composed also by a binary tool. You can set the following option:
-#
-# ``FLTK_SKIP_FLUID``
-# Set to true to not look for the FLUID binary
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# The following variables will be defined:
-#
-# ``FLTK_FOUND``
-# True if all components not skipped were found
-#
-# ``FLTK_INCLUDE_DIR``
-# Path to the include directory for FLTK header files
-#
-# ``FLTK_LIBRARIES``
-# List of the FLTK libraries found
-#
-# ``FLTK_FLUID_EXECUTABLE``
-# Path to the FLUID binary tool
-#
-# ``FLTK_WRAP_UI``
-# True if FLUID is found, used to enable the FLTK_WRAP_UI command
-#
-# Cache Variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables are also available to set or use:
-#
-# ``FLTK_BASE_LIBRARY_RELEASE``
-# The FLTK base library (optimized)
-#
-# ``FLTK_BASE_LIBRARY_DEBUG``
-# The FLTK base library (debug)
-#
-# ``FLTK_GL_LIBRARY_RELEASE``
-# The FLTK GL library (optimized)
-#
-# ``FLTK_GL_LIBRARY_DEBUG``
-# The FLTK GL library (debug)
-#
-# ``FLTK_FORMS_LIBRARY_RELEASE``
-# The FLTK Forms library (optimized)
-#
-# ``FLTK_FORMS_LIBRARY_DEBUG``
-# The FLTK Forms library (debug)
-#
-# ``FLTK_IMAGES_LIBRARY_RELEASE``
-# The FLTK Images protobuf library (optimized)
-#
-# ``FLTK_IMAGES_LIBRARY_DEBUG``
-# The FLTK Images library (debug)
+#[=======================================================================[.rst:
+FindFLTK
+--------
+
+Find the FLTK library
+
+Input Variables
+^^^^^^^^^^^^^^^
+
+By default this module will search for all of the FLTK components and
+add them to the FLTK_LIBRARIES variable. You can limit the components
+which get placed in FLTK_LIBRARIES by defining one or more of the
+following three options:
+
+``FLTK_SKIP_OPENGL``
+ Set to true to disable searching for the FLTK GL library
+
+``FLTK_SKIP_FORMS``
+ Set to true to disable searching for the FLTK Forms library
+
+``FLTK_SKIP_IMAGES``
+ Set to true to disable searching for the FLTK Images library
+
+FLTK is composed also by a binary tool. You can set the following option:
+
+``FLTK_SKIP_FLUID``
+ Set to true to not look for the FLUID binary
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+The following variables will be defined:
+
+``FLTK_FOUND``
+ True if all components not skipped were found
+
+``FLTK_INCLUDE_DIR``
+ Path to the include directory for FLTK header files
+
+``FLTK_LIBRARIES``
+ List of the FLTK libraries found
+
+``FLTK_FLUID_EXECUTABLE``
+ Path to the FLUID binary tool
+
+``FLTK_WRAP_UI``
+ True if FLUID is found, used to enable the FLTK_WRAP_UI command
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+The following cache variables are also available to set or use:
+
+``FLTK_BASE_LIBRARY_RELEASE``
+ The FLTK base library (optimized)
+
+``FLTK_BASE_LIBRARY_DEBUG``
+ The FLTK base library (debug)
+
+``FLTK_GL_LIBRARY_RELEASE``
+ The FLTK GL library (optimized)
+
+``FLTK_GL_LIBRARY_DEBUG``
+ The FLTK GL library (debug)
+
+``FLTK_FORMS_LIBRARY_RELEASE``
+ The FLTK Forms library (optimized)
+
+``FLTK_FORMS_LIBRARY_DEBUG``
+ The FLTK Forms library (debug)
+
+``FLTK_IMAGES_LIBRARY_RELEASE``
+ The FLTK Images protobuf library (optimized)
+
+``FLTK_IMAGES_LIBRARY_DEBUG``
+ The FLTK Images library (debug)
+#]=======================================================================]
if(NOT FLTK_SKIP_OPENGL)
find_package(OpenGL)
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 365a82a55..161d15c4a 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -1,29 +1,30 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindFLTK2
-# ---------
-#
-# Find the native FLTK2 includes and library
-#
-# The following settings are defined
-#
-# ::
-#
-# FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
-# FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
-# FLTK2_INCLUDE_DIR, where to find include files
-# FLTK2_LIBRARIES, list of fltk2 libraries
-# FLTK2_FOUND, Don't use FLTK2 if false.
-#
-# The following settings should not be used in general.
-#
-# ::
-#
-# FLTK2_BASE_LIBRARY = the full path to fltk2.lib
-# FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib
-# FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
+#[=======================================================================[.rst:
+FindFLTK2
+---------
+
+Find the native FLTK2 includes and library
+
+The following settings are defined
+
+::
+
+ FLTK2_FLUID_EXECUTABLE, where to find the Fluid tool
+ FLTK2_WRAP_UI, This enables the FLTK2_WRAP_UI command
+ FLTK2_INCLUDE_DIR, where to find include files
+ FLTK2_LIBRARIES, list of fltk2 libraries
+ FLTK2_FOUND, Don't use FLTK2 if false.
+
+The following settings should not be used in general.
+
+::
+
+ FLTK2_BASE_LIBRARY = the full path to fltk2.lib
+ FLTK2_GL_LIBRARY = the full path to fltk2_gl.lib
+ FLTK2_IMAGES_LIBRARY = the full path to fltk2_images.lib
+#]=======================================================================]
set (FLTK2_DIR $ENV{FLTK2_DIR} )
diff --git a/Modules/FindFontconfig.cmake b/Modules/FindFontconfig.cmake
new file mode 100644
index 000000000..a6f0180b3
--- /dev/null
+++ b/Modules/FindFontconfig.cmake
@@ -0,0 +1,101 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindFontconfig
+--------------
+
+Find Fontconfig headers and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+``Fontconfig::Fontconfig``
+ The Fontconfig library, if found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables in your project:
+
+``Fontconfig_FOUND``
+ true if (the requested version of) Fontconfig is available.
+``Fontconfig_VERSION``
+ the version of Fontconfig.
+``Fontconfig_LIBRARIES``
+ the libraries to link against to use Fontconfig.
+``Fontconfig_INCLUDE_DIRS``
+ where to find the Fontconfig headers.
+``Fontconfig_COMPILE_OPTIONS``
+ this should be passed to target_compile_options(), if the
+ target is not used for linking
+
+#]=======================================================================]
+
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+find_package(PkgConfig QUIET)
+pkg_check_modules(PKG_FONTCONFIG QUIET fontconfig)
+set(Fontconfig_COMPILE_OPTIONS ${PKG_FONTCONFIG_CFLAGS_OTHER})
+set(Fontconfig_VERSION ${PKG_FONTCONFIG_VERSION})
+
+find_path( Fontconfig_INCLUDE_DIR
+ NAMES
+ fontconfig/fontconfig.h
+ HINTS
+ ${PKG_FONTCONFIG_INCLUDE_DIRS}
+ /usr/X11/include
+)
+
+find_library( Fontconfig_LIBRARY
+ NAMES
+ fontconfig
+ PATHS
+ ${PKG_FONTCONFIG_LIBRARY_DIRS}
+)
+
+if (Fontconfig_INCLUDE_DIR AND NOT Fontconfig_VERSION)
+ file(STRINGS ${Fontconfig_INCLUDE_DIR}/fontconfig/fontconfig.h _contents REGEX "^#define[ \t]+FC_[A-Z]+[ \t]+[0-9]+$")
+ unset(Fontconfig_VERSION)
+ foreach(VPART MAJOR MINOR REVISION)
+ foreach(VLINE ${_contents})
+ if(VLINE MATCHES "^#define[\t ]+FC_${VPART}[\t ]+([0-9]+)$")
+ set(Fontconfig_VERSION_PART "${CMAKE_MATCH_1}")
+ if(Fontconfig_VERSION)
+ string(APPEND Fontconfig_VERSION ".${Fontconfig_VERSION_PART}")
+ else()
+ set(Fontconfig_VERSION "${Fontconfig_VERSION_PART}")
+ endif()
+ endif()
+ endforeach()
+ endforeach()
+endif ()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Fontconfig
+ FOUND_VAR
+ Fontconfig_FOUND
+ REQUIRED_VARS
+ Fontconfig_LIBRARY
+ Fontconfig_INCLUDE_DIR
+ VERSION_VAR
+ Fontconfig_VERSION
+)
+
+
+if(Fontconfig_FOUND AND NOT TARGET Fontconfig::Fontconfig)
+ add_library(Fontconfig::Fontconfig UNKNOWN IMPORTED)
+ set_target_properties(Fontconfig::Fontconfig PROPERTIES
+ IMPORTED_LOCATION "${Fontconfig_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${Fontconfig_COMPILE_OPTIONS}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Fontconfig_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(Fontconfig_LIBRARY Fontconfig_INCLUDE_DIR)
+
+if(Fontconfig_FOUND)
+ set(Fontconfig_LIBRARIES ${Fontconfig_LIBRARY})
+ set(Fontconfig_INCLUDE_DIRS ${Fontconfig_INCLUDE_DIR})
+endif()
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 61643be45..3e6a177dc 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -1,45 +1,46 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindFreetype
-# ------------
-#
-# Find the FreeType font renderer includes and library.
-#
-# Imported Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` target:
-#
-# ``Freetype::Freetype``
-# The Freetype ``freetype`` library, if found
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``FREETYPE_FOUND``
-# true if the Freetype headers and libraries were found
-# ``FREETYPE_INCLUDE_DIRS``
-# directories containing the Freetype headers. This is the
-# concatenation of the variables:
-#
-# ``FREETYPE_INCLUDE_DIR_ft2build``
-# directory holding the main Freetype API configuration header
-# ``FREETYPE_INCLUDE_DIR_freetype2``
-# directory holding Freetype public headers
-# ``FREETYPE_LIBRARIES``
-# the library to link against
-# ``FREETYPE_VERSION_STRING``
-# the version of freetype found (since CMake 2.8.8)
-#
-# Hints
-# ^^^^^
-#
-# The user may set the environment variable ``FREETYPE_DIR`` to the root
-# directory of a Freetype installation.
+#[=======================================================================[.rst:
+FindFreetype
+------------
+
+Find the FreeType font renderer includes and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``Freetype::Freetype``
+ The Freetype ``freetype`` library, if found
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``FREETYPE_FOUND``
+ true if the Freetype headers and libraries were found
+``FREETYPE_INCLUDE_DIRS``
+ directories containing the Freetype headers. This is the
+ concatenation of the variables:
+
+ ``FREETYPE_INCLUDE_DIR_ft2build``
+ directory holding the main Freetype API configuration header
+ ``FREETYPE_INCLUDE_DIR_freetype2``
+ directory holding Freetype public headers
+``FREETYPE_LIBRARIES``
+ the library to link against
+``FREETYPE_VERSION_STRING``
+ the version of freetype found (since CMake 2.8.8)
+
+Hints
+^^^^^
+
+The user may set the environment variable ``FREETYPE_DIR`` to the root
+directory of a Freetype installation.
+#]=======================================================================]
# Created by Eric Wing.
# Modifications by Alexander Neundorf.
diff --git a/Modules/FindGCCXML.cmake b/Modules/FindGCCXML.cmake
index 1f8d738f8..e6c7f2434 100644
--- a/Modules/FindGCCXML.cmake
+++ b/Modules/FindGCCXML.cmake
@@ -1,19 +1,20 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGCCXML
-# ----------
-#
-# Find the GCC-XML front-end executable.
-#
-#
-#
-# This module will define the following variables:
-#
-# ::
-#
-# GCCXML - the GCC-XML front-end executable.
+#[=======================================================================[.rst:
+FindGCCXML
+----------
+
+Find the GCC-XML front-end executable.
+
+
+
+This module will define the following variables:
+
+::
+
+ GCCXML - the GCC-XML front-end executable.
+#]=======================================================================]
find_program(GCCXML
NAMES gccxml
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index ff2976e6a..8522f9b59 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -1,31 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGDAL
-# --------
-#
-#
-#
-# Locate gdal
-#
-# This module accepts the following environment variables:
-#
-# ::
-#
-# GDAL_DIR or GDAL_ROOT - Specify the location of GDAL
-#
-#
-#
-# This module defines the following CMake variables:
-#
-# ::
-#
-# GDAL_FOUND - True if libgdal is found
-# GDAL_LIBRARY - A variable pointing to the GDAL library
-# GDAL_INCLUDE_DIR - Where to find the headers
+#[=======================================================================[.rst:
+FindGDAL
+--------
+
+Find GDAL.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``GDAL::GDAL``
+if GDAL has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``GDAL_FOUND``
+ True if GDAL is found.
+``GDAL_INCLUDE_DIRS``
+ Include directories for GDAL headers.
+``GDAL_LIBRARIES``
+ Libraries to link to GDAL.
+``GDAL_VERSION``
+ The version of GDAL found.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``GDAL_LIBRARY``
+ The libgdal library file.
+``GDAL_INCLUDE_DIR``
+ The directory containing ``gdal.h``.
+
+Hints
+^^^^^
+
+Set ``GDAL_DIR`` or ``GDAL_ROOT`` in the environment to specify the
+GDAL installation prefix.
+#]=======================================================================]
-#
# $GDALDIR is an environment variable that would
# correspond to the ./configure --prefix=$GDAL_DIR
# used in building gdal.
@@ -122,8 +140,26 @@ find_library(GDAL_LIBRARY
PATH_SUFFIXES lib
)
+if (EXISTS "${GDAL_INCLUDE_DIR}/gdal_version.h")
+ file(STRINGS "${GDAL_INCLUDE_DIR}/gdal_version.h" _gdal_version
+ REGEX "GDAL_RELEASE_NAME")
+ string(REGEX REPLACE ".*\"\(.*\)\"" "\\1" GDAL_VERSION "${_gdal_version}")
+ unset(_gdal_version)
+else ()
+ set(GDAL_VERSION GDAL_VERSION-NOTFOUND)
+endif ()
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GDAL DEFAULT_MSG GDAL_LIBRARY GDAL_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GDAL
+ VERSION_VAR GDAL_VERSION
+ REQUIRED_VARS GDAL_LIBRARY GDAL_INCLUDE_DIR)
+
+if (GDAL_FOUND AND NOT TARGET GDAL::GDAL)
+ add_library(GDAL::GDAL UNKNOWN IMPORTED)
+ set_target_properties(GDAL::GDAL PROPERTIES
+ IMPORTED_LOCATION "${GDAL_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${GDAL_INCLUDE_DIR}")
+endif ()
set(GDAL_LIBRARIES ${GDAL_LIBRARY})
set(GDAL_INCLUDE_DIRS ${GDAL_INCLUDE_DIR})
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index efc397318..9687b57e5 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -1,28 +1,50 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGIF
-# -------
-#
-# This finds the GIF library (giflib)
-#
-# The module defines the following variables:
-#
-# ``GIF_FOUND``
-# True if giflib was found
-# ``GIF_LIBRARIES``
-# Libraries to link to in order to use giflib
-# ``GIF_INCLUDE_DIR``
-# where to find the headers
-# ``GIF_VERSION``
-# 3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6
-#
-# The minimum required version of giflib can be specified using the
-# standard syntax, e.g. find_package(GIF 4)
-#
-# $GIF_DIR is an environment variable that would correspond to the
-# ./configure --prefix=$GIF_DIR
+#[=======================================================================[.rst:
+FindGIF
+-------
+
+This finds the GIF library (giflib)
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``GIF::GIF``
+ The giflib library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``GIF_FOUND``
+ If false, do not try to use GIF.
+``GIF_INCLUDE_DIRS``
+ where to find gif_lib.h, etc.
+``GIF_LIBRARIES``
+ the libraries needed to use GIF.
+``GIF_VERSION``
+ 3, 4 or a full version string (eg 5.1.4) for versions >= 4.1.6.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``GIF_INCLUDE_DIR``
+ where to find the GIF headers.
+``GIF_LIBRARY``
+ where to find the GIF library.
+
+Hints
+^^^^^
+
+``GIF_DIR`` is an environment variable that would correspond to the
+``./configure --prefix=$GIF_DIR``.
+#]=======================================================================]
# Created by Eric Wing.
# Modifications by Alexander Neundorf, Ben Campbell
@@ -43,9 +65,6 @@ find_library(GIF_LIBRARY
PATH_SUFFIXES lib
)
-# see readme.txt
-set(GIF_LIBRARIES ${GIF_LIBRARY})
-
# Very basic version detection.
# The GIF_LIB_VERSION string in gif_lib.h seems to be unreliable, since it seems
# to be always " Version 2.0, " in versions 3.x of giflib.
@@ -89,4 +108,20 @@ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GIF REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR
VERSION_VAR GIF_VERSION )
+if(GIF_FOUND)
+ set(GIF_INCLUDE_DIRS "${GIF_INCLUDE_DIR}")
+ set(GIF_LIBRARIES ${GIF_LIBRARY})
+
+ if(NOT TARGET GIF::GIF)
+ add_library(GIF::GIF UNKNOWN IMPORTED)
+ set_target_properties(GIF::GIF PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIRS}")
+ if(EXISTS "${GIF_LIBRARY}")
+ set_target_properties(GIF::GIF PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${GIF_LIBRARY}")
+ endif()
+ endif()
+endif()
+
mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY)
diff --git a/Modules/FindGLEW.cmake b/Modules/FindGLEW.cmake
index 11e872446..ad8a810b5 100644
--- a/Modules/FindGLEW.cmake
+++ b/Modules/FindGLEW.cmake
@@ -1,28 +1,29 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGLEW
-# --------
-#
-# Find the OpenGL Extension Wrangler Library (GLEW)
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
-# if GLEW has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ::
-#
-# GLEW_INCLUDE_DIRS - include directories for GLEW
-# GLEW_LIBRARIES - libraries to link against GLEW
-# GLEW_FOUND - true if GLEW has been found and can be used
+#[=======================================================================[.rst:
+FindGLEW
+--------
+
+Find the OpenGL Extension Wrangler Library (GLEW)
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the :prop_tgt:`IMPORTED` target ``GLEW::GLEW``,
+if GLEW has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ GLEW_INCLUDE_DIRS - include directories for GLEW
+ GLEW_LIBRARIES - libraries to link against GLEW
+ GLEW_FOUND - true if GLEW has been found and can be used
+#]=======================================================================]
find_path(GLEW_INCLUDE_DIR GL/glew.h)
diff --git a/Modules/FindGLUT.cmake b/Modules/FindGLUT.cmake
index 177968387..d42db539f 100644
--- a/Modules/FindGLUT.cmake
+++ b/Modules/FindGLUT.cmake
@@ -1,38 +1,39 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGLUT
-# --------
-#
-# try to find glut library and include files.
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the :prop_tgt:`IMPORTED` targets:
-#
-# ``GLUT::GLUT``
-# Defined if the system has GLUT.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module sets the following variables:
-#
-# ::
-#
-# GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
-# GLUT_LIBRARIES, the libraries to link against
-# GLUT_FOUND, If false, do not try to use GLUT.
-#
-# Also defined, but not for general use are:
-#
-# ::
-#
-# GLUT_glut_LIBRARY = the full path to the glut library.
-# GLUT_Xmu_LIBRARY = the full path to the Xmu library.
-# GLUT_Xi_LIBRARY = the full path to the Xi Library.
+#[=======================================================================[.rst:
+FindGLUT
+--------
+
+try to find glut library and include files.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the :prop_tgt:`IMPORTED` targets:
+
+``GLUT::GLUT``
+ Defined if the system has GLUT.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following variables:
+
+::
+
+ GLUT_INCLUDE_DIR, where to find GL/glut.h, etc.
+ GLUT_LIBRARIES, the libraries to link against
+ GLUT_FOUND, If false, do not try to use GLUT.
+
+Also defined, but not for general use are:
+
+::
+
+ GLUT_glut_LIBRARY = the full path to the glut library.
+ GLUT_Xmu_LIBRARY = the full path to the Xmu library.
+ GLUT_Xi_LIBRARY = the full path to the Xi Library.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
diff --git a/Modules/FindGSL.cmake b/Modules/FindGSL.cmake
index 8d10b6ce5..db0512166 100644
--- a/Modules/FindGSL.cmake
+++ b/Modules/FindGSL.cmake
@@ -1,60 +1,61 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGSL
-# --------
-#
-# Find the native GSL includes and libraries.
-#
-# The GNU Scientific Library (GSL) is a numerical library for C and C++
-# programmers. It is free software under the GNU General Public
-# License.
-#
-# Imported Targets
-# ^^^^^^^^^^^^^^^^
-#
-# If GSL is found, this module defines the following :prop_tgt:`IMPORTED`
-# targets::
-#
-# GSL::gsl - The main GSL library.
-# GSL::gslcblas - The CBLAS support library used by GSL.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project::
-#
-# GSL_FOUND - True if GSL found on the local system
-# GSL_INCLUDE_DIRS - Location of GSL header files.
-# GSL_LIBRARIES - The GSL libraries.
-# GSL_VERSION - The version of the discovered GSL install.
-#
-# Hints
-# ^^^^^
-#
-# Set ``GSL_ROOT_DIR`` to a directory that contains a GSL installation.
-#
-# This script expects to find libraries at ``$GSL_ROOT_DIR/lib`` and the GSL
-# headers at ``$GSL_ROOT_DIR/include/gsl``. The library directory may
-# optionally provide Release and Debug folders. If available, the libraries
-# named ``gsld``, ``gslblasd`` or ``cblasd`` are recognized as debug libraries.
-# For Unix-like systems, this script will use ``$GSL_ROOT_DIR/bin/gsl-config``
-# (if found) to aid in the discovery of GSL.
-#
-# Cache Variables
-# ^^^^^^^^^^^^^^^
-#
-# This module may set the following variables depending on platform and type
-# of GSL installation discovered. These variables may optionally be set to
-# help this module find the correct files::
-#
-# GSL_CBLAS_LIBRARY - Location of the GSL CBLAS library.
-# GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any).
-# GSL_CONFIG_EXECUTABLE - Location of the ``gsl-config`` script (if any).
-# GSL_LIBRARY - Location of the GSL library.
-# GSL_LIBRARY_DEBUG - Location of the debug GSL library (if any).
-#
+#[=======================================================================[.rst:
+FindGSL
+--------
+
+Find the native GSL includes and libraries.
+
+The GNU Scientific Library (GSL) is a numerical library for C and C++
+programmers. It is free software under the GNU General Public
+License.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+If GSL is found, this module defines the following :prop_tgt:`IMPORTED`
+targets::
+
+ GSL::gsl - The main GSL library.
+ GSL::gslcblas - The CBLAS support library used by GSL.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project::
+
+ GSL_FOUND - True if GSL found on the local system
+ GSL_INCLUDE_DIRS - Location of GSL header files.
+ GSL_LIBRARIES - The GSL libraries.
+ GSL_VERSION - The version of the discovered GSL install.
+
+Hints
+^^^^^
+
+Set ``GSL_ROOT_DIR`` to a directory that contains a GSL installation.
+
+This script expects to find libraries at ``$GSL_ROOT_DIR/lib`` and the GSL
+headers at ``$GSL_ROOT_DIR/include/gsl``. The library directory may
+optionally provide Release and Debug folders. If available, the libraries
+named ``gsld``, ``gslblasd`` or ``cblasd`` are recognized as debug libraries.
+For Unix-like systems, this script will use ``$GSL_ROOT_DIR/bin/gsl-config``
+(if found) to aid in the discovery of GSL.
+
+Cache Variables
+^^^^^^^^^^^^^^^
+
+This module may set the following variables depending on platform and type
+of GSL installation discovered. These variables may optionally be set to
+help this module find the correct files::
+
+ GSL_CBLAS_LIBRARY - Location of the GSL CBLAS library.
+ GSL_CBLAS_LIBRARY_DEBUG - Location of the debug GSL CBLAS library (if any).
+ GSL_CONFIG_EXECUTABLE - Location of the ``gsl-config`` script (if any).
+ GSL_LIBRARY - Location of the GSL library.
+ GSL_LIBRARY_DEBUG - Location of the debug GSL library (if any).
+
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index 89fb54baf..8cc6c970d 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -1,18 +1,19 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGTK
-# -------
-#
-# try to find GTK (and glib) and GTKGLArea
-#
-# ::
-#
-# GTK_INCLUDE_DIR - Directories to include to use GTK
-# GTK_LIBRARIES - Files to link against to use GTK
-# GTK_FOUND - GTK was found
-# GTK_GL_FOUND - GTK's GL features were found
+#[=======================================================================[.rst:
+FindGTK
+-------
+
+try to find GTK (and glib) and GTKGLArea
+
+::
+
+ GTK_INCLUDE_DIR - Directories to include to use GTK
+ GTK_LIBRARIES - Files to link against to use GTK
+ GTK_FOUND - GTK was found
+ GTK_GL_FOUND - GTK's GL features were found
+#]=======================================================================]
# don't even bother under WIN32
if(UNIX)
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 15d123059..6c1897cae 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -1,102 +1,103 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGTK2
-# --------
-#
-# FindGTK2.cmake
-#
-# This module can find the GTK2 widget libraries and several of its
-# other optional components like gtkmm, glade, and glademm.
-#
-# NOTE: If you intend to use version checking, CMake 2.6.2 or later is
-#
-# ::
-#
-# required.
-#
-#
-#
-# Specify one or more of the following components as you call this find
-# module. See example below.
-#
-# ::
-#
-# gtk
-# gtkmm
-# glade
-# glademm
-#
-#
-#
-# The following variables will be defined for your use
-#
-# ::
-#
-# GTK2_FOUND - Were all of your specified components found?
-# GTK2_INCLUDE_DIRS - All include directories
-# GTK2_LIBRARIES - All libraries
-# GTK2_TARGETS - All imported targets
-# GTK2_DEFINITIONS - Additional compiler flags
-#
-#
-#
-# ::
-#
-# GTK2_VERSION - The version of GTK2 found (x.y.z)
-# GTK2_MAJOR_VERSION - The major version of GTK2
-# GTK2_MINOR_VERSION - The minor version of GTK2
-# GTK2_PATCH_VERSION - The patch version of GTK2
-#
-#
-#
-# Optional variables you can define prior to calling this module:
-#
-# ::
-#
-# GTK2_DEBUG - Enables verbose debugging of the module
-# GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
-# search for include files
-#
-#
-#
-# ================= Example Usage:
-#
-# ::
-#
-# Call find_package() once, here are some examples to pick from:
-#
-#
-#
-# ::
-#
-# Require GTK 2.6 or later
-# find_package(GTK2 2.6 REQUIRED gtk)
-#
-#
-#
-# ::
-#
-# Require GTK 2.10 or later and Glade
-# find_package(GTK2 2.10 REQUIRED gtk glade)
-#
-#
-#
-# ::
-#
-# Search for GTK/GTKMM 2.8 or later
-# find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
-#
-#
-#
-# ::
-#
-# if(GTK2_FOUND)
-# include_directories(${GTK2_INCLUDE_DIRS})
-# add_executable(mygui mygui.cc)
-# target_link_libraries(mygui ${GTK2_LIBRARIES})
-# endif()
+#[=======================================================================[.rst:
+FindGTK2
+--------
+
+FindGTK2.cmake
+
+This module can find the GTK2 widget libraries and several of its
+other optional components like gtkmm, glade, and glademm.
+
+NOTE: If you intend to use version checking, CMake 2.6.2 or later is
+
+::
+
+ required.
+
+
+
+Specify one or more of the following components as you call this find
+module. See example below.
+
+::
+
+ gtk
+ gtkmm
+ glade
+ glademm
+
+
+
+The following variables will be defined for your use
+
+::
+
+ GTK2_FOUND - Were all of your specified components found?
+ GTK2_INCLUDE_DIRS - All include directories
+ GTK2_LIBRARIES - All libraries
+ GTK2_TARGETS - All imported targets
+ GTK2_DEFINITIONS - Additional compiler flags
+
+
+
+::
+
+ GTK2_VERSION - The version of GTK2 found (x.y.z)
+ GTK2_MAJOR_VERSION - The major version of GTK2
+ GTK2_MINOR_VERSION - The minor version of GTK2
+ GTK2_PATCH_VERSION - The patch version of GTK2
+
+
+
+Optional variables you can define prior to calling this module:
+
+::
+
+ GTK2_DEBUG - Enables verbose debugging of the module
+ GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to
+ search for include files
+
+
+
+================= Example Usage:
+
+::
+
+ Call find_package() once, here are some examples to pick from:
+
+
+
+::
+
+ Require GTK 2.6 or later
+ find_package(GTK2 2.6 REQUIRED gtk)
+
+
+
+::
+
+ Require GTK 2.10 or later and Glade
+ find_package(GTK2 2.10 REQUIRED gtk glade)
+
+
+
+::
+
+ Search for GTK/GTKMM 2.8 or later
+ find_package(GTK2 2.8 COMPONENTS gtk gtkmm)
+
+
+
+::
+
+ if(GTK2_FOUND)
+ include_directories(${GTK2_INCLUDE_DIRS})
+ add_executable(mygui mygui.cc)
+ target_link_libraries(mygui ${GTK2_LIBRARIES})
+ endif()
+#]=======================================================================]
# Version 1.6 (CMake 3.0)
# * Create targets for each library
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index b0579d967..b0175febc 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -1,77 +1,78 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGTest
-# ---------
-#
-# Locate the Google C++ Testing Framework.
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``GTest::GTest``
-# The Google Test ``gtest`` library, if found; adds Thread::Thread
-# automatically
-# ``GTest::Main``
-# The Google Test ``gtest_main`` library, if found
-#
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``GTEST_FOUND``
-# Found the Google Testing framework
-# ``GTEST_INCLUDE_DIRS``
-# the directory containing the Google Test headers
-#
-# The library variables below are set as normal variables. These
-# contain debug/optimized keywords when a debugging library is found.
-#
-# ``GTEST_LIBRARIES``
-# The Google Test ``gtest`` library; note it also requires linking
-# with an appropriate thread library
-# ``GTEST_MAIN_LIBRARIES``
-# The Google Test ``gtest_main`` library
-# ``GTEST_BOTH_LIBRARIES``
-# Both ``gtest`` and ``gtest_main``
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``GTEST_ROOT``
-# The root directory of the Google Test installation (may also be
-# set as an environment variable)
-# ``GTEST_MSVC_SEARCH``
-# If compiling with MSVC, this variable can be set to ``MT`` or
-# ``MD`` (the default) to enable searching a GTest build tree
-#
-#
-# Example usage
-# ^^^^^^^^^^^^^
-#
-# ::
-#
-# enable_testing()
-# find_package(GTest REQUIRED)
-#
-# add_executable(foo foo.cc)
-# target_link_libraries(foo GTest::GTest GTest::Main)
-#
-# add_test(AllTestsInFoo foo)
-#
-#
-# Deeper integration with CTest
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# See :module:`GoogleTest` for information on the :command:`gtest_add_tests`
-# and :command:`gtest_discover_tests` commands.
+#[=======================================================================[.rst:
+FindGTest
+---------
+
+Locate the Google C++ Testing Framework.
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``GTest::GTest``
+ The Google Test ``gtest`` library, if found; adds Thread::Thread
+ automatically
+``GTest::Main``
+ The Google Test ``gtest_main`` library, if found
+
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``GTEST_FOUND``
+ Found the Google Testing framework
+``GTEST_INCLUDE_DIRS``
+ the directory containing the Google Test headers
+
+The library variables below are set as normal variables. These
+contain debug/optimized keywords when a debugging library is found.
+
+``GTEST_LIBRARIES``
+ The Google Test ``gtest`` library; note it also requires linking
+ with an appropriate thread library
+``GTEST_MAIN_LIBRARIES``
+ The Google Test ``gtest_main`` library
+``GTEST_BOTH_LIBRARIES``
+ Both ``gtest`` and ``gtest_main``
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``GTEST_ROOT``
+ The root directory of the Google Test installation (may also be
+ set as an environment variable)
+``GTEST_MSVC_SEARCH``
+ If compiling with MSVC, this variable can be set to ``MT`` or
+ ``MD`` (the default) to enable searching a GTest build tree
+
+
+Example usage
+^^^^^^^^^^^^^
+
+::
+
+ enable_testing()
+ find_package(GTest REQUIRED)
+
+ add_executable(foo foo.cc)
+ target_link_libraries(foo GTest::GTest GTest::Main)
+
+ add_test(AllTestsInFoo foo)
+
+
+Deeper integration with CTest
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+See :module:`GoogleTest` for information on the :command:`gtest_add_tests`
+and :command:`gtest_discover_tests` commands.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/GoogleTest.cmake)
diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake
index 9623b85dd..9e29e8d2d 100644
--- a/Modules/FindGettext.cmake
+++ b/Modules/FindGettext.cmake
@@ -1,61 +1,62 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGettext
-# -----------
-#
-# Find GNU gettext tools
-#
-# This module looks for the GNU gettext tools. This module defines the
-# following values:
-#
-# ::
-#
-# GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
-# GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
-# GETTEXT_FOUND: True if gettext has been found.
-# GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
-#
-#
-#
-# Additionally it provides the following macros:
-#
-# GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
-#
-# ::
-#
-# This will create a target "translations" which will convert the
-# given input po files into the binary output mo file. If the
-# ALL option is used, the translations will also be created when
-# building the default target.
-#
-# GETTEXT_PROCESS_POT_FILE( <potfile> [ALL] [INSTALL_DESTINATION <destdir>]
-# LANGUAGES <lang1> <lang2> ... )
-#
-# ::
-#
-# Process the given pot file to mo files.
-# If INSTALL_DESTINATION is given then automatically install rules will
-# be created, the language subdirectory will be taken into account
-# (by default use share/locale/).
-# If ALL is specified, the pot file is processed when building the all traget.
-# It creates a custom target "potfile".
-#
-# GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>]
-# PO_FILES <po1> <po2> ... )
-#
-# ::
-#
-# Process the given po files to mo files for the given language.
-# If INSTALL_DESTINATION is given then automatically install rules will
-# be created, the language subdirectory will be taken into account
-# (by default use share/locale/).
-# If ALL is specified, the po files are processed when building the all traget.
-# It creates a custom target "pofiles".
-#
-# .. note::
-# If you wish to use the Gettext library (libintl), use :module:`FindIntl`.
+#[=======================================================================[.rst:
+FindGettext
+-----------
+
+Find GNU gettext tools
+
+This module looks for the GNU gettext tools. This module defines the
+following values:
+
+::
+
+ GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool.
+ GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool.
+ GETTEXT_FOUND: True if gettext has been found.
+ GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8)
+
+
+
+Additionally it provides the following macros:
+
+GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN )
+
+::
+
+ This will create a target "translations" which will convert the
+ given input po files into the binary output mo file. If the
+ ALL option is used, the translations will also be created when
+ building the default target.
+
+GETTEXT_PROCESS_POT_FILE( <potfile> [ALL] [INSTALL_DESTINATION <destdir>]
+LANGUAGES <lang1> <lang2> ... )
+
+::
+
+ Process the given pot file to mo files.
+ If INSTALL_DESTINATION is given then automatically install rules will
+ be created, the language subdirectory will be taken into account
+ (by default use share/locale/).
+ If ALL is specified, the pot file is processed when building the all traget.
+ It creates a custom target "potfile".
+
+GETTEXT_PROCESS_PO_FILES( <lang> [ALL] [INSTALL_DESTINATION <dir>]
+PO_FILES <po1> <po2> ... )
+
+::
+
+ Process the given po files to mo files for the given language.
+ If INSTALL_DESTINATION is given then automatically install rules will
+ be created, the language subdirectory will be taken into account
+ (by default use share/locale/).
+ If ALL is specified, the po files are processed when building the all traget.
+ It creates a custom target "pofiles".
+
+.. note::
+ If you wish to use the Gettext library (libintl), use :module:`FindIntl`.
+#]=======================================================================]
find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index fae31eb83..3491cdcc2 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -1,27 +1,34 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGit
-# -------
-#
-# The module defines the following variables:
-#
-# ``GIT_EXECUTABLE``
-# Path to Git command-line client.
-# ``Git_FOUND``, ``GIT_FOUND``
-# True if the Git command-line client was found.
-# ``GIT_VERSION_STRING``
-# The version of Git found.
-#
-# Example usage:
-#
-# .. code-block:: cmake
-#
-# find_package(Git)
-# if(Git_FOUND)
-# message("Git found: ${GIT_EXECUTABLE}")
-# endif()
+#[=======================================================================[.rst:
+FindGit
+-------
+
+The module defines the following ``IMPORTED`` targets (when
+:prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
+
+``Git::Git``
+ Executable of the Git command-line client.
+
+The module defines the following variables:
+
+``GIT_EXECUTABLE``
+ Path to Git command-line client.
+``Git_FOUND``, ``GIT_FOUND``
+ True if the Git command-line client was found.
+``GIT_VERSION_STRING``
+ The version of Git found.
+
+Example usage:
+
+.. code-block:: cmake
+
+ find_package(Git)
+ if(Git_FOUND)
+ message("Git found: ${GIT_EXECUTABLE}")
+ endif()
+#]=======================================================================]
# Look for 'git' or 'eg' (easy git)
#
@@ -77,6 +84,12 @@ if(GIT_EXECUTABLE)
string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
endif()
unset(git_version)
+
+ get_property(_findgit_role GLOBAL PROPERTY CMAKE_ROLE)
+ if(_findgit_role STREQUAL "PROJECT" AND NOT TARGET Git::Git)
+ add_executable(Git::Git IMPORTED)
+ set_property(TARGET Git::Git PROPERTY IMPORTED_LOCATION "${GIT_EXECUTABLE}")
+ endif()
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindGnuTLS.cmake b/Modules/FindGnuTLS.cmake
index 1a97d99ea..9c0744415 100644
--- a/Modules/FindGnuTLS.cmake
+++ b/Modules/FindGnuTLS.cmake
@@ -1,22 +1,23 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGnuTLS
-# ----------
-#
-# Try to find the GNU Transport Layer Security library (gnutls)
-#
-#
-#
-# Once done this will define
-#
-# ::
-#
-# GNUTLS_FOUND - System has gnutls
-# GNUTLS_INCLUDE_DIR - The gnutls include directory
-# GNUTLS_LIBRARIES - The libraries needed to use gnutls
-# GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
+#[=======================================================================[.rst:
+FindGnuTLS
+----------
+
+Try to find the GNU Transport Layer Security library (gnutls)
+
+
+
+Once done this will define
+
+::
+
+ GNUTLS_FOUND - System has gnutls
+ GNUTLS_INCLUDE_DIR - The gnutls include directory
+ GNUTLS_LIBRARIES - The libraries needed to use gnutls
+ GNUTLS_DEFINITIONS - Compiler switches required for using gnutls
+#]=======================================================================]
# Note that this doesn't try to find the gnutls-extra package.
diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake
index aa4cd6c26..ca2467d68 100644
--- a/Modules/FindGnuplot.cmake
+++ b/Modules/FindGnuplot.cmake
@@ -1,25 +1,26 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindGnuplot
-# -----------
-#
-# this module looks for gnuplot
-#
-#
-#
-# Once done this will define
-#
-# ::
-#
-# GNUPLOT_FOUND - system has Gnuplot
-# GNUPLOT_EXECUTABLE - the Gnuplot executable
-# GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
-#
-#
-#
-# GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
+#[=======================================================================[.rst:
+FindGnuplot
+-----------
+
+this module looks for gnuplot
+
+
+
+Once done this will define
+
+::
+
+ GNUPLOT_FOUND - system has Gnuplot
+ GNUPLOT_EXECUTABLE - the Gnuplot executable
+ GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8)
+
+
+
+GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 41b10025b..70bfc96f1 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -1,109 +1,130 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindHDF5
-# --------
-#
-# Find HDF5, a library for reading and writing self describing array data.
-#
-#
-#
-# This module invokes the HDF5 wrapper compiler that should be installed
-# alongside HDF5. Depending upon the HDF5 Configuration, the wrapper
-# compiler is called either h5cc or h5pcc. If this succeeds, the module
-# will then call the compiler with the -show argument to see what flags
-# are used when compiling an HDF5 client application.
-#
-# The module will optionally accept the COMPONENTS argument. If no
-# COMPONENTS are specified, then the find module will default to finding
-# only the HDF5 C library. If one or more COMPONENTS are specified, the
-# module will attempt to find the language bindings for the specified
-# components. The only valid components are C, CXX, Fortran, HL, and
-# Fortran_HL. If the COMPONENTS argument is not given, the module will
-# attempt to find only the C bindings.
-#
-# This module will read the variable
-# HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
-# static link to a dynamic link for HDF5 and all of it's dependencies.
-# To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
-# variable is set before the call to find_package.
-#
-# To provide the module with a hint about where to find your HDF5
-# installation, you can set the environment variable HDF5_ROOT. The
-# Find module will then look in this path when searching for HDF5
-# executables, paths, and libraries.
-#
-# Both the serial and parallel HDF5 wrappers are considered and the first
-# directory to contain either one will be used. In the event that both appear
-# in the same directory the serial version is preferentially selected. This
-# behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to
-# true.
-#
-# In addition to finding the includes and libraries required to compile
-# an HDF5 client application, this module also makes an effort to find
-# tools that come with the HDF5 distribution that may be useful for
-# regression testing.
-#
-# This module will define the following variables:
-#
-# ::
-#
-# HDF5_FOUND - true if HDF5 was found on the system
-# HDF5_VERSION - HDF5 version in format Major.Minor.Release
-# HDF5_INCLUDE_DIRS - Location of the hdf5 includes
-# HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated)
-# HDF5_DEFINITIONS - Required compiler definitions for HDF5
-# HDF5_LIBRARIES - Required libraries for all requested bindings
-# HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API for all
-# bindings, if the HL component is enabled
-#
-# Available components are: C CXX Fortran and HL. For each enabled language
-# binding, a corresponding HDF5_${LANG}_LIBRARIES variable, and potentially
-# HDF5_${LANG}_DEFINITIONS, will be defined.
-# If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will
-# also be defined. With all components enabled, the following variables will be defined:
-#
-# ::
-#
-# HDF5_C_DEFINITIONS -- Required compiler definitions for HDF5 C bindings
-# HDF5_CXX_DEFINITIONS -- Required compiler definitions for HDF5 C++ bindings
-# HDF5_Fortran_DEFINITIONS -- Required compiler definitions for HDF5 Fortran bindings
-# HDF5_C_INCLUDE_DIRS -- Required include directories for HDF5 C bindings
-# HDF5_CXX_INCLUDE_DIRS -- Required include directories for HDF5 C++ bindings
-# HDF5_Fortran_INCLUDE_DIRS -- Required include directories for HDF5 Fortran bindings
-# HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings
-# HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings
-# HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings
-# HDF5_C_HL_LIBRARIES - Required libraries for the high level C bindings
-# HDF5_CXX_HL_LIBRARIES - Required libraries for the high level C++ bindings
-# HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran
-# bindings.
-#
-# HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support
-# HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler
-# HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler
-# HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler
-# HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C compiler
-# which is also the HDF5 wrapper
-# HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C++
-# compiler which is also
-# the HDF5 wrapper
-# HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary
-# Fortran compiler which
-# is also the HDF5 wrapper
-# HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool
-#
-# The following variable can be set to guide the search for HDF5 libraries and includes:
-#
-# ``HDF5_ROOT``
-# Specify the path to the HDF5 installation to use.
-#
-# ``HDF5_FIND_DEBUG``
-# Set to a true value to get some extra debugging output.
-#
-# ``HDF5_NO_FIND_PACKAGE_CONFIG_FILE``
-# Set to a true value to skip trying to find ``hdf5-config.cmake``.
+#[=======================================================================[.rst:
+FindHDF5
+--------
+
+Find HDF5, a library for reading and writing self describing array data.
+
+
+This module invokes the HDF5 wrapper compiler that should be installed
+alongside HDF5. Depending upon the HDF5 Configuration, the wrapper
+compiler is called either h5cc or h5pcc. If this succeeds, the module
+will then call the compiler with the -show argument to see what flags
+are used when compiling an HDF5 client application.
+
+The module will optionally accept the COMPONENTS argument. If no
+COMPONENTS are specified, then the find module will default to finding
+only the HDF5 C library. If one or more COMPONENTS are specified, the
+module will attempt to find the language bindings for the specified
+components. The only valid components are C, CXX, Fortran, HL, and
+Fortran_HL. If the COMPONENTS argument is not given, the module will
+attempt to find only the C bindings.
+
+This module will read the variable
+HDF5_USE_STATIC_LIBRARIES to determine whether or not to prefer a
+static link to a dynamic link for HDF5 and all of it's dependencies.
+To use this feature, make sure that the HDF5_USE_STATIC_LIBRARIES
+variable is set before the call to find_package.
+
+To provide the module with a hint about where to find your HDF5
+installation, you can set the environment variable HDF5_ROOT. The
+Find module will then look in this path when searching for HDF5
+executables, paths, and libraries.
+
+Both the serial and parallel HDF5 wrappers are considered and the first
+directory to contain either one will be used. In the event that both appear
+in the same directory the serial version is preferentially selected. This
+behavior can be reversed by setting the variable HDF5_PREFER_PARALLEL to
+true.
+
+In addition to finding the includes and libraries required to compile
+an HDF5 client application, this module also makes an effort to find
+tools that come with the HDF5 distribution that may be useful for
+regression testing.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``HDF5_FOUND``
+ HDF5 was found on the system
+``HDF5_VERSION``
+ HDF5 library version
+``HDF5_INCLUDE_DIRS``
+ Location of the HDF5 header files
+``HDF5_DEFINITIONS``
+ Required compiler definitions for HDF5
+``HDF5_LIBRARIES``
+ Required libraries for all requested bindings
+``HDF5_HL_LIBRARIES``
+ Required libraries for the HDF5 high level API for all bindings,
+ if the ``HL`` component is enabled
+
+Available components are: ``C`` ``CXX`` ``Fortran`` and ``HL``.
+For each enabled language binding, a corresponding ``HDF5_${LANG}_LIBRARIES``
+variable, and potentially ``HDF5_${LANG}_DEFINITIONS``, will be defined.
+If the ``HL`` component is enabled, then an ``HDF5_${LANG}_HL_LIBRARIES`` will
+also be defined. With all components enabled, the following variables will be defined:
+
+``HDF5_C_DEFINITIONS``
+ Required compiler definitions for HDF5 C bindings
+``HDF5_CXX_DEFINITIONS``
+ Required compiler definitions for HDF5 C++ bindings
+``HDF5_Fortran_DEFINITIONS``
+ Required compiler definitions for HDF5 Fortran bindings
+``HDF5_C_INCLUDE_DIRS``
+ Required include directories for HDF5 C bindings
+``HDF5_CXX_INCLUDE_DIRS``
+ Required include directories for HDF5 C++ bindings
+``HDF5_Fortran_INCLUDE_DIRS``
+ Required include directories for HDF5 Fortran bindings
+``HDF5_C_LIBRARIES``
+ Required libraries for the HDF5 C bindings
+``HDF5_CXX_LIBRARIES``
+ Required libraries for the HDF5 C++ bindings
+``HDF5_Fortran_LIBRARIES``
+ Required libraries for the HDF5 Fortran bindings
+``HDF5_C_HL_LIBRARIES``
+ Required libraries for the high level C bindings
+``HDF5_CXX_HL_LIBRARIES``
+ Required libraries for the high level C++ bindings
+``HDF5_Fortran_HL_LIBRARIES``
+ Required libraries for the high level Fortran bindings.
+
+``HDF5_IS_PARALLEL``
+ HDF5 library has parallel IO support
+``HDF5_C_COMPILER_EXECUTABLE``
+ path to the HDF5 C wrapper compiler
+``HDF5_CXX_COMPILER_EXECUTABLE``
+ path to the HDF5 C++ wrapper compiler
+``HDF5_Fortran_COMPILER_EXECUTABLE``
+ path to the HDF5 Fortran wrapper compiler
+``HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE``
+ path to the primary C compiler which is also the HDF5 wrapper
+``HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE``
+ path to the primary C++ compiler which is also the HDF5 wrapper
+``HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE``
+ path to the primary Fortran compiler which is also the HDF5 wrapper
+``HDF5_DIFF_EXECUTABLE``
+ path to the HDF5 dataset comparison tool
+
+Hints
+^^^^^
+
+The following variable can be set to guide the search for HDF5 libraries and includes:
+
+``HDF5_ROOT``
+ Specify the path to the HDF5 installation to use.
+
+``HDF5_FIND_DEBUG``
+ Set ``true`` to get extra debugging output.
+
+``HDF5_NO_FIND_PACKAGE_CONFIG_FILE``
+ Set ``true`` to skip trying to find ``hdf5-config.cmake``.
+#]=======================================================================]
# This module is maintained by Will Dicharry <wdicharry@stellarscience.com>.
@@ -321,20 +342,22 @@ macro( _HDF5_invoke_compiler language output return_value version is_parallel)
elseif("${language}" STREQUAL "Fortran")
set(test_file ${scratch_dir}/cmake_hdf5_test.f90)
endif()
- exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
- ARGS -show ${lib_type_args} ${test_file}
- OUTPUT_VARIABLE ${output}
- RETURN_VALUE ${return_value}
- )
+ execute_process(
+ COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file}
+ OUTPUT_VARIABLE ${output}
+ ERROR_VARIABLE ${output}
+ RESULT_VARIABLE ${return_value}
+ )
if(NOT ${${return_value}} EQUAL 0)
message(STATUS
"Unable to determine HDF5 ${language} flags from HDF5 wrapper.")
endif()
- exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE}
- ARGS -showconfig
- OUTPUT_VARIABLE config_output
- RETURN_VALUE config_return
- )
+ execute_process(
+ COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig
+ OUTPUT_VARIABLE config_output
+ ERROR_VARIABLE config_output
+ RESULT_VARIABLE config_return
+ )
if(NOT ${return_value} EQUAL 0)
message( STATUS
"Unable to determine HDF5 ${language} version from HDF5 wrapper.")
@@ -817,7 +840,7 @@ if( NOT HDF5_FOUND )
set( THIS_LIBRARY_SEARCH_DEBUG
lib${LIB}d.a lib${LIB}_debug.a lib${LIB}d lib${LIB}_D lib${LIB}_debug
lib${LIB}d-static.a lib${LIB}_debug-static.a lib${LIB}d-static lib${LIB}_D-static lib${LIB}_debug-static )
- set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a ${LIB} lib${LIB}-static.a lib${LIB}-static)
+ set( THIS_LIBRARY_SEARCH_RELEASE lib${LIB}.a lib${LIB} lib${LIB}-static.a lib${LIB}-static)
else()
set( THIS_LIBRARY_SEARCH_DEBUG ${LIB}d ${LIB}_D ${LIB}_debug ${LIB}d-shared ${LIB}_D-shared ${LIB}_debug-shared)
set( THIS_LIBRARY_SEARCH_RELEASE ${LIB} ${LIB}-shared)
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index bb0e2f08e..ec077a5d0 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -1,28 +1,29 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindHSPELL
-# ----------
-#
-# Try to find Hspell
-#
-# Once done this will define
-#
-# ::
-#
-# HSPELL_FOUND - system has Hspell
-# HSPELL_INCLUDE_DIR - the Hspell include directory
-# HSPELL_LIBRARIES - The libraries needed to use Hspell
-# HSPELL_DEFINITIONS - Compiler switches required for using Hspell
-#
-#
-#
-# ::
-#
-# HSPELL_VERSION_STRING - The version of Hspell found (x.y)
-# HSPELL_MAJOR_VERSION - the major version of Hspell
-# HSPELL_MINOR_VERSION - The minor version of Hspell
+#[=======================================================================[.rst:
+FindHSPELL
+----------
+
+Try to find Hspell
+
+Once done this will define
+
+::
+
+ HSPELL_FOUND - system has Hspell
+ HSPELL_INCLUDE_DIR - the Hspell include directory
+ HSPELL_LIBRARIES - The libraries needed to use Hspell
+ HSPELL_DEFINITIONS - Compiler switches required for using Hspell
+
+
+
+::
+
+ HSPELL_VERSION_STRING - The version of Hspell found (x.y)
+ HSPELL_MAJOR_VERSION - the major version of Hspell
+ HSPELL_MINOR_VERSION - The minor version of Hspell
+#]=======================================================================]
find_path(HSPELL_INCLUDE_DIR hspell.h)
diff --git a/Modules/FindHTMLHelp.cmake b/Modules/FindHTMLHelp.cmake
index 6aab8a712..a11ad4d69 100644
--- a/Modules/FindHTMLHelp.cmake
+++ b/Modules/FindHTMLHelp.cmake
@@ -1,19 +1,20 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindHTMLHelp
-# ------------
-#
-# This module looks for Microsoft HTML Help Compiler
-#
-# It defines:
-#
-# ::
-#
-# HTML_HELP_COMPILER : full path to the Compiler (hhc.exe)
-# HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
-# HTML_HELP_LIBRARY : full path to the library (htmlhelp.lib)
+#[=======================================================================[.rst:
+FindHTMLHelp
+------------
+
+This module looks for Microsoft HTML Help Compiler
+
+It defines:
+
+::
+
+ HTML_HELP_COMPILER : full path to the Compiler (hhc.exe)
+ HTML_HELP_INCLUDE_PATH : include path to the API (htmlhelp.h)
+ HTML_HELP_LIBRARY : full path to the library (htmlhelp.lib)
+#]=======================================================================]
if(WIN32)
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
index 8aa553e79..1358363d2 100644
--- a/Modules/FindHg.cmake
+++ b/Modules/FindHg.cmake
@@ -1,45 +1,46 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindHg
-# ------
-#
-# Extract information from a mercurial working copy.
-#
-# The module defines the following variables:
-#
-# ::
-#
-# HG_EXECUTABLE - path to mercurial command line client (hg)
-# HG_FOUND - true if the command line client was found
-# HG_VERSION_STRING - the version of mercurial found
-#
-# If the command line client executable is found the following macro is defined:
-#
-# ::
-#
-# HG_WC_INFO(<dir> <var-prefix>)
-#
-# Hg_WC_INFO extracts information of a mercurial working copy
-# at a given location. This macro defines the following variables:
-#
-# ::
-#
-# <var-prefix>_WC_CHANGESET - current changeset
-# <var-prefix>_WC_REVISION - current revision
-#
-# Example usage:
-#
-# ::
-#
-# find_package(Hg)
-# if(HG_FOUND)
-# message("hg found: ${HG_EXECUTABLE}")
-# HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
-# message("Current revision is ${Project_WC_REVISION}")
-# message("Current changeset is ${Project_WC_CHANGESET}")
-# endif()
+#[=======================================================================[.rst:
+FindHg
+------
+
+Extract information from a mercurial working copy.
+
+The module defines the following variables:
+
+::
+
+ HG_EXECUTABLE - path to mercurial command line client (hg)
+ HG_FOUND - true if the command line client was found
+ HG_VERSION_STRING - the version of mercurial found
+
+If the command line client executable is found the following macro is defined:
+
+::
+
+ HG_WC_INFO(<dir> <var-prefix>)
+
+Hg_WC_INFO extracts information of a mercurial working copy
+at a given location. This macro defines the following variables:
+
+::
+
+ <var-prefix>_WC_CHANGESET - current changeset
+ <var-prefix>_WC_REVISION - current revision
+
+Example usage:
+
+::
+
+ find_package(Hg)
+ if(HG_FOUND)
+ message("hg found: ${HG_EXECUTABLE}")
+ HG_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+ message("Current revision is ${Project_WC_REVISION}")
+ message("Current changeset is ${Project_WC_CHANGESET}")
+ endif()
+#]=======================================================================]
find_program(HG_EXECUTABLE
NAMES hg
diff --git a/Modules/FindICU.cmake b/Modules/FindICU.cmake
index aa531d522..e4b4909b5 100644
--- a/Modules/FindICU.cmake
+++ b/Modules/FindICU.cmake
@@ -1,89 +1,90 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindICU
-# -------
-#
-# Find the International Components for Unicode (ICU) libraries and
-# programs.
-#
-# This module supports multiple components.
-# Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
-# ``lx``, ``test``, ``tu`` and ``uc``.
-#
-# Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
-# ``in``; any of the names may be used, and the appropriate
-# platform-specific library name will be automatically selected.
-#
-# This module reports information about the ICU installation in
-# several variables. General variables::
-#
-# ICU_VERSION - ICU release version
-# ICU_FOUND - true if the main programs and libraries were found
-# ICU_LIBRARIES - component libraries to be linked
-# ICU_INCLUDE_DIRS - the directories containing the ICU headers
-#
-# Imported targets::
-#
-# ICU::<C>
-#
-# Where ``<C>`` is the name of an ICU component, for example
-# ``ICU::i18n``.
-#
-# ICU programs are reported in::
-#
-# ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
-# ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
-# ICU_GENBRK_EXECUTABLE - path to genbrk executable
-# ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
-# ICU_GENRB_EXECUTABLE - path to genrb executable
-# ICU_GENDICT_EXECUTABLE - path to gendict executable
-# ICU_DERB_EXECUTABLE - path to derb executable
-# ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
-# ICU_UCONV_EXECUTABLE - path to uconv executable
-# ICU_GENCFU_EXECUTABLE - path to gencfu executable
-# ICU_MAKECONV_EXECUTABLE - path to makeconv executable
-# ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
-# ICU_GENCCODE_EXECUTABLE - path to genccode executable
-# ICU_GENSPREP_EXECUTABLE - path to gensprep executable
-# ICU_ICUPKG_EXECUTABLE - path to icupkg executable
-# ICU_GENCMN_EXECUTABLE - path to gencmn executable
-#
-# ICU component libraries are reported in::
-#
-# ICU_<C>_FOUND - ON if component was found
-# ICU_<C>_LIBRARIES - libraries for component
-#
-# ICU datafiles are reported in::
-#
-# ICU_MAKEFILE_INC - Makefile.inc
-# ICU_PKGDATA_INC - pkgdata.inc
-#
-# Note that ``<C>`` is the uppercased name of the component.
-#
-# This module reads hints about search results from::
-#
-# ICU_ROOT - the root of the ICU installation
-#
-# The environment variable ``ICU_ROOT`` may also be used; the
-# ICU_ROOT variable takes precedence.
-#
-# The following cache variables may also be set::
-#
-# ICU_<P>_EXECUTABLE - the path to executable <P>
-# ICU_INCLUDE_DIR - the directory containing the ICU headers
-# ICU_<C>_LIBRARY - the library for component <C>
-#
-# .. note::
-#
-# In most cases none of the above variables will require setting,
-# unless multiple ICU versions are available and a specific version
-# is required.
-#
-# Other variables one may set to control this module are::
-#
-# ICU_DEBUG - Set to ON to enable debug output from FindICU.
+#[=======================================================================[.rst:
+FindICU
+-------
+
+Find the International Components for Unicode (ICU) libraries and
+programs.
+
+This module supports multiple components.
+Components can include any of: ``data``, ``i18n``, ``io``, ``le``,
+``lx``, ``test``, ``tu`` and ``uc``.
+
+Note that on Windows ``data`` is named ``dt`` and ``i18n`` is named
+``in``; any of the names may be used, and the appropriate
+platform-specific library name will be automatically selected.
+
+This module reports information about the ICU installation in
+several variables. General variables::
+
+ ICU_VERSION - ICU release version
+ ICU_FOUND - true if the main programs and libraries were found
+ ICU_LIBRARIES - component libraries to be linked
+ ICU_INCLUDE_DIRS - the directories containing the ICU headers
+
+Imported targets::
+
+ ICU::<C>
+
+Where ``<C>`` is the name of an ICU component, for example
+``ICU::i18n``.
+
+ICU programs are reported in::
+
+ ICU_GENCNVAL_EXECUTABLE - path to gencnval executable
+ ICU_ICUINFO_EXECUTABLE - path to icuinfo executable
+ ICU_GENBRK_EXECUTABLE - path to genbrk executable
+ ICU_ICU-CONFIG_EXECUTABLE - path to icu-config executable
+ ICU_GENRB_EXECUTABLE - path to genrb executable
+ ICU_GENDICT_EXECUTABLE - path to gendict executable
+ ICU_DERB_EXECUTABLE - path to derb executable
+ ICU_PKGDATA_EXECUTABLE - path to pkgdata executable
+ ICU_UCONV_EXECUTABLE - path to uconv executable
+ ICU_GENCFU_EXECUTABLE - path to gencfu executable
+ ICU_MAKECONV_EXECUTABLE - path to makeconv executable
+ ICU_GENNORM2_EXECUTABLE - path to gennorm2 executable
+ ICU_GENCCODE_EXECUTABLE - path to genccode executable
+ ICU_GENSPREP_EXECUTABLE - path to gensprep executable
+ ICU_ICUPKG_EXECUTABLE - path to icupkg executable
+ ICU_GENCMN_EXECUTABLE - path to gencmn executable
+
+ICU component libraries are reported in::
+
+ ICU_<C>_FOUND - ON if component was found
+ ICU_<C>_LIBRARIES - libraries for component
+
+ICU datafiles are reported in::
+
+ ICU_MAKEFILE_INC - Makefile.inc
+ ICU_PKGDATA_INC - pkgdata.inc
+
+Note that ``<C>`` is the uppercased name of the component.
+
+This module reads hints about search results from::
+
+ ICU_ROOT - the root of the ICU installation
+
+The environment variable ``ICU_ROOT`` may also be used; the
+ICU_ROOT variable takes precedence.
+
+The following cache variables may also be set::
+
+ ICU_<P>_EXECUTABLE - the path to executable <P>
+ ICU_INCLUDE_DIR - the directory containing the ICU headers
+ ICU_<C>_LIBRARY - the library for component <C>
+
+.. note::
+
+ In most cases none of the above variables will require setting,
+ unless multiple ICU versions are available and a specific version
+ is required.
+
+Other variables one may set to control this module are::
+
+ ICU_DEBUG - Set to ON to enable debug output from FindICU.
+#]=======================================================================]
# Written by Roger Leigh <rleigh@codelibre.net>
@@ -164,7 +165,9 @@ function(_ICU_FIND)
find_program("${cache_var}" "${program}"
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_binary_suffixes}
- DOC "ICU ${program} executable")
+ DOC "ICU ${program} executable"
+ NO_PACKAGE_ROOT_PATH
+ )
mark_as_advanced(cache_var)
set("${program_var}" "${${cache_var}}" PARENT_SCOPE)
endforeach()
@@ -228,11 +231,15 @@ function(_ICU_FIND)
find_library("${component_cache_release}" ${component_libnames}
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_library_suffixes}
- DOC "ICU ${component} library (release)")
+ DOC "ICU ${component} library (release)"
+ NO_PACKAGE_ROOT_PATH
+ )
find_library("${component_cache_debug}" ${component_debug_libnames}
HINTS ${icu_roots}
PATH_SUFFIXES ${icu_library_suffixes}
- DOC "ICU ${component} library (debug)")
+ DOC "ICU ${component} library (debug)"
+ NO_PACKAGE_ROOT_PATH
+ )
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(ICU_${component_upcase})
mark_as_advanced("${component_cache_release}" "${component_cache_debug}")
@@ -362,6 +369,10 @@ if(ICU_FOUND)
IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
IMPORTED_LOCATION_DEBUG "${${_ICU_component_cache_debug}}")
endif()
+ if(CMAKE_DL_LIBS AND _ICU_component STREQUAL "uc")
+ set_target_properties(${_ICU_imported_target} PROPERTIES
+ INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
+ endif()
endif()
endif()
unset(_ICU_component_upcase)
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
index df76e5a66..1e0f0b828 100644
--- a/Modules/FindIce.cmake
+++ b/Modules/FindIce.cmake
@@ -1,146 +1,149 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindIce
-# -------
-#
-# Find the ZeroC Internet Communication Engine (ICE) programs,
-# libraries and datafiles.
-#
-# This module supports multiple components.
-# Components can include any of: ``Freeze``, ``Glacier2``, ``Ice``,
-# ``IceBox``, ``IceDB``, ``IceDiscovery``, ``IceGrid``,
-# ``IceLocatorDiscovery``, ``IcePatch``, ``IceSSL``, ``IceStorm``,
-# ``IceUtil``, ``IceXML``, or ``Slice``.
-#
-# Ice 3.7 and later also include C++11-specific components:
-# ``Glacier2++11``, ``Ice++11``, ``IceBox++11``, ``IceDiscovery++11``
-# ``IceGrid``, ``IceLocatorDiscovery++11``, ``IceSSL++11``,
-# ``IceStorm++11``
-#
-# Note that the set of supported components is Ice version-specific.
-#
-# This module reports information about the Ice installation in
-# several variables. General variables::
-#
-# Ice_VERSION - Ice release version
-# Ice_FOUND - true if the main programs and libraries were found
-# Ice_LIBRARIES - component libraries to be linked
-# Ice_INCLUDE_DIRS - the directories containing the Ice headers
-# Ice_SLICE_DIRS - the directories containing the Ice slice interface
-# definitions
-#
-# Imported targets::
-#
-# Ice::<C>
-#
-# Where ``<C>`` is the name of an Ice component, for example
-# ``Ice::Glacier2`` or ``Ice++11``.
-#
-# Ice slice programs are reported in::
-#
-# Ice_SLICE2CPP_EXECUTABLE - path to slice2cpp executable
-# Ice_SLICE2CS_EXECUTABLE - path to slice2cs executable
-# Ice_SLICE2FREEZEJ_EXECUTABLE - path to slice2freezej executable
-# Ice_SLICE2FREEZE_EXECUTABLE - path to slice2freeze executable
-# Ice_SLICE2HTML_EXECUTABLE - path to slice2html executable
-# Ice_SLICE2JAVA_EXECUTABLE - path to slice2java executable
-# Ice_SLICE2JS_EXECUTABLE - path to slice2js executable
-# Ice_SLICE2OBJC_EXECUTABLE - path to slice2objc executable
-# Ice_SLICE2PHP_EXECUTABLE - path to slice2php executable
-# Ice_SLICE2PY_EXECUTABLE - path to slice2py executable
-# Ice_SLICE2RB_EXECUTABLE - path to slice2rb executable
-#
-# Ice programs are reported in::
-#
-# Ice_GLACIER2ROUTER_EXECUTABLE - path to glacier2router executable
-# Ice_ICEBOX_EXECUTABLE - path to icebox executable
-# Ice_ICEBOXXX11_EXECUTABLE - path to icebox++11 executable
-# Ice_ICEBOXADMIN_EXECUTABLE - path to iceboxadmin executable
-# Ice_ICEBOXD_EXECUTABLE - path to iceboxd executable
-# Ice_ICEBOXNET_EXECUTABLE - path to iceboxnet executable
-# Ice_ICEBRIDGE_EXECUTABLE - path to icebridge executable
-# Ice_ICEGRIDADMIN_EXECUTABLE - path to icegridadmin executable
-# Ice_ICEGRIDDB_EXECUTABLE - path to icegriddb executable
-# Ice_ICEGRIDNODE_EXECUTABLE - path to icegridnode executable
-# Ice_ICEGRIDNODED_EXECUTABLE - path to icegridnoded executable
-# Ice_ICEGRIDREGISTRY_EXECUTABLE - path to icegridregistry executable
-# Ice_ICEGRIDREGISTRYD_EXECUTABLE - path to icegridregistryd executable
-# Ice_ICEPATCH2CALC_EXECUTABLE - path to icepatch2calc executable
-# Ice_ICEPATCH2CLIENT_EXECUTABLE - path to icepatch2client executable
-# Ice_ICEPATCH2SERVER_EXECUTABLE - path to icepatch2server executable
-# Ice_ICESERVICEINSTALL_EXECUTABLE - path to iceserviceinstall executable
-# Ice_ICESTORMADMIN_EXECUTABLE - path to icestormadmin executable
-# Ice_ICESTORMDB_EXECUTABLE - path to icestormdb executable
-# Ice_ICESTORMMIGRATE_EXECUTABLE - path to icestormmigrate executable
-#
-# Ice db programs (Windows only; standard system versions on all other
-# platforms) are reported in::
-#
-# Ice_DB_ARCHIVE_EXECUTABLE - path to db_archive executable
-# Ice_DB_CHECKPOINT_EXECUTABLE - path to db_checkpoint executable
-# Ice_DB_DEADLOCK_EXECUTABLE - path to db_deadlock executable
-# Ice_DB_DUMP_EXECUTABLE - path to db_dump executable
-# Ice_DB_HOTBACKUP_EXECUTABLE - path to db_hotbackup executable
-# Ice_DB_LOAD_EXECUTABLE - path to db_load executable
-# Ice_DB_LOG_VERIFY_EXECUTABLE - path to db_log_verify executable
-# Ice_DB_PRINTLOG_EXECUTABLE - path to db_printlog executable
-# Ice_DB_RECOVER_EXECUTABLE - path to db_recover executable
-# Ice_DB_STAT_EXECUTABLE - path to db_stat executable
-# Ice_DB_TUNER_EXECUTABLE - path to db_tuner executable
-# Ice_DB_UPGRADE_EXECUTABLE - path to db_upgrade executable
-# Ice_DB_VERIFY_EXECUTABLE - path to db_verify executable
-# Ice_DUMPDB_EXECUTABLE - path to dumpdb executable
-# Ice_TRANSFORMDB_EXECUTABLE - path to transformdb executable
-#
-# Ice component libraries are reported in::
-#
-# Ice_<C>_FOUND - ON if component was found
-# Ice_<C>_LIBRARIES - libraries for component
-#
-# Note that ``<C>`` is the uppercased name of the component.
-#
-# This module reads hints about search results from::
-#
-# Ice_HOME - the root of the Ice installation
-#
-# The environment variable ``ICE_HOME`` may also be used; the
-# Ice_HOME variable takes precedence.
-#
-# .. note::
-# On Windows, Ice 3.7.0 and later provide libraries via the NuGet
-# package manager. Appropriate NuGet packages will be searched for
-# using ``CMAKE_PREFIX_PATH``, or alternatively ``Ice_HOME`` may be
-# set to the location of a specific NuGet package to restrict the
-# search.
-#
-# The following cache variables may also be set::
-#
-# Ice_<P>_EXECUTABLE - the path to executable <P>
-# Ice_INCLUDE_DIR - the directory containing the Ice headers
-# Ice_SLICE_DIR - the directory containing the Ice slice interface
-# definitions
-# Ice_<C>_LIBRARY - the library for component <C>
-#
-# .. note::
-#
-# In most cases none of the above variables will require setting,
-# unless multiple Ice versions are available and a specific version
-# is required. On Windows, the most recent version of Ice will be
-# found through the registry. On Unix, the programs, headers and
-# libraries will usually be in standard locations, but Ice_SLICE_DIRS
-# might not be automatically detected (commonly known locations are
-# searched). All the other variables are defaulted using Ice_HOME,
-# if set. It's possible to set Ice_HOME and selectively specify
-# alternative locations for the other components; this might be
-# required for e.g. newer versions of Visual Studio if the
-# heuristics are not sufficient to identify the correct programs and
-# libraries for the specific Visual Studio version.
-#
-# Other variables one may set to control this module are::
-#
-# Ice_DEBUG - Set to ON to enable debug output from FindIce.
+#[=======================================================================[.rst:
+FindIce
+-------
+
+Find the ZeroC Internet Communication Engine (ICE) programs,
+libraries and datafiles.
+
+This module supports multiple components.
+Components can include any of: ``Freeze``, ``Glacier2``, ``Ice``,
+``IceBox``, ``IceDB``, ``IceDiscovery``, ``IceGrid``,
+``IceLocatorDiscovery``, ``IcePatch``, ``IceSSL``, ``IceStorm``,
+``IceUtil``, ``IceXML``, or ``Slice``.
+
+Ice 3.7 and later also include C++11-specific components:
+``Glacier2++11``, ``Ice++11``, ``IceBox++11``, ``IceDiscovery++11``
+``IceGrid``, ``IceLocatorDiscovery++11``, ``IceSSL++11``,
+``IceStorm++11``
+
+Note that the set of supported components is Ice version-specific.
+
+This module reports information about the Ice installation in
+several variables. General variables::
+
+ Ice_VERSION - Ice release version
+ Ice_FOUND - true if the main programs and libraries were found
+ Ice_LIBRARIES - component libraries to be linked
+ Ice_INCLUDE_DIRS - the directories containing the Ice headers
+ Ice_SLICE_DIRS - the directories containing the Ice slice interface
+ definitions
+
+Imported targets::
+
+ Ice::<C>
+
+Where ``<C>`` is the name of an Ice component, for example
+``Ice::Glacier2`` or ``Ice++11``.
+
+Ice slice programs are reported in::
+
+ Ice_SLICE2CONFLUENCE_EXECUTABLE - path to slice2confluence executable
+ Ice_SLICE2CPP_EXECUTABLE - path to slice2cpp executable
+ Ice_SLICE2CS_EXECUTABLE - path to slice2cs executable
+ Ice_SLICE2FREEZEJ_EXECUTABLE - path to slice2freezej executable
+ Ice_SLICE2FREEZE_EXECUTABLE - path to slice2freeze executable
+ Ice_SLICE2HTML_EXECUTABLE - path to slice2html executable
+ Ice_SLICE2JAVA_EXECUTABLE - path to slice2java executable
+ Ice_SLICE2JS_EXECUTABLE - path to slice2js executable
+ Ice_SLICE2MATLAB_EXECUTABLE - path to slice2matlab executable
+ Ice_SLICE2OBJC_EXECUTABLE - path to slice2objc executable
+ Ice_SLICE2PHP_EXECUTABLE - path to slice2php executable
+ Ice_SLICE2PY_EXECUTABLE - path to slice2py executable
+ Ice_SLICE2RB_EXECUTABLE - path to slice2rb executable
+
+Ice programs are reported in::
+
+ Ice_GLACIER2ROUTER_EXECUTABLE - path to glacier2router executable
+ Ice_ICEBOX_EXECUTABLE - path to icebox executable
+ Ice_ICEBOXXX11_EXECUTABLE - path to icebox++11 executable
+ Ice_ICEBOXADMIN_EXECUTABLE - path to iceboxadmin executable
+ Ice_ICEBOXD_EXECUTABLE - path to iceboxd executable
+ Ice_ICEBOXNET_EXECUTABLE - path to iceboxnet executable
+ Ice_ICEBRIDGE_EXECUTABLE - path to icebridge executable
+ Ice_ICEGRIDADMIN_EXECUTABLE - path to icegridadmin executable
+ Ice_ICEGRIDDB_EXECUTABLE - path to icegriddb executable
+ Ice_ICEGRIDNODE_EXECUTABLE - path to icegridnode executable
+ Ice_ICEGRIDNODED_EXECUTABLE - path to icegridnoded executable
+ Ice_ICEGRIDREGISTRY_EXECUTABLE - path to icegridregistry executable
+ Ice_ICEGRIDREGISTRYD_EXECUTABLE - path to icegridregistryd executable
+ Ice_ICEPATCH2CALC_EXECUTABLE - path to icepatch2calc executable
+ Ice_ICEPATCH2CLIENT_EXECUTABLE - path to icepatch2client executable
+ Ice_ICEPATCH2SERVER_EXECUTABLE - path to icepatch2server executable
+ Ice_ICESERVICEINSTALL_EXECUTABLE - path to iceserviceinstall executable
+ Ice_ICESTORMADMIN_EXECUTABLE - path to icestormadmin executable
+ Ice_ICESTORMDB_EXECUTABLE - path to icestormdb executable
+ Ice_ICESTORMMIGRATE_EXECUTABLE - path to icestormmigrate executable
+
+Ice db programs (Windows only; standard system versions on all other
+platforms) are reported in::
+
+ Ice_DB_ARCHIVE_EXECUTABLE - path to db_archive executable
+ Ice_DB_CHECKPOINT_EXECUTABLE - path to db_checkpoint executable
+ Ice_DB_DEADLOCK_EXECUTABLE - path to db_deadlock executable
+ Ice_DB_DUMP_EXECUTABLE - path to db_dump executable
+ Ice_DB_HOTBACKUP_EXECUTABLE - path to db_hotbackup executable
+ Ice_DB_LOAD_EXECUTABLE - path to db_load executable
+ Ice_DB_LOG_VERIFY_EXECUTABLE - path to db_log_verify executable
+ Ice_DB_PRINTLOG_EXECUTABLE - path to db_printlog executable
+ Ice_DB_RECOVER_EXECUTABLE - path to db_recover executable
+ Ice_DB_STAT_EXECUTABLE - path to db_stat executable
+ Ice_DB_TUNER_EXECUTABLE - path to db_tuner executable
+ Ice_DB_UPGRADE_EXECUTABLE - path to db_upgrade executable
+ Ice_DB_VERIFY_EXECUTABLE - path to db_verify executable
+ Ice_DUMPDB_EXECUTABLE - path to dumpdb executable
+ Ice_TRANSFORMDB_EXECUTABLE - path to transformdb executable
+
+Ice component libraries are reported in::
+
+ Ice_<C>_FOUND - ON if component was found
+ Ice_<C>_LIBRARIES - libraries for component
+
+Note that ``<C>`` is the uppercased name of the component.
+
+This module reads hints about search results from::
+
+ Ice_HOME - the root of the Ice installation
+
+The environment variable ``ICE_HOME`` may also be used; the
+Ice_HOME variable takes precedence.
+
+.. note::
+ On Windows, Ice 3.7.0 and later provide libraries via the NuGet
+ package manager. Appropriate NuGet packages will be searched for
+ using ``CMAKE_PREFIX_PATH``, or alternatively ``Ice_HOME`` may be
+ set to the location of a specific NuGet package to restrict the
+ search.
+
+The following cache variables may also be set::
+
+ Ice_<P>_EXECUTABLE - the path to executable <P>
+ Ice_INCLUDE_DIR - the directory containing the Ice headers
+ Ice_SLICE_DIR - the directory containing the Ice slice interface
+ definitions
+ Ice_<C>_LIBRARY - the library for component <C>
+
+.. note::
+
+ In most cases none of the above variables will require setting,
+ unless multiple Ice versions are available and a specific version
+ is required. On Windows, the most recent version of Ice will be
+ found through the registry. On Unix, the programs, headers and
+ libraries will usually be in standard locations, but Ice_SLICE_DIRS
+ might not be automatically detected (commonly known locations are
+ searched). All the other variables are defaulted using Ice_HOME,
+ if set. It's possible to set Ice_HOME and selectively specify
+ alternative locations for the other components; this might be
+ required for e.g. newer versions of Visual Studio if the
+ heuristics are not sufficient to identify the correct programs and
+ libraries for the specific Visual Studio version.
+
+Other variables one may set to control this module are::
+
+ Ice_DEBUG - Set to ON to enable debug output from FindIce.
+#]=======================================================================]
# Written by Roger Leigh <rleigh@codelibre.net>
@@ -184,6 +187,7 @@
icestormmigrate)
set(_Ice_slice_programs
+ slice2confluence
slice2cpp
slice2cs
slice2freezej
@@ -191,6 +195,7 @@
slice2html
slice2java
slice2js
+ slice2matlab
slice2objc
slice2php
slice2py
diff --git a/Modules/FindIcotool.cmake b/Modules/FindIcotool.cmake
index 26e95a0fa..32fc4aebd 100644
--- a/Modules/FindIcotool.cmake
+++ b/Modules/FindIcotool.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindIcotool
-# -----------
-#
-# Find icotool
-#
-# This module looks for icotool. This module defines the following
-# values:
-#
-# ::
-#
-# ICOTOOL_EXECUTABLE: the full path to the icotool tool.
-# ICOTOOL_FOUND: True if icotool has been found.
-# ICOTOOL_VERSION_STRING: the version of icotool found.
+#[=======================================================================[.rst:
+FindIcotool
+-----------
+
+Find icotool
+
+This module looks for icotool. This module defines the following
+values:
+
+::
+
+ ICOTOOL_EXECUTABLE: the full path to the icotool tool.
+ ICOTOOL_FOUND: True if icotool has been found.
+ ICOTOOL_VERSION_STRING: the version of icotool found.
+#]=======================================================================]
find_program(ICOTOOL_EXECUTABLE
icotool
diff --git a/Modules/FindImageMagick.cmake b/Modules/FindImageMagick.cmake
index 6d94d3b68..2ddd11c8d 100644
--- a/Modules/FindImageMagick.cmake
+++ b/Modules/FindImageMagick.cmake
@@ -1,87 +1,88 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindImageMagick
-# ---------------
-#
-# Find the ImageMagick binary suite.
-#
-# This module will search for a set of ImageMagick tools specified as
-# components in the FIND_PACKAGE call. Typical components include, but
-# are not limited to (future versions of ImageMagick might have
-# additional components not listed here):
-#
-# ::
-#
-# animate
-# compare
-# composite
-# conjure
-# convert
-# display
-# identify
-# import
-# mogrify
-# montage
-# stream
-#
-#
-#
-# If no component is specified in the FIND_PACKAGE call, then it only
-# searches for the ImageMagick executable directory. This code defines
-# the following variables:
-#
-# ::
-#
-# ImageMagick_FOUND - TRUE if all components are found.
-# ImageMagick_EXECUTABLE_DIR - Full path to executables directory.
-# ImageMagick_<component>_FOUND - TRUE if <component> is found.
-# ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
-# ImageMagick_VERSION_STRING - the version of ImageMagick found
-# (since CMake 2.8.8)
-#
-#
-#
-# ImageMagick_VERSION_STRING will not work for old versions like 5.2.3.
-#
-# There are also components for the following ImageMagick APIs:
-#
-# ::
-#
-# Magick++
-# MagickWand
-# MagickCore
-#
-#
-#
-# For these components the following variables are set:
-#
-# ::
-#
-# ImageMagick_FOUND - TRUE if all components are found.
-# ImageMagick_INCLUDE_DIRS - Full paths to all include dirs.
-# ImageMagick_LIBRARIES - Full paths to all libraries.
-# ImageMagick_<component>_FOUND - TRUE if <component> is found.
-# ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
-# ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
-#
-#
-#
-# Example Usages:
-#
-# ::
-#
-# find_package(ImageMagick)
-# find_package(ImageMagick COMPONENTS convert)
-# find_package(ImageMagick COMPONENTS convert mogrify display)
-# find_package(ImageMagick COMPONENTS Magick++)
-# find_package(ImageMagick COMPONENTS Magick++ convert)
-#
-#
-#
-# Note that the standard FIND_PACKAGE features are supported (i.e.,
-# QUIET, REQUIRED, etc.).
+#[=======================================================================[.rst:
+FindImageMagick
+---------------
+
+Find the ImageMagick binary suite.
+
+This module will search for a set of ImageMagick tools specified as
+components in the FIND_PACKAGE call. Typical components include, but
+are not limited to (future versions of ImageMagick might have
+additional components not listed here):
+
+::
+
+ animate
+ compare
+ composite
+ conjure
+ convert
+ display
+ identify
+ import
+ mogrify
+ montage
+ stream
+
+
+
+If no component is specified in the FIND_PACKAGE call, then it only
+searches for the ImageMagick executable directory. This code defines
+the following variables:
+
+::
+
+ ImageMagick_FOUND - TRUE if all components are found.
+ ImageMagick_EXECUTABLE_DIR - Full path to executables directory.
+ ImageMagick_<component>_FOUND - TRUE if <component> is found.
+ ImageMagick_<component>_EXECUTABLE - Full path to <component> executable.
+ ImageMagick_VERSION_STRING - the version of ImageMagick found
+ (since CMake 2.8.8)
+
+
+
+ImageMagick_VERSION_STRING will not work for old versions like 5.2.3.
+
+There are also components for the following ImageMagick APIs:
+
+::
+
+ Magick++
+ MagickWand
+ MagickCore
+
+
+
+For these components the following variables are set:
+
+::
+
+ ImageMagick_FOUND - TRUE if all components are found.
+ ImageMagick_INCLUDE_DIRS - Full paths to all include dirs.
+ ImageMagick_LIBRARIES - Full paths to all libraries.
+ ImageMagick_<component>_FOUND - TRUE if <component> is found.
+ ImageMagick_<component>_INCLUDE_DIRS - Full path to <component> include dirs.
+ ImageMagick_<component>_LIBRARIES - Full path to <component> libraries.
+
+
+
+Example Usages:
+
+::
+
+ find_package(ImageMagick)
+ find_package(ImageMagick COMPONENTS convert)
+ find_package(ImageMagick COMPONENTS convert mogrify display)
+ find_package(ImageMagick COMPONENTS Magick++)
+ find_package(ImageMagick COMPONENTS Magick++ convert)
+
+
+
+Note that the standard FIND_PACKAGE features are supported (i.e.,
+QUIET, REQUIRED, etc.).
+#]=======================================================================]
find_package(PkgConfig QUIET)
diff --git a/Modules/FindIntl.cmake b/Modules/FindIntl.cmake
index f887721d6..3818d45ec 100644
--- a/Modules/FindIntl.cmake
+++ b/Modules/FindIntl.cmake
@@ -1,33 +1,34 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindIntl
-# --------
-#
-# Find the Gettext libintl headers and libraries.
-#
-# This module reports information about the Gettext libintl
-# installation in several variables. General variables::
-#
-# Intl_FOUND - true if the libintl headers and libraries were found
-# Intl_INCLUDE_DIRS - the directory containing the libintl headers
-# Intl_LIBRARIES - libintl libraries to be linked
-#
-# The following cache variables may also be set::
-#
-# Intl_INCLUDE_DIR - the directory containing the libintl headers
-# Intl_LIBRARY - the libintl library (if any)
-#
-# .. note::
-# On some platforms, such as Linux with GNU libc, the gettext
-# functions are present in the C standard library and libintl
-# is not required. ``Intl_LIBRARIES`` will be empty in this
-# case.
-#
-# .. note::
-# If you wish to use the Gettext tools (``msgmerge``,
-# ``msgfmt``, etc.), use :module:`FindGettext`.
+#[=======================================================================[.rst:
+FindIntl
+--------
+
+Find the Gettext libintl headers and libraries.
+
+This module reports information about the Gettext libintl
+installation in several variables. General variables::
+
+ Intl_FOUND - true if the libintl headers and libraries were found
+ Intl_INCLUDE_DIRS - the directory containing the libintl headers
+ Intl_LIBRARIES - libintl libraries to be linked
+
+The following cache variables may also be set::
+
+ Intl_INCLUDE_DIR - the directory containing the libintl headers
+ Intl_LIBRARY - the libintl library (if any)
+
+.. note::
+ On some platforms, such as Linux with GNU libc, the gettext
+ functions are present in the C standard library and libintl
+ is not required. ``Intl_LIBRARIES`` will be empty in this
+ case.
+
+.. note::
+ If you wish to use the Gettext tools (``msgmerge``,
+ ``msgfmt``, etc.), use :module:`FindGettext`.
+#]=======================================================================]
# Written by Roger Leigh <rleigh@codelibre.net>
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index fdddcc7e0..237ea96dc 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -185,40 +185,57 @@ if (WIN32)
)
endif()
-JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
- /usr/lib/jvm/java/lib
- /usr/lib/java/jre/lib/{libarch}
- /usr/lib/jvm/jre/lib/{libarch}
- /usr/local/lib/java/jre/lib/{libarch}
- /usr/local/share/java/jre/lib/{libarch}
- /usr/lib/j2sdk1.4-sun/jre/lib/{libarch}
- /usr/lib/j2sdk1.5-sun/jre/lib/{libarch}
- /opt/sun-jdk-1.5.0.04/jre/lib/{libarch}
- /usr/lib/jvm/java-6-sun/jre/lib/{libarch}
- /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
- /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch} # can this one be removed according to #8821 ? Alex
- /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
- /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch} # fedora
+set(_JNI_JAVA_DIRECTORIES_BASE
+ /usr/lib/jvm/java
+ /usr/lib/java
+ /usr/lib/jvm
+ /usr/local/lib/java
+ /usr/local/share/java
+ /usr/lib/j2sdk1.4-sun
+ /usr/lib/j2sdk1.5-sun
+ /opt/sun-jdk-1.5.0.04
+ /usr/lib/jvm/java-6-sun
+ /usr/lib/jvm/java-1.5.0-sun
+ /usr/lib/jvm/java-6-sun-1.6.0.00 # can this one be removed according to #8821 ? Alex
+ /usr/lib/jvm/java-6-openjdk
+ /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0 # fedora
# Debian specific paths for default JVM
- /usr/lib/jvm/default-java/jre/lib/{libarch}
- /usr/lib/jvm/default-java/jre/lib
- /usr/lib/jvm/default-java/lib
+ /usr/lib/jvm/default-java
# Arch Linux specific paths for default JVM
- /usr/lib/jvm/default/jre/lib/{libarch}
- /usr/lib/jvm/default/lib/{libarch}
+ /usr/lib/jvm/default
# Ubuntu specific paths for default JVM
- /usr/lib/jvm/java-11-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 18.04 LTS
- /usr/lib/jvm/java-8-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
- /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
- /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
+ /usr/lib/jvm/java-11-openjdk-{libarch} # Ubuntu 18.04 LTS
+ /usr/lib/jvm/java-8-openjdk-{libarch} # Ubuntu 15.10
+ /usr/lib/jvm/java-7-openjdk-{libarch} # Ubuntu 15.10
+ /usr/lib/jvm/java-6-openjdk-{libarch} # Ubuntu 15.10
# OpenBSD specific paths for default JVM
- /usr/local/jdk-1.7.0/jre/lib/{libarch}
- /usr/local/jre-1.7.0/lib/{libarch}
- /usr/local/jdk-1.6.0/jre/lib/{libarch}
- /usr/local/jre-1.6.0/lib/{libarch}
+ /usr/local/jdk-1.7.0
+ /usr/local/jre-1.7.0
+ /usr/local/jdk-1.6.0
+ /usr/local/jre-1.6.0
# SuSE specific paths for default JVM
- /usr/lib64/jvm/java/jre/lib/{libarch}
- /usr/lib64/jvm/jre/lib/{libarch}
+ /usr/lib64/jvm/java
+ /usr/lib64/jvm/jre
+ )
+
+set(_JNI_JAVA_AWT_LIBRARY_TRIES)
+set(_JNI_JAVA_INCLUDE_TRIES)
+
+foreach(_java_dir IN LISTS _JNI_JAVA_DIRECTORIES_BASE)
+ list(APPEND _JNI_JAVA_AWT_LIBRARY_TRIES
+ ${_java_dir}/jre/lib/{libarch}
+ ${_java_dir}/jre/lib
+ ${_java_dir}/lib/{libarch}
+ ${_java_dir}/lib
+ ${_java_dir}
+ )
+ list(APPEND _JNI_JAVA_INCLUDE_TRIES
+ ${_java_dir}/include
+ )
+endforeach()
+
+JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
+ ${_JNI_JAVA_AWT_LIBRARY_TRIES}
)
set(JAVA_JVM_LIBRARY_DIRECTORIES)
@@ -254,29 +271,7 @@ if (WIN32)
endif()
JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES
- /usr/lib/java/include
- /usr/local/lib/java/include
- /usr/lib/jvm/java/include
- /usr/lib/jvm/java-6-sun/include
- /usr/lib/jvm/java-1.5.0-sun/include
- /usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
- /usr/lib/jvm/java-6-openjdk/include
- /usr/lib/jvm/java-8-openjdk-{libarch}/include # ubuntu 15.10
- /usr/lib/jvm/java-7-openjdk-{libarch}/include # ubuntu 15.10
- /usr/lib/jvm/java-6-openjdk-{libarch}/include # ubuntu 15.10
- /usr/local/share/java/include
- /usr/lib/j2sdk1.4-sun/include
- /usr/lib/j2sdk1.5-sun/include
- /opt/sun-jdk-1.5.0.04/include
- # Debian specific path for default JVM
- /usr/lib/jvm/default-java/include
- # Arch specific path for default JVM
- /usr/lib/jvm/default/include
- # OpenBSD specific path for default JVM
- /usr/local/jdk-1.7.0/include
- /usr/local/jdk-1.6.0/include
- # SuSE specific paths for default JVM
- /usr/lib64/jvm/java/include
+ ${_JNI_JAVA_INCLUDE_TRIES}
)
foreach(JAVA_PROG "${JAVA_RUNTIME}" "${JAVA_COMPILE}" "${JAVA_ARCHIVE}")
diff --git a/Modules/FindJPEG.cmake b/Modules/FindJPEG.cmake
index 7290724ce..f50f79e9b 100644
--- a/Modules/FindJPEG.cmake
+++ b/Modules/FindJPEG.cmake
@@ -1,53 +1,54 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindJPEG
-# --------
-#
-# Find the JPEG library (libjpeg)
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``JPEG::JPEG``
-# The JPEG library, if found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``JPEG_FOUND``
-# If false, do not try to use JPEG.
-# ``JPEG_INCLUDE_DIRS``
-# where to find jpeglib.h, etc.
-# ``JPEG_LIBRARIES``
-# the libraries needed to use JPEG.
-# ``JPEG_VERSION``
-# the version of the JPEG library found
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``JPEG_INCLUDE_DIRS``
-# where to find jpeglib.h, etc.
-# ``JPEG_LIBRARY_RELEASE``
-# where to find the JPEG library (optimized).
-# ``JPEG_LIBRARY_DEBUG``
-# where to find the JPEG library (debug).
-#
-# Obsolete variables
-# ^^^^^^^^^^^^^^^^^^
-#
-# ``JPEG_INCLUDE_DIR``
-# where to find jpeglib.h, etc. (same as JPEG_INCLUDE_DIRS)
-# ``JPEG_LIBRARY``
-# where to find the JPEG library.
+#[=======================================================================[.rst:
+FindJPEG
+--------
+
+Find the JPEG library (libjpeg)
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``JPEG::JPEG``
+ The JPEG library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``JPEG_FOUND``
+ If false, do not try to use JPEG.
+``JPEG_INCLUDE_DIRS``
+ where to find jpeglib.h, etc.
+``JPEG_LIBRARIES``
+ the libraries needed to use JPEG.
+``JPEG_VERSION``
+ the version of the JPEG library found
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``JPEG_INCLUDE_DIRS``
+ where to find jpeglib.h, etc.
+``JPEG_LIBRARY_RELEASE``
+ where to find the JPEG library (optimized).
+``JPEG_LIBRARY_DEBUG``
+ where to find the JPEG library (debug).
+
+Obsolete variables
+^^^^^^^^^^^^^^^^^^
+
+``JPEG_INCLUDE_DIR``
+ where to find jpeglib.h, etc. (same as JPEG_INCLUDE_DIRS)
+``JPEG_LIBRARY``
+ where to find the JPEG library.
+#]=======================================================================]
find_path(JPEG_INCLUDE_DIR jpeglib.h)
@@ -66,23 +67,33 @@ endif()
unset(jpeg_names)
unset(jpeg_names_debug)
-if(JPEG_INCLUDE_DIR AND EXISTS "${JPEG_INCLUDE_DIR}/jpeglib.h")
- file(STRINGS "${JPEG_INCLUDE_DIR}/jpeglib.h"
- jpeg_lib_version REGEX "^#define[\t ]+JPEG_LIB_VERSION[\t ]+.*")
+if(JPEG_INCLUDE_DIR)
+ file(GLOB _JPEG_CONFIG_HEADERS_FEDORA "${JPEG_INCLUDE_DIR}/jconfig*.h")
+ file(GLOB _JPEG_CONFIG_HEADERS_DEBIAN "${JPEG_INCLUDE_DIR}/*/jconfig.h")
+ set(_JPEG_CONFIG_HEADERS
+ "${JPEG_INCLUDE_DIR}/jpeglib.h"
+ ${_JPEG_CONFIG_HEADERS_FEDORA}
+ ${_JPEG_CONFIG_HEADERS_DEBIAN})
+ foreach (_JPEG_CONFIG_HEADER IN LISTS _JPEG_CONFIG_HEADERS)
+ if (NOT EXISTS "${_JPEG_CONFIG_HEADER}")
+ continue ()
+ endif ()
+ file(STRINGS "${_JPEG_CONFIG_HEADER}"
+ jpeg_lib_version REGEX "^#define[\t ]+JPEG_LIB_VERSION[\t ]+.*")
- if (NOT jpeg_lib_version)
- # libjpeg-turbo sticks JPEG_LIB_VERSION in jconfig.h
- find_path(jconfig_dir jconfig.h)
- if (jconfig_dir)
- file(STRINGS "${jconfig_dir}/jconfig.h"
- jpeg_lib_version REGEX "^#define[\t ]+JPEG_LIB_VERSION[\t ]+.*")
- endif()
- unset(jconfig_dir)
- endif()
+ if (NOT jpeg_lib_version)
+ continue ()
+ endif ()
- string(REGEX REPLACE "^#define[\t ]+JPEG_LIB_VERSION[\t ]+([0-9]+).*"
- "\\1" JPEG_VERSION "${jpeg_lib_version}")
+ string(REGEX REPLACE "^#define[\t ]+JPEG_LIB_VERSION[\t ]+([0-9]+).*"
+ "\\1" JPEG_VERSION "${jpeg_lib_version}")
+ break ()
+ endforeach ()
unset(jpeg_lib_version)
+ unset(_JPEG_CONFIG_HEADER)
+ unset(_JPEG_CONFIG_HEADERS)
+ unset(_JPEG_CONFIG_HEADERS_FEDORA)
+ unset(_JPEG_CONFIG_HEADERS_DEBIAN)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindJasper.cmake b/Modules/FindJasper.cmake
index db766576b..dd0e98411 100644
--- a/Modules/FindJasper.cmake
+++ b/Modules/FindJasper.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindJasper
-# ----------
-#
-# Try to find the Jasper JPEG2000 library
-#
-# Once done this will define
-#
-# ::
-#
-# JASPER_FOUND - system has Jasper
-# JASPER_INCLUDE_DIR - the Jasper include directory
-# JASPER_LIBRARIES - the libraries needed to use Jasper
-# JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
+#[=======================================================================[.rst:
+FindJasper
+----------
+
+Try to find the Jasper JPEG2000 library
+
+Once done this will define
+
+::
+
+ JASPER_FOUND - system has Jasper
+ JASPER_INCLUDE_DIR - the Jasper include directory
+ JASPER_LIBRARIES - the libraries needed to use Jasper
+ JASPER_VERSION_STRING - the version of Jasper found (since CMake 2.8.8)
+#]=======================================================================]
find_path(JASPER_INCLUDE_DIR jasper/jasper.h)
diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake
index bcdf166fd..0d62cd669 100644
--- a/Modules/FindJava.cmake
+++ b/Modules/FindJava.cmake
@@ -1,79 +1,80 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindJava
-# --------
-#
-# Find Java
-#
-# This module finds if Java is installed and determines where the
-# include files and libraries are. The caller may set variable ``JAVA_HOME``
-# to specify a Java installation prefix explicitly.
-#
-# See also the :module:`FindJNI` module to find Java Native Interface (JNI).
-#
-# Specify one or more of the following components as you call this find module. See example below.
-#
-# ::
-#
-# Runtime = Java Runtime Environment used to execute Java byte-compiled applications
-# Development = Development tools (java, javac, javah, jar and javadoc), includes Runtime component
-# IdlJ = Interface Description Language (IDL) to Java compiler
-# JarSigner = Signer and verifier tool for Java Archive (JAR) files
-#
-#
-# This module sets the following result variables:
-#
-# ::
-#
-# Java_JAVA_EXECUTABLE = the full path to the Java runtime
-# Java_JAVAC_EXECUTABLE = the full path to the Java compiler
-# Java_JAVAH_EXECUTABLE = the full path to the Java header generator
-# Java_JAVADOC_EXECUTABLE = the full path to the Java documentation generator
-# Java_IDLJ_EXECUTABLE = the full path to the Java idl compiler
-# Java_JAR_EXECUTABLE = the full path to the Java archiver
-# Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
-# Java_VERSION_STRING = Version of java found, eg. 1.6.0_12
-# Java_VERSION_MAJOR = The major version of the package found.
-# Java_VERSION_MINOR = The minor version of the package found.
-# Java_VERSION_PATCH = The patch version of the package found.
-# Java_VERSION_TWEAK = The tweak version of the package found (after '_')
-# Java_VERSION = This is set to: $major[.$minor[.$patch[.$tweak]]]
-#
-#
-#
-# The minimum required version of Java can be specified using the
-# :command:`find_package` syntax, e.g.
-#
-# .. code-block:: cmake
-#
-# find_package(Java 1.8)
-#
-# NOTE: ``${Java_VERSION}`` and ``${Java_VERSION_STRING}`` are not guaranteed to
-# be identical. For example some java version may return:
-# ``Java_VERSION_STRING = 1.8.0_17`` and ``Java_VERSION = 1.8.0.17``
-#
-# another example is the Java OEM, with: ``Java_VERSION_STRING = 1.8.0-oem``
-# and ``Java_VERSION = 1.8.0``
-#
-# For these components the following variables are set:
-#
-# ::
-#
-# Java_FOUND - TRUE if all components are found.
-# Java_<component>_FOUND - TRUE if <component> is found.
-#
-#
-#
-# Example Usages:
-#
-# ::
-#
-# find_package(Java)
-# find_package(Java 1.8 REQUIRED)
-# find_package(Java COMPONENTS Runtime)
-# find_package(Java COMPONENTS Development)
+#[=======================================================================[.rst:
+FindJava
+--------
+
+Find Java
+
+This module finds if Java is installed and determines where the
+include files and libraries are. The caller may set variable ``JAVA_HOME``
+to specify a Java installation prefix explicitly.
+
+See also the :module:`FindJNI` module to find Java Native Interface (JNI).
+
+Specify one or more of the following components as you call this find module. See example below.
+
+::
+
+ Runtime = Java Runtime Environment used to execute Java byte-compiled applications
+ Development = Development tools (java, javac, javah, jar and javadoc), includes Runtime component
+ IdlJ = Interface Description Language (IDL) to Java compiler
+ JarSigner = Signer and verifier tool for Java Archive (JAR) files
+
+
+This module sets the following result variables:
+
+::
+
+ Java_JAVA_EXECUTABLE = the full path to the Java runtime
+ Java_JAVAC_EXECUTABLE = the full path to the Java compiler
+ Java_JAVAH_EXECUTABLE = the full path to the Java header generator
+ Java_JAVADOC_EXECUTABLE = the full path to the Java documentation generator
+ Java_IDLJ_EXECUTABLE = the full path to the Java idl compiler
+ Java_JAR_EXECUTABLE = the full path to the Java archiver
+ Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
+ Java_VERSION_STRING = Version of java found, eg. 1.6.0_12
+ Java_VERSION_MAJOR = The major version of the package found.
+ Java_VERSION_MINOR = The minor version of the package found.
+ Java_VERSION_PATCH = The patch version of the package found.
+ Java_VERSION_TWEAK = The tweak version of the package found (after '_')
+ Java_VERSION = This is set to: $major[.$minor[.$patch[.$tweak]]]
+
+
+
+The minimum required version of Java can be specified using the
+:command:`find_package` syntax, e.g.
+
+.. code-block:: cmake
+
+ find_package(Java 1.8)
+
+NOTE: ``${Java_VERSION}`` and ``${Java_VERSION_STRING}`` are not guaranteed to
+be identical. For example some java version may return:
+``Java_VERSION_STRING = 1.8.0_17`` and ``Java_VERSION = 1.8.0.17``
+
+another example is the Java OEM, with: ``Java_VERSION_STRING = 1.8.0-oem``
+and ``Java_VERSION = 1.8.0``
+
+For these components the following variables are set:
+
+::
+
+ Java_FOUND - TRUE if all components are found.
+ Java_<component>_FOUND - TRUE if <component> is found.
+
+
+
+Example Usages:
+
+::
+
+ find_package(Java)
+ find_package(Java 1.8 REQUIRED)
+ find_package(Java COMPONENTS Runtime)
+ find_package(Java COMPONENTS Development)
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index daf681863..c7ad6e180 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -1,141 +1,142 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindKDE3
-# --------
-#
-# Find the KDE3 include and library dirs, KDE preprocessors and define a some macros
-#
-#
-#
-# This module defines the following variables:
-#
-# ``KDE3_DEFINITIONS``
-# compiler definitions required for compiling KDE software
-# ``KDE3_INCLUDE_DIR``
-# the KDE include directory
-# ``KDE3_INCLUDE_DIRS``
-# the KDE and the Qt include directory, for use with include_directories()
-# ``KDE3_LIB_DIR``
-# the directory where the KDE libraries are installed, for use with link_directories()
-# ``QT_AND_KDECORE_LIBS``
-# this contains both the Qt and the kdecore library
-# ``KDE3_DCOPIDL_EXECUTABLE``
-# the dcopidl executable
-# ``KDE3_DCOPIDL2CPP_EXECUTABLE``
-# the dcopidl2cpp executable
-# ``KDE3_KCFGC_EXECUTABLE``
-# the kconfig_compiler executable
-# ``KDE3_FOUND``
-# set to TRUE if all of the above has been found
-#
-# The following user adjustable options are provided:
-#
-# ``KDE3_BUILD_TESTS``
-# enable this to build KDE testcases
-#
-# It also adds the following macros (from KDE3Macros.cmake) SRCS_VAR is
-# always the variable which contains the list of source files for your
-# application or library.
-#
-# KDE3_AUTOMOC(file1 ... fileN)
-#
-# ::
-#
-# Call this if you want to have automatic moc file handling.
-# This means if you include "foo.moc" in the source file foo.cpp
-# a moc file for the header foo.h will be created automatically.
-# You can set the property SKIP_AUTOMAKE using set_source_files_properties()
-# to exclude some files in the list from being processed.
-#
-#
-#
-# KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
-#
-# ::
-#
-# If you don't use the KDE3_AUTOMOC() macro, for the files
-# listed here moc files will be created (named "foo.moc.cpp")
-#
-#
-#
-# KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ... headerN.h )
-#
-# ::
-#
-# Use this to generate DCOP skeletions from the listed headers.
-#
-#
-#
-# KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ... headerN.h )
-#
-# ::
-#
-# Use this to generate DCOP stubs from the listed headers.
-#
-#
-#
-# KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ... fileN.ui )
-#
-# ::
-#
-# Use this to add the Qt designer ui files to your application/library.
-#
-#
-#
-# KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ... fileN.kcfgc )
-#
-# ::
-#
-# Use this to add KDE kconfig compiler files to your application/library.
-#
-#
-#
-# KDE3_INSTALL_LIBTOOL_FILE(target)
-#
-# ::
-#
-# This will create and install a simple libtool file for the given target.
-#
-#
-#
-# KDE3_ADD_EXECUTABLE(name file1 ... fileN )
-#
-# ::
-#
-# Currently identical to add_executable(), may provide some advanced
-# features in the future.
-#
-#
-#
-# KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
-#
-# ::
-#
-# Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
-# If WITH_PREFIX is given, the resulting plugin will have the prefix "lib",
-# otherwise it won't.
-# It creates and installs an appropriate libtool la-file.
-#
-#
-#
-# KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ... fileN )
-#
-# ::
-#
-# Create a KDE application in the form of a module loadable via kdeinit.
-# A library named kdeinit_<name> will be created and a small executable
-# which links to it.
-#
-#
-#
-# The option KDE3_ENABLE_FINAL to enable all-in-one compilation is no
-# longer supported.
-#
-#
-#
-# Author: Alexander Neundorf <neundorf@kde.org>
+#[=======================================================================[.rst:
+FindKDE3
+--------
+
+Find the KDE3 include and library dirs, KDE preprocessors and define a some macros
+
+
+
+This module defines the following variables:
+
+``KDE3_DEFINITIONS``
+ compiler definitions required for compiling KDE software
+``KDE3_INCLUDE_DIR``
+ the KDE include directory
+``KDE3_INCLUDE_DIRS``
+ the KDE and the Qt include directory, for use with include_directories()
+``KDE3_LIB_DIR``
+ the directory where the KDE libraries are installed, for use with link_directories()
+``QT_AND_KDECORE_LIBS``
+ this contains both the Qt and the kdecore library
+``KDE3_DCOPIDL_EXECUTABLE``
+ the dcopidl executable
+``KDE3_DCOPIDL2CPP_EXECUTABLE``
+ the dcopidl2cpp executable
+``KDE3_KCFGC_EXECUTABLE``
+ the kconfig_compiler executable
+``KDE3_FOUND``
+ set to TRUE if all of the above has been found
+
+The following user adjustable options are provided:
+
+``KDE3_BUILD_TESTS``
+ enable this to build KDE testcases
+
+It also adds the following macros (from KDE3Macros.cmake) SRCS_VAR is
+always the variable which contains the list of source files for your
+application or library.
+
+KDE3_AUTOMOC(file1 ... fileN)
+
+::
+
+ Call this if you want to have automatic moc file handling.
+ This means if you include "foo.moc" in the source file foo.cpp
+ a moc file for the header foo.h will be created automatically.
+ You can set the property SKIP_AUTOMAKE using set_source_files_properties()
+ to exclude some files in the list from being processed.
+
+
+
+KDE3_ADD_MOC_FILES(SRCS_VAR file1 ... fileN )
+
+::
+
+ If you don't use the KDE3_AUTOMOC() macro, for the files
+ listed here moc files will be created (named "foo.moc.cpp")
+
+
+
+KDE3_ADD_DCOP_SKELS(SRCS_VAR header1.h ... headerN.h )
+
+::
+
+ Use this to generate DCOP skeletions from the listed headers.
+
+
+
+KDE3_ADD_DCOP_STUBS(SRCS_VAR header1.h ... headerN.h )
+
+::
+
+ Use this to generate DCOP stubs from the listed headers.
+
+
+
+KDE3_ADD_UI_FILES(SRCS_VAR file1.ui ... fileN.ui )
+
+::
+
+ Use this to add the Qt designer ui files to your application/library.
+
+
+
+KDE3_ADD_KCFG_FILES(SRCS_VAR file1.kcfgc ... fileN.kcfgc )
+
+::
+
+ Use this to add KDE kconfig compiler files to your application/library.
+
+
+
+KDE3_INSTALL_LIBTOOL_FILE(target)
+
+::
+
+ This will create and install a simple libtool file for the given target.
+
+
+
+KDE3_ADD_EXECUTABLE(name file1 ... fileN )
+
+::
+
+ Currently identical to add_executable(), may provide some advanced
+ features in the future.
+
+
+
+KDE3_ADD_KPART(name [WITH_PREFIX] file1 ... fileN )
+
+::
+
+ Create a KDE plugin (KPart, kioslave, etc.) from the given source files.
+ If WITH_PREFIX is given, the resulting plugin will have the prefix "lib",
+ otherwise it won't.
+ It creates and installs an appropriate libtool la-file.
+
+
+
+KDE3_ADD_KDEINIT_EXECUTABLE(name file1 ... fileN )
+
+::
+
+ Create a KDE application in the form of a module loadable via kdeinit.
+ A library named kdeinit_<name> will be created and a small executable
+ which links to it.
+
+
+
+The option KDE3_ENABLE_FINAL to enable all-in-one compilation is no
+longer supported.
+
+
+
+Author: Alexander Neundorf <neundorf@kde.org>
+#]=======================================================================]
if(NOT UNIX AND KDE3_FIND_REQUIRED)
message(FATAL_ERROR "Compiling KDE3 applications and libraries under Windows is not supported")
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index bb98e53bd..c04804be9 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -1,29 +1,30 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindKDE4
-# --------
-#
-#
-#
-# Find KDE4 and provide all necessary variables and macros to compile
-# software for it. It looks for KDE 4 in the following directories in
-# the given order:
-#
-# ::
-#
-# CMAKE_INSTALL_PREFIX
-# KDEDIRS
-# /opt/kde4
-#
-#
-#
-# Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for more
-# information. They are installed with the KDE 4 libraries in
-# $KDEDIRS/share/apps/cmake/modules/.
-#
-# Author: Alexander Neundorf <neundorf@kde.org>
+#[=======================================================================[.rst:
+FindKDE4
+--------
+
+
+
+Find KDE4 and provide all necessary variables and macros to compile
+software for it. It looks for KDE 4 in the following directories in
+the given order:
+
+::
+
+ CMAKE_INSTALL_PREFIX
+ KDEDIRS
+ /opt/kde4
+
+
+
+Please look in FindKDE4Internal.cmake and KDE4Macros.cmake for more
+information. They are installed with the KDE 4 libraries in
+$KDEDIRS/share/apps/cmake/modules/.
+
+Author: Alexander Neundorf <neundorf@kde.org>
+#]=======================================================================]
# If Qt3 has already been found, fail.
if(QT_QT_LIBRARY)
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index dc94079ef..d6646eaac 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -1,48 +1,76 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLAPACK
-# ----------
-#
-# Find LAPACK library
-#
-# This module finds an installed fortran library that implements the
-# LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
-#
-# The approach follows that taken for the autoconf macro file,
-# acx_lapack.m4 (distributed at
-# http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
-#
-# This module sets the following variables:
-#
-# ::
-#
-# LAPACK_FOUND - set to true if a library implementing the LAPACK interface
-# is found
-# LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l
-# and -L).
-# LAPACK_LIBRARIES - uncached list of libraries (using full path name) to
-# link against to use LAPACK
-# LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to
-# link against to use LAPACK95
-# LAPACK95_FOUND - set to true if a library implementing the LAPACK f95
-# interface is found
-# BLA_STATIC if set on this determines what kind of linkage we do (static)
-# BLA_VENDOR if set checks only the specified vendor, if not set checks
-# all the possibilities
-# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK
-#
-# List of vendors (BLA_VENDOR) valid in this module:
-#
-# * Intel(mkl)
-# * OpenBLAS
-# * FLAME
-# * ACML
-# * Apple
-# * NAS
-# * Generic
-#
+#[=======================================================================[.rst:
+FindLAPACK
+----------
+
+Find LAPACK library
+
+This module finds an installed fortran library that implements the
+LAPACK linear-algebra interface (see http://www.netlib.org/lapack/).
+
+The approach follows that taken for the autoconf macro file,
+acx_lapack.m4 (distributed at
+http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html).
+
+Input Variables
+^^^^^^^^^^^^^^^
+
+The following variables may be set to influence this module's behavior:
+
+``BLA_STATIC``
+ if ``ON`` use static linkage
+
+``BLA_VENDOR``
+ If set, checks only the specified vendor, if not set checks all the
+ possibilities. List of vendors valid in this module:
+
+ * ``Intel10_32`` (intel mkl v10 32 bit)
+ * ``Intel10_64lp`` (intel mkl v10+ 64 bit, threaded code, lp64 model)
+ * ``Intel10_64lp_seq`` (intel mkl v10+ 64 bit, sequential code, lp64 model)
+ * ``Intel10_64ilp`` (intel mkl v10+ 64 bit, threaded code, ilp64 model)
+ * ``Intel10_64ilp_seq`` (intel mkl v10+ 64 bit, sequential code, ilp64 model)
+ * ``Intel`` (obsolete versions of mkl 32 and 64 bit)
+ * ``OpenBLAS``
+ * ``FLAME``
+ * ``ACML``
+ * ``Apple``
+ * ``NAS``
+ * ``Generic``
+
+``BLA_F95``
+ if ``ON`` tries to find BLAS95/LAPACK95
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``LAPACK_FOUND``
+ library implementing the LAPACK interface is found
+``LAPACK_LINKER_FLAGS``
+ uncached list of required linker flags (excluding -l and -L).
+``LAPACK_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use LAPACK
+``LAPACK95_LIBRARIES``
+ uncached list of libraries (using full path name) to link against
+ to use LAPACK95
+``LAPACK95_FOUND``
+ library implementing the LAPACK95 interface is found
+
+.. note::
+
+ C or CXX must be enabled to use Intel MKL
+
+ For example, to use Intel MKL libraries and/or Intel compiler:
+
+ .. code-block:: cmake
+
+ set(BLA_VENDOR Intel10_64lp)
+ find_package(LAPACK)
+#]=======================================================================]
set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
@@ -95,6 +123,9 @@ if (NOT _libdir)
set(_libdir ENV LD_LIBRARY_PATH)
endif ()
endif ()
+
+list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
+
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
@@ -109,7 +140,7 @@ foreach(_library ${_list})
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif ()
else ()
- if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# for ubuntu's libblas3gf and liblapack3gf packages
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
endif ()
@@ -138,7 +169,6 @@ if(_libraries_work)
check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS)
endif ()
set(CMAKE_REQUIRED_LIBRARIES)
- mark_as_advanced(${_prefix}${_combined_name}_WORKS)
set(_libraries_work ${${_prefix}${_combined_name}_WORKS})
#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}")
endif()
@@ -174,6 +204,84 @@ if(BLAS_FOUND)
endif()
endif ()
+#intel lapack
+if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
+ if (NOT WIN32)
+ set(LAPACK_mkl_LM "-lm")
+ set(LAPACK_mkl_LDL "-ldl")
+ endif ()
+ if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
+ if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
+ find_PACKAGE(Threads)
+ else()
+ find_package(Threads REQUIRED)
+ endif()
+
+ if (BLA_VENDOR MATCHES "_64ilp")
+ set(LAPACK_mkl_ILP_MODE "ilp64")
+ else ()
+ set(LAPACK_mkl_ILP_MODE "lp64")
+ endif ()
+
+ set(LAPACK_SEARCH_LIBS "")
+
+ if (BLA_F95)
+ set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95")
+ set(_LIBRARIES LAPACK95_LIBRARIES)
+ set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
+
+ # old
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack95")
+ # new >= 10.3
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_intel_c")
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack95_${LAPACK_mkl_ILP_MODE}")
+ else()
+ set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
+ set(_LIBRARIES LAPACK_LIBRARIES)
+ set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
+
+ # old
+ list(APPEND LAPACK_SEARCH_LIBS
+ "mkl_lapack")
+ endif()
+
+ # First try empty lapack libs
+ if (NOT ${_LIBRARIES})
+ check_lapack_libraries(
+ ${_LIBRARIES}
+ LAPACK
+ ${LAPACK_mkl_SEARCH_SYMBOL}
+ ""
+ ""
+ "${_BLAS_LIBRARIES}"
+ ""
+ )
+ endif ()
+ # Then try the search libs
+ foreach (IT ${LAPACK_SEARCH_LIBS})
+ if (NOT ${_LIBRARIES})
+ check_lapack_libraries(
+ ${_LIBRARIES}
+ LAPACK
+ ${LAPACK_mkl_SEARCH_SYMBOL}
+ ""
+ "${IT}"
+ "${_BLAS_LIBRARIES}"
+ "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
+ )
+ endif ()
+ endforeach ()
+
+ unset(LAPACK_mkl_ILP_MODE)
+ unset(LAPACK_mkl_SEARCH_SYMBOL)
+ unset(LAPACK_mkl_LM)
+ unset(LAPACK_mkl_LDL)
+ endif ()
+endif()
+
if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All")
if(NOT LAPACK_LIBRARIES)
check_lapack_libraries(
@@ -266,82 +374,7 @@ if (BLA_VENDOR STREQUAL "Generic" OR
)
endif ()
endif ()
-#intel lapack
-if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
- if (NOT WIN32)
- set(LM "-lm")
- endif ()
- if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
- if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
- find_PACKAGE(Threads)
- else()
- find_package(Threads REQUIRED)
- endif()
- if (BLA_VENDOR MATCHES "_64ilp")
- set(BLAS_mkl_ILP_MODE "ilp64")
- else ()
- set(BLAS_mkl_ILP_MODE "lp64")
- endif ()
-
- set(LAPACK_SEARCH_LIBS "")
-
- if (BLA_F95)
- set(LAPACK_mkl_SEARCH_SYMBOL "cheev_f95")
- set(_LIBRARIES LAPACK95_LIBRARIES)
- set(_BLAS_LIBRARIES ${BLAS95_LIBRARIES})
-
- # old
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_lapack95")
- # new >= 10.3
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_intel_c")
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_lapack95_${BLAS_mkl_ILP_MODE}")
- else()
- set(LAPACK_mkl_SEARCH_SYMBOL "cheev")
- set(_LIBRARIES LAPACK_LIBRARIES)
- set(_BLAS_LIBRARIES ${BLAS_LIBRARIES})
-
- # old
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_lapack")
- # new >= 10.3
- list(APPEND LAPACK_SEARCH_LIBS
- "mkl_gf_${BLAS_mkl_ILP_MODE}")
- endif()
-
- # First try empty lapack libs
- if (NOT ${_LIBRARIES})
- check_lapack_libraries(
- ${_LIBRARIES}
- LAPACK
- ${LAPACK_mkl_SEARCH_SYMBOL}
- ""
- ""
- "${_BLAS_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
- )
- endif ()
- # Then try the search libs
- foreach (IT ${LAPACK_SEARCH_LIBS})
- if (NOT ${_LIBRARIES})
- check_lapack_libraries(
- ${_LIBRARIES}
- LAPACK
- ${LAPACK_mkl_SEARCH_SYMBOL}
- ""
- "${IT}"
- "${_BLAS_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LM}"
- )
- endif ()
- endforeach ()
-
- unset(BLAS_mkl_ILP_MODE)
- endif ()
-endif()
else()
message(STATUS "LAPACK requires BLAS")
endif()
diff --git a/Modules/FindLATEX.cmake b/Modules/FindLATEX.cmake
index d1f4fa497..01f479397 100644
--- a/Modules/FindLATEX.cmake
+++ b/Modules/FindLATEX.cmake
@@ -1,56 +1,57 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLATEX
-# ---------
-#
-# Find Latex
-#
-# This module finds an installed Latex and determines the location
-# of the compiler. Additionally the module looks for Latex-related
-# software like BibTeX.
-#
-# This module sets the following result variables::
-#
-# LATEX_FOUND: whether found Latex and requested components
-# LATEX_<component>_FOUND: whether found <component>
-# LATEX_COMPILER: path to the LaTeX compiler
-# PDFLATEX_COMPILER: path to the PdfLaTeX compiler
-# XELATEX_COMPILER: path to the XeLaTeX compiler
-# LUALATEX_COMPILER: path to the LuaLaTeX compiler
-# BIBTEX_COMPILER: path to the BibTeX compiler
-# BIBER_COMPILER: path to the Biber compiler
-# MAKEINDEX_COMPILER: path to the MakeIndex compiler
-# XINDY_COMPILER: path to the xindy compiler
-# DVIPS_CONVERTER: path to the DVIPS converter
-# DVIPDF_CONVERTER: path to the DVIPDF converter
-# PS2PDF_CONVERTER: path to the PS2PDF converter
-# PDFTOPS_CONVERTER: path to the pdftops converter
-# LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
-# HTLATEX_COMPILER: path to the htlatex compiler
-#
-# Possible components are::
-#
-# PDFLATEX
-# XELATEX
-# LUALATEX
-# BIBTEX
-# BIBER
-# MAKEINDEX
-# XINDY
-# DVIPS
-# DVIPDF
-# PS2PDF
-# PDFTOPS
-# LATEX2HTML
-# HTLATEX
-#
-# Example Usages::
-#
-# find_package(LATEX)
-# find_package(LATEX COMPONENTS PDFLATEX)
-# find_package(LATEX COMPONENTS BIBTEX PS2PDF)
+#[=======================================================================[.rst:
+FindLATEX
+---------
+
+Find Latex
+
+This module finds an installed Latex and determines the location
+of the compiler. Additionally the module looks for Latex-related
+software like BibTeX.
+
+This module sets the following result variables::
+
+ LATEX_FOUND: whether found Latex and requested components
+ LATEX_<component>_FOUND: whether found <component>
+ LATEX_COMPILER: path to the LaTeX compiler
+ PDFLATEX_COMPILER: path to the PdfLaTeX compiler
+ XELATEX_COMPILER: path to the XeLaTeX compiler
+ LUALATEX_COMPILER: path to the LuaLaTeX compiler
+ BIBTEX_COMPILER: path to the BibTeX compiler
+ BIBER_COMPILER: path to the Biber compiler
+ MAKEINDEX_COMPILER: path to the MakeIndex compiler
+ XINDY_COMPILER: path to the xindy compiler
+ DVIPS_CONVERTER: path to the DVIPS converter
+ DVIPDF_CONVERTER: path to the DVIPDF converter
+ PS2PDF_CONVERTER: path to the PS2PDF converter
+ PDFTOPS_CONVERTER: path to the pdftops converter
+ LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
+ HTLATEX_COMPILER: path to the htlatex compiler
+
+Possible components are::
+
+ PDFLATEX
+ XELATEX
+ LUALATEX
+ BIBTEX
+ BIBER
+ MAKEINDEX
+ XINDY
+ DVIPS
+ DVIPDF
+ PS2PDF
+ PDFTOPS
+ LATEX2HTML
+ HTLATEX
+
+Example Usages::
+
+ find_package(LATEX)
+ find_package(LATEX COMPONENTS PDFLATEX)
+ find_package(LATEX COMPONENTS BIBTEX PS2PDF)
+#]=======================================================================]
if (WIN32)
# Try to find the MikTex binary path (look for its package manager).
diff --git a/Modules/FindLTTngUST.cmake b/Modules/FindLTTngUST.cmake
index 00d5e7aed..a074187ca 100644
--- a/Modules/FindLTTngUST.cmake
+++ b/Modules/FindLTTngUST.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLTTngUST
-# ------------
-#
-# This module finds the `LTTng-UST <http://lttng.org/>`__ library.
-#
-# Imported target
-# ^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` target:
-#
-# ``LTTng::UST``
-# The LTTng-UST library, if found
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module sets the following
-#
-# ``LTTNGUST_FOUND``
-# ``TRUE`` if system has LTTng-UST
-# ``LTTNGUST_INCLUDE_DIRS``
-# The LTTng-UST include directories
-# ``LTTNGUST_LIBRARIES``
-# The libraries needed to use LTTng-UST
-# ``LTTNGUST_VERSION_STRING``
-# The LTTng-UST version
-# ``LTTNGUST_HAS_TRACEF``
-# ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST
-# ``LTTNGUST_HAS_TRACELOG``
-# ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
+#[=======================================================================[.rst:
+FindLTTngUST
+------------
+
+This module finds the `LTTng-UST <http://lttng.org/>`__ library.
+
+Imported target
+^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``LTTng::UST``
+ The LTTng-UST library, if found
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following
+
+``LTTNGUST_FOUND``
+ ``TRUE`` if system has LTTng-UST
+``LTTNGUST_INCLUDE_DIRS``
+ The LTTng-UST include directories
+``LTTNGUST_LIBRARIES``
+ The libraries needed to use LTTng-UST
+``LTTNGUST_VERSION_STRING``
+ The LTTng-UST version
+``LTTNGUST_HAS_TRACEF``
+ ``TRUE`` if the ``tracef()`` API is available in the system's LTTng-UST
+``LTTNGUST_HAS_TRACELOG``
+ ``TRUE`` if the ``tracelog()`` API is available in the system's LTTng-UST
+#]=======================================================================]
find_path(LTTNGUST_INCLUDE_DIRS NAMES lttng/tracepoint.h)
find_library(LTTNGUST_LIBRARIES NAMES lttng-ust)
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index 38e512fa3..34fc2e252 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLibArchive
-# --------------
-#
-# Find libarchive library and headers
-#
-# The module defines the following variables:
-#
-# ::
-#
-# LibArchive_FOUND - true if libarchive was found
-# LibArchive_INCLUDE_DIRS - include search path
-# LibArchive_LIBRARIES - libraries to link
-# LibArchive_VERSION - libarchive 3-component version number
+#[=======================================================================[.rst:
+FindLibArchive
+--------------
+
+Find libarchive library and headers
+
+The module defines the following variables:
+
+::
+
+ LibArchive_FOUND - true if libarchive was found
+ LibArchive_INCLUDE_DIRS - include search path
+ LibArchive_LIBRARIES - libraries to link
+ LibArchive_VERSION - libarchive 3-component version number
+#]=======================================================================]
find_path(LibArchive_INCLUDE_DIR
NAMES archive.h
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index d203eafa1..622574438 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -1,26 +1,45 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLibLZMA
-# -----------
-#
-# Find LibLZMA
-#
-# Find LibLZMA headers and library
-#
-# ::
-#
-# LIBLZMA_FOUND - True if liblzma is found.
-# LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located.
-# LIBLZMA_LIBRARIES - Lzma libraries to link against.
-# LIBLZMA_HAS_AUTO_DECODER - True if lzma_auto_decoder() is found (required).
-# LIBLZMA_HAS_EASY_ENCODER - True if lzma_easy_encoder() is found (required).
-# LIBLZMA_HAS_LZMA_PRESET - True if lzma_lzma_preset() is found (required).
-# LIBLZMA_VERSION_MAJOR - The major version of lzma
-# LIBLZMA_VERSION_MINOR - The minor version of lzma
-# LIBLZMA_VERSION_PATCH - The patch version of lzma
-# LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3")
+#[=======================================================================[.rst:
+FindLibLZMA
+-----------
+
+Find LZMA compression algorithm headers and library.
+
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``LibLZMA::LibLZMA``, if
+liblzma has been found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``LIBLZMA_FOUND``
+ True if liblzma headers and library were found.
+``LIBLZMA_INCLUDE_DIRS``
+ Directory where liblzma headers are located.
+``LIBLZMA_LIBRARIES``
+ Lzma libraries to link against.
+``LIBLZMA_HAS_AUTO_DECODER``
+ True if lzma_auto_decoder() is found (required).
+``LIBLZMA_HAS_EASY_ENCODER``
+ True if lzma_easy_encoder() is found (required).
+``LIBLZMA_HAS_LZMA_PRESET``
+ True if lzma_lzma_preset() is found (required).
+``LIBLZMA_VERSION_MAJOR``
+ The major version of lzma
+``LIBLZMA_VERSION_MINOR``
+ The minor version of lzma
+``LIBLZMA_VERSION_PATCH``
+ The patch version of lzma
+``LIBLZMA_VERSION_STRING``
+ version number as a string (ex: "5.0.3")
+#]=======================================================================]
find_path(LIBLZMA_INCLUDE_DIR lzma.h )
find_library(LIBLZMA_LIBRARY NAMES lzma liblzma)
@@ -50,17 +69,23 @@ if (LIBLZMA_LIBRARY)
endif ()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR
- LIBLZMA_LIBRARY
+find_package_handle_standard_args(LibLZMA REQUIRED_VARS LIBLZMA_LIBRARY
+ LIBLZMA_INCLUDE_DIR
LIBLZMA_HAS_AUTO_DECODER
LIBLZMA_HAS_EASY_ENCODER
LIBLZMA_HAS_LZMA_PRESET
VERSION_VAR LIBLZMA_VERSION_STRING
)
+mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
if (LIBLZMA_FOUND)
set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
+ if(NOT TARGET LibLZMA::LibLZMA)
+ add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED)
+ set_target_properties(LibLZMA::LibLZMA PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR}
+ IMPORTED_LINK_INTERFACE_LANGUAGES C
+ IMPORTED_LOCATION ${LIBLZMA_LIBRARY})
+ endif()
endif ()
-
-mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake
index 615de49e3..47c0e7907 100644
--- a/Modules/FindLibXml2.cmake
+++ b/Modules/FindLibXml2.cmake
@@ -1,47 +1,48 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLibXml2
-# -----------
-#
-# Find the XML processing library (libxml2).
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``LibXml2::LibXml2``, if
-# libxml2 has been found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``LIBXML2_FOUND``
-# true if libxml2 headers and libraries were found
-# ``LIBXML2_INCLUDE_DIR``
-# the directory containing LibXml2 headers
-# ``LIBXML2_INCLUDE_DIRS``
-# list of the include directories needed to use LibXml2
-# ``LIBXML2_LIBRARIES``
-# LibXml2 libraries to be linked
-# ``LIBXML2_DEFINITIONS``
-# the compiler switches required for using LibXml2
-# ``LIBXML2_XMLLINT_EXECUTABLE``
-# path to the XML checking tool xmllint coming with LibXml2
-# ``LIBXML2_VERSION_STRING``
-# the version of LibXml2 found (since CMake 2.8.8)
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``LIBXML2_INCLUDE_DIR``
-# the directory containing LibXml2 headers
-# ``LIBXML2_LIBRARY``
-# path to the LibXml2 library
+#[=======================================================================[.rst:
+FindLibXml2
+-----------
+
+Find the XML processing library (libxml2).
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``LibXml2::LibXml2``, if
+libxml2 has been found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``LibXml2_FOUND``
+ true if libxml2 headers and libraries were found
+``LIBXML2_INCLUDE_DIR``
+ the directory containing LibXml2 headers
+``LIBXML2_INCLUDE_DIRS``
+ list of the include directories needed to use LibXml2
+``LIBXML2_LIBRARIES``
+ LibXml2 libraries to be linked
+``LIBXML2_DEFINITIONS``
+ the compiler switches required for using LibXml2
+``LIBXML2_XMLLINT_EXECUTABLE``
+ path to the XML checking tool xmllint coming with LibXml2
+``LIBXML2_VERSION_STRING``
+ the version of LibXml2 found (since CMake 2.8.8)
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``LIBXML2_INCLUDE_DIR``
+ the directory containing LibXml2 headers
+``LIBXML2_LIBRARY``
+ path to the LibXml2 library
+#]=======================================================================]
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index abd1963d5..4cca64f2c 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -1,29 +1,30 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLibXslt
-# -----------
-#
-# Try to find the LibXslt library
-#
-# Once done this will define
-#
-# ::
-#
-# LIBXSLT_FOUND - system has LibXslt
-# LIBXSLT_INCLUDE_DIR - the LibXslt include directory
-# LIBXSLT_LIBRARIES - Link these to LibXslt
-# LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
-# LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
-#
-# Additionally, the following two variables are set (but not required
-# for using xslt):
-#
-# ``LIBXSLT_EXSLT_LIBRARIES``
-# Link to these if you need to link against the exslt library.
-# ``LIBXSLT_XSLTPROC_EXECUTABLE``
-# Contains the full path to the xsltproc executable if found.
+#[=======================================================================[.rst:
+FindLibXslt
+-----------
+
+Try to find the LibXslt library
+
+Once done this will define
+
+::
+
+ LIBXSLT_FOUND - system has LibXslt
+ LIBXSLT_INCLUDE_DIR - the LibXslt include directory
+ LIBXSLT_LIBRARIES - Link these to LibXslt
+ LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
+ LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
+
+Additionally, the following two variables are set (but not required
+for using xslt):
+
+``LIBXSLT_EXSLT_LIBRARIES``
+ Link to these if you need to link against the exslt library.
+``LIBXSLT_XSLTPROC_EXECUTABLE``
+ Contains the full path to the xsltproc executable if found.
+#]=======================================================================]
# use pkg-config to get the directories and then use these values
# in the find_path() and find_library() calls
diff --git a/Modules/FindLibinput.cmake b/Modules/FindLibinput.cmake
new file mode 100644
index 000000000..c1fe45562
--- /dev/null
+++ b/Modules/FindLibinput.cmake
@@ -0,0 +1,82 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindLibinput
+------------
+
+Find libinput headers and library.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+``Libinput::Libinput``
+ The libinput library, if found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables in your project:
+
+``Libinput_FOUND``
+ true if (the requested version of) libinput is available.
+``Libinput_VERSION``
+ the version of libinput.
+``Libinput_LIBRARIES``
+ the libraries to link against to use libinput.
+``Libinput_INCLUDE_DIRS``
+ where to find the libinput headers.
+``Libinput_COMPILE_OPTIONS``
+ this should be passed to target_compile_options(), if the
+ target is not used for linking
+
+#]=======================================================================]
+
+
+# Use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+find_package(PkgConfig QUIET)
+pkg_check_modules(PKG_Libinput QUIET libinput)
+
+set(Libinput_COMPILE_OPTIONS ${PKG_Libinput_CFLAGS_OTHER})
+set(Libinput_VERSION ${PKG_Libinput_VERSION})
+
+find_path(Libinput_INCLUDE_DIR
+ NAMES
+ libinput.h
+ HINTS
+ ${PKG_Libinput_INCLUDE_DIRS}
+)
+find_library(Libinput_LIBRARY
+ NAMES
+ input
+ HINTS
+ ${PKG_Libinput_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Libinput
+ FOUND_VAR
+ Libinput_FOUND
+ REQUIRED_VARS
+ Libinput_LIBRARY
+ Libinput_INCLUDE_DIR
+ VERSION_VAR
+ Libinput_VERSION
+)
+
+if(Libinput_FOUND AND NOT TARGET Libinput::Libinput)
+ add_library(Libinput::Libinput UNKNOWN IMPORTED)
+ set_target_properties(Libinput::Libinput PROPERTIES
+ IMPORTED_LOCATION "${Libinput_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${Libinput_COMPILE_OPTIONS}"
+ INTERFACE_INCLUDE_DIRECTORIES "${Libinput_INCLUDE_DIR}"
+ )
+endif()
+
+mark_as_advanced(Libinput_LIBRARY Libinput_INCLUDE_DIR)
+
+if(Libinput_FOUND)
+ set(Libinput_LIBRARIES ${Libinput_LIBRARY})
+ set(Libinput_INCLUDE_DIRS ${Libinput_INCLUDE_DIR})
+endif()
diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index 68530b353..eb3b5fb0d 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -1,40 +1,41 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLua
-# -------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-# LUA_FOUND - if false, do not try to link to Lua
-# LUA_LIBRARIES - both lua and lualib
-# LUA_INCLUDE_DIR - where to find lua.h
-# LUA_VERSION_STRING - the version of Lua found
-# LUA_VERSION_MAJOR - the major version of Lua
-# LUA_VERSION_MINOR - the minor version of Lua
-# LUA_VERSION_PATCH - the patch version of Lua
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-# #include "lua.h"
-#
-# and not
-#
-# ::
-#
-# #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
+#[=======================================================================[.rst:
+FindLua
+-------
+
+
+
+Locate Lua library This module defines
+
+::
+
+ LUA_FOUND - if false, do not try to link to Lua
+ LUA_LIBRARIES - both lua and lualib
+ LUA_INCLUDE_DIR - where to find lua.h
+ LUA_VERSION_STRING - the version of Lua found
+ LUA_VERSION_MAJOR - the major version of Lua
+ LUA_VERSION_MINOR - the minor version of Lua
+ LUA_VERSION_PATCH - the patch version of Lua
+
+
+
+Note that the expected include convention is
+
+::
+
+ #include "lua.h"
+
+and not
+
+::
+
+ #include <lua/lua.h>
+
+This is because, the lua location is not standardized and may exist in
+locations other than lua/
+#]=======================================================================]
cmake_policy(PUSH) # Policies apply to functions at definition-time
cmake_policy(SET CMP0012 NEW) # For while(TRUE)
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index 315f301b7..aafc05664 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLua50
-# ---------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-# LUA50_FOUND, if false, do not try to link to Lua
-# LUA_LIBRARIES, both lua and lualib
-# LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-# #include "lua.h"
-#
-# and not
-#
-# ::
-#
-# #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
+#[=======================================================================[.rst:
+FindLua50
+---------
+
+
+
+Locate Lua library This module defines
+
+::
+
+ LUA50_FOUND, if false, do not try to link to Lua
+ LUA_LIBRARIES, both lua and lualib
+ LUA_INCLUDE_DIR, where to find lua.h and lualib.h (and probably lauxlib.h)
+
+
+
+Note that the expected include convention is
+
+::
+
+ #include "lua.h"
+
+and not
+
+::
+
+ #include <lua/lua.h>
+
+This is because, the lua location is not standardized and may exist in
+locations other than lua/
+#]=======================================================================]
find_path(LUA_INCLUDE_DIR lua.h
HINTS
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index f2b232216..31eaf87bb 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindLua51
-# ---------
-#
-#
-#
-# Locate Lua library This module defines
-#
-# ::
-#
-# LUA51_FOUND, if false, do not try to link to Lua
-# LUA_LIBRARIES
-# LUA_INCLUDE_DIR, where to find lua.h
-# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
-#
-#
-#
-# Note that the expected include convention is
-#
-# ::
-#
-# #include "lua.h"
-#
-# and not
-#
-# ::
-#
-# #include <lua/lua.h>
-#
-# This is because, the lua location is not standardized and may exist in
-# locations other than lua/
+#[=======================================================================[.rst:
+FindLua51
+---------
+
+
+
+Locate Lua library This module defines
+
+::
+
+ LUA51_FOUND, if false, do not try to link to Lua
+ LUA_LIBRARIES
+ LUA_INCLUDE_DIR, where to find lua.h
+ LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
+
+
+
+Note that the expected include convention is
+
+::
+
+ #include "lua.h"
+
+and not
+
+::
+
+ #include <lua/lua.h>
+
+This is because, the lua location is not standardized and may exist in
+locations other than lua/
+#]=======================================================================]
find_path(LUA_INCLUDE_DIR lua.h
HINTS
diff --git a/Modules/FindMFC.cmake b/Modules/FindMFC.cmake
index 3baaf3208..9738ac56f 100644
--- a/Modules/FindMFC.cmake
+++ b/Modules/FindMFC.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindMFC
-# -------
-#
-# Find MFC on Windows
-#
-# Find the native MFC - i.e. decide if an application can link to the
-# MFC libraries.
-#
-# ::
-#
-# MFC_FOUND - Was MFC support found
-#
-# You don't need to include anything or link anything to use it.
+#[=======================================================================[.rst:
+FindMFC
+-------
+
+Find MFC on Windows
+
+Find the native MFC - i.e. decide if an application can link to the
+MFC libraries.
+
+::
+
+ MFC_FOUND - Was MFC support found
+
+You don't need to include anything or link anything to use it.
+#]=======================================================================]
# Assume no MFC support
set(MFC_FOUND "NO")
diff --git a/Modules/FindMPEG.cmake b/Modules/FindMPEG.cmake
index 850a57e4d..e5a80e389 100644
--- a/Modules/FindMPEG.cmake
+++ b/Modules/FindMPEG.cmake
@@ -1,26 +1,27 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindMPEG
-# --------
-#
-# Find the native MPEG includes and library
-#
-# This module defines
-#
-# ::
-#
-# MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
-# MPEG_LIBRARIES, the libraries required to use MPEG.
-# MPEG_FOUND, If false, do not try to use MPEG.
-#
-# also defined, but not for general use are
-#
-# ::
-#
-# MPEG_mpeg2_LIBRARY, where to find the MPEG library.
-# MPEG_vo_LIBRARY, where to find the vo library.
+#[=======================================================================[.rst:
+FindMPEG
+--------
+
+Find the native MPEG includes and library
+
+This module defines
+
+::
+
+ MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
+ MPEG_LIBRARIES, the libraries required to use MPEG.
+ MPEG_FOUND, If false, do not try to use MPEG.
+
+also defined, but not for general use are
+
+::
+
+ MPEG_mpeg2_LIBRARY, where to find the MPEG library.
+ MPEG_vo_LIBRARY, where to find the vo library.
+#]=======================================================================]
find_path(MPEG_INCLUDE_DIR
NAMES mpeg2.h mpeg2dec/mpeg2.h mpeg2dec/include/video_out.h)
diff --git a/Modules/FindMPEG2.cmake b/Modules/FindMPEG2.cmake
index f9ccd6ae1..763d86a85 100644
--- a/Modules/FindMPEG2.cmake
+++ b/Modules/FindMPEG2.cmake
@@ -1,26 +1,27 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindMPEG2
-# ---------
-#
-# Find the native MPEG2 includes and library
-#
-# This module defines
-#
-# ::
-#
-# MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
-# MPEG2_LIBRARIES, the libraries required to use MPEG2.
-# MPEG2_FOUND, If false, do not try to use MPEG2.
-#
-# also defined, but not for general use are
-#
-# ::
-#
-# MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
-# MPEG2_vo_LIBRARY, where to find the vo library.
+#[=======================================================================[.rst:
+FindMPEG2
+---------
+
+Find the native MPEG2 includes and library
+
+This module defines
+
+::
+
+ MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
+ MPEG2_LIBRARIES, the libraries required to use MPEG2.
+ MPEG2_FOUND, If false, do not try to use MPEG2.
+
+also defined, but not for general use are
+
+::
+
+ MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
+ MPEG2_vo_LIBRARY, where to find the vo library.
+#]=======================================================================]
find_path(MPEG2_INCLUDE_DIR
NAMES mpeg2.h mpeg2dec/mpeg2.h)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index b94e69eac..8c45a8c5f 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -1,247 +1,248 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindMPI
-# -------
-#
-# Find a Message Passing Interface (MPI) implementation.
-#
-# The Message Passing Interface (MPI) is a library used to write
-# high-performance distributed-memory parallel applications, and is
-# typically deployed on a cluster. MPI is a standard interface (defined
-# by the MPI forum) for which many implementations are available.
-#
-# Variables for using MPI
-# ^^^^^^^^^^^^^^^^^^^^^^^
-#
-# The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``.
-# Each of these controls the various MPI languages to search for.
-# The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the
-# MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API
-# that was removed again in MPI-3.
-#
-# Depending on the enabled components the following variables will be set:
-#
-# ``MPI_FOUND``
-# Variable indicating that MPI settings for all requested languages have been found.
-# If no components are specified, this is true if MPI settings for all enabled languages
-# were detected. Note that the ``MPICXX`` component does not affect this variable.
-# ``MPI_VERSION``
-# Minimal version of MPI detected among the requested languages, or all enabled languages
-# if no components were specified.
-#
-# This module will set the following variables per language in your
-# project, where ``<lang>`` is one of C, CXX, or Fortran:
-#
-# ``MPI_<lang>_FOUND``
-# Variable indicating the MPI settings for ``<lang>`` were found and that
-# simple MPI test programs compile with the provided settings.
-# ``MPI_<lang>_COMPILER``
-# MPI compiler for ``<lang>`` if such a program exists.
-# ``MPI_<lang>_COMPILE_OPTIONS``
-# Compilation options for MPI programs in ``<lang>``, given as a :ref:`;-list <CMake Language Lists>`.
-# ``MPI_<lang>_COMPILE_DEFINITIONS``
-# Compilation definitions for MPI programs in ``<lang>``, given as a :ref:`;-list <CMake Language Lists>`.
-# ``MPI_<lang>_INCLUDE_DIRS``
-# Include path(s) for MPI header.
-# ``MPI_<lang>_LINK_FLAGS``
-# Linker flags for MPI programs.
-# ``MPI_<lang>_LIBRARIES``
-# All libraries to link MPI programs against.
-#
-# Additionally, the following :prop_tgt:`IMPORTED` targets are defined:
-#
-# ``MPI::MPI_<lang>``
-# Target for using MPI from ``<lang>``.
-#
-# The following variables indicating which bindings are present will be defined:
-#
-# ``MPI_MPICXX_FOUND``
-# Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3).
-# ``MPI_Fortran_HAVE_F77_HEADER``
-# True if the Fortran 77 header ``mpif.h`` is available.
-# ``MPI_Fortran_HAVE_F90_MODULE``
-# True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only).
-# ``MPI_Fortran_HAVE_F08_MODULE``
-# True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only).
-#
-# If possible, the MPI version will be determined by this module. The facilities to detect the MPI version
-# were introduced with MPI-1.2, and therefore cannot be found for older MPI versions.
-#
-# ``MPI_<lang>_VERSION_MAJOR``
-# Major version of MPI implemented for ``<lang>`` by the MPI distribution.
-# ``MPI_<lang>_VERSION_MINOR``
-# Minor version of MPI implemented for ``<lang>`` by the MPI distribution.
-# ``MPI_<lang>_VERSION``
-# MPI version implemented for ``<lang>`` by the MPI distribution.
-#
-# Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards
-# always have required this binding to work in both C and C++ code.
-#
-# For running MPI programs, the module sets the following variables
-#
-# ``MPIEXEC_EXECUTABLE``
-# Executable for running MPI programs, if such exists.
-# ``MPIEXEC_NUMPROC_FLAG``
-# Flag to pass to ``mpiexec`` before giving it the number of processors to run on.
-# ``MPIEXEC_MAX_NUMPROCS``
-# Number of MPI processors to utilize. Defaults to the number
-# of processors detected on the host system.
-# ``MPIEXEC_PREFLAGS``
-# Flags to pass to ``mpiexec`` directly before the executable to run.
-# ``MPIEXEC_POSTFLAGS``
-# Flags to pass to ``mpiexec`` after other flags.
-#
-# Variables for locating MPI
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# This module performs a three step search for an MPI implementation:
-#
-# 1. Check if the compiler has MPI support built-in. This is the case if the user passed a
-# compiler wrapper as ``CMAKE_<LANG>_COMPILER`` or if they're on a Cray system.
-# 2. Attempt to find an MPI compiler wrapper and determine the compiler information from it.
-# 3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings.
-# Currently, only Microsoft MPI and MPICH2 on Windows are supported.
-#
-# For controlling the second step, the following variables may be set:
-#
-# ``MPI_<lang>_COMPILER``
-# Search for the specified compiler wrapper and use it.
-# ``MPI_<lang>_COMPILER_FLAGS``
-# Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers
-# support linking debug or tracing libraries if a specific flag is passed and this variable
-# may be used to obtain them.
-# ``MPI_COMPILER_FLAGS``
-# Used to initialize ``MPI_<lang>_COMPILER_FLAGS`` if no language specific flag has been given.
-# Empty by default.
-# ``MPI_EXECUTABLE_SUFFIX``
-# A suffix which is appended to all names that are being looked for. For instance you may set this
-# to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives.
-#
-# In order to control the guessing step, the following variable may be set:
-#
-# ``MPI_GUESS_LIBRARY_NAME``
-# Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for.
-# By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available.
-# This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden.
-#
-# Each of the search steps may be skipped with the following control variables:
-#
-# ``MPI_ASSUME_NO_BUILTIN_MPI``
-# If true, the module assumes that the compiler itself does not provide an MPI implementation and
-# skips to step 2.
-# ``MPI_SKIP_COMPILER_WRAPPER``
-# If true, no compiler wrapper will be searched for.
-# ``MPI_SKIP_GUESSING``
-# If true, the guessing step will be skipped.
-#
-# Additionally, the following control variable is available to change search behavior:
-#
-# ``MPI_CXX_SKIP_MPICXX``
-# Add some definitions that will disable the MPI-2 C++ bindings.
-# Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof,
-# for example MVAPICH or Intel MPI.
-#
-# If the find procedure fails for a variable ``MPI_<lang>_WORKS``, then the settings detected by or passed to
-# the module did not work and even a simple MPI test program failed to compile.
-#
-# If all of these parameters were not sufficient to find the right MPI implementation, a user may
-# disable the entire autodetection process by specifying both a list of libraries in ``MPI_<lang>_LIBRARIES``
-# and a list of include directories in ``MPI_<lang>_ADDITIONAL_INCLUDE_DIRS``.
-# Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the
-# settings in the cache.
-#
-# Cache variables for MPI
-# ^^^^^^^^^^^^^^^^^^^^^^^
-#
-# The variable ``MPI_<lang>_INCLUDE_DIRS`` will be assembled from the following variables.
-# For C and CXX:
-#
-# ``MPI_<lang>_HEADER_DIR``
-# Location of the ``mpi.h`` header on disk.
-#
-# For Fortran:
-#
-# ``MPI_Fortran_F77_HEADER_DIR``
-# Location of the Fortran 77 header ``mpif.h``, if it exists.
-# ``MPI_Fortran_MODULE_DIR``
-# Location of the ``mpi`` or ``mpi_f08`` modules, if available.
-#
-# For all languages the following variables are additionally considered:
-#
-# ``MPI_<lang>_ADDITIONAL_INCLUDE_DIRS``
-# A :ref:`;-list <CMake Language Lists>` of paths needed in addition to the normal include directories.
-# ``MPI_<include_name>_INCLUDE_DIR``
-# Path variables for include folders referred to by ``<include_name>``.
-# ``MPI_<lang>_ADDITIONAL_INCLUDE_VARS``
-# A :ref:`;-list <CMake Language Lists>` of ``<include_name>`` that will be added to the include locations of ``<lang>``.
-#
-# The variable ``MPI_<lang>_LIBRARIES`` will be assembled from the following variables:
-#
-# ``MPI_<lib_name>_LIBRARY``
-# The location of a library called ``<lib_name>`` for use with MPI.
-# ``MPI_<lang>_LIB_NAMES``
-# A :ref:`;-list <CMake Language Lists>` of ``<lib_name>`` that will be added to the include locations of ``<lang>``.
-#
-# Usage of mpiexec
-# ^^^^^^^^^^^^^^^^
-#
-# When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically
-# use all of the ``MPIEXEC_EXECUTABLE`` flags as follows:
-#
-# ::
-#
-# ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS}
-# ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
-#
-# where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to
-# pass to the MPI program.
-#
-# Advanced variables for using MPI
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# The module can perform some advanced feature detections upon explicit request.
-#
-# **Important notice:** The following checks cannot be performed without *executing* an MPI test program.
-# Consider the special considerations for the behavior of :command:`try_run` during cross compilation.
-# Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems.
-# You should only enable these detections if you absolutely need the information.
-#
-# If the following variables are set to true, the respective search will be performed:
-#
-# ``MPI_DETERMINE_Fortran_CAPABILITIES``
-# Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and
-# ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran_<binding>_SUBARRAYS``
-# and ``MPI_Fortran_<binding>_ASYNCPROT``, where ``<binding>`` is one of ``F77_HEADER``, ``F90_MODULE`` and
-# ``F08_MODULE``.
-# ``MPI_DETERMINE_LIBRARY_VERSION``
-# For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI_<lang>_LIBRARY_VERSION``.
-# This information is usually tied to the runtime component of an MPI implementation and might differ depending on ``<lang>``.
-# Note that the return value is entirely implementation defined. This information might be used to identify
-# the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor.
-#
-# Backward Compatibility
-# ^^^^^^^^^^^^^^^^^^^^^^
-#
-# For backward compatibility with older versions of FindMPI, these
-# variables are set, but deprecated:
-#
-# ::
-#
-# MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY
-# MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS
-# MPI_LIBRARIES
-#
-# In new projects, please use the ``MPI_<lang>_XXX`` equivalents.
-# Additionally, the following variables are deprecated:
-#
-# ``MPI_<lang>_COMPILE_FLAGS``
-# Use ``MPI_<lang>_COMPILE_OPTIONS`` and ``MPI_<lang>_COMPILE_DEFINITIONS`` instead.
-# ``MPI_<lang>_INCLUDE_PATH``
-# For consumption use ``MPI_<lang>_INCLUDE_DIRS`` and for specifying folders use ``MPI_<lang>_ADDITIONAL_INCLUDE_DIRS`` instead.
-# ``MPIEXEC``
-# Use ``MPIEXEC_EXECUTABLE`` instead.
+#[=======================================================================[.rst:
+FindMPI
+-------
+
+Find a Message Passing Interface (MPI) implementation.
+
+The Message Passing Interface (MPI) is a library used to write
+high-performance distributed-memory parallel applications, and is
+typically deployed on a cluster. MPI is a standard interface (defined
+by the MPI forum) for which many implementations are available.
+
+Variables for using MPI
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The module exposes the components ``C``, ``CXX``, ``MPICXX`` and ``Fortran``.
+Each of these controls the various MPI languages to search for.
+The difference between ``CXX`` and ``MPICXX`` is that ``CXX`` refers to the
+MPI C API being usable from C++, whereas ``MPICXX`` refers to the MPI-2 C++ API
+that was removed again in MPI-3.
+
+Depending on the enabled components the following variables will be set:
+
+``MPI_FOUND``
+ Variable indicating that MPI settings for all requested languages have been found.
+ If no components are specified, this is true if MPI settings for all enabled languages
+ were detected. Note that the ``MPICXX`` component does not affect this variable.
+``MPI_VERSION``
+ Minimal version of MPI detected among the requested languages, or all enabled languages
+ if no components were specified.
+
+This module will set the following variables per language in your
+project, where ``<lang>`` is one of C, CXX, or Fortran:
+
+``MPI_<lang>_FOUND``
+ Variable indicating the MPI settings for ``<lang>`` were found and that
+ simple MPI test programs compile with the provided settings.
+``MPI_<lang>_COMPILER``
+ MPI compiler for ``<lang>`` if such a program exists.
+``MPI_<lang>_COMPILE_OPTIONS``
+ Compilation options for MPI programs in ``<lang>``, given as a :ref:`;-list <CMake Language Lists>`.
+``MPI_<lang>_COMPILE_DEFINITIONS``
+ Compilation definitions for MPI programs in ``<lang>``, given as a :ref:`;-list <CMake Language Lists>`.
+``MPI_<lang>_INCLUDE_DIRS``
+ Include path(s) for MPI header.
+``MPI_<lang>_LINK_FLAGS``
+ Linker flags for MPI programs.
+``MPI_<lang>_LIBRARIES``
+ All libraries to link MPI programs against.
+
+Additionally, the following :prop_tgt:`IMPORTED` targets are defined:
+
+``MPI::MPI_<lang>``
+ Target for using MPI from ``<lang>``.
+
+The following variables indicating which bindings are present will be defined:
+
+``MPI_MPICXX_FOUND``
+ Variable indicating whether the MPI-2 C++ bindings are present (introduced in MPI-2, removed with MPI-3).
+``MPI_Fortran_HAVE_F77_HEADER``
+ True if the Fortran 77 header ``mpif.h`` is available.
+``MPI_Fortran_HAVE_F90_MODULE``
+ True if the Fortran 90 module ``mpi`` can be used for accessing MPI (MPI-2 and higher only).
+``MPI_Fortran_HAVE_F08_MODULE``
+ True if the Fortran 2008 ``mpi_f08`` is available to MPI programs (MPI-3 and higher only).
+
+If possible, the MPI version will be determined by this module. The facilities to detect the MPI version
+were introduced with MPI-1.2, and therefore cannot be found for older MPI versions.
+
+``MPI_<lang>_VERSION_MAJOR``
+ Major version of MPI implemented for ``<lang>`` by the MPI distribution.
+``MPI_<lang>_VERSION_MINOR``
+ Minor version of MPI implemented for ``<lang>`` by the MPI distribution.
+``MPI_<lang>_VERSION``
+ MPI version implemented for ``<lang>`` by the MPI distribution.
+
+Note that there's no variable for the C bindings being accessible through ``mpi.h``, since the MPI standards
+always have required this binding to work in both C and C++ code.
+
+For running MPI programs, the module sets the following variables
+
+``MPIEXEC_EXECUTABLE``
+ Executable for running MPI programs, if such exists.
+``MPIEXEC_NUMPROC_FLAG``
+ Flag to pass to ``mpiexec`` before giving it the number of processors to run on.
+``MPIEXEC_MAX_NUMPROCS``
+ Number of MPI processors to utilize. Defaults to the number
+ of processors detected on the host system.
+``MPIEXEC_PREFLAGS``
+ Flags to pass to ``mpiexec`` directly before the executable to run.
+``MPIEXEC_POSTFLAGS``
+ Flags to pass to ``mpiexec`` after other flags.
+
+Variables for locating MPI
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This module performs a three step search for an MPI implementation:
+
+1. Check if the compiler has MPI support built-in. This is the case if the user passed a
+ compiler wrapper as ``CMAKE_<LANG>_COMPILER`` or if they're on a Cray system.
+2. Attempt to find an MPI compiler wrapper and determine the compiler information from it.
+3. Try to find an MPI implementation that does not ship such a wrapper by guessing settings.
+ Currently, only Microsoft MPI and MPICH2 on Windows are supported.
+
+For controlling the second step, the following variables may be set:
+
+``MPI_<lang>_COMPILER``
+ Search for the specified compiler wrapper and use it.
+``MPI_<lang>_COMPILER_FLAGS``
+ Flags to pass to the MPI compiler wrapper during interrogation. Some compiler wrappers
+ support linking debug or tracing libraries if a specific flag is passed and this variable
+ may be used to obtain them.
+``MPI_COMPILER_FLAGS``
+ Used to initialize ``MPI_<lang>_COMPILER_FLAGS`` if no language specific flag has been given.
+ Empty by default.
+``MPI_EXECUTABLE_SUFFIX``
+ A suffix which is appended to all names that are being looked for. For instance you may set this
+ to ``.mpich`` or ``.openmpi`` to prefer the one or the other on Debian and its derivatives.
+
+In order to control the guessing step, the following variable may be set:
+
+``MPI_GUESS_LIBRARY_NAME``
+ Valid values are ``MSMPI`` and ``MPICH2``. If set, only the given library will be searched for.
+ By default, ``MSMPI`` will be preferred over ``MPICH2`` if both are available.
+ This also sets ``MPI_SKIP_COMPILER_WRAPPER`` to ``true``, which may be overridden.
+
+Each of the search steps may be skipped with the following control variables:
+
+``MPI_ASSUME_NO_BUILTIN_MPI``
+ If true, the module assumes that the compiler itself does not provide an MPI implementation and
+ skips to step 2.
+``MPI_SKIP_COMPILER_WRAPPER``
+ If true, no compiler wrapper will be searched for.
+``MPI_SKIP_GUESSING``
+ If true, the guessing step will be skipped.
+
+Additionally, the following control variable is available to change search behavior:
+
+``MPI_CXX_SKIP_MPICXX``
+ Add some definitions that will disable the MPI-2 C++ bindings.
+ Currently supported are MPICH, Open MPI, Platform MPI and derivatives thereof,
+ for example MVAPICH or Intel MPI.
+
+If the find procedure fails for a variable ``MPI_<lang>_WORKS``, then the settings detected by or passed to
+the module did not work and even a simple MPI test program failed to compile.
+
+If all of these parameters were not sufficient to find the right MPI implementation, a user may
+disable the entire autodetection process by specifying both a list of libraries in ``MPI_<lang>_LIBRARIES``
+and a list of include directories in ``MPI_<lang>_ADDITIONAL_INCLUDE_DIRS``.
+Any other variable may be set in addition to these two. The module will then validate the MPI settings and store the
+settings in the cache.
+
+Cache variables for MPI
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The variable ``MPI_<lang>_INCLUDE_DIRS`` will be assembled from the following variables.
+For C and CXX:
+
+``MPI_<lang>_HEADER_DIR``
+ Location of the ``mpi.h`` header on disk.
+
+For Fortran:
+
+``MPI_Fortran_F77_HEADER_DIR``
+ Location of the Fortran 77 header ``mpif.h``, if it exists.
+``MPI_Fortran_MODULE_DIR``
+ Location of the ``mpi`` or ``mpi_f08`` modules, if available.
+
+For all languages the following variables are additionally considered:
+
+``MPI_<lang>_ADDITIONAL_INCLUDE_DIRS``
+ A :ref:`;-list <CMake Language Lists>` of paths needed in addition to the normal include directories.
+``MPI_<include_name>_INCLUDE_DIR``
+ Path variables for include folders referred to by ``<include_name>``.
+``MPI_<lang>_ADDITIONAL_INCLUDE_VARS``
+ A :ref:`;-list <CMake Language Lists>` of ``<include_name>`` that will be added to the include locations of ``<lang>``.
+
+The variable ``MPI_<lang>_LIBRARIES`` will be assembled from the following variables:
+
+``MPI_<lib_name>_LIBRARY``
+ The location of a library called ``<lib_name>`` for use with MPI.
+``MPI_<lang>_LIB_NAMES``
+ A :ref:`;-list <CMake Language Lists>` of ``<lib_name>`` that will be added to the include locations of ``<lang>``.
+
+Usage of mpiexec
+^^^^^^^^^^^^^^^^
+
+When using ``MPIEXEC_EXECUTABLE`` to execute MPI applications, you should typically
+use all of the ``MPIEXEC_EXECUTABLE`` flags as follows:
+
+::
+
+ ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS}
+ ${MPIEXEC_PREFLAGS} EXECUTABLE ${MPIEXEC_POSTFLAGS} ARGS
+
+where ``EXECUTABLE`` is the MPI program, and ``ARGS`` are the arguments to
+pass to the MPI program.
+
+Advanced variables for using MPI
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The module can perform some advanced feature detections upon explicit request.
+
+**Important notice:** The following checks cannot be performed without *executing* an MPI test program.
+Consider the special considerations for the behavior of :command:`try_run` during cross compilation.
+Moreover, running an MPI program can cause additional issues, like a firewall notification on some systems.
+You should only enable these detections if you absolutely need the information.
+
+If the following variables are set to true, the respective search will be performed:
+
+``MPI_DETERMINE_Fortran_CAPABILITIES``
+ Determine for all available Fortran bindings what the values of ``MPI_SUBARRAYS_SUPPORTED`` and
+ ``MPI_ASYNC_PROTECTS_NONBLOCKING`` are and make their values available as ``MPI_Fortran_<binding>_SUBARRAYS``
+ and ``MPI_Fortran_<binding>_ASYNCPROT``, where ``<binding>`` is one of ``F77_HEADER``, ``F90_MODULE`` and
+ ``F08_MODULE``.
+``MPI_DETERMINE_LIBRARY_VERSION``
+ For each language, find the output of ``MPI_Get_library_version`` and make it available as ``MPI_<lang>_LIBRARY_VERSION``.
+ This information is usually tied to the runtime component of an MPI implementation and might differ depending on ``<lang>``.
+ Note that the return value is entirely implementation defined. This information might be used to identify
+ the MPI vendor and for example pick the correct one of multiple third party binaries that matches the MPI vendor.
+
+Backward Compatibility
+^^^^^^^^^^^^^^^^^^^^^^
+
+For backward compatibility with older versions of FindMPI, these
+variables are set, but deprecated:
+
+::
+
+ MPI_COMPILER MPI_LIBRARY MPI_EXTRA_LIBRARY
+ MPI_COMPILE_FLAGS MPI_INCLUDE_PATH MPI_LINK_FLAGS
+ MPI_LIBRARIES
+
+In new projects, please use the ``MPI_<lang>_XXX`` equivalents.
+Additionally, the following variables are deprecated:
+
+``MPI_<lang>_COMPILE_FLAGS``
+ Use ``MPI_<lang>_COMPILE_OPTIONS`` and ``MPI_<lang>_COMPILE_DEFINITIONS`` instead.
+``MPI_<lang>_INCLUDE_PATH``
+ For consumption use ``MPI_<lang>_INCLUDE_DIRS`` and for specifying folders use ``MPI_<lang>_ADDITIONAL_INCLUDE_DIRS`` instead.
+``MPIEXEC``
+ Use ``MPIEXEC_EXECUTABLE`` instead.
+#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 547a33085..354764217 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -1,232 +1,228 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindMatlab
-# ----------
-#
-# Finds Matlab or Matlab Compiler Runtime (MCR) and provides Matlab tools,
-# libraries and compilers to CMake.
-#
-# This package primary purpose is to find the libraries associated with Matlab
-# or the MCR in order to be able to build Matlab extensions (mex files). It
-# can also be used:
-#
-# * to run specific commands in Matlab in case Matlab is available
-# * for declaring Matlab unit test
-# * to retrieve various information from Matlab (mex extensions, versions and
-# release queries, ...)
-#
-# The module supports the following components:
-#
-# * ``MX_LIBRARY``, ``ENG_LIBRARY`` and ``MAT_LIBRARY``: respectively the ``MX``,
-# ``ENG`` and ``MAT`` libraries of Matlab
-# * ``ENGINE_LIBRARY``, ``DATAARRAY_LIBRARY``: respectively the ``MatlabEngine``
-# and ``MatlabDataArray`` libraries of Matlab (Matlab 2018a and later)
-# * ``MAIN_PROGRAM`` the Matlab binary program. Note that this component is not
-# available on the MCR version, and will yield an error if the MCR is found
-# instead of the regular Matlab installation.
-# * ``MEX_COMPILER`` the MEX compiler.
-# * ``MCC_COMPILER`` the MCC compiler, included with the Matlab Compiler add-on.
-# * ``SIMULINK`` the Simulink environment.
-#
-# .. note::
-#
-# The version given to the :command:`find_package` directive is the Matlab
-# **version**, which should not be confused with the Matlab *release* name
-# (eg. `R2014`).
-# The :command:`matlab_get_version_from_release_name` and
-# :command:`matlab_get_release_name_from_version` provide a mapping
-# between the release name and the version.
-#
-# The variable :variable:`Matlab_ROOT_DIR` may be specified in order to give
-# the path of the desired Matlab version. Otherwise, the behaviour is platform
-# specific:
-#
-# * Windows: The installed versions of Matlab/MCR are retrieved from the
-# Windows registry
-# * OS X: The installed versions of Matlab/MCR are given by the MATLAB
-# default installation paths in ``/Application``. If no such application is
-# found, it falls back to the one that might be accessible from the ``PATH``.
-# * Unix: The desired Matlab should be accessible from the ``PATH``. This does
-# not work for MCR installation and :variable:`Matlab_ROOT_DIR` should be
-# specified on this platform.
-#
-# Additional information is provided when :variable:`MATLAB_FIND_DEBUG` is set.
-# When a Matlab/MCR installation is found automatically and the ``MATLAB_VERSION``
-# is not given, the version is queried from Matlab directly (on Windows this
-# may pop up a Matlab window) or from the MCR installation.
-#
-# The mapping of the release names and the version of Matlab is performed by
-# defining pairs (name, version). The variable
-# :variable:`MATLAB_ADDITIONAL_VERSIONS` may be provided before the call to
-# the :command:`find_package` in order to handle additional versions.
-#
-# A Matlab scripts can be added to the set of tests using the
-# :command:`matlab_add_unit_test`. By default, the Matlab unit test framework
-# will be used (>= 2013a) to run this script, but regular ``.m`` files
-# returning an exit code can be used as well (0 indicating a success).
-#
-# Module Input Variables
-# ^^^^^^^^^^^^^^^^^^^^^^
-#
-# Users or projects may set the following variables to configure the module
-# behaviour:
-#
-# :variable:`Matlab_ROOT_DIR`
-# the root of the Matlab installation.
-# :variable:`MATLAB_FIND_DEBUG`
-# outputs debug information
-# :variable:`MATLAB_ADDITIONAL_VERSIONS`
-# additional versions of Matlab for the automatic retrieval of the installed
-# versions.
-#
-# Variables defined by the module
-# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-#
-# Result variables
-# """"""""""""""""
-#
-# ``Matlab_FOUND``
-# ``TRUE`` if the Matlab installation is found, ``FALSE``
-# otherwise. All variable below are defined if Matlab is found.
-# ``Matlab_ROOT_DIR``
-# the final root of the Matlab installation determined by the FindMatlab
-# module.
-# ``Matlab_MAIN_PROGRAM``
-# the Matlab binary program. Available only if the component ``MAIN_PROGRAM``
-# is given in the :command:`find_package` directive.
-# ``Matlab_INCLUDE_DIRS``
-# the path of the Matlab libraries headers
-# ``Matlab_MEX_LIBRARY``
-# library for mex, always available.
-# ``Matlab_MX_LIBRARY``
-# mx library of Matlab (arrays). Available only if the component
-# ``MX_LIBRARY`` has been requested.
-# ``Matlab_ENG_LIBRARY``
-# Matlab engine library. Available only if the component ``ENG_LIBRARY``
-# is requested.
-# ``Matlab_MAT_LIBRARY``
-# Matlab matrix library. Available only if the component ``MAT_LIBRARY``
-# is requested.
-# ``Matlab_ENGINE_LIBRARY``
-# Matlab C++ engine library. Available only if the component ``ENGINE_LIBRARY``
-# is requested.
-# ``Matlab_DATAARRAY_LIBRARY``
-# Matlab C++ data array library. Available only if the component ``DATAARRAY_LIBRARY``
-# is requested.
-# ``Matlab_LIBRARIES``
-# the whole set of libraries of Matlab
-# ``Matlab_MEX_COMPILER``
-# the mex compiler of Matlab. Currently not used.
-# Available only if the component ``MEX_COMPILER`` is requested.
-# ``Matlab_MCC_COMPILER``
-# the mcc compiler of Matlab. Included with the Matlab Compiler add-on.
-# Available only if the component ``MCC_COMPILER`` is requested.
-#
-# Cached variables
-# """"""""""""""""
-#
-# ``Matlab_MEX_EXTENSION``
-# the extension of the mex files for the current platform (given by Matlab).
-# ``Matlab_ROOT_DIR``
-# the location of the root of the Matlab installation found. If this value
-# is changed by the user, the result variables are recomputed.
-#
-# Provided macros
-# ^^^^^^^^^^^^^^^
-#
-# :command:`matlab_get_version_from_release_name`
-# returns the version from the release name
-# :command:`matlab_get_release_name_from_version`
-# returns the release name from the Matlab version
-#
-# Provided functions
-# ^^^^^^^^^^^^^^^^^^
-#
-# :command:`matlab_add_mex`
-# adds a target compiling a MEX file.
-# :command:`matlab_add_unit_test`
-# adds a Matlab unit test file as a test to the project.
-# :command:`matlab_extract_all_installed_versions_from_registry`
-# parses the registry for all Matlab versions. Available on Windows only.
-# The part of the registry parsed is dependent on the host processor
-# :command:`matlab_get_all_valid_matlab_roots_from_registry`
-# returns all the possible Matlab or MCR paths, according to a previously
-# given list. Only the existing/accessible paths are kept. This is mainly
-# useful for the searching all possible Matlab installation.
-# :command:`matlab_get_mex_suffix`
-# returns the suffix to be used for the mex files
-# (platform/architecture dependent)
-# :command:`matlab_get_version_from_matlab_run`
-# returns the version of Matlab/MCR, given the full directory of the Matlab/MCR
-# installation path.
-#
-#
-# Known issues
-# ^^^^^^^^^^^^
-#
-# **Symbol clash in a MEX target**
-# By default, every symbols inside a MEX
-# file defined with the command :command:`matlab_add_mex` have hidden
-# visibility, except for the entry point. This is the default behaviour of
-# the MEX compiler, which lowers the risk of symbol collision between the
-# libraries shipped with Matlab, and the libraries to which the MEX file is
-# linking to. This is also the default on Windows platforms.
-#
-# However, this is not sufficient in certain case, where for instance your
-# MEX file is linking against libraries that are already loaded by Matlab,
-# even if those libraries have different SONAMES.
-# A possible solution is to hide the symbols of the libraries to which the
-# MEX target is linking to. This can be achieved in GNU GCC compilers with
-# the linker option ``-Wl,--exclude-libs,ALL``.
-#
-# **Tests using GPU resources**
-# in case your MEX file is using the GPU and
-# in order to be able to run unit tests on this MEX file, the GPU resources
-# should be properly released by Matlab. A possible solution is to make
-# Matlab aware of the use of the GPU resources in the session, which can be
-# performed by a command such as ``D = gpuDevice()`` at the beginning of
-# the test script (or via a fixture).
-#
-#
-# Reference
-# ^^^^^^^^^
-#
-# .. variable:: Matlab_ROOT_DIR
-#
-# The root folder of the Matlab installation. If set before the call to
-# :command:`find_package`, the module will look for the components in that
-# path. If not set, then an automatic search of Matlab
-# will be performed. If set, it should point to a valid version of Matlab.
-#
-# .. variable:: MATLAB_FIND_DEBUG
-#
-# If set, the lookup of Matlab and the intermediate configuration steps are
-# outputted to the console.
-#
-# .. variable:: MATLAB_ADDITIONAL_VERSIONS
-#
-# If set, specifies additional versions of Matlab that may be looked for.
-# The variable should be a list of strings, organised by pairs of release
-# name and versions, such as follows::
-#
-# set(MATLAB_ADDITIONAL_VERSIONS
-# "release_name1=corresponding_version1"
-# "release_name2=corresponding_version2"
-# ...
-# )
-#
-# Example::
-#
-# set(MATLAB_ADDITIONAL_VERSIONS
-# "R2013b=8.2"
-# "R2013a=8.1"
-# "R2012b=8.0")
-#
-# The order of entries in this list matters when several versions of
-# Matlab are installed. The priority is set according to the ordering in
-# this list.
+#[=======================================================================[.rst:
+FindMatlab
+----------
+
+Finds Matlab or Matlab Compiler Runtime (MCR) and provides Matlab tools,
+libraries and compilers to CMake.
+
+This package primary purpose is to find the libraries associated with Matlab
+or the MCR in order to be able to build Matlab extensions (mex files). It
+can also be used:
+
+* to run specific commands in Matlab in case Matlab is available
+* for declaring Matlab unit test
+* to retrieve various information from Matlab (mex extensions, versions and
+ release queries, ...)
+
+The module supports the following components:
+
+* ``ENG_LIBRARY`` and ``MAT_LIBRARY``: respectively the ``ENG`` and ``MAT``
+ libraries of Matlab
+* ``MAIN_PROGRAM`` the Matlab binary program. Note that this component is not
+ available on the MCR version, and will yield an error if the MCR is found
+ instead of the regular Matlab installation.
+* ``MEX_COMPILER`` the MEX compiler.
+* ``MCC_COMPILER`` the MCC compiler, included with the Matlab Compiler add-on.
+* ``SIMULINK`` the Simulink environment.
+
+.. note::
+
+ The version given to the :command:`find_package` directive is the Matlab
+ **version**, which should not be confused with the Matlab *release* name
+ (eg. `R2014`).
+ The :command:`matlab_get_version_from_release_name` and
+ :command:`matlab_get_release_name_from_version` provide a mapping
+ between the release name and the version.
+
+The variable :variable:`Matlab_ROOT_DIR` may be specified in order to give
+the path of the desired Matlab version. Otherwise, the behaviour is platform
+specific:
+
+* Windows: The installed versions of Matlab/MCR are retrieved from the
+ Windows registry
+* OS X: The installed versions of Matlab/MCR are given by the MATLAB
+ default installation paths in ``/Application``. If no such application is
+ found, it falls back to the one that might be accessible from the ``PATH``.
+* Unix: The desired Matlab should be accessible from the ``PATH``. This does
+ not work for MCR installation and :variable:`Matlab_ROOT_DIR` should be
+ specified on this platform.
+
+Additional information is provided when :variable:`MATLAB_FIND_DEBUG` is set.
+When a Matlab/MCR installation is found automatically and the ``MATLAB_VERSION``
+is not given, the version is queried from Matlab directly (on Windows this
+may pop up a Matlab window) or from the MCR installation.
+
+The mapping of the release names and the version of Matlab is performed by
+defining pairs (name, version). The variable
+:variable:`MATLAB_ADDITIONAL_VERSIONS` may be provided before the call to
+the :command:`find_package` in order to handle additional versions.
+
+A Matlab scripts can be added to the set of tests using the
+:command:`matlab_add_unit_test`. By default, the Matlab unit test framework
+will be used (>= 2013a) to run this script, but regular ``.m`` files
+returning an exit code can be used as well (0 indicating a success).
+
+Module Input Variables
+^^^^^^^^^^^^^^^^^^^^^^
+
+Users or projects may set the following variables to configure the module
+behaviour:
+
+:variable:`Matlab_ROOT_DIR`
+ the root of the Matlab installation.
+:variable:`MATLAB_FIND_DEBUG`
+ outputs debug information
+:variable:`MATLAB_ADDITIONAL_VERSIONS`
+ additional versions of Matlab for the automatic retrieval of the installed
+ versions.
+
+Variables defined by the module
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Result variables
+""""""""""""""""
+
+``Matlab_FOUND``
+ ``TRUE`` if the Matlab installation is found, ``FALSE``
+ otherwise. All variable below are defined if Matlab is found.
+``Matlab_ROOT_DIR``
+ the final root of the Matlab installation determined by the FindMatlab
+ module.
+``Matlab_MAIN_PROGRAM``
+ the Matlab binary program. Available only if the component ``MAIN_PROGRAM``
+ is given in the :command:`find_package` directive.
+``Matlab_INCLUDE_DIRS``
+ the path of the Matlab libraries headers
+``Matlab_MEX_LIBRARY``
+ library for mex, always available.
+``Matlab_MX_LIBRARY``
+ mx library of Matlab (arrays), always available.
+``Matlab_ENG_LIBRARY``
+ Matlab engine library. Available only if the component ``ENG_LIBRARY``
+ is requested.
+``Matlab_MAT_LIBRARY``
+ Matlab matrix library. Available only if the component ``MAT_LIBRARY``
+ is requested.
+``Matlab_ENGINE_LIBRARY``
+ Matlab C++ engine library, always available for R2018a and newer.
+``Matlab_DATAARRAY_LIBRARY``
+ Matlab C++ data array library, always available for R2018a and newer.
+``Matlab_LIBRARIES``
+ the whole set of libraries of Matlab
+``Matlab_MEX_COMPILER``
+ the mex compiler of Matlab. Currently not used.
+ Available only if the component ``MEX_COMPILER`` is requested.
+``Matlab_MCC_COMPILER``
+ the mcc compiler of Matlab. Included with the Matlab Compiler add-on.
+ Available only if the component ``MCC_COMPILER`` is requested.
+
+Cached variables
+""""""""""""""""
+
+``Matlab_MEX_EXTENSION``
+ the extension of the mex files for the current platform (given by Matlab).
+``Matlab_ROOT_DIR``
+ the location of the root of the Matlab installation found. If this value
+ is changed by the user, the result variables are recomputed.
+
+Provided macros
+^^^^^^^^^^^^^^^
+
+:command:`matlab_get_version_from_release_name`
+ returns the version from the release name
+:command:`matlab_get_release_name_from_version`
+ returns the release name from the Matlab version
+
+Provided functions
+^^^^^^^^^^^^^^^^^^
+
+:command:`matlab_add_mex`
+ adds a target compiling a MEX file.
+:command:`matlab_add_unit_test`
+ adds a Matlab unit test file as a test to the project.
+:command:`matlab_extract_all_installed_versions_from_registry`
+ parses the registry for all Matlab versions. Available on Windows only.
+ The part of the registry parsed is dependent on the host processor
+:command:`matlab_get_all_valid_matlab_roots_from_registry`
+ returns all the possible Matlab or MCR paths, according to a previously
+ given list. Only the existing/accessible paths are kept. This is mainly
+ useful for the searching all possible Matlab installation.
+:command:`matlab_get_mex_suffix`
+ returns the suffix to be used for the mex files
+ (platform/architecture dependent)
+:command:`matlab_get_version_from_matlab_run`
+ returns the version of Matlab/MCR, given the full directory of the Matlab/MCR
+ installation path.
+
+
+Known issues
+^^^^^^^^^^^^
+
+**Symbol clash in a MEX target**
+ By default, every symbols inside a MEX
+ file defined with the command :command:`matlab_add_mex` have hidden
+ visibility, except for the entry point. This is the default behaviour of
+ the MEX compiler, which lowers the risk of symbol collision between the
+ libraries shipped with Matlab, and the libraries to which the MEX file is
+ linking to. This is also the default on Windows platforms.
+
+ However, this is not sufficient in certain case, where for instance your
+ MEX file is linking against libraries that are already loaded by Matlab,
+ even if those libraries have different SONAMES.
+ A possible solution is to hide the symbols of the libraries to which the
+ MEX target is linking to. This can be achieved in GNU GCC compilers with
+ the linker option ``-Wl,--exclude-libs,ALL``.
+
+**Tests using GPU resources**
+ in case your MEX file is using the GPU and
+ in order to be able to run unit tests on this MEX file, the GPU resources
+ should be properly released by Matlab. A possible solution is to make
+ Matlab aware of the use of the GPU resources in the session, which can be
+ performed by a command such as ``D = gpuDevice()`` at the beginning of
+ the test script (or via a fixture).
+
+
+Reference
+^^^^^^^^^
+
+.. variable:: Matlab_ROOT_DIR
+
+ The root folder of the Matlab installation. If set before the call to
+ :command:`find_package`, the module will look for the components in that
+ path. If not set, then an automatic search of Matlab
+ will be performed. If set, it should point to a valid version of Matlab.
+
+.. variable:: MATLAB_FIND_DEBUG
+
+ If set, the lookup of Matlab and the intermediate configuration steps are
+ outputted to the console.
+
+.. variable:: MATLAB_ADDITIONAL_VERSIONS
+
+ If set, specifies additional versions of Matlab that may be looked for.
+ The variable should be a list of strings, organised by pairs of release
+ name and versions, such as follows::
+
+ set(MATLAB_ADDITIONAL_VERSIONS
+ "release_name1=corresponding_version1"
+ "release_name2=corresponding_version2"
+ ...
+ )
+
+ Example::
+
+ set(MATLAB_ADDITIONAL_VERSIONS
+ "R2013b=8.2"
+ "R2013a=8.1"
+ "R2012b=8.0")
+
+ The order of entries in this list matters when several versions of
+ Matlab are installed. The priority is set according to the ordering in
+ this list.
+#]=======================================================================]
set(_FindMatlab_SELF_DIR "${CMAKE_CURRENT_LIST_DIR}")
@@ -271,10 +267,11 @@ if(NOT EXISTS "${_matlab_temporary_folder}")
file(MAKE_DIRECTORY "${_matlab_temporary_folder}")
endif()
-#.rst:
-# .. command:: matlab_get_version_from_release_name
-#
-# Returns the version of Matlab (17.58) from a release name (R2017k)
+#[=======================================================================[.rst:
+.. command:: matlab_get_version_from_release_name
+
+ Returns the version of Matlab (17.58) from a release name (R2017k)
+#]=======================================================================]
macro(matlab_get_version_from_release_name release_name version_name)
string(REGEX MATCHALL "${release_name}=([0-9]+\\.?[0-9]*)" _matched ${MATLAB_VERSIONS_MAPPING})
@@ -293,10 +290,11 @@ endmacro()
-#.rst:
-# .. command:: matlab_get_release_name_from_version
-#
-# Returns the release name (R2017k) from the version of Matlab (17.58)
+#[=======================================================================[.rst:
+.. command:: matlab_get_release_name_from_version
+
+ Returns the release name (R2017k) from the version of Matlab (17.58)
+#]=======================================================================]
macro(matlab_get_release_name_from_version version release_name)
set(${release_name} "")
@@ -353,22 +351,23 @@ macro(matlab_get_supported_versions list_versions)
endmacro()
-#.rst:
-# .. command:: matlab_extract_all_installed_versions_from_registry
-#
-# This function parses the registry and founds the Matlab versions that are
-# installed. The found versions are returned in `matlab_versions`.
-# Set `win64` to `TRUE` if the 64 bit version of Matlab should be looked for
-# The returned list contains all versions under
-# ``HKLM\\SOFTWARE\\Mathworks\\MATLAB`` and
-# ``HKLM\\SOFTWARE\\Mathworks\\MATLAB Runtime`` or an empty list in case an
-# error occurred (or nothing found).
-#
-# .. note::
-#
-# Only the versions are provided. No check is made over the existence of the
-# installation referenced in the registry,
-#
+#[=======================================================================[.rst:
+.. command:: matlab_extract_all_installed_versions_from_registry
+
+ This function parses the registry and founds the Matlab versions that are
+ installed. The found versions are returned in `matlab_versions`.
+ Set `win64` to `TRUE` if the 64 bit version of Matlab should be looked for
+ The returned list contains all versions under
+ ``HKLM\\SOFTWARE\\Mathworks\\MATLAB`` and
+ ``HKLM\\SOFTWARE\\Mathworks\\MATLAB Runtime`` or an empty list in case an
+ error occurred (or nothing found).
+
+ .. note::
+
+ Only the versions are provided. No check is made over the existence of the
+ installation referenced in the registry,
+
+#]=======================================================================]
function(matlab_extract_all_installed_versions_from_registry win64 matlab_versions)
if(NOT CMAKE_HOST_WIN32)
@@ -477,25 +476,26 @@ endmacro()
-#.rst:
-# .. command:: matlab_get_all_valid_matlab_roots_from_registry
-#
-# Populates the Matlab root with valid versions of Matlab or
-# Matlab Runtime (MCR).
-# The returned matlab_roots is organized in triplets
-# ``(type,version_number,matlab_root_path)``, where ``type``
-# indicates either ``MATLAB`` or ``MCR``.
-#
-# ::
-#
-# matlab_get_all_valid_matlab_roots_from_registry(
-# matlab_versions
-# matlab_roots)
-#
-# ``matlab_versions``
-# the versions of each of the Matlab or MCR installations
-# ``matlab_roots``
-# the location of each of the Matlab or MCR installations
+#[=======================================================================[.rst:
+.. command:: matlab_get_all_valid_matlab_roots_from_registry
+
+ Populates the Matlab root with valid versions of Matlab or
+ Matlab Runtime (MCR).
+ The returned matlab_roots is organized in triplets
+ ``(type,version_number,matlab_root_path)``, where ``type``
+ indicates either ``MATLAB`` or ``MCR``.
+
+ ::
+
+ matlab_get_all_valid_matlab_roots_from_registry(
+ matlab_versions
+ matlab_roots)
+
+ ``matlab_versions``
+ the versions of each of the Matlab or MCR installations
+ ``matlab_roots``
+ the location of each of the Matlab or MCR installations
+#]=======================================================================]
function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_roots)
# The matlab_versions comes either from
@@ -534,23 +534,24 @@ function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_
set(${matlab_roots} ${_matlab_roots_list} PARENT_SCOPE)
endfunction()
-#.rst:
-# .. command:: matlab_get_mex_suffix
-#
-# Returns the extension of the mex files (the suffixes).
-# This function should not be called before the appropriate Matlab root has
-# been found.
-#
-# ::
-#
-# matlab_get_mex_suffix(
-# matlab_root
-# mex_suffix)
-#
-# ``matlab_root``
-# the root of the Matlab/MCR installation
-# ``mex_suffix``
-# the variable name in which the suffix will be returned.
+#[=======================================================================[.rst:
+.. command:: matlab_get_mex_suffix
+
+ Returns the extension of the mex files (the suffixes).
+ This function should not be called before the appropriate Matlab root has
+ been found.
+
+ ::
+
+ matlab_get_mex_suffix(
+ matlab_root
+ mex_suffix)
+
+ ``matlab_root``
+ the root of the Matlab/MCR installation
+ ``mex_suffix``
+ the variable name in which the suffix will be returned.
+#]=======================================================================]
function(matlab_get_mex_suffix matlab_root mex_suffix)
# todo setup the extension properly. Currently I do not know if this is
@@ -636,23 +637,24 @@ endfunction()
-#.rst:
-# .. command:: matlab_get_version_from_matlab_run
-#
-# This function runs Matlab program specified on arguments and extracts its
-# version. If the path provided for the Matlab installation points to an MCR
-# installation, the version is extracted from the installed files.
-#
-# ::
-#
-# matlab_get_version_from_matlab_run(
-# matlab_binary_path
-# matlab_list_versions)
-#
-# ``matlab_binary_path``
-# the location of the `matlab` binary executable
-# ``matlab_list_versions``
-# the version extracted from Matlab
+#[=======================================================================[.rst:
+.. command:: matlab_get_version_from_matlab_run
+
+ This function runs Matlab program specified on arguments and extracts its
+ version. If the path provided for the Matlab installation points to an MCR
+ installation, the version is extracted from the installed files.
+
+ ::
+
+ matlab_get_version_from_matlab_run(
+ matlab_binary_path
+ matlab_list_versions)
+
+ ``matlab_binary_path``
+ the location of the `matlab` binary executable
+ ``matlab_list_versions``
+ the version extracted from Matlab
+#]=======================================================================]
function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_versions)
set(${matlab_list_versions} "" PARENT_SCOPE)
@@ -723,7 +725,7 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
file(REMOVE "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp")
set(index -1)
- string(FIND ${_matlab_version_from_cmd} "ans" index)
+ string(FIND "${_matlab_version_from_cmd}" "ans" index)
if(index EQUAL -1)
if(MATLAB_FIND_DEBUG)
@@ -733,7 +735,7 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
else()
set(matlab_list_of_all_versions_tmp)
- string(SUBSTRING ${_matlab_version_from_cmd} ${index} -1 substring_ans)
+ string(SUBSTRING "${_matlab_version_from_cmd}" ${index} -1 substring_ans)
string(
REGEX MATCHALL "ans[\r\n\t ]*=[\r\n\t ]*'?([0-9]+(\\.[0-9]+)?)"
matlab_versions_regex
@@ -754,76 +756,77 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
endfunction()
-#.rst:
-# .. command:: matlab_add_unit_test
-#
-# Adds a Matlab unit test to the test set of cmake/ctest.
-# This command requires the component ``MAIN_PROGRAM`` and hence is not
-# available for an MCR installation.
-#
-# The unit test uses the Matlab unittest framework (default, available
-# starting Matlab 2013b+) except if the option ``NO_UNITTEST_FRAMEWORK``
-# is given.
-#
-# The function expects one Matlab test script file to be given.
-# In the case ``NO_UNITTEST_FRAMEWORK`` is given, the unittest script file
-# should contain the script to be run, plus an exit command with the exit
-# value. This exit value will be passed to the ctest framework (0 success,
-# non 0 failure). Additional arguments accepted by :command:`add_test` can be
-# passed through ``TEST_ARGS`` (eg. ``CONFIGURATION <config> ...``).
-#
-# ::
-#
-# matlab_add_unit_test(
-# NAME <name>
-# UNITTEST_FILE matlab_file_containing_unittest.m
-# [CUSTOM_TEST_COMMAND matlab_command_to_run_as_test]
-# [UNITTEST_PRECOMMAND matlab_command_to_run]
-# [TIMEOUT timeout]
-# [ADDITIONAL_PATH path1 [path2 ...]]
-# [MATLAB_ADDITIONAL_STARTUP_OPTIONS option1 [option2 ...]]
-# [TEST_ARGS arg1 [arg2 ...]]
-# [NO_UNITTEST_FRAMEWORK]
-# )
-#
-# The function arguments are:
-#
-# ``NAME``
-# name of the unittest in ctest.
-# ``UNITTEST_FILE``
-# the matlab unittest file. Its path will be automatically
-# added to the Matlab path.
-# ``CUSTOM_TEST_COMMAND``
-# Matlab script command to run as the test.
-# If this is not set, then the following is run:
-# ``runtests('matlab_file_name'), exit(max([ans(1,:).Failed]))``
-# where ``matlab_file_name`` is the ``UNITTEST_FILE`` without the extension.
-# ``UNITTEST_PRECOMMAND``
-# Matlab script command to be ran before the file
-# containing the test (eg. GPU device initialisation based on CMake
-# variables).
-# ``TIMEOUT``
-# the test timeout in seconds. Defaults to 180 seconds as the
-# Matlab unit test may hang.
-# ``ADDITIONAL_PATH``
-# a list of paths to add to the Matlab path prior to
-# running the unit test.
-# ``MATLAB_ADDITIONAL_STARTUP_OPTIONS``
-# a list of additional option in order
-# to run Matlab from the command line.
-# ``-nosplash -nodesktop -nodisplay`` are always added.
-# ``TEST_ARGS``
-# Additional options provided to the add_test command. These
-# options are added to the default options (eg. "CONFIGURATIONS Release")
-# ``NO_UNITTEST_FRAMEWORK``
-# when set, indicates that the test should not
-# use the unittest framework of Matlab (available for versions >= R2013a).
-# ``WORKING_DIRECTORY``
-# This will be the working directory for the test. If specified it will
-# also be the output directory used for the log file of the test run.
-# If not specified the temporary directory ``${CMAKE_BINARY_DIR}/Matlab`` will
-# be used as the working directory and the log location.
-#
+#[=======================================================================[.rst:
+.. command:: matlab_add_unit_test
+
+ Adds a Matlab unit test to the test set of cmake/ctest.
+ This command requires the component ``MAIN_PROGRAM`` and hence is not
+ available for an MCR installation.
+
+ The unit test uses the Matlab unittest framework (default, available
+ starting Matlab 2013b+) except if the option ``NO_UNITTEST_FRAMEWORK``
+ is given.
+
+ The function expects one Matlab test script file to be given.
+ In the case ``NO_UNITTEST_FRAMEWORK`` is given, the unittest script file
+ should contain the script to be run, plus an exit command with the exit
+ value. This exit value will be passed to the ctest framework (0 success,
+ non 0 failure). Additional arguments accepted by :command:`add_test` can be
+ passed through ``TEST_ARGS`` (eg. ``CONFIGURATION <config> ...``).
+
+ ::
+
+ matlab_add_unit_test(
+ NAME <name>
+ UNITTEST_FILE matlab_file_containing_unittest.m
+ [CUSTOM_TEST_COMMAND matlab_command_to_run_as_test]
+ [UNITTEST_PRECOMMAND matlab_command_to_run]
+ [TIMEOUT timeout]
+ [ADDITIONAL_PATH path1 [path2 ...]]
+ [MATLAB_ADDITIONAL_STARTUP_OPTIONS option1 [option2 ...]]
+ [TEST_ARGS arg1 [arg2 ...]]
+ [NO_UNITTEST_FRAMEWORK]
+ )
+
+ The function arguments are:
+
+ ``NAME``
+ name of the unittest in ctest.
+ ``UNITTEST_FILE``
+ the matlab unittest file. Its path will be automatically
+ added to the Matlab path.
+ ``CUSTOM_TEST_COMMAND``
+ Matlab script command to run as the test.
+ If this is not set, then the following is run:
+ ``runtests('matlab_file_name'), exit(max([ans(1,:).Failed]))``
+ where ``matlab_file_name`` is the ``UNITTEST_FILE`` without the extension.
+ ``UNITTEST_PRECOMMAND``
+ Matlab script command to be ran before the file
+ containing the test (eg. GPU device initialisation based on CMake
+ variables).
+ ``TIMEOUT``
+ the test timeout in seconds. Defaults to 180 seconds as the
+ Matlab unit test may hang.
+ ``ADDITIONAL_PATH``
+ a list of paths to add to the Matlab path prior to
+ running the unit test.
+ ``MATLAB_ADDITIONAL_STARTUP_OPTIONS``
+ a list of additional option in order
+ to run Matlab from the command line.
+ ``-nosplash -nodesktop -nodisplay`` are always added.
+ ``TEST_ARGS``
+ Additional options provided to the add_test command. These
+ options are added to the default options (eg. "CONFIGURATIONS Release")
+ ``NO_UNITTEST_FRAMEWORK``
+ when set, indicates that the test should not
+ use the unittest framework of Matlab (available for versions >= R2013a).
+ ``WORKING_DIRECTORY``
+ This will be the working directory for the test. If specified it will
+ also be the output directory used for the log file of the test run.
+ If not specified the temporary directory ``${CMAKE_BINARY_DIR}/Matlab`` will
+ be used as the working directory and the log location.
+
+#]=======================================================================]
function(matlab_add_unit_test)
if(NOT Matlab_MAIN_PROGRAM)
@@ -862,58 +865,65 @@ function(matlab_add_unit_test)
endfunction()
-#.rst:
-# .. command:: matlab_add_mex
-#
-# Adds a Matlab MEX target.
-# This commands compiles the given sources with the current tool-chain in
-# order to produce a MEX file. The final name of the produced output may be
-# specified, as well as additional link libraries, and a documentation entry
-# for the MEX file. Remaining arguments of the call are passed to the
-# :command:`add_library` or :command:`add_executable` command.
-#
-# ::
-#
-# matlab_add_mex(
-# NAME <name>
-# [EXECUTABLE | MODULE | SHARED]
-# SRC src1 [src2 ...]
-# [OUTPUT_NAME output_name]
-# [DOCUMENTATION file.txt]
-# [LINK_TO target1 target2 ...]
-# [...]
-# )
-#
-# ``NAME``
-# name of the target.
-# ``SRC``
-# list of source files.
-# ``LINK_TO``
-# a list of additional link dependencies. The target links to ``libmex``
-# by default. If ``Matlab_MX_LIBRARY`` is defined, it also
-# links to ``libmx``.
-# ``OUTPUT_NAME``
-# if given, overrides the default name. The default name is
-# the name of the target without any prefix and
-# with ``Matlab_MEX_EXTENSION`` suffix.
-# ``DOCUMENTATION``
-# if given, the file ``file.txt`` will be considered as
-# being the documentation file for the MEX file. This file is copied into
-# the same folder without any processing, with the same name as the final
-# mex file, and with extension `.m`. In that case, typing ``help <name>``
-# in Matlab prints the documentation contained in this file.
-# ``MODULE`` or ``SHARED`` may be given to specify the type of library to be
-# created. ``EXECUTABLE`` may be given to create an executable instead of
-# a library. If no type is given explicitly, the type is ``SHARED``.
-#
-# The documentation file is not processed and should be in the following
-# format:
-#
-# ::
-#
-# % This is the documentation
-# function ret = mex_target_output_name(input1)
-#
+#[=======================================================================[.rst:
+.. command:: matlab_add_mex
+
+ Adds a Matlab MEX target.
+ This commands compiles the given sources with the current tool-chain in
+ order to produce a MEX file. The final name of the produced output may be
+ specified, as well as additional link libraries, and a documentation entry
+ for the MEX file. Remaining arguments of the call are passed to the
+ :command:`add_library` or :command:`add_executable` command.
+
+ ::
+
+ matlab_add_mex(
+ NAME <name>
+ [EXECUTABLE | MODULE | SHARED]
+ SRC src1 [src2 ...]
+ [OUTPUT_NAME output_name]
+ [DOCUMENTATION file.txt]
+ [LINK_TO target1 target2 ...]
+ [R2017b | R2018a]
+ [...]
+ )
+
+ ``NAME``
+ name of the target.
+ ``SRC``
+ list of source files.
+ ``LINK_TO``
+ a list of additional link dependencies. The target links to ``libmex``
+ and ``libmx`` by default.
+ ``OUTPUT_NAME``
+ if given, overrides the default name. The default name is
+ the name of the target without any prefix and
+ with ``Matlab_MEX_EXTENSION`` suffix.
+ ``DOCUMENTATION``
+ if given, the file ``file.txt`` will be considered as
+ being the documentation file for the MEX file. This file is copied into
+ the same folder without any processing, with the same name as the final
+ mex file, and with extension `.m`. In that case, typing ``help <name>``
+ in Matlab prints the documentation contained in this file.
+ ``R2017b`` or ``R2018a`` may be given to specify the version of the C API
+ to use: ``R2017b`` specifies the traditional (separate complex) C API,
+ and corresponds to the ``-R2017b`` flag for the `mex` command. ``R2018a``
+ specifies the new interleaved complex C API, and corresponds to the
+ ``-R2018a`` flag for the `mex` command. Ignored if MATLAB version prior
+ to R2018a. Defaults to ``R2017b``.
+ ``MODULE`` or ``SHARED`` may be given to specify the type of library to be
+ created. ``EXECUTABLE`` may be given to create an executable instead of
+ a library. If no type is given explicitly, the type is ``SHARED``.
+
+ The documentation file is not processed and should be in the following
+ format:
+
+ ::
+
+ % This is the documentation
+ function ret = mex_target_output_name(input1)
+
+#]=======================================================================]
function(matlab_add_mex)
if(NOT WIN32)
@@ -930,7 +940,7 @@ function(matlab_add_mex)
endif()
- set(options EXECUTABLE MODULE SHARED)
+ set(options EXECUTABLE MODULE SHARED R2017b R2018a)
set(oneValueArgs NAME DOCUMENTATION OUTPUT_NAME)
set(multiValueArgs LINK_TO SRC)
@@ -945,9 +955,25 @@ function(matlab_add_mex)
set(${prefix}_OUTPUT_NAME ${${prefix}_NAME})
endif()
+ if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, add version source file
+ # TODO: check the file extensions in ${${prefix}_SRC} to see if they're C or C++ files
+ # Currently, the C and C++ versions of the version files are identical, so this doesn't matter.
+ set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/c_mexapi_version.c")
+ #set(MEX_VERSION_FILE "${Matlab_ROOT_DIR}/extern/version/cpp_mexapi_version.cpp")
+ endif()
+
+ if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro
+ if(${${prefix}_R2018a})
+ set(MEX_API_MACRO "MATLAB_DEFAULT_RELEASE=R2018a")
+ else()
+ set(MEX_API_MACRO "MATLAB_DEFAULT_RELEASE=R2017b")
+ endif()
+ endif()
+
if(${prefix}_EXECUTABLE)
add_executable(${${prefix}_NAME}
${${prefix}_SRC}
+ ${MEX_VERSION_FILE}
${${prefix}_DOCUMENTATION}
${${prefix}_UNPARSED_ARGUMENTS})
else()
@@ -960,31 +986,25 @@ function(matlab_add_mex)
add_library(${${prefix}_NAME}
${type}
${${prefix}_SRC}
+ ${MEX_VERSION_FILE}
${${prefix}_DOCUMENTATION}
${${prefix}_UNPARSED_ARGUMENTS})
endif()
target_include_directories(${${prefix}_NAME} PRIVATE ${Matlab_INCLUDE_DIRS})
- if(DEFINED Matlab_MX_LIBRARY)
- target_link_libraries(${${prefix}_NAME} ${Matlab_MX_LIBRARY})
+ if(Matlab_HAS_CPP_API)
+ target_link_libraries(${${prefix}_NAME} ${Matlab_ENGINE_LIBRARY} ${Matlab_DATAARRAY_LIBRARY})
endif()
- if(DEFINED Matlab_ENGINE_LIBRARY)
- target_link_libraries(${${prefix}_NAME} ${Matlab_ENGINE_LIBRARY})
- endif()
-
- if(DEFINED Matlab_DATAARRAY_LIBRARY)
- target_link_libraries(${${prefix}_NAME} ${Matlab_DATAARRAY_LIBRARY})
- endif()
-
- target_link_libraries(${${prefix}_NAME} ${Matlab_MEX_LIBRARY} ${${prefix}_LINK_TO})
+ target_link_libraries(${${prefix}_NAME} ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} ${${prefix}_LINK_TO})
set_target_properties(${${prefix}_NAME}
PROPERTIES
PREFIX ""
OUTPUT_NAME ${${prefix}_OUTPUT_NAME}
SUFFIX ".${Matlab_MEX_EXTENSION}")
+ target_compile_definitions(${${prefix}_NAME} PRIVATE ${MEX_API_MACRO} MATLAB_MEX_FILE)
# documentation
if(NOT ${${prefix}_DOCUMENTATION} STREQUAL "")
@@ -998,82 +1018,82 @@ function(matlab_add_mex)
endif() # documentation
# entry point in the mex file + taking care of visibility and symbol clashes.
- if (MSVC)
- get_target_property(
- _previous_link_flags
- ${${prefix}_NAME}
- LINK_FLAGS)
- if(NOT _previous_link_flags)
- set(_previous_link_flags)
- endif()
+ if(WIN32)
- set_target_properties(${${prefix}_NAME}
- PROPERTIES
- LINK_FLAGS "${_previous_link_flags} /EXPORT:mexFunction")
- endif()
+ if (MSVC)
+
+ set(_link_flags "${_link_flags} /EXPORT:mexFunction")
+ if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.1") # For 9.1 (R2016b) and newer, export version
+ set(_link_flags "${_link_flags} /EXPORT:mexfilerequiredapiversion")
+ endif()
+
+ if(Matlab_HAS_CPP_API)
+ set(_link_flags "${_link_flags} /EXPORT:mexCreateMexFunction /EXPORT:mexDestroyMexFunction /EXPORT:mexFunctionAdapter")
+ #TODO: Is this necessary?
+ endif()
+
+ set_property(TARGET ${${prefix}_NAME} APPEND PROPERTY LINK_FLAGS ${_link_flags})
+
+ endif() # TODO: what if there's a different compiler on Windows?
- if(WIN32)
set_target_properties(${${prefix}_NAME}
PROPERTIES
DEFINE_SYMBOL "DLL_EXPORT_SYM=__declspec(dllexport)")
+
else()
- if(HAS_MINUS_PTHREAD AND NOT APPLE)
- # Apparently, compiling with -pthread generated the proper link flags
- # and some defines at compilation
- target_compile_options(${${prefix}_NAME} PRIVATE "-pthread")
+ if(${Matlab_VERSION_STRING} VERSION_LESS "9.1") # For versions prior to 9.1 (R2016b)
+ set(_ver_map_files ${Matlab_EXTERN_LIBRARY_DIR}/mexFunction.map)
+ else() # For 9.1 (R2016b) and newer
+ set(_ver_map_files ${Matlab_EXTERN_LIBRARY_DIR}/c_exportsmexfileversion.map)
endif()
+ if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.5") # For 9.5 (R2018b) (and newer?)
+ target_compile_options(${${prefix}_NAME} PRIVATE "-fvisibility=default")
+ # This one is weird, it might be a bug in <mex.h> for R2018b. When compiling with
+ # -fvisibility=hidden, the symbol `mexFunction` cannot be exported. Reading the
+ # source code for <mex.h>, it seems that the preprocessor macro `MW_NEEDS_VERSION_H`
+ # needs to be defined for `__attribute__ ((visibility("default")))` to be added
+ # in front of the declaration of `mexFunction`. In previous versions of MATLAB this
+ # was not the case, there `DLL_EXPORT_SYM` needed to be defined.
+ # Adding `-fvisibility=hidden` to the `mex` command causes the build to fail.
+ # TODO: Check that this is still necessary in R2019a when it comes out.
+ endif()
- # if we do not do that, the symbols linked from eg. boost remain weak and
- # then clash with the ones defined in the matlab process. So by default
- # the symbols are hidden.
- # This also means that for shared libraries (like MEX), the entry point
- # should be explicitly declared with default visibility, otherwise Matlab
- # cannot find the entry point.
- # Note that this is particularly meaningful if the MEX wrapper itself
- # contains symbols that are clashing with Matlab (that are compiled in the
- # MEX file). In order to propagate the visibility options to the libraries
- # to which the MEX file is linked against, the -Wl,--exclude-libs,ALL
- # option should also be specified.
+ if(APPLE)
- set_target_properties(${${prefix}_NAME}
- PROPERTIES
- CXX_VISIBILITY_PRESET "hidden"
- C_VISIBILITY_PRESET "hidden"
- VISIBILITY_INLINES_HIDDEN ON
- )
+ if(Matlab_HAS_CPP_API)
+ list(APPEND _ver_map_files ${Matlab_EXTERN_LIBRARY_DIR}/cppMexFunction.map) # This one doesn't exist on Linux
+ set(_link_flags "${_link_flags} -Wl,-U,_mexCreateMexFunction -Wl,-U,_mexDestroyMexFunction -Wl,-U,_mexFunctionAdapter")
+ # On MacOS, the MEX command adds the above, without it the link breaks
+ # because we indiscriminately use "cppMexFunction.map" even for C API MEX-files.
+ endif()
- # get_target_property(
- # _previous_link_flags
- # ${${prefix}_NAME}
- # LINK_FLAGS)
- # if(NOT _previous_link_flags)
- # set(_previous_link_flags)
- # endif()
-
- # if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- # set_target_properties(${${prefix}_NAME}
- # PROPERTIES
- # LINK_FLAGS "${_previous_link_flags} -Wl,--exclude-libs,ALL"
- # # -Wl,--version-script=${_FindMatlab_SELF_DIR}/MatlabLinuxVisibility.map"
- # )
- # elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- # # in this case, all other symbols become hidden.
- # set_target_properties(${${prefix}_NAME}
- # PROPERTIES
- # LINK_FLAGS "${_previous_link_flags} -Wl,-exported_symbol,_mexFunction"
- # #-Wl,-exported_symbols_list,${_FindMatlab_SELF_DIR}/MatlabOSXVisilibity.map"
- # )
- # endif()
+ set(_export_flag_name -exported_symbols_list)
+ else() # Linux
+
+ if(HAS_MINUS_PTHREAD)
+ # Apparently, compiling with -pthread generated the proper link flags
+ # and some defines at compilation
+ target_compile_options(${${prefix}_NAME} PRIVATE "-pthread")
+ endif()
+ set(_link_flags "${_link_flags} -Wl,--as-needed")
+
+ set(_export_flag_name --version-script)
+
+ endif()
+
+ foreach(_file ${_ver_map_files})
+ set(_link_flags "${_link_flags} -Wl,${_export_flag_name},${_file}")
+ endforeach()
set_target_properties(${${prefix}_NAME}
PROPERTIES
DEFINE_SYMBOL "DLL_EXPORT_SYM=__attribute__ ((visibility (\"default\")))"
- )
-
+ LINK_FLAGS "${_link_flags}"
+ ) # The `mex` command doesn't add this define. Is it necessary?
endif()
@@ -1440,6 +1460,7 @@ if(DEFINED Matlab_ROOT_DIR_LAST_CACHED)
if(NOT Matlab_ROOT_DIR_LAST_CACHED STREQUAL Matlab_ROOT_DIR)
set(_Matlab_cached_vars
+ Matlab_VERSION_STRING
Matlab_INCLUDE_DIRS
Matlab_MEX_LIBRARY
Matlab_MEX_COMPILER
@@ -1457,7 +1478,7 @@ if(DEFINED Matlab_ROOT_DIR_LAST_CACHED)
Matlab_MEXEXTENSIONS_PROG
Matlab_ROOT_DIR_LAST_CACHED
#Matlab_PROG_VERSION_STRING_AUTO_DETECT
- Matlab_VERSION_STRING_INTERNAL
+ #Matlab_VERSION_STRING_INTERNAL
)
foreach(_var IN LISTS _Matlab_cached_vars)
if(DEFINED ${_var})
@@ -1482,7 +1503,9 @@ if(MATLAB_FIND_DEBUG)
message(STATUS "[MATLAB] Current version is ${Matlab_VERSION_STRING} located ${Matlab_ROOT_DIR}")
endif()
-
+if(NOT ${Matlab_VERSION_STRING} VERSION_LESS "9.4") # MATLAB 9.4 (R2018a) and newer have a new C++ API
+ set(Matlab_HAS_CPP_API 1)
+endif()
if(Matlab_ROOT_DIR)
file(TO_CMAKE_PATH ${Matlab_ROOT_DIR} Matlab_ROOT_DIR)
@@ -1521,6 +1544,8 @@ set(Matlab_BINARIES_DIR
${Matlab_ROOT_DIR}/bin/${_matlab_bin_prefix}${_matlab_current_suffix})
set(Matlab_EXTERN_LIBRARY_DIR
${Matlab_ROOT_DIR}/extern/lib/${_matlab_bin_prefix}${_matlab_current_suffix})
+set(Matlab_EXTERN_BINARIES_DIR
+ ${Matlab_ROOT_DIR}/extern/bin/${_matlab_bin_prefix}${_matlab_current_suffix})
if(WIN32)
if(MINGW)
@@ -1530,7 +1555,7 @@ if(WIN32)
endif()
set(_matlab_lib_prefix_for_search "lib")
else()
- set(_matlab_lib_dir_for_search ${Matlab_BINARIES_DIR})
+ set(_matlab_lib_dir_for_search ${Matlab_BINARIES_DIR} ${Matlab_EXTERN_BINARIES_DIR})
set(_matlab_lib_prefix_for_search "lib")
endif()
@@ -1581,7 +1606,6 @@ _Matlab_find_library(
PATHS ${_matlab_lib_dir_for_search}
NO_DEFAULT_PATH
)
-
list(APPEND _matlab_required_variables Matlab_MEX_LIBRARY)
# the MEX extension is required
@@ -1622,21 +1646,18 @@ if(_matlab_find_matlab_program GREATER -1)
endif()
unset(_matlab_find_matlab_program)
-# Component MX library
-list(FIND Matlab_FIND_COMPONENTS MX_LIBRARY _matlab_find_mx)
-if(_matlab_find_mx GREATER -1)
- _Matlab_find_library(
- ${_matlab_lib_prefix_for_search}
- Matlab_MX_LIBRARY
- mx
- PATHS ${_matlab_lib_dir_for_search}
- NO_DEFAULT_PATH
- )
- if(Matlab_MX_LIBRARY)
- set(Matlab_MX_LIBRARY_FOUND TRUE)
- endif()
+# The MX library is required
+_Matlab_find_library(
+ ${_matlab_lib_prefix_for_search}
+ Matlab_MX_LIBRARY
+ mx
+ PATHS ${_matlab_lib_dir_for_search}
+ NO_DEFAULT_PATH
+)
+list(APPEND _matlab_required_variables Matlab_MX_LIBRARY)
+if(Matlab_MX_LIBRARY)
+ set(Matlab_MX_LIBRARY_FOUND TRUE)
endif()
-unset(_matlab_find_mx)
# Component ENG library
list(FIND Matlab_FIND_COMPONENTS ENG_LIBRARY _matlab_find_eng)
@@ -1702,9 +1723,9 @@ if(_matlab_find_mcc_compiler GREATER -1)
endif()
unset(_matlab_find_mcc_compiler)
-# component MatlabEngine
-list(FIND Matlab_FIND_COMPONENTS ENGINE_LIBRARY _matlab_find_matlab_engine)
-if(_matlab_find_matlab_engine GREATER -1)
+if(Matlab_HAS_CPP_API)
+
+ # The MatlabEngine library is required for R2018a+
_Matlab_find_library(
${_matlab_lib_prefix_for_search}
Matlab_ENGINE_LIBRARY
@@ -1713,40 +1734,33 @@ if(_matlab_find_matlab_engine GREATER -1)
DOC "MatlabEngine Library"
NO_DEFAULT_PATH
)
+ list(APPEND _matlab_required_variables Matlab_ENGINE_LIBRARY)
if(Matlab_ENGINE_LIBRARY)
set(Matlab_ENGINE_LIBRARY_FOUND TRUE)
endif()
-endif()
-unset(_matlab_find_matlab_engine)
-# component MatlabDataArray
-list(FIND Matlab_FIND_COMPONENTS DATAARRAY_LIBRARY _matlab_find_matlab_dataarray)
-if(_matlab_find_matlab_dataarray GREATER -1)
+ # The MatlabDataArray library is required for R2018a+
_Matlab_find_library(
- ${_matlab_lib_prefix_for_search}
+ ${_matlab_lib_prefix_for_search}
Matlab_DATAARRAY_LIBRARY
MatlabDataArray
PATHS ${_matlab_lib_dir_for_search}
DOC "MatlabDataArray Library"
NO_DEFAULT_PATH
)
+ list(APPEND _matlab_required_variables Matlab_DATAARRAY_LIBRARY)
if(Matlab_DATAARRAY_LIBRARY)
set(Matlab_DATAARRAY_LIBRARY_FOUND TRUE)
endif()
+
endif()
-unset(_matlab_find_matlab_dataarray)
unset(_matlab_lib_dir_for_search)
-set(Matlab_LIBRARIES ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} ${Matlab_ENG_LIBRARY} ${Matlab_MAT_LIBRARY})
-
-if(Matlab_DATAARRAY_LIBRARY_FOUND)
- set(Matlab_LIBRARIES ${Matlab_LIBRARIES} ${Matlab_DATAARRAY_LIBRARY})
-endif()
-
-if(Matlab_ENGINE_LIBRARY_FOUND)
- set(Matlab_LIBRARIES ${Matlab_LIBRARIES} ${Matlab_ENGINE_LIBRARY})
-endif()
+set(Matlab_LIBRARIES
+ ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY}
+ ${Matlab_ENG_LIBRARY} ${Matlab_MAT_LIBRARY}
+ ${Matlab_DATAARRAY_LIBRARY} ${Matlab_ENGINE_LIBRARY})
find_package_handle_standard_args(
Matlab
diff --git a/Modules/FindMotif.cmake b/Modules/FindMotif.cmake
index 7304d957c..4f7080a44 100644
--- a/Modules/FindMotif.cmake
+++ b/Modules/FindMotif.cmake
@@ -1,19 +1,20 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindMotif
-# ---------
-#
-# Try to find Motif (or lesstif)
-#
-# Once done this will define:
-#
-# ::
-#
-# MOTIF_FOUND - system has MOTIF
-# MOTIF_INCLUDE_DIR - include paths to use Motif
-# MOTIF_LIBRARIES - Link these to use Motif
+#[=======================================================================[.rst:
+FindMotif
+---------
+
+Try to find Motif (or lesstif)
+
+Once done this will define:
+
+::
+
+ MOTIF_FOUND - system has MOTIF
+ MOTIF_INCLUDE_DIR - include paths to use Motif
+ MOTIF_LIBRARIES - Link these to use Motif
+#]=======================================================================]
set(MOTIF_FOUND 0)
diff --git a/Modules/FindODBC.cmake b/Modules/FindODBC.cmake
index c8ca477cc..29d7af9e8 100644
--- a/Modules/FindODBC.cmake
+++ b/Modules/FindODBC.cmake
@@ -90,7 +90,9 @@ set(_odbc_required_libs_names)
### Try Windows Kits ##########################################################
if(WIN32)
# List names of ODBC libraries on Windows
- set(ODBC_LIBRARY odbc32.lib)
+ if(NOT MINGW)
+ set(ODBC_LIBRARY odbc32.lib)
+ endif()
set(_odbc_lib_names odbc32;)
# List additional libraries required to use ODBC library
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index 7521d5121..dbd796101 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -1,21 +1,22 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindOpenAL
-# ----------
-#
-#
-#
-# Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
-# false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
-# the headers
-#
-# $OPENALDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OPENALDIR used in building OpenAL.
-#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module.
+#[=======================================================================[.rst:
+FindOpenAL
+----------
+
+
+
+Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if
+false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find
+the headers
+
+$OPENALDIR is an environment variable that would correspond to the
+./configure --prefix=$OPENALDIR used in building OpenAL.
+
+Created by Eric Wing. This was influenced by the FindSDL.cmake
+module.
+#]=======================================================================]
# This makes the presumption that you are include al.h like
# #include "al.h"
diff --git a/Modules/FindOpenCL.cmake b/Modules/FindOpenCL.cmake
index fe162b49b..79c0382d3 100644
--- a/Modules/FindOpenCL.cmake
+++ b/Modules/FindOpenCL.cmake
@@ -1,35 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindOpenCL
-# ----------
-#
-# Try to find OpenCL
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``OpenCL::OpenCL``, if
-# OpenCL has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables::
-#
-# OpenCL_FOUND - True if OpenCL was found
-# OpenCL_INCLUDE_DIRS - include directories for OpenCL
-# OpenCL_LIBRARIES - link against this library to use OpenCL
-# OpenCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
-# OpenCL_VERSION_MAJOR - The major version of the OpenCL implementation
-# OpenCL_VERSION_MINOR - The minor version of the OpenCL implementation
-#
-# The module will also define two cache variables::
-#
-# OpenCL_INCLUDE_DIR - the OpenCL include directory
-# OpenCL_LIBRARY - the path to the OpenCL library
-#
+#[=======================================================================[.rst:
+FindOpenCL
+----------
+
+Try to find OpenCL
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``OpenCL::OpenCL``, if
+OpenCL has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables::
+
+ OpenCL_FOUND - True if OpenCL was found
+ OpenCL_INCLUDE_DIRS - include directories for OpenCL
+ OpenCL_LIBRARIES - link against this library to use OpenCL
+ OpenCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
+ OpenCL_VERSION_MAJOR - The major version of the OpenCL implementation
+ OpenCL_VERSION_MINOR - The minor version of the OpenCL implementation
+
+The module will also define two cache variables::
+
+ OpenCL_INCLUDE_DIR - the OpenCL include directory
+ OpenCL_LIBRARY - the path to the OpenCL library
+
+#]=======================================================================]
function(_FIND_OPENCL_VERSION)
include(CheckSymbolExists)
diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake
index 4d0786cd2..832dca274 100644
--- a/Modules/FindOpenGL.cmake
+++ b/Modules/FindOpenGL.cmake
@@ -1,125 +1,126 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindOpenGL
-# ----------
-#
-# FindModule for OpenGL and GLU.
-#
-# Optional COMPONENTS
-# ^^^^^^^^^^^^^^^^^^^
-#
-# This module respects several optional COMPONENTS: ``EGL``, ``GLX``, and
-# ``OpenGL``. There are corresponding import targets for each of these flags.
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the :prop_tgt:`IMPORTED` targets:
-#
-# ``OpenGL::GL``
-# Defined to the platform-specific OpenGL libraries if the system has OpenGL.
-# ``OpenGL::OpenGL``
-# Defined to libOpenGL if the system is GLVND-based.
-# ``OpenGL::GLU``
-# Defined if the system has GLU.
-# ``OpenGL::GLX``
-# Defined if the system has GLX.
-# ``OpenGL::EGL``
-# Defined if the system has EGL.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module sets the following variables:
-#
-# ``OPENGL_FOUND``
-# True, if the system has OpenGL and all components are found.
-# ``OPENGL_XMESA_FOUND``
-# True, if the system has XMESA.
-# ``OPENGL_GLU_FOUND``
-# True, if the system has GLU.
-# ``OpenGL_OpenGL_FOUND``
-# True, if the system has an OpenGL library.
-# ``OpenGL_GLX_FOUND``
-# True, if the system has GLX.
-# ``OpenGL_EGL_FOUND``
-# True, if the system has EGL.
-# ``OPENGL_INCLUDE_DIR``
-# Path to the OpenGL include directory.
-# ``OPENGL_EGL_INCLUDE_DIRS``
-# Path to the EGL include directory.
-# ``OPENGL_LIBRARIES``
-# Paths to the OpenGL library, windowing system libraries, and GLU libraries.
-# On Linux, this assumes GLX and is never correct for EGL-based targets.
-# Clients are encouraged to use the ``OpenGL::*`` import targets instead.
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``OPENGL_egl_LIBRARY``
-# Path to the EGL library.
-# ``OPENGL_glu_LIBRARY``
-# Path to the GLU library.
-# ``OPENGL_glx_LIBRARY``
-# Path to the GLVND 'GLX' library.
-# ``OPENGL_opengl_LIBRARY``
-# Path to the GLVND 'OpenGL' library
-# ``OPENGL_gl_LIBRARY``
-# Path to the OpenGL library. New code should prefer the ``OpenGL::*`` import
-# targets.
-#
-# Linux-specific
-# ^^^^^^^^^^^^^^
-#
-# Some Linux systems utilize GLVND as a new ABI for OpenGL. GLVND separates
-# context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and
-# contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way
-# to get OpenGL 3+ functionality via EGL in a manner portable across vendors.
-# Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either
-# ``OpenGL::GLX`` or ``OpenGL::EGL``.
-#
-# Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable)
-# to use legacy GL interfaces. These will use the legacy GL library located
-# by ``OPENGL_gl_LIBRARY``, if available. If ``OPENGL_gl_LIBRARY`` is empty or
-# not found and GLVND is available, the ``OpenGL::GL`` target will use GLVND
-# ``OpenGL::OpenGL`` and ``OpenGL::GLX`` (and the ``OPENGL_LIBRARIES``
-# variable will use the corresponding libraries). Thus, for non-EGL-based
-# Linux targets, the ``OpenGL::GL`` target is most portable.
-#
-# A ``OpenGL_GL_PREFERENCE`` variable may be set to specify the preferred way
-# to provide legacy GL interfaces in case multiple choices are available.
-# The value may be one of:
-#
-# ``GLVND``
-# If the GLVND OpenGL and GLX libraries are available, prefer them.
-# This forces ``OPENGL_gl_LIBRARY`` to be empty.
-# This is the default if components were requested (since components
-# correspond to GLVND libraries) or if policy :policy:`CMP0072` is
-# set to ``NEW``.
-#
-# ``LEGACY``
-# Prefer to use the legacy libGL library, if available.
-# This is the default if no components were requested and
-# policy :policy:`CMP0072` is not set to ``NEW``.
-#
-# For EGL targets the client must rely on GLVND support on the user's system.
-# Linking should use the ``OpenGL::OpenGL OpenGL::EGL`` targets. Using GLES*
-# libraries is theoretically possible in place of ``OpenGL::OpenGL``, but this
-# module does not currently support that; contributions welcome.
-#
-# ``OPENGL_egl_LIBRARY`` and ``OPENGL_EGL_INCLUDE_DIRS`` are defined in the case of
-# GLVND. For non-GLVND Linux and other systems these are left undefined.
-#
-# macOS-Specific
-# ^^^^^^^^^^^^^^
-#
-# On OSX FindOpenGL defaults to using the framework version of OpenGL. People
-# will have to change the cache values of OPENGL_glu_LIBRARY and
-# OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
+#[=======================================================================[.rst:
+FindOpenGL
+----------
+
+FindModule for OpenGL and GLU.
+
+Optional COMPONENTS
+^^^^^^^^^^^^^^^^^^^
+
+This module respects several optional COMPONENTS: ``EGL``, ``GLX``, and
+``OpenGL``. There are corresponding import targets for each of these flags.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the :prop_tgt:`IMPORTED` targets:
+
+``OpenGL::GL``
+ Defined to the platform-specific OpenGL libraries if the system has OpenGL.
+``OpenGL::OpenGL``
+ Defined to libOpenGL if the system is GLVND-based.
+``OpenGL::GLU``
+ Defined if the system has GLU.
+``OpenGL::GLX``
+ Defined if the system has GLX.
+``OpenGL::EGL``
+ Defined if the system has EGL.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module sets the following variables:
+
+``OPENGL_FOUND``
+ True, if the system has OpenGL and all components are found.
+``OPENGL_XMESA_FOUND``
+ True, if the system has XMESA.
+``OPENGL_GLU_FOUND``
+ True, if the system has GLU.
+``OpenGL_OpenGL_FOUND``
+ True, if the system has an OpenGL library.
+``OpenGL_GLX_FOUND``
+ True, if the system has GLX.
+``OpenGL_EGL_FOUND``
+ True, if the system has EGL.
+``OPENGL_INCLUDE_DIR``
+ Path to the OpenGL include directory.
+``OPENGL_EGL_INCLUDE_DIRS``
+ Path to the EGL include directory.
+``OPENGL_LIBRARIES``
+ Paths to the OpenGL library, windowing system libraries, and GLU libraries.
+ On Linux, this assumes GLX and is never correct for EGL-based targets.
+ Clients are encouraged to use the ``OpenGL::*`` import targets instead.
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``OPENGL_egl_LIBRARY``
+ Path to the EGL library.
+``OPENGL_glu_LIBRARY``
+ Path to the GLU library.
+``OPENGL_glx_LIBRARY``
+ Path to the GLVND 'GLX' library.
+``OPENGL_opengl_LIBRARY``
+ Path to the GLVND 'OpenGL' library
+``OPENGL_gl_LIBRARY``
+ Path to the OpenGL library. New code should prefer the ``OpenGL::*`` import
+ targets.
+
+Linux-specific
+^^^^^^^^^^^^^^
+
+Some Linux systems utilize GLVND as a new ABI for OpenGL. GLVND separates
+context libraries from OpenGL itself; OpenGL lives in "libOpenGL", and
+contexts are defined in "libGLX" or "libEGL". GLVND is currently the only way
+to get OpenGL 3+ functionality via EGL in a manner portable across vendors.
+Projects may use GLVND explicitly with target ``OpenGL::OpenGL`` and either
+``OpenGL::GLX`` or ``OpenGL::EGL``.
+
+Projects may use the ``OpenGL::GL`` target (or ``OPENGL_LIBRARIES`` variable)
+to use legacy GL interfaces. These will use the legacy GL library located
+by ``OPENGL_gl_LIBRARY``, if available. If ``OPENGL_gl_LIBRARY`` is empty or
+not found and GLVND is available, the ``OpenGL::GL`` target will use GLVND
+``OpenGL::OpenGL`` and ``OpenGL::GLX`` (and the ``OPENGL_LIBRARIES``
+variable will use the corresponding libraries). Thus, for non-EGL-based
+Linux targets, the ``OpenGL::GL`` target is most portable.
+
+A ``OpenGL_GL_PREFERENCE`` variable may be set to specify the preferred way
+to provide legacy GL interfaces in case multiple choices are available.
+The value may be one of:
+
+``GLVND``
+ If the GLVND OpenGL and GLX libraries are available, prefer them.
+ This forces ``OPENGL_gl_LIBRARY`` to be empty.
+ This is the default if components were requested (since components
+ correspond to GLVND libraries) or if policy :policy:`CMP0072` is
+ set to ``NEW``.
+
+``LEGACY``
+ Prefer to use the legacy libGL library, if available.
+ This is the default if no components were requested and
+ policy :policy:`CMP0072` is not set to ``NEW``.
+
+For EGL targets the client must rely on GLVND support on the user's system.
+Linking should use the ``OpenGL::OpenGL OpenGL::EGL`` targets. Using GLES*
+libraries is theoretically possible in place of ``OpenGL::OpenGL``, but this
+module does not currently support that; contributions welcome.
+
+``OPENGL_egl_LIBRARY`` and ``OPENGL_EGL_INCLUDE_DIRS`` are defined in the case of
+GLVND. For non-GLVND Linux and other systems these are left undefined.
+
+macOS-Specific
+^^^^^^^^^^^^^^
+
+On OSX FindOpenGL defaults to using the framework version of OpenGL. People
+will have to change the cache values of OPENGL_glu_LIBRARY and
+OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX.
+#]=======================================================================]
set(_OpenGL_REQUIRED_VARS OPENGL_gl_LIBRARY)
@@ -267,11 +268,9 @@ else()
endif()
if(_OpenGL_GL_POLICY_WARN AND OPENGL_gl_LIBRARY AND OPENGL_opengl_LIBRARY AND OPENGL_glx_LIBRARY)
+ cmake_policy(GET_WARNING CMP0072 _cmp0072_warning)
message(AUTHOR_WARNING
- "Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when available. "
- "Run \"cmake --help-policy CMP0072\" for policy details. "
- "Use the cmake_policy command to set the policy and suppress this warning."
- "\n"
+ "${_cmp0072_warning}\n"
"FindOpenGL found both a legacy GL library:\n"
" OPENGL_gl_LIBRARY: ${OPENGL_gl_LIBRARY}\n"
"and GLVND libraries for OpenGL and GLX:\n"
diff --git a/Modules/FindOpenMP.cmake b/Modules/FindOpenMP.cmake
index cbc6ed846..7e3721276 100644
--- a/Modules/FindOpenMP.cmake
+++ b/Modules/FindOpenMP.cmake
@@ -1,78 +1,79 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindOpenMP
-# ----------
-#
-# Finds OpenMP support
-#
-# This module can be used to detect OpenMP support in a compiler. If
-# the compiler supports OpenMP, the flags required to compile with
-# OpenMP support are returned in variables for the different languages.
-# The variables may be empty if the compiler does not need a special
-# flag to support OpenMP.
-#
-# Variables
-# ^^^^^^^^^
-#
-# The module exposes the components ``C``, ``CXX``, and ``Fortran``.
-# Each of these controls the various languages to search OpenMP support for.
-#
-# Depending on the enabled components the following variables will be set:
-#
-# ``OpenMP_FOUND``
-# Variable indicating that OpenMP flags for all requested languages have been found.
-# If no components are specified, this is true if OpenMP settings for all enabled languages
-# were detected.
-# ``OpenMP_VERSION``
-# Minimal version of the OpenMP standard detected among the requested languages,
-# or all enabled languages if no components were specified.
-#
-# This module will set the following variables per language in your
-# project, where ``<lang>`` is one of C, CXX, or Fortran:
-#
-# ``OpenMP_<lang>_FOUND``
-# Variable indicating if OpenMP support for ``<lang>`` was detected.
-# ``OpenMP_<lang>_FLAGS``
-# OpenMP compiler flags for ``<lang>``, separated by spaces.
-#
-# For linking with OpenMP code written in ``<lang>``, the following
-# variables are provided:
-#
-# ``OpenMP_<lang>_LIB_NAMES``
-# :ref:`;-list <CMake Language Lists>` of libraries for OpenMP programs for ``<lang>``.
-# ``OpenMP_<libname>_LIBRARY``
-# Location of the individual libraries needed for OpenMP support in ``<lang>``.
-# ``OpenMP_<lang>_LIBRARIES``
-# A list of libraries needed to link with OpenMP code written in ``<lang>``.
-#
-# Additionally, the module provides :prop_tgt:`IMPORTED` targets:
-#
-# ``OpenMP::OpenMP_<lang>``
-# Target for using OpenMP from ``<lang>``.
-#
-# Specifically for Fortran, the module sets the following variables:
-#
-# ``OpenMP_Fortran_HAVE_OMPLIB_HEADER``
-# Boolean indicating if OpenMP is accessible through ``omp_lib.h``.
-# ``OpenMP_Fortran_HAVE_OMPLIB_MODULE``
-# Boolean indicating if OpenMP is accessible through the ``omp_lib`` Fortran module.
-#
-# The module will also try to provide the OpenMP version variables:
-#
-# ``OpenMP_<lang>_SPEC_DATE``
-# Date of the OpenMP specification implemented by the ``<lang>`` compiler.
-# ``OpenMP_<lang>_VERSION_MAJOR``
-# Major version of OpenMP implemented by the ``<lang>`` compiler.
-# ``OpenMP_<lang>_VERSION_MINOR``
-# Minor version of OpenMP implemented by the ``<lang>`` compiler.
-# ``OpenMP_<lang>_VERSION``
-# OpenMP version implemented by the ``<lang>`` compiler.
-#
-# The specification date is formatted as given in the OpenMP standard:
-# ``yyyymm`` where ``yyyy`` and ``mm`` represents the year and month of
-# the OpenMP specification implemented by the ``<lang>`` compiler.
+#[=======================================================================[.rst:
+FindOpenMP
+----------
+
+Finds OpenMP support
+
+This module can be used to detect OpenMP support in a compiler. If
+the compiler supports OpenMP, the flags required to compile with
+OpenMP support are returned in variables for the different languages.
+The variables may be empty if the compiler does not need a special
+flag to support OpenMP.
+
+Variables
+^^^^^^^^^
+
+The module exposes the components ``C``, ``CXX``, and ``Fortran``.
+Each of these controls the various languages to search OpenMP support for.
+
+Depending on the enabled components the following variables will be set:
+
+``OpenMP_FOUND``
+ Variable indicating that OpenMP flags for all requested languages have been found.
+ If no components are specified, this is true if OpenMP settings for all enabled languages
+ were detected.
+``OpenMP_VERSION``
+ Minimal version of the OpenMP standard detected among the requested languages,
+ or all enabled languages if no components were specified.
+
+This module will set the following variables per language in your
+project, where ``<lang>`` is one of C, CXX, or Fortran:
+
+``OpenMP_<lang>_FOUND``
+ Variable indicating if OpenMP support for ``<lang>`` was detected.
+``OpenMP_<lang>_FLAGS``
+ OpenMP compiler flags for ``<lang>``, separated by spaces.
+
+For linking with OpenMP code written in ``<lang>``, the following
+variables are provided:
+
+``OpenMP_<lang>_LIB_NAMES``
+ :ref:`;-list <CMake Language Lists>` of libraries for OpenMP programs for ``<lang>``.
+``OpenMP_<libname>_LIBRARY``
+ Location of the individual libraries needed for OpenMP support in ``<lang>``.
+``OpenMP_<lang>_LIBRARIES``
+ A list of libraries needed to link with OpenMP code written in ``<lang>``.
+
+Additionally, the module provides :prop_tgt:`IMPORTED` targets:
+
+``OpenMP::OpenMP_<lang>``
+ Target for using OpenMP from ``<lang>``.
+
+Specifically for Fortran, the module sets the following variables:
+
+``OpenMP_Fortran_HAVE_OMPLIB_HEADER``
+ Boolean indicating if OpenMP is accessible through ``omp_lib.h``.
+``OpenMP_Fortran_HAVE_OMPLIB_MODULE``
+ Boolean indicating if OpenMP is accessible through the ``omp_lib`` Fortran module.
+
+The module will also try to provide the OpenMP version variables:
+
+``OpenMP_<lang>_SPEC_DATE``
+ Date of the OpenMP specification implemented by the ``<lang>`` compiler.
+``OpenMP_<lang>_VERSION_MAJOR``
+ Major version of OpenMP implemented by the ``<lang>`` compiler.
+``OpenMP_<lang>_VERSION_MINOR``
+ Minor version of OpenMP implemented by the ``<lang>`` compiler.
+``OpenMP_<lang>_VERSION``
+ OpenMP version implemented by the ``<lang>`` compiler.
+
+The specification date is formatted as given in the OpenMP standard:
+``yyyymm`` where ``yyyy`` and ``mm`` represents the year and month of
+the OpenMP specification implemented by the ``<lang>`` compiler.
+#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0012 NEW) # if() recognizes numbers and booleans
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index d5cd8bc02..5f947fe54 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -1,53 +1,54 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindOpenSSL
-# -----------
-#
-# Find the OpenSSL encryption library.
-#
-# Optional COMPONENTS
-# ^^^^^^^^^^^^^^^^^^^
-#
-# This module supports two optional COMPONENTS: ``Crypto`` and ``SSL``. Both
-# components have associated imported targets, as described below.
-#
-# Imported Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``OpenSSL::SSL``
-# The OpenSSL ``ssl`` library, if found.
-# ``OpenSSL::Crypto``
-# The OpenSSL ``crypto`` library, if found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``OPENSSL_FOUND``
-# System has the OpenSSL library. If no components are requested it only
-# requires the crypto library.
-# ``OPENSSL_INCLUDE_DIR``
-# The OpenSSL include directory.
-# ``OPENSSL_CRYPTO_LIBRARY``
-# The OpenSSL crypto library.
-# ``OPENSSL_SSL_LIBRARY``
-# The OpenSSL SSL library.
-# ``OPENSSL_LIBRARIES``
-# All OpenSSL libraries.
-# ``OPENSSL_VERSION``
-# This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``).
-#
-# Hints
-# ^^^^^
-#
-# Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation.
-# Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries.
-# Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib.
+#[=======================================================================[.rst:
+FindOpenSSL
+-----------
+
+Find the OpenSSL encryption library.
+
+Optional COMPONENTS
+^^^^^^^^^^^^^^^^^^^
+
+This module supports two optional COMPONENTS: ``Crypto`` and ``SSL``. Both
+components have associated imported targets, as described below.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``OpenSSL::SSL``
+ The OpenSSL ``ssl`` library, if found.
+``OpenSSL::Crypto``
+ The OpenSSL ``crypto`` library, if found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``OPENSSL_FOUND``
+ System has the OpenSSL library. If no components are requested it only
+ requires the crypto library.
+``OPENSSL_INCLUDE_DIR``
+ The OpenSSL include directory.
+``OPENSSL_CRYPTO_LIBRARY``
+ The OpenSSL crypto library.
+``OPENSSL_SSL_LIBRARY``
+ The OpenSSL SSL library.
+``OPENSSL_LIBRARIES``
+ All OpenSSL libraries.
+``OPENSSL_VERSION``
+ This is set to ``$major.$minor.$revision$patch`` (e.g. ``0.9.8s``).
+
+Hints
+^^^^^
+
+Set ``OPENSSL_ROOT_DIR`` to the root directory of an OpenSSL installation.
+Set ``OPENSSL_USE_STATIC_LIBS`` to ``TRUE`` to look for static libraries.
+Set ``OPENSSL_MSVC_STATIC_RT`` set ``TRUE`` to choose the MT version of the lib.
+#]=======================================================================]
if (UNIX)
find_package(PkgConfig QUIET)
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 425aa4581..6f7d3c836 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -1,102 +1,103 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindOpenSceneGraph
-# ------------------
-#
-# Find OpenSceneGraph
-#
-# This module searches for the OpenSceneGraph core "osg" library as well
-# as OpenThreads, and whatever additional COMPONENTS (nodekits) that you
-# specify.
-#
-# ::
-#
-# See http://www.openscenegraph.org
-#
-#
-#
-# NOTE: To use this module effectively you must either require CMake >=
-# 2.6.3 with cmake_minimum_required(VERSION 2.6.3) or download and place
-# FindOpenThreads.cmake, Findosg_functions.cmake, Findosg.cmake, and
-# Find<etc>.cmake files into your CMAKE_MODULE_PATH.
-#
-# ==================================
-#
-# This module accepts the following variables (note mixed case)
-#
-# ::
-#
-# OpenSceneGraph_DEBUG - Enable debugging output
-#
-#
-#
-# ::
-#
-# OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
-# automatically
-#
-#
-#
-# The following environment variables are also respected for finding the
-# OSG and it's various components. CMAKE_PREFIX_PATH can also be used
-# for this (see find_library() CMake documentation).
-#
-# ``<MODULE>_DIR``
-# (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file)
-# ``OSG_DIR``
-# ..
-# ``OSGDIR``
-# ..
-# ``OSG_ROOT``
-# ..
-#
-#
-# [CMake 2.8.10]: The CMake variable OSG_DIR can now be used as well to
-# influence detection, instead of needing to specify an environment
-# variable.
-#
-# This module defines the following output variables:
-#
-# ::
-#
-# OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
-#
-#
-#
-# ::
-#
-# OPENSCENEGRAPH_VERSION - The version of the OSG which was found
-#
-#
-#
-# ::
-#
-# OPENSCENEGRAPH_INCLUDE_DIRS - Where to find the headers
-#
-#
-#
-# ::
-#
-# OPENSCENEGRAPH_LIBRARIES - The OSG libraries
-#
-#
-#
-# ================================== Example Usage:
-#
-# ::
-#
-# find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgUtil)
-# # libOpenThreads & libosg automatically searched
-# include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
-#
-#
-#
-# ::
-#
-# add_executable(foo foo.cc)
-# target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
+#[=======================================================================[.rst:
+FindOpenSceneGraph
+------------------
+
+Find OpenSceneGraph
+
+This module searches for the OpenSceneGraph core "osg" library as well
+as OpenThreads, and whatever additional COMPONENTS (nodekits) that you
+specify.
+
+::
+
+ See http://www.openscenegraph.org
+
+
+
+NOTE: To use this module effectively you must either require CMake >=
+2.6.3 with cmake_minimum_required(VERSION 2.6.3) or download and place
+FindOpenThreads.cmake, Findosg_functions.cmake, Findosg.cmake, and
+Find<etc>.cmake files into your CMAKE_MODULE_PATH.
+
+==================================
+
+This module accepts the following variables (note mixed case)
+
+::
+
+ OpenSceneGraph_DEBUG - Enable debugging output
+
+
+
+::
+
+ OpenSceneGraph_MARK_AS_ADVANCED - Mark cache variables as advanced
+ automatically
+
+
+
+The following environment variables are also respected for finding the
+OSG and it's various components. CMAKE_PREFIX_PATH can also be used
+for this (see find_library() CMake documentation).
+
+``<MODULE>_DIR``
+ (where MODULE is of the form "OSGVOLUME" and there is a FindosgVolume.cmake file)
+``OSG_DIR``
+ ..
+``OSGDIR``
+ ..
+``OSG_ROOT``
+ ..
+
+
+[CMake 2.8.10]: The CMake variable OSG_DIR can now be used as well to
+influence detection, instead of needing to specify an environment
+variable.
+
+This module defines the following output variables:
+
+::
+
+ OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
+
+
+
+::
+
+ OPENSCENEGRAPH_VERSION - The version of the OSG which was found
+
+
+
+::
+
+ OPENSCENEGRAPH_INCLUDE_DIRS - Where to find the headers
+
+
+
+::
+
+ OPENSCENEGRAPH_LIBRARIES - The OSG libraries
+
+
+
+================================== Example Usage:
+
+::
+
+ find_package(OpenSceneGraph 2.0.0 REQUIRED osgDB osgUtil)
+ # libOpenThreads & libosg automatically searched
+ include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
+
+
+
+::
+
+ add_executable(foo foo.cc)
+ target_link_libraries(foo ${OPENSCENEGRAPH_LIBRARIES})
+#]=======================================================================]
#
# Naming convention:
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 91545e0ea..bc45eea7b 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -1,30 +1,31 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindOpenThreads
-# ---------------
-#
-#
-#
-# OpenThreads is a C++ based threading library. Its largest userbase
-# seems to OpenSceneGraph so you might notice I accept OSGDIR as an
-# environment path. I consider this part of the Findosg* suite used to
-# find OpenSceneGraph components. Each component is separate and you
-# must opt in to each module.
-#
-# Locate OpenThreads This module defines OPENTHREADS_LIBRARY
-# OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
-# OPENTHREADS_INCLUDE_DIR, where to find the headers
-#
-# $OPENTHREADS_DIR is an environment variable that would correspond to
-# the ./configure --prefix=$OPENTHREADS_DIR used in building osg.
-#
-# [CMake 2.8.10]: The CMake variables OPENTHREADS_DIR or OSG_DIR can now
-# be used as well to influence detection, instead of needing to specify
-# an environment variable.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindOpenThreads
+---------------
+
+
+
+OpenThreads is a C++ based threading library. Its largest userbase
+seems to OpenSceneGraph so you might notice I accept OSGDIR as an
+environment path. I consider this part of the Findosg* suite used to
+find OpenSceneGraph components. Each component is separate and you
+must opt in to each module.
+
+Locate OpenThreads This module defines OPENTHREADS_LIBRARY
+OPENTHREADS_FOUND, if false, do not try to link to OpenThreads
+OPENTHREADS_INCLUDE_DIR, where to find the headers
+
+$OPENTHREADS_DIR is an environment variable that would correspond to
+the ./configure --prefix=$OPENTHREADS_DIR used in building osg.
+
+[CMake 2.8.10]: The CMake variables OPENTHREADS_DIR or OSG_DIR can now
+be used as well to influence detection, instead of needing to specify
+an environment variable.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <OpenThreads/Thread>
diff --git a/Modules/FindPHP4.cmake b/Modules/FindPHP4.cmake
index 426453bd4..34b4adb01 100644
--- a/Modules/FindPHP4.cmake
+++ b/Modules/FindPHP4.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPHP4
-# --------
-#
-# Find PHP4
-#
-# This module finds if PHP4 is installed and determines where the
-# include files and libraries are. It also determines what the name of
-# the library is. This code sets the following variables:
-#
-# ::
-#
-# PHP4_INCLUDE_PATH = path to where php.h can be found
-# PHP4_EXECUTABLE = full path to the php4 binary
+#[=======================================================================[.rst:
+FindPHP4
+--------
+
+Find PHP4
+
+This module finds if PHP4 is installed and determines where the
+include files and libraries are. It also determines what the name of
+the library is. This code sets the following variables:
+
+::
+
+ PHP4_INCLUDE_PATH = path to where php.h can be found
+ PHP4_EXECUTABLE = full path to the php4 binary
+#]=======================================================================]
set(PHP4_POSSIBLE_INCLUDE_PATHS
/usr/include/php4
diff --git a/Modules/FindPNG.cmake b/Modules/FindPNG.cmake
index 936f01fed..2208b4847 100644
--- a/Modules/FindPNG.cmake
+++ b/Modules/FindPNG.cmake
@@ -1,49 +1,50 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPNG
-# -------
-#
-# Find libpng, the official reference library for the PNG image format.
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` target:
-#
-# ``PNG::PNG``
-# The libpng library, if found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``PNG_INCLUDE_DIRS``
-# where to find png.h, etc.
-# ``PNG_LIBRARIES``
-# the libraries to link against to use PNG.
-# ``PNG_DEFINITIONS``
-# You should add_definitions(${PNG_DEFINITIONS}) before compiling code
-# that includes png library files.
-# ``PNG_FOUND``
-# If false, do not try to use PNG.
-# ``PNG_VERSION_STRING``
-# the version of the PNG library found (since CMake 2.8.8)
-#
-# Obsolete variables
-# ^^^^^^^^^^^^^^^^^^
-#
-# The following variables may also be set, for backwards compatibility:
-#
-# ``PNG_LIBRARY``
-# where to find the PNG library.
-# ``PNG_INCLUDE_DIR``
-# where to find the PNG headers (same as PNG_INCLUDE_DIRS)
-#
-# Since PNG depends on the ZLib compression library, none of the above
-# will be defined unless ZLib can be found.
+#[=======================================================================[.rst:
+FindPNG
+-------
+
+Find libpng, the official reference library for the PNG image format.
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``PNG::PNG``
+ The libpng library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``PNG_INCLUDE_DIRS``
+ where to find png.h, etc.
+``PNG_LIBRARIES``
+ the libraries to link against to use PNG.
+``PNG_DEFINITIONS``
+ You should add_definitions(${PNG_DEFINITIONS}) before compiling code
+ that includes png library files.
+``PNG_FOUND``
+ If false, do not try to use PNG.
+``PNG_VERSION_STRING``
+ the version of the PNG library found (since CMake 2.8.8)
+
+Obsolete variables
+^^^^^^^^^^^^^^^^^^
+
+The following variables may also be set, for backwards compatibility:
+
+``PNG_LIBRARY``
+ where to find the PNG library.
+``PNG_INCLUDE_DIR``
+ where to find the PNG headers (same as PNG_INCLUDE_DIRS)
+
+Since PNG depends on the ZLib compression library, none of the above
+will be defined unless ZLib can be found.
+#]=======================================================================]
if(PNG_FIND_QUIETLY)
set(_FIND_ZLIB_ARG QUIET)
diff --git a/Modules/FindPackageMessage.cmake b/Modules/FindPackageMessage.cmake
index 6821cee4f..0628b9816 100644
--- a/Modules/FindPackageMessage.cmake
+++ b/Modules/FindPackageMessage.cmake
@@ -1,35 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPackageMessage
-# ------------------
-#
-#
-#
-# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
-#
-# This macro is intended to be used in FindXXX.cmake modules files. It
-# will print a message once for each unique find result. This is useful
-# for telling the user where a package was found. The first argument
-# specifies the name (XXX) of the package. The second argument
-# specifies the message to display. The third argument lists details
-# about the find result so that if they change the message will be
-# displayed again. The macro also obeys the QUIET argument to the
-# find_package command.
-#
-# Example:
-#
-# ::
-#
-# if(X11_FOUND)
-# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
-# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
-# else()
-# ...
-# endif()
-
-function(FIND_PACKAGE_MESSAGE pkg msg details)
+#[=======================================================================[.rst:
+FindPackageMessage
+------------------
+
+.. code-block:: cmake
+
+ find_package_message(<name> "message for user" "find result details")
+
+This function is intended to be used in FindXXX.cmake modules files.
+It will print a message once for each unique find result. This is
+useful for telling the user where a package was found. The first
+argument specifies the name (XXX) of the package. The second argument
+specifies the message to display. The third argument lists details
+about the find result so that if they change the message will be
+displayed again. The macro also obeys the QUIET argument to the
+find_package command.
+
+Example:
+
+.. code-block:: cmake
+
+ if(X11_FOUND)
+ find_package_message(X11 "Found X11: ${X11_X11_LIB}"
+ "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
+ else()
+ ...
+ endif()
+#]=======================================================================]
+
+function(find_package_message pkg msg details)
# Avoid printing a message repeatedly for the same find result.
if(NOT ${pkg}_FIND_QUIETLY)
string(REPLACE "\n" "" details "${details}")
diff --git a/Modules/FindPatch.cmake b/Modules/FindPatch.cmake
index 3ebcae909..49988395b 100644
--- a/Modules/FindPatch.cmake
+++ b/Modules/FindPatch.cmake
@@ -1,30 +1,31 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPatch
-# ---------
-#
-# The module defines the following variables:
-#
-# ``Patch_EXECUTABLE``
-# Path to patch command-line executable.
-# ``Patch_FOUND``
-# True if the patch command-line executable was found.
-#
-# The following :prop_tgt:`IMPORTED` targets are also defined:
-#
-# ``Patch::patch``
-# The command-line executable.
-#
-# Example usage:
-#
-# .. code-block:: cmake
-#
-# find_package(Patch)
-# if(Patch_FOUND)
-# message("Patch found: ${Patch_EXECUTABLE}")
-# endif()
+#[=======================================================================[.rst:
+FindPatch
+---------
+
+The module defines the following variables:
+
+``Patch_EXECUTABLE``
+ Path to patch command-line executable.
+``Patch_FOUND``
+ True if the patch command-line executable was found.
+
+The following :prop_tgt:`IMPORTED` targets are also defined:
+
+``Patch::patch``
+ The command-line executable.
+
+Example usage:
+
+.. code-block:: cmake
+
+ find_package(Patch)
+ if(Patch_FOUND)
+ message("Patch found: ${Patch_EXECUTABLE}")
+ endif()
+#]=======================================================================]
set(_doc "Patch command line executable")
set(_patch_path )
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index c38527cfa..fd120bf8e 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -1,19 +1,20 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPerl
-# --------
-#
-# Find perl
-#
-# this module looks for Perl
-#
-# ::
-#
-# PERL_EXECUTABLE - the full path to perl
-# PERL_FOUND - If false, don't attempt to use perl.
-# PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
+#[=======================================================================[.rst:
+FindPerl
+--------
+
+Find perl
+
+this module looks for Perl
+
+::
+
+ PERL_EXECUTABLE - the full path to perl
+ PERL_FOUND - If false, don't attempt to use perl.
+ PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index 0b902e74d..7e27f3188 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -1,47 +1,48 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPerlLibs
-# ------------
-#
-# Find Perl libraries
-#
-# This module finds if PERL is installed and determines where the
-# include files and libraries are. It also determines what the name of
-# the library is. This code sets the following variables:
-#
-# ::
-#
-# PERLLIBS_FOUND = True if perl.h & libperl were found
-# PERL_INCLUDE_PATH = path to where perl.h is found
-# PERL_LIBRARY = path to libperl
-# PERL_EXECUTABLE = full path to the perl binary
-#
-#
-#
-# The minimum required version of Perl can be specified using the
-# standard syntax, e.g. find_package(PerlLibs 6.0)
-#
-# ::
-#
-# The following variables are also available if needed
-# (introduced after CMake 2.6.4)
-#
-#
-#
-# ::
-#
-# PERL_SITESEARCH = path to the sitesearch install dir (-V:installsitesearch)
-# PERL_SITEARCH = path to the sitelib install directory (-V:installsitearch)
-# PERL_SITELIB = path to the sitelib install directory (-V:installsitelib)
-# PERL_VENDORARCH = path to the vendor arch install directory (-V:installvendorarch)
-# PERL_VENDORLIB = path to the vendor lib install directory (-V:installvendorlib)
-# PERL_ARCHLIB = path to the core arch lib install directory (-V:archlib)
-# PERL_PRIVLIB = path to the core priv lib install directory (-V:privlib)
-# PERL_UPDATE_ARCHLIB = path to the update arch lib install directory (-V:installarchlib)
-# PERL_UPDATE_PRIVLIB = path to the update priv lib install directory (-V:installprivlib)
-# PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
+#[=======================================================================[.rst:
+FindPerlLibs
+------------
+
+Find Perl libraries
+
+This module finds if PERL is installed and determines where the
+include files and libraries are. It also determines what the name of
+the library is. This code sets the following variables:
+
+::
+
+ PERLLIBS_FOUND = True if perl.h & libperl were found
+ PERL_INCLUDE_PATH = path to where perl.h is found
+ PERL_LIBRARY = path to libperl
+ PERL_EXECUTABLE = full path to the perl binary
+
+
+
+The minimum required version of Perl can be specified using the
+standard syntax, e.g. find_package(PerlLibs 6.0)
+
+::
+
+ The following variables are also available if needed
+ (introduced after CMake 2.6.4)
+
+
+
+::
+
+ PERL_SITESEARCH = path to the sitesearch install dir (-V:installsitesearch)
+ PERL_SITEARCH = path to the sitelib install directory (-V:installsitearch)
+ PERL_SITELIB = path to the sitelib install directory (-V:installsitelib)
+ PERL_VENDORARCH = path to the vendor arch install directory (-V:installvendorarch)
+ PERL_VENDORLIB = path to the vendor lib install directory (-V:installvendorlib)
+ PERL_ARCHLIB = path to the core arch lib install directory (-V:archlib)
+ PERL_PRIVLIB = path to the core priv lib install directory (-V:privlib)
+ PERL_UPDATE_ARCHLIB = path to the update arch lib install directory (-V:installarchlib)
+ PERL_UPDATE_PRIVLIB = path to the update priv lib install directory (-V:installprivlib)
+ PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
+#]=======================================================================]
# find the perl executable
include(${CMAKE_CURRENT_LIST_DIR}/FindPerl.cmake)
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index cfe9b0f19..0366f77a3 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPhysFS
-# ----------
-#
-#
-#
-# Locate PhysFS library This module defines PHYSFS_LIBRARY, the name of
-# the library to link against PHYSFS_FOUND, if false, do not try to link
-# to PHYSFS PHYSFS_INCLUDE_DIR, where to find physfs.h
-#
-# $PHYSFSDIR is an environment variable that would correspond to the
-# ./configure --prefix=$PHYSFSDIR used in building PHYSFS.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindPhysFS
+----------
+
+
+
+Locate PhysFS library This module defines PHYSFS_LIBRARY, the name of
+the library to link against PHYSFS_FOUND, if false, do not try to link
+to PHYSFS PHYSFS_INCLUDE_DIR, where to find physfs.h
+
+$PHYSFSDIR is an environment variable that would correspond to the
+./configure --prefix=$PHYSFSDIR used in building PHYSFS.
+
+Created by Eric Wing.
+#]=======================================================================]
find_path(PHYSFS_INCLUDE_DIR physfs.h
HINTS
diff --git a/Modules/FindPike.cmake b/Modules/FindPike.cmake
index ec71c949a..b78db2adb 100644
--- a/Modules/FindPike.cmake
+++ b/Modules/FindPike.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPike
-# --------
-#
-# Find Pike
-#
-# This module finds if PIKE is installed and determines where the
-# include files and libraries are. It also determines what the name of
-# the library is. This code sets the following variables:
-#
-# ::
-#
-# PIKE_INCLUDE_PATH = path to where program.h is found
-# PIKE_EXECUTABLE = full path to the pike binary
+#[=======================================================================[.rst:
+FindPike
+--------
+
+Find Pike
+
+This module finds if PIKE is installed and determines where the
+include files and libraries are. It also determines what the name of
+the library is. This code sets the following variables:
+
+::
+
+ PIKE_INCLUDE_PATH = path to where program.h is found
+ PIKE_EXECUTABLE = full path to the pike binary
+#]=======================================================================]
find_path(PIKE_INCLUDE_PATH program.h
${PIKE_POSSIBLE_INCLUDE_PATHS}
diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake
index 06beb7d84..e19242626 100644
--- a/Modules/FindPkgConfig.cmake
+++ b/Modules/FindPkgConfig.cmake
@@ -9,12 +9,14 @@ A ``pkg-config`` module for CMake.
Finds the ``pkg-config`` executable and adds the :command:`pkg_get_variable`,
:command:`pkg_check_modules` and :command:`pkg_search_module` commands. The
-following variables will also be set::
+following variables will also be set:
- PKG_CONFIG_FOUND ... if pkg-config executable was found
- PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
- PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
- (since CMake 2.8.8)
+``PKG_CONFIG_FOUND``
+ if pkg-config executable was found
+``PKG_CONFIG_EXECUTABLE``
+ pathname of the pkg-config program
+``PKG_CONFIG_VERSION_STRING``
+ version of pkg-config (since CMake 2.8.8)
#]========================================]
@@ -86,7 +88,9 @@ endmacro()
.. command:: pkg_get_variable
Retrieves the value of a pkg-config variable ``varName`` and stores it in the
- result variable ``resultVar`` in the calling scope. ::
+ result variable ``resultVar`` in the calling scope.
+
+ .. code-block:: cmake
pkg_get_variable(<resultVar> <moduleName> <varName>)
@@ -227,6 +231,7 @@ function(_pkg_find_libs _prefix _no_cmake_path _no_cmake_environment_path)
find_library(pkgcfg_lib_${_prefix}_${_pkg_search}
NAMES ${_pkg_search}
${_find_opts})
+ mark_as_advanced(pkgcfg_lib_${_prefix}_${_pkg_search})
list(APPEND _libs "${pkgcfg_lib_${_prefix}_${_pkg_search}}")
endforeach()
@@ -512,7 +517,9 @@ endmacro()
.. command:: pkg_check_modules
Checks for all the given modules, setting a variety of result variables in
- the calling scope. ::
+ the calling scope.
+
+ .. code-block:: cmake
pkg_check_modules(<prefix>
[REQUIRED] [QUIET]
@@ -543,27 +550,36 @@ endmacro()
Each ``<moduleSpec>`` can be either a bare module name or it can be a
module name with a version constraint (operators ``=``, ``<``, ``>``,
``<=`` and ``>=`` are supported). The following are examples for a module
- named ``foo`` with various constraints::
-
- foo # Any version matches
- foo<2 # Only match versions before 2
- foo>=3.1 # Match any version from 3.1 or later
- foo=1.2.3 # Foo must be exactly version 1.2.3
-
- The following variables may be set upon return. Two sets of values exist,
- one for the common case (``<XXX> = <prefix>``) and another for the
- information ``pkg-config`` provides when it is called with the ``--static``
- option (``<XXX> = <prefix>_STATIC``)::
-
- <XXX>_FOUND ... set to 1 if module(s) exist
- <XXX>_LIBRARIES ... only the libraries (without the '-l')
- <XXX>_LINK_LIBRARIES ... the libraries and their absolute paths
- <XXX>_LIBRARY_DIRS ... the paths of the libraries (without the '-L')
- <XXX>_LDFLAGS ... all required linker flags
- <XXX>_LDFLAGS_OTHER ... all other linker flags
- <XXX>_INCLUDE_DIRS ... the '-I' preprocessor flags (without the '-I')
- <XXX>_CFLAGS ... all required cflags
- <XXX>_CFLAGS_OTHER ... the other compiler flags
+ named ``foo`` with various constraints:
+
+ - ``foo`` matches any version.
+ - ``foo<2`` only matches versions before 2.
+ - ``foo>=3.1`` matches any version from 3.1 or later.
+ - ``foo=1.2.3`` requires that foo must be exactly version 1.2.3.
+
+ The following variables may be set upon return. Two sets of values exist:
+ One for the common case (``<XXX> = <prefix>``) and another for the
+ information ``pkg-config`` provides when called with the ``--static``
+ option (``<XXX> = <prefix>_STATIC``).
+
+ ``<XXX>_FOUND``
+ set to 1 if module(s) exist
+ ``<XXX>_LIBRARIES``
+ only the libraries (without the '-l')
+ ``<XXX>_LINK_LIBRARIES``
+ the libraries and their absolute paths
+ ``<XXX>_LIBRARY_DIRS``
+ the paths of the libraries (without the '-L')
+ ``<XXX>_LDFLAGS``
+ all required linker flags
+ ``<XXX>_LDFLAGS_OTHER``
+ all other linker flags
+ ``<XXX>_INCLUDE_DIRS``
+ the '-I' preprocessor flags (without the '-I')
+ ``<XXX>_CFLAGS``
+ all required cflags
+ ``<XXX>_CFLAGS_OTHER``
+ the other compiler flags
All but ``<XXX>_FOUND`` may be a :ref:`;-list <CMake Language Lists>` if the
associated variable returned from ``pkg-config`` has multiple values.
@@ -571,14 +587,18 @@ endmacro()
There are some special variables whose prefix depends on the number of
``<moduleSpec>`` given. When there is only one ``<moduleSpec>``,
``<YYY>`` will simply be ``<prefix>``, but if two or more ``<moduleSpec>``
- items are given, ``<YYY>`` will be ``<prefix>_<moduleName>``::
+ items are given, ``<YYY>`` will be ``<prefix>_<moduleName>``.
- <YYY>_VERSION ... version of the module
- <YYY>_PREFIX ... prefix directory of the module
- <YYY>_INCLUDEDIR ... include directory of the module
- <YYY>_LIBDIR ... lib directory of the module
+ ``<YYY>_VERSION``
+ version of the module
+ ``<YYY>_PREFIX``
+ prefix directory of the module
+ ``<YYY>_INCLUDEDIR``
+ include directory of the module
+ ``<YYY>_LIBDIR``
+ lib directory of the module
- Examples
+ Examples:
.. code-block:: cmake
@@ -638,7 +658,9 @@ endmacro()
The behavior of this command is the same as :command:`pkg_check_modules`,
except that rather than checking for all the specified modules, it searches
- for just the first successful match. ::
+ for just the first successful match.
+
+ .. code-block:: cmake
pkg_search_module(<prefix>
[REQUIRED] [QUIET]
@@ -647,7 +669,7 @@ endmacro()
[IMPORTED_TARGET [GLOBAL]]
<moduleSpec> [<moduleSpec>...])
- Examples
+ Example:
.. code-block:: cmake
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index c044ab3b7..4b5e60e21 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -1,20 +1,34 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPostgreSQL
-# --------------
-#
-# Find the PostgreSQL installation.
-#
-# This module defines
-#
-# ::
-#
-# PostgreSQL_LIBRARIES - the PostgreSQL libraries needed for linking
-# PostgreSQL_INCLUDE_DIRS - the directories of the PostgreSQL headers
-# PostgreSQL_LIBRARY_DIRS - the link directories for PostgreSQL libraries
-# PostgreSQL_VERSION_STRING - the version of PostgreSQL found (since CMake 2.8.8)
+#[=======================================================================[.rst:
+FindPostgreSQL
+--------------
+
+Find the PostgreSQL installation.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``PostgreSQL::PostgreSQL``
+if PostgreSQL has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``PostgreSQL_FOUND``
+ True if PostgreSQL is found.
+``PostgreSQL_LIBRARIES``
+ the PostgreSQL libraries needed for linking
+``PostgreSQL_INCLUDE_DIRS``
+ the directories of the PostgreSQL headers
+``PostgreSQL_LIBRARY_DIRS``
+ the link directories for PostgreSQL libraries
+``PostgreSQL_VERSION_STRING``
+ the version of PostgreSQL found
+#]=======================================================================]
# ----------------------------------------------------------------------------
# History:
@@ -48,6 +62,8 @@
# PostgreSQL_LIBRARY_DIRS - Link directories for PostgreSQL libraries
# PostgreSQL_LIBRARIES - The PostgreSQL libraries.
#
+# The ``PostgreSQL::PostgreSQL`` imported target is also created.
+#
# ----------------------------------------------------------------------------
# If you have installed PostgreSQL in a non-standard location.
# (Please note that in the following comments, it is assumed that <Your Path>
@@ -159,14 +175,34 @@ if (PostgreSQL_INCLUDE_DIR)
foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
if(EXISTS "${_PG_CONFIG_HEADER}")
file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
- REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
+ REGEX "^#define[\t ]+PG_VERSION_NUM[\t ]+.*")
if(pgsql_version_str)
- string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*"
- "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}")
+ string(REGEX REPLACE "^#define[\t ]+PG_VERSION_NUM[\t ]+([0-9]*).*"
+ "\\1" _PostgreSQL_VERSION_NUM "${pgsql_version_str}")
break()
endif()
endif()
endforeach()
+ if (_PostgreSQL_VERSION_NUM)
+ math(EXPR _PostgreSQL_major_version "${_PostgreSQL_VERSION_NUM} / 10000")
+ math(EXPR _PostgreSQL_minor_version "${_PostgreSQL_VERSION_NUM} % 10000")
+ set(PostgreSQL_VERSION_STRING "${_PostgreSQL_major_version}.${_PostgreSQL_minor_version}")
+ unset(_PostgreSQL_major_version)
+ unset(_PostgreSQL_minor_version)
+ else ()
+ foreach(_PG_CONFIG_HEADER ${_PG_CONFIG_HEADERS})
+ if(EXISTS "${_PG_CONFIG_HEADER}")
+ file(STRINGS "${_PG_CONFIG_HEADER}" pgsql_version_str
+ REGEX "^#define[\t ]+PG_VERSION[\t ]+\".*\"")
+ if(pgsql_version_str)
+ string(REGEX REPLACE "^#define[\t ]+PG_VERSION[\t ]+\"([^\"]*)\".*"
+ "\\1" PostgreSQL_VERSION_STRING "${pgsql_version_str}")
+ break()
+ endif()
+ endif()
+ endforeach()
+ endif ()
+ unset(_PostgreSQL_VERSION_NUM)
unset(pgsql_version_str)
endif()
@@ -179,6 +215,12 @@ set(PostgreSQL_FOUND ${POSTGRESQL_FOUND})
# Now try to get the include and library path.
if(PostgreSQL_FOUND)
+ if (NOT TARGET PostgreSQL::PostgreSQL)
+ add_library(PostgreSQL::PostgreSQL UNKNOWN IMPORTED)
+ set_target_properties(PostgreSQL::PostgreSQL PROPERTIES
+ IMPORTED_LOCATION "${PostgreSQL_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${PostgreSQL_INCLUDE_DIR};${PostgreSQL_TYPE_INCLUDE_DIR}")
+ endif ()
set(PostgreSQL_INCLUDE_DIRS ${PostgreSQL_INCLUDE_DIR} ${PostgreSQL_TYPE_INCLUDE_DIR} )
set(PostgreSQL_LIBRARY_DIRS ${PostgreSQL_LIBRARY_DIR} )
set(PostgreSQL_LIBRARIES ${PostgreSQL_LIBRARY})
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index 500c8edf6..fba0494e3 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -1,35 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindProducer
-# ------------
-#
-#
-#
-# Though Producer isn't directly part of OpenSceneGraph, its primary
-# user is OSG so I consider this part of the Findosg* suite used to find
-# OpenSceneGraph components. You'll notice that I accept OSGDIR as an
-# environment path.
-#
-# Each component is separate and you must opt in to each module. You
-# must also opt into OpenGL (and OpenThreads?) as these modules won't do
-# it for you. This is to allow you control over your own system piece
-# by piece in case you need to opt out of certain components or change
-# the Find behavior for a particular module (perhaps because the default
-# FindOpenGL.cmake module doesn't work with your system as an example).
-# If you want to use a more convenient module that includes everything,
-# use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake
-# modules.
-#
-# Locate Producer This module defines PRODUCER_LIBRARY PRODUCER_FOUND,
-# if false, do not try to link to Producer PRODUCER_INCLUDE_DIR, where
-# to find the headers
-#
-# $PRODUCER_DIR is an environment variable that would correspond to the
-# ./configure --prefix=$PRODUCER_DIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindProducer
+------------
+
+
+
+Though Producer isn't directly part of OpenSceneGraph, its primary
+user is OSG so I consider this part of the Findosg* suite used to find
+OpenSceneGraph components. You'll notice that I accept OSGDIR as an
+environment path.
+
+Each component is separate and you must opt in to each module. You
+must also opt into OpenGL (and OpenThreads?) as these modules won't do
+it for you. This is to allow you control over your own system piece
+by piece in case you need to opt out of certain components or change
+the Find behavior for a particular module (perhaps because the default
+FindOpenGL.cmake module doesn't work with your system as an example).
+If you want to use a more convenient module that includes everything,
+use the FindOpenSceneGraph.cmake instead of the Findosg*.cmake
+modules.
+
+Locate Producer This module defines PRODUCER_LIBRARY PRODUCER_FOUND,
+if false, do not try to link to Producer PRODUCER_INCLUDE_DIR, where
+to find the headers
+
+$PRODUCER_DIR is an environment variable that would correspond to the
+./configure --prefix=$PRODUCER_DIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <Producer/CameraGroup>
diff --git a/Modules/FindProtobuf.cmake b/Modules/FindProtobuf.cmake
index eda036158..1758fb355 100644
--- a/Modules/FindProtobuf.cmake
+++ b/Modules/FindProtobuf.cmake
@@ -1,127 +1,126 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindProtobuf
-# ------------
-#
-# Locate and configure the Google Protocol Buffers library.
-#
-# The following variables can be set and are optional:
-#
-# ``Protobuf_SRC_ROOT_FOLDER``
-# When compiling with MSVC, if this cache variable is set
-# the protobuf-default VS project build locations
-# (vsprojects/Debug and vsprojects/Release
-# or vsprojects/x64/Debug and vsprojects/x64/Release)
-# will be searched for libraries and binaries.
-# ``Protobuf_IMPORT_DIRS``
-# List of additional directories to be searched for
-# imported .proto files.
-# ``Protobuf_DEBUG``
-# Show debug messages.
-# ``Protobuf_USE_STATIC_LIBS``
-# Set to ON to force the use of the static libraries.
-# Default is OFF.
-#
-# Defines the following variables:
-#
-# ``Protobuf_FOUND``
-# Found the Google Protocol Buffers library
-# (libprotobuf & header files)
-# ``Protobuf_VERSION``
-# Version of package found.
-# ``Protobuf_INCLUDE_DIRS``
-# Include directories for Google Protocol Buffers
-# ``Protobuf_LIBRARIES``
-# The protobuf libraries
-# ``Protobuf_PROTOC_LIBRARIES``
-# The protoc libraries
-# ``Protobuf_LITE_LIBRARIES``
-# The protobuf-lite libraries
-#
-# The following :prop_tgt:`IMPORTED` targets are also defined:
-#
-# ``protobuf::libprotobuf``
-# The protobuf library.
-# ``protobuf::libprotobuf-lite``
-# The protobuf lite library.
-# ``protobuf::libprotoc``
-# The protoc library.
-# ``protobuf::protoc``
-# The protoc compiler.
-#
-# The following cache variables are also available to set or use:
-#
-# ``Protobuf_LIBRARY``
-# The protobuf library
-# ``Protobuf_PROTOC_LIBRARY``
-# The protoc library
-# ``Protobuf_INCLUDE_DIR``
-# The include directory for protocol buffers
-# ``Protobuf_PROTOC_EXECUTABLE``
-# The protoc compiler
-# ``Protobuf_LIBRARY_DEBUG``
-# The protobuf library (debug)
-# ``Protobuf_PROTOC_LIBRARY_DEBUG``
-# The protoc library (debug)
-# ``Protobuf_LITE_LIBRARY``
-# The protobuf lite library
-# ``Protobuf_LITE_LIBRARY_DEBUG``
-# The protobuf lite library (debug)
-#
-# Example:
-#
-# .. code-block:: cmake
-#
-# find_package(Protobuf REQUIRED)
-# include_directories(${Protobuf_INCLUDE_DIRS})
-# include_directories(${CMAKE_CURRENT_BINARY_DIR})
-# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto)
-# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS EXPORT_MACRO DLL_EXPORT foo.proto)
-# protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS DESCRIPTORS PROTO_DESCS foo.proto)
-# protobuf_generate_python(PROTO_PY foo.proto)
-# add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
-# target_link_libraries(bar ${Protobuf_LIBRARIES})
-#
-# .. note::
-# The ``protobuf_generate_cpp`` and ``protobuf_generate_python``
-# functions and :command:`add_executable` or :command:`add_library`
-# calls only work properly within the same directory.
-#
-# .. command:: protobuf_generate_cpp
-#
-# Add custom commands to process ``.proto`` files to C++::
-#
-# protobuf_generate_cpp (<SRCS> <HDRS>
-# [DESCRIPTORS <DESC>] [EXPORT_MACRO <MACRO>] [<ARGN>...])
-#
-# ``SRCS``
-# Variable to define with autogenerated source files
-# ``HDRS``
-# Variable to define with autogenerated header files
-# ``DESCRIPTORS``
-# Variable to define with autogenerated descriptor files, if requested.
-# ``EXPORT_MACRO``
-# is a macro which should expand to ``__declspec(dllexport)`` or
-# ``__declspec(dllimport)`` depending on what is being compiled.
-# ``ARGN``
-# ``.proto`` files
-#
-# .. command:: protobuf_generate_python
-#
-# Add custom commands to process ``.proto`` files to Python::
-#
-# protobuf_generate_python (<PY> [<ARGN>...])
-#
-# ``PY``
-# Variable to define with autogenerated Python files
-# ``ARGN``
-# ``.proto`` filess
+#[=======================================================================[.rst:
+FindProtobuf
+------------
+
+Locate and configure the Google Protocol Buffers library.
+
+The following variables can be set and are optional:
+
+``Protobuf_SRC_ROOT_FOLDER``
+ When compiling with MSVC, if this cache variable is set
+ the protobuf-default VS project build locations
+ (vsprojects/Debug and vsprojects/Release
+ or vsprojects/x64/Debug and vsprojects/x64/Release)
+ will be searched for libraries and binaries.
+``Protobuf_IMPORT_DIRS``
+ List of additional directories to be searched for
+ imported .proto files.
+``Protobuf_DEBUG``
+ Show debug messages.
+``Protobuf_USE_STATIC_LIBS``
+ Set to ON to force the use of the static libraries.
+ Default is OFF.
+
+Defines the following variables:
+
+``Protobuf_FOUND``
+ Found the Google Protocol Buffers library
+ (libprotobuf & header files)
+``Protobuf_VERSION``
+ Version of package found.
+``Protobuf_INCLUDE_DIRS``
+ Include directories for Google Protocol Buffers
+``Protobuf_LIBRARIES``
+ The protobuf libraries
+``Protobuf_PROTOC_LIBRARIES``
+ The protoc libraries
+``Protobuf_LITE_LIBRARIES``
+ The protobuf-lite libraries
+
+The following :prop_tgt:`IMPORTED` targets are also defined:
+
+``protobuf::libprotobuf``
+ The protobuf library.
+``protobuf::libprotobuf-lite``
+ The protobuf lite library.
+``protobuf::libprotoc``
+ The protoc library.
+``protobuf::protoc``
+ The protoc compiler.
+
+The following cache variables are also available to set or use:
+
+``Protobuf_LIBRARY``
+ The protobuf library
+``Protobuf_PROTOC_LIBRARY``
+ The protoc library
+``Protobuf_INCLUDE_DIR``
+ The include directory for protocol buffers
+``Protobuf_PROTOC_EXECUTABLE``
+ The protoc compiler
+``Protobuf_LIBRARY_DEBUG``
+ The protobuf library (debug)
+``Protobuf_PROTOC_LIBRARY_DEBUG``
+ The protoc library (debug)
+``Protobuf_LITE_LIBRARY``
+ The protobuf lite library
+``Protobuf_LITE_LIBRARY_DEBUG``
+ The protobuf lite library (debug)
+
+Example:
+
+.. code-block:: cmake
+
+ find_package(Protobuf REQUIRED)
+ include_directories(${Protobuf_INCLUDE_DIRS})
+ include_directories(${CMAKE_CURRENT_BINARY_DIR})
+ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS foo.proto)
+ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS EXPORT_MACRO DLL_EXPORT foo.proto)
+ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS DESCRIPTORS PROTO_DESCS foo.proto)
+ protobuf_generate_python(PROTO_PY foo.proto)
+ add_executable(bar bar.cc ${PROTO_SRCS} ${PROTO_HDRS})
+ target_link_libraries(bar ${Protobuf_LIBRARIES})
+
+.. note::
+ The ``protobuf_generate_cpp`` and ``protobuf_generate_python``
+ functions and :command:`add_executable` or :command:`add_library`
+ calls only work properly within the same directory.
+
+.. command:: protobuf_generate_cpp
+
+ Add custom commands to process ``.proto`` files to C++::
+
+ protobuf_generate_cpp (<SRCS> <HDRS>
+ [DESCRIPTORS <DESC>] [EXPORT_MACRO <MACRO>] [<ARGN>...])
+
+ ``SRCS``
+ Variable to define with autogenerated source files
+ ``HDRS``
+ Variable to define with autogenerated header files
+ ``DESCRIPTORS``
+ Variable to define with autogenerated descriptor files, if requested.
+ ``EXPORT_MACRO``
+ is a macro which should expand to ``__declspec(dllexport)`` or
+ ``__declspec(dllimport)`` depending on what is being compiled.
+ ``ARGN``
+ ``.proto`` files
+
+.. command:: protobuf_generate_python
+
+ Add custom commands to process ``.proto`` files to Python::
+
+ protobuf_generate_python (<PY> [<ARGN>...])
+
+ ``PY``
+ Variable to define with autogenerated Python files
+ ``ARGN``
+ ``.proto`` filess
+#]=======================================================================]
function(protobuf_generate)
- include(CMakeParseArguments)
-
set(_options APPEND_PATH DESCRIPTORS)
set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR)
if(COMMAND target_sources)
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index 8645a0db5..1c134e278 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -14,11 +14,12 @@ Three components are supported:
* ``Compiler``: search for Python compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
libraries).
+* ``NumPy``: search for NumPy include directories.
If no ``COMPONENTS`` is specified, ``Interpreter`` is assumed.
-To ensure consistent versions between components ``Interpreter``, ``Compiler``
-and ``Development``, specify all components at the same time::
+To ensure consistent versions between components ``Interpreter``, ``Compiler``,
+``Development`` and ``NumPy``, specify all components at the same time::
find_package (Python COMPONENTS Interpreter Development)
@@ -27,10 +28,18 @@ is searched.
To manage concurrent versions 3 and 2 of Python, use :module:`FindPython3` and
:module:`FindPython2` modules rather than this one.
+.. note::
+
+ If components ``Interpreter`` and ``Development`` are both specified, this
+ module search only for interpreter with same platform architecture as the one
+ defined by ``CMake`` configuration. This contraint does not apply if only
+ ``Interpreter`` component is specified.
+
Imported Targets
^^^^^^^^^^^^^^^^
-This module defines the following :ref:`Imported Targets <Imported Targets>`:
+This module defines the following :ref:`Imported Targets <Imported Targets>`
+(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
``Python::Interpreter``
Python interpreter. Target defined if component ``Interpreter`` is found.
@@ -38,6 +47,8 @@ This module defines the following :ref:`Imported Targets <Imported Targets>`:
Python compiler. Target defined if component ``Compiler`` is found.
``Python::Python``
Python library. Target defined if component ``Development`` is found.
+``Python::NumPy``
+ NumPy Python library. Target defined if component ``NumPy`` is found.
Result Variables
^^^^^^^^^^^^^^^^
@@ -103,6 +114,12 @@ This module will set the following variables in your project
Python minor version.
``Python_VERSION_PATCH``
Python patch version.
+``Python_NumPy_FOUND``
+ System has the NumPy.
+``Python_NumPy_INCLUDE_DIRS``
+ The NumPy include directries.
+``Python_NumPy_VERSION``
+ The NumPy version.
Hints
^^^^^
@@ -144,9 +161,10 @@ Hints
Commands
^^^^^^^^
-This module defines the command ``Python_add_library`` which have the same
-semantic as :command:`add_library` but take care of Python module naming rules
-(only applied if library is of type ``MODULE``) and add dependency to target
+This module defines the command ``Python_add_library`` (when
+:prop_gbl:`CMAKE_ROLE` is ``PROJECT``), which has the same semantics as
+:command:`add_library`, but takes care of Python module naming rules
+(only applied if library is of type ``MODULE``), and adds a dependency to target
``Python::Python``::
Python_add_library (my_module MODULE src1.cpp)
diff --git a/Modules/FindPython/Support.cmake b/Modules/FindPython/Support.cmake
index e0ebb9033..1236bf8f8 100644
--- a/Modules/FindPython/Support.cmake
+++ b/Modules/FindPython/Support.cmake
@@ -24,6 +24,8 @@ else()
message (FATAL_ERROR "FindPython: INTERNAL ERROR")
endif()
+get_property(_${_PYTHON_PREFIX}_CMAKE_ROLE GLOBAL PROPERTY CMAKE_ROLE)
+
#
# helper commands
@@ -207,6 +209,10 @@ if (NOT ${_PYTHON_PREFIX}_FIND_COMPONENTS)
set (${_PYTHON_PREFIX}_FIND_COMPONENTS Interpreter)
set (${_PYTHON_PREFIX}_FIND_REQUIRED_Interpreter TRUE)
endif()
+if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
+ list (APPEND ${_PYTHON_PREFIX}_FIND_COMPONENTS "Interpreter" "Development")
+ list (REMOVE_DUPLICATES ${_PYTHON_PREFIX}_FIND_COMPONENTS)
+endif()
foreach (_${_PYTHON_PREFIX}_COMPONENT IN LISTS ${_PYTHON_PREFIX}_FIND_COMPONENTS)
set (${_PYTHON_PREFIX}_${_${_PYTHON_PREFIX}_COMPONENT}_FOUND FALSE)
endforeach()
@@ -335,14 +341,14 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
NAMES_PER_DIR
HINTS ${_${_PYTHON_PREFIX}_HINTS}
- PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
+ PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\IronPython\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
@@ -396,14 +402,14 @@ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS)
python
${_${_PYTHON_PREFIX}_IRON_PYTHON_NAMES}
NAMES_PER_DIR
- PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
+ PATHS [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\IronPython\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
@@ -810,14 +816,14 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
_python_get_frameworks (_${_PYTHON_PREFIX}_FRAMEWORK_PATHS ${_${_PYTHON_PREFIX}_VERSION})
set (_${_PYTHON_PREFIX}_REGISTRY_PATHS
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
+ [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_${_PYTHON_PREFIX}_VERSION}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH}\\InstallPath]
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\ContinuumAnalytics\\Anaconda${_${_PYTHON_PREFIX}_VERSION_NO_DOTS}-${_${_PYTHON_PREFIX}_ARCH2}\\InstallPath])
@@ -1120,6 +1126,40 @@ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
endif()
endif()
+if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_Interpreter_FOUND)
+ if (${_PYTHON_PREFIX}_FIND_REQUIRED_NumPy)
+ list (APPEND _${_PYTHON_PREFIX}_REQUIRED_VARS ${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
+ list (APPEND _${_PYTHON_PREFIX}_CACHED_VARS ${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
+ endif()
+ execute_process(
+ COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c
+ "from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept:pass\n"
+ RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT
+ OUTPUT_VARIABLE _${_PYTHON_PREFIX}_NumPy_PATH
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (NOT _${_PYTHON_PREFIX}_RESULT)
+ find_path(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR
+ NAMES "numpy/arrayobject.h" "numpy/numpyconfig.h"
+ HINTS "${_${_PYTHON_PREFIX}_NumPy_PATH}"
+ NO_DEFAULT_PATH)
+ endif()
+ if(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR)
+ set(${_PYTHON_PREFIX}_NumPy_INCLUDE_DIRS "${${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
+ set(${_PYTHON_PREFIX}_NumPy_FOUND TRUE)
+ endif()
+ if(${_PYTHON_PREFIX}_NumPy_FOUND)
+ execute_process(
+ COMMAND "${${_PYTHON_PREFIX}_EXECUTABLE}" -c
+ "from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept:pass\n"
+ RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT
+ OUTPUT_VARIABLE _${_PYTHON_PREFIX}_NumPy_VERSION)
+ if (NOT _${_PYTHON_PREFIX}_RESULT)
+ set(${_PYTHON_PREFIX}_NumPy_VERSION "${_${_PYTHON_PREFIX}_NumPy_VERSION}")
+ endif()
+ endif()
+endif()
+
# final validation
if (${_PYTHON_PREFIX}_VERSION_MAJOR AND
NOT ${_PYTHON_PREFIX}_VERSION_MAJOR VERSION_EQUAL _${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR)
@@ -1133,118 +1173,128 @@ find_package_handle_standard_args (${_PYTHON_PREFIX}
HANDLE_COMPONENTS)
# Create imported targets and helper functions
-if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
- AND ${_PYTHON_PREFIX}_Interpreter_FOUND
- AND NOT TARGET ${_PYTHON_PREFIX}::Interpreter)
- add_executable (${_PYTHON_PREFIX}::Interpreter IMPORTED)
- set_property (TARGET ${_PYTHON_PREFIX}::Interpreter
- PROPERTY IMPORTED_LOCATION "${${_PYTHON_PREFIX}_EXECUTABLE}")
-endif()
-
-if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
- AND ${_PYTHON_PREFIX}_Compiler_FOUND
- AND NOT TARGET ${_PYTHON_PREFIX}::Compiler)
- add_executable (${_PYTHON_PREFIX}::Compiler IMPORTED)
- set_property (TARGET ${_PYTHON_PREFIX}::Compiler
- PROPERTY IMPORTED_LOCATION "${${_PYTHON_PREFIX}_COMPILER}")
-endif()
-
-if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
- AND ${_PYTHON_PREFIX}_Development_FOUND AND NOT TARGET ${_PYTHON_PREFIX}::Python)
+if(_${_PYTHON_PREFIX}_CMAKE_ROLE STREQUAL "PROJECT")
+ if ("Interpreter" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
+ AND ${_PYTHON_PREFIX}_Interpreter_FOUND
+ AND NOT TARGET ${_PYTHON_PREFIX}::Interpreter)
+ add_executable (${_PYTHON_PREFIX}::Interpreter IMPORTED)
+ set_property (TARGET ${_PYTHON_PREFIX}::Interpreter
+ PROPERTY IMPORTED_LOCATION "${${_PYTHON_PREFIX}_EXECUTABLE}")
+ endif()
- if (${_PYTHON_PREFIX}_LIBRARY_RELEASE MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$"
- OR ${_PYTHON_PREFIX}_LIBRARY_DEBUG MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$"
- OR ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE OR ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG)
- set (_${_PYTHON_PREFIX}_LIBRARY_TYPE SHARED)
- else()
- set (_${_PYTHON_PREFIX}_LIBRARY_TYPE STATIC)
+ if ("Compiler" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
+ AND ${_PYTHON_PREFIX}_Compiler_FOUND
+ AND NOT TARGET ${_PYTHON_PREFIX}::Compiler)
+ add_executable (${_PYTHON_PREFIX}::Compiler IMPORTED)
+ set_property (TARGET ${_PYTHON_PREFIX}::Compiler
+ PROPERTY IMPORTED_LOCATION "${${_PYTHON_PREFIX}_COMPILER}")
endif()
- add_library (${_PYTHON_PREFIX}::Python ${_${_PYTHON_PREFIX}_LIBRARY_TYPE} IMPORTED)
-
- set_property (TARGET ${_PYTHON_PREFIX}::Python
- PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_PYTHON_PREFIX}_INCLUDE_DIR}")
-
- if ((${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE)
- OR (${_PYTHON_PREFIX}_LIBRARY_DEBUG AND ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG))
- # System manage shared libraries in two parts: import and runtime
- if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
- set_property (TARGET ${_PYTHON_PREFIX}::Python PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
- set_target_properties (${_PYTHON_PREFIX}::Python
- PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
- IMPORTED_IMPLIB_RELEASE "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}"
- IMPORTED_LOCATION_RELEASE "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE}")
- set_target_properties (${_PYTHON_PREFIX}::Python
- PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
- IMPORTED_IMPLIB_DEBUG "${${_PYTHON_PREFIX}_LIBRARY_DEBUG}"
- IMPORTED_LOCATION_DEBUG "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG}")
+ if ("Development" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS
+ AND ${_PYTHON_PREFIX}_Development_FOUND AND NOT TARGET ${_PYTHON_PREFIX}::Python)
+
+ if (${_PYTHON_PREFIX}_LIBRARY_RELEASE MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$"
+ OR ${_PYTHON_PREFIX}_LIBRARY_DEBUG MATCHES "${CMAKE_SHARED_LIBRARY_SUFFIX}$"
+ OR ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE OR ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG)
+ set (_${_PYTHON_PREFIX}_LIBRARY_TYPE SHARED)
else()
- set_target_properties (${_PYTHON_PREFIX}::Python
- PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
- IMPORTED_IMPLIB "${${_PYTHON_PREFIX}_LIBRARY}"
- IMPORTED_LOCATION "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY}")
+ set (_${_PYTHON_PREFIX}_LIBRARY_TYPE STATIC)
endif()
- else()
- if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
- set_property (TARGET ${_PYTHON_PREFIX}::Python PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
- set_target_properties (${_PYTHON_PREFIX}::Python
- PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
- IMPORTED_LOCATION_RELEASE "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
- set_target_properties (${_PYTHON_PREFIX}::Python
- PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
- IMPORTED_LOCATION_DEBUG "${${_PYTHON_PREFIX}_LIBRARY_DEBUG}")
+
+ add_library (${_PYTHON_PREFIX}::Python ${_${_PYTHON_PREFIX}_LIBRARY_TYPE} IMPORTED)
+
+ set_property (TARGET ${_PYTHON_PREFIX}::Python
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_PYTHON_PREFIX}_INCLUDE_DIR}")
+
+ if ((${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE)
+ OR (${_PYTHON_PREFIX}_LIBRARY_DEBUG AND ${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG))
+ # System manage shared libraries in two parts: import and runtime
+ if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
+ set_property (TARGET ${_PYTHON_PREFIX}::Python PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
+ set_target_properties (${_PYTHON_PREFIX}::Python
+ PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+ IMPORTED_IMPLIB_RELEASE "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}"
+ IMPORTED_LOCATION_RELEASE "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_RELEASE}")
+ set_target_properties (${_PYTHON_PREFIX}::Python
+ PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+ IMPORTED_IMPLIB_DEBUG "${${_PYTHON_PREFIX}_LIBRARY_DEBUG}"
+ IMPORTED_LOCATION_DEBUG "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY_DEBUG}")
+ else()
+ set_target_properties (${_PYTHON_PREFIX}::Python
+ PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_IMPLIB "${${_PYTHON_PREFIX}_LIBRARY}"
+ IMPORTED_LOCATION "${${_PYTHON_PREFIX}_RUNTIME_LIBRARY}")
+ endif()
else()
- set_target_properties (${_PYTHON_PREFIX}::Python
- PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
- IMPORTED_LOCATION "${${_PYTHON_PREFIX}_LIBRARY}")
+ if (${_PYTHON_PREFIX}_LIBRARY_RELEASE AND ${_PYTHON_PREFIX}_LIBRARY_DEBUG)
+ set_property (TARGET ${_PYTHON_PREFIX}::Python PROPERTY IMPORTED_CONFIGURATIONS RELEASE DEBUG)
+ set_target_properties (${_PYTHON_PREFIX}::Python
+ PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+ IMPORTED_LOCATION_RELEASE "${${_PYTHON_PREFIX}_LIBRARY_RELEASE}")
+ set_target_properties (${_PYTHON_PREFIX}::Python
+ PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+ IMPORTED_LOCATION_DEBUG "${${_PYTHON_PREFIX}_LIBRARY_DEBUG}")
+ else()
+ set_target_properties (${_PYTHON_PREFIX}::Python
+ PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${${_PYTHON_PREFIX}_LIBRARY}")
+ endif()
endif()
- endif()
- if (_${_PYTHON_PREFIX}_CONFIG AND _${_PYTHON_PREFIX}_LIBRARY_TYPE STREQUAL "STATIC")
- # extend link information with dependent libraries
- execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --ldflags
- RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT
- OUTPUT_VARIABLE _${_PYTHON_PREFIX}_FLAGS
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (NOT _${_PYTHON_PREFIX}_RESULT)
- string (REGEX MATCHALL "-[Ll][^ ]+" _${_PYTHON_PREFIX}_LINK_LIBRARIES "${_${_PYTHON_PREFIX}_FLAGS}")
- # remove elements relative to python library itself
- list (FILTER _${_PYTHON_PREFIX}_LINK_LIBRARIES EXCLUDE REGEX "-lpython")
- foreach (_${_PYTHON_PREFIX}_DIR IN LISTS ${_PYTHON_PREFIX}_LIBRARY_DIRS)
- list (FILTER _${_PYTHON_PREFIX}_LINK_LIBRARIES EXCLUDE REGEX "-L${${_PYTHON_PREFIX}_DIR}")
- endforeach()
- set_property (TARGET ${_PYTHON_PREFIX}::Python
- PROPERTY INTERFACE_LINK_LIBRARIES ${_${_PYTHON_PREFIX}_LINK_LIBRARIES})
+ if (_${_PYTHON_PREFIX}_CONFIG AND _${_PYTHON_PREFIX}_LIBRARY_TYPE STREQUAL "STATIC")
+ # extend link information with dependent libraries
+ execute_process (COMMAND "${_${_PYTHON_PREFIX}_CONFIG}" --ldflags
+ RESULT_VARIABLE _${_PYTHON_PREFIX}_RESULT
+ OUTPUT_VARIABLE _${_PYTHON_PREFIX}_FLAGS
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if (NOT _${_PYTHON_PREFIX}_RESULT)
+ string (REGEX MATCHALL "-[Ll][^ ]+" _${_PYTHON_PREFIX}_LINK_LIBRARIES "${_${_PYTHON_PREFIX}_FLAGS}")
+ # remove elements relative to python library itself
+ list (FILTER _${_PYTHON_PREFIX}_LINK_LIBRARIES EXCLUDE REGEX "-lpython")
+ foreach (_${_PYTHON_PREFIX}_DIR IN LISTS ${_PYTHON_PREFIX}_LIBRARY_DIRS)
+ list (FILTER _${_PYTHON_PREFIX}_LINK_LIBRARIES EXCLUDE REGEX "-L${${_PYTHON_PREFIX}_DIR}")
+ endforeach()
+ set_property (TARGET ${_PYTHON_PREFIX}::Python
+ PROPERTY INTERFACE_LINK_LIBRARIES ${_${_PYTHON_PREFIX}_LINK_LIBRARIES})
+ endif()
endif()
- endif()
- #
- # PYTHON_ADD_LIBRARY (<name> [STATIC|SHARED|MODULE] src1 src2 ... srcN)
- # It is used to build modules for python.
- #
- function (__${_PYTHON_PREFIX}_ADD_LIBRARY prefix name)
- cmake_parse_arguments (PARSE_ARGV 2 PYTHON_ADD_LIBRARY
- "STATIC;SHARED;MODULE" "" "")
-
- unset (type)
- if (NOT (PYTHON_ADD_LIBRARY_STATIC
- OR PYTHON_ADD_LIBRARY_SHARED
- OR PYTHON_ADD_LIBRARY_MODULE))
- set (type MODULE)
- endif()
- add_library (${name} ${type} ${ARGN})
- target_link_libraries (${name} PRIVATE ${prefix}::Python)
-
- # customize library name to follow module name rules
- get_property (type TARGET ${name} PROPERTY TYPE)
- if (type STREQUAL "MODULE_LIBRARY")
- set_property (TARGET ${name} PROPERTY PREFIX "")
- if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
- set_property (TARGET ${name} PROPERTY SUFFIX ".pyd")
+ #
+ # PYTHON_ADD_LIBRARY (<name> [STATIC|SHARED|MODULE] src1 src2 ... srcN)
+ # It is used to build modules for python.
+ #
+ function (__${_PYTHON_PREFIX}_ADD_LIBRARY prefix name)
+ cmake_parse_arguments (PARSE_ARGV 2 PYTHON_ADD_LIBRARY
+ "STATIC;SHARED;MODULE" "" "")
+
+ unset (type)
+ if (NOT (PYTHON_ADD_LIBRARY_STATIC
+ OR PYTHON_ADD_LIBRARY_SHARED
+ OR PYTHON_ADD_LIBRARY_MODULE))
+ set (type MODULE)
endif()
- endif()
- endfunction()
+ add_library (${name} ${type} ${ARGN})
+ target_link_libraries (${name} PRIVATE ${prefix}::Python)
+
+ # customize library name to follow module name rules
+ get_property (type TARGET ${name} PROPERTY TYPE)
+ if (type STREQUAL "MODULE_LIBRARY")
+ set_property (TARGET ${name} PROPERTY PREFIX "")
+ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ set_property (TARGET ${name} PROPERTY SUFFIX ".pyd")
+ endif()
+ endif()
+ endfunction()
+ endif()
+
+ if ("NumPy" IN_LIST ${_PYTHON_PREFIX}_FIND_COMPONENTS AND ${_PYTHON_PREFIX}_NumPy_FOUND
+ AND NOT TARGET ${_PYTHON_PREFIX}::NumPy AND TARGET ${_PYTHON_PREFIX}::Python)
+ add_library (${_PYTHON_PREFIX}::NumPy INTERFACE IMPORTED)
+ set_property (TARGET ${_PYTHON_PREFIX}::NumPy
+ PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${${_PYTHON_PREFIX}_NumPy_INCLUDE_DIR}")
+ target_link_libraries (${_PYTHON_PREFIX}::NumPy INTERFACE ${_PYTHON_PREFIX}::Python)
+ endif()
endif()
# final clean-up
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 998e99223..b9c0b6b73 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -14,11 +14,12 @@ Three components are supported:
* ``Compiler``: search for Python 2 compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
libraries)
+* ``NumPy``: search for NumPy include directories.
If no ``COMPONENTS`` is specified, ``Interpreter`` is assumed.
-To ensure consistent versions between components ``Interpreter``, ``Compiler``
-and ``Development``, specify all components at the same time::
+To ensure consistent versions between components ``Interpreter``, ``Compiler``,
+``Development`` and ``NumPy``, specify all components at the same time::
find_package (Python2 COMPONENTS Interpreter Development)
@@ -28,10 +29,18 @@ concurrently with :module:`FindPython3` module to use both Python versions.
The :module:`FindPython` module can be used if Python version does not matter
for you.
+.. note::
+
+ If components ``Interpreter`` and ``Development`` are both specified, this
+ module search only for interpreter with same platform architecture as the one
+ defined by ``CMake`` configuration. This contraint does not apply if only
+ ``Interpreter`` component is specified.
+
Imported Targets
^^^^^^^^^^^^^^^^
-This module defines the following :ref:`Imported Targets <Imported Targets>`:
+This module defines the following :ref:`Imported Targets <Imported Targets>`
+(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
``Python2::Interpreter``
Python 2 interpreter. Target defined if component ``Interpreter`` is found.
@@ -39,6 +48,8 @@ This module defines the following :ref:`Imported Targets <Imported Targets>`:
Python 2 compiler. Target defined if component ``Compiler`` is found.
``Python2::Python``
Python 2 library. Target defined if component ``Development`` is found.
+``Python2::NumPy``
+ NumPy library for Python 2. Target defined if component ``NumPy`` is found.
Result Variables
^^^^^^^^^^^^^^^^
@@ -104,6 +115,12 @@ This module will set the following variables in your project
Python 2 minor version.
``Python2_VERSION_PATCH``
Python 2 patch version.
+``Python2_NumPy_FOUND``
+ System has the NumPy.
+``Python2_NumPy_INCLUDE_DIRS``
+ The NumPy include directries.
+``Python2_NumPy_VERSION``
+ The NumPy version.
Hints
^^^^^
@@ -145,9 +162,10 @@ Hints
Commands
^^^^^^^^
-This module defines the command ``Python2_add_library`` which have the same
-semantic as :command:`add_library` but take care of Python module naming rules
-(only applied if library is of type ``MODULE``) and add dependency to target
+This module defines the command ``Python2_add_library`` (when
+:prop_gbl:`CMAKE_ROLE` is ``PROJECT``), which has the same semantics as
+:command:`add_library`, but takes care of Python module naming rules
+(only applied if library is of type ``MODULE``), and adds a dependency to target
``Python2::Python``::
Python2_add_library (my_module MODULE src1.cpp)
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 2176f3f4f..c2f338469 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -14,11 +14,12 @@ Three components are supported:
* ``Compiler``: search for Python 3 compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
libraries)
+* ``NumPy``: search for NumPy include directories.
If no ``COMPONENTS`` is specified, ``Interpreter`` is assumed.
-To ensure consistent versions between components ``Interpreter``, ``Compiler``
-and ``Development``, specify all components at the same time::
+To ensure consistent versions between components ``Interpreter``, ``Compiler``,
+``Development`` and ``NumPy``, specify all components at the same time::
find_package (Python3 COMPONENTS Interpreter Development)
@@ -28,10 +29,18 @@ concurrently with :module:`FindPython2` module to use both Python versions.
The :module:`FindPython` module can be used if Python version does not matter
for you.
+.. note::
+
+ If components ``Interpreter`` and ``Development`` are both specified, this
+ module search only for interpreter with same platform architecture as the one
+ defined by ``CMake`` configuration. This contraint does not apply if only
+ ``Interpreter`` component is specified.
+
Imported Targets
^^^^^^^^^^^^^^^^
-This module defines the following :ref:`Imported Targets <Imported Targets>`:
+This module defines the following :ref:`Imported Targets <Imported Targets>`
+(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
``Python3::Interpreter``
Python 3 interpreter. Target defined if component ``Interpreter`` is found.
@@ -39,6 +48,8 @@ This module defines the following :ref:`Imported Targets <Imported Targets>`:
Python 3 compiler. Target defined if component ``Compiler`` is found.
``Python3::Python``
Python 3 library. Target defined if component ``Development`` is found.
+``Python3::NumPy``
+ NumPy library for Python 3. Target defined if component ``NumPy`` is found.
Result Variables
^^^^^^^^^^^^^^^^
@@ -104,6 +115,12 @@ This module will set the following variables in your project
Python 3 minor version.
``Python3_VERSION_PATCH``
Python 3 patch version.
+``Python3_NumPy_FOUND``
+ System has the NumPy.
+``Python3_NumPy_INCLUDE_DIRS``
+ The NumPy include directries.
+``Python3_NumPy_VERSION``
+ The NumPy version.
Hints
^^^^^
@@ -145,9 +162,10 @@ Hints
Commands
^^^^^^^^
-This module defines the command ``Python3_add_library`` which have the same
-semantic as :command:`add_library` but take care of Python module naming rules
-(only applied if library is of type ``MODULE``) and add dependency to target
+This module defines the command ``Python3_add_library`` (when
+:prop_gbl:`CMAKE_ROLE` is ``PROJECT``), which has the same semantics as
+:command:`add_library`, but takes care of Python module naming rules
+(only applied if library is of type ``MODULE``), and adds a dependency to target
``Python3::Python``::
Python3_add_library (my_module MODULE src1.cpp)
diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake
index 370e5e422..da33301af 100644
--- a/Modules/FindPythonInterp.cmake
+++ b/Modules/FindPythonInterp.cmake
@@ -1,44 +1,45 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPythonInterp
-# ----------------
-#
-# Find python interpreter
-#
-# .. deprecated:: 3.12
-#
-# Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
-#
-# This module finds if Python interpreter is installed and determines
-# where the executables are. This code sets the following variables:
-#
-# ::
-#
-# PYTHONINTERP_FOUND - Was the Python executable found
-# PYTHON_EXECUTABLE - path to the Python interpreter
-#
-#
-#
-# ::
-#
-# PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
-# PYTHON_VERSION_MAJOR - Python major version found e.g. 2
-# PYTHON_VERSION_MINOR - Python minor version found e.g. 5
-# PYTHON_VERSION_PATCH - Python patch version found e.g. 2
-#
-#
-#
-# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
-# of version numbers that should be taken into account when searching
-# for Python. You need to set this variable before calling
-# find_package(PythonInterp).
-#
-# If calling both ``find_package(PythonInterp)`` and
-# ``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
-# get the currently active Python version by default with a consistent version
-# of PYTHON_LIBRARIES.
+#[=======================================================================[.rst:
+FindPythonInterp
+----------------
+
+.. deprecated:: 3.12
+
+ Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
+
+Find python interpreter
+
+This module finds if Python interpreter is installed and determines
+where the executables are. This code sets the following variables:
+
+::
+
+ PYTHONINTERP_FOUND - Was the Python executable found
+ PYTHON_EXECUTABLE - path to the Python interpreter
+
+
+
+::
+
+ PYTHON_VERSION_STRING - Python version found e.g. 2.5.2
+ PYTHON_VERSION_MAJOR - Python major version found e.g. 2
+ PYTHON_VERSION_MINOR - Python minor version found e.g. 5
+ PYTHON_VERSION_PATCH - Python patch version found e.g. 2
+
+
+
+The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
+of version numbers that should be taken into account when searching
+for Python. You need to set this variable before calling
+find_package(PythonInterp).
+
+If calling both ``find_package(PythonInterp)`` and
+``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
+get the currently active Python version by default with a consistent version
+of PYTHON_LIBRARIES.
+#]=======================================================================]
unset(_Python_NAMES)
@@ -129,7 +130,9 @@ if(PYTHON_EXECUTABLE)
endif()
else()
# sys.version predates sys.version_info, so use that
- execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sys; sys.stdout.write(sys.version)"
+ # sys.version was first documented for Python 1.5, so assume version 1.4
+ # if retrieving sys.version fails.
+ execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "try: import sys; sys.stdout.write(sys.version)\nexcept: sys.stdout.write(\"1.4.0\")"
OUTPUT_VARIABLE _VERSION
RESULT_VARIABLE _PYTHON_VERSION_RESULT
ERROR_QUIET)
@@ -143,12 +146,10 @@ if(PYTHON_EXECUTABLE)
set(PYTHON_VERSION_PATCH "0")
endif()
else()
- # sys.version was first documented for Python 1.5, so assume
- # this is older.
- set(PYTHON_VERSION_STRING "1.4")
- set(PYTHON_VERSION_MAJOR "1")
- set(PYTHON_VERSION_MINOR "4")
- set(PYTHON_VERSION_PATCH "0")
+ unset(PYTHON_VERSION_STRING)
+ unset(PYTHON_VERSION_MAJOR)
+ unset(PYTHON_VERSION_MINOR)
+ unset(PYTHON_VERSION_PATCH)
endif()
endif()
unset(_PYTHON_VERSION_RESULT)
diff --git a/Modules/FindPythonLibs.cmake b/Modules/FindPythonLibs.cmake
index 6da87a88f..1d62ac43e 100644
--- a/Modules/FindPythonLibs.cmake
+++ b/Modules/FindPythonLibs.cmake
@@ -1,48 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindPythonLibs
-# --------------
-#
-# Find python libraries
-#
-# .. deprecated:: 3.12
-#
-# Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
-#
-# This module finds if Python is installed and determines where the
-# include files and libraries are. It also determines what the name of
-# the library is. This code sets the following variables:
-#
-# ::
-#
-# PYTHONLIBS_FOUND - have the Python libs been found
-# PYTHON_LIBRARIES - path to the python library
-# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
-# PYTHON_INCLUDE_DIRS - path to where Python.h is found
-# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
-# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
-#
-#
-#
-# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
-# of version numbers that should be taken into account when searching
-# for Python. You need to set this variable before calling
-# find_package(PythonLibs).
-#
-# If you'd like to specify the installation of Python to use, you should
-# modify the following cache variables:
-#
-# ::
-#
-# PYTHON_LIBRARY - path to the python library
-# PYTHON_INCLUDE_DIR - path to where Python.h is found
-#
-# If calling both ``find_package(PythonInterp)`` and
-# ``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
-# get the currently active Python version by default with a consistent version
-# of PYTHON_LIBRARIES.
+#[=======================================================================[.rst:
+FindPythonLibs
+--------------
+
+.. deprecated:: 3.12
+
+ Use :module:`FindPython3`, :module:`FindPython2` or :module:`FindPython` instead.
+
+Find python libraries
+
+This module finds if Python is installed and determines where the
+include files and libraries are. It also determines what the name of
+the library is. This code sets the following variables:
+
+::
+
+ PYTHONLIBS_FOUND - have the Python libs been found
+ PYTHON_LIBRARIES - path to the python library
+ PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
+ PYTHON_INCLUDE_DIRS - path to where Python.h is found
+ PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
+ PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
+
+
+
+The Python_ADDITIONAL_VERSIONS variable can be used to specify a list
+of version numbers that should be taken into account when searching
+for Python. You need to set this variable before calling
+find_package(PythonLibs).
+
+If you'd like to specify the installation of Python to use, you should
+modify the following cache variables:
+
+::
+
+ PYTHON_LIBRARY - path to the python library
+ PYTHON_INCLUDE_DIR - path to where Python.h is found
+
+If calling both ``find_package(PythonInterp)`` and
+``find_package(PythonLibs)``, call ``find_package(PythonInterp)`` first to
+get the currently active Python version by default with a consistent version
+of PYTHON_LIBRARIES.
+#]=======================================================================]
# Use the executable's path as a hint
set(_Python_LIBRARY_PATH_HINT)
diff --git a/Modules/FindQt.cmake b/Modules/FindQt.cmake
index 68dfa7d28..d6a06628e 100644
--- a/Modules/FindQt.cmake
+++ b/Modules/FindQt.cmake
@@ -1,37 +1,46 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindQt
-# ------
-#
-# Searches for all installed versions of Qt.
-#
-# This should only be used if your project can work with multiple
-# versions of Qt. If not, you should just directly use FindQt4 or
-# FindQt3. If multiple versions of Qt are found on the machine, then
-# The user must set the option DESIRED_QT_VERSION to the version they
-# want to use. If only one version of qt is found on the machine, then
-# the DESIRED_QT_VERSION is set to that version and the matching FindQt3
-# or FindQt4 module is included. Once the user sets DESIRED_QT_VERSION,
-# then the FindQt3 or FindQt4 module is included.
-#
-# This module can only detect and switch between Qt versions 3 and 4. It
-# cannot handle Qt5 or any later versions.
-#
-# ::
-#
-# QT_REQUIRED if this is set to TRUE then if CMake can
-# not find Qt4 or Qt3 an error is raised
-# and a message is sent to the user.
-#
-#
-#
-# ::
-#
-# DESIRED_QT_VERSION OPTION is created
-# QT4_INSTALLED is set to TRUE if qt4 is found.
-# QT3_INSTALLED is set to TRUE if qt3 is found.
+#[=======================================================================[.rst:
+FindQt
+------
+
+Searches for all installed versions of Qt3 or Qt4.
+
+This module cannot handle Qt5 or any later versions.
+For those, see :manual:`cmake-qt(7)`.
+
+This module exists for the :command:`find_package` command only if
+policy :policy:`CMP0084` is not set to ``NEW``.
+
+This module should only be used if your project can work with multiple
+versions of Qt. If not, you should just directly use FindQt4 or
+FindQt3. If multiple versions of Qt are found on the machine, then
+The user must set the option DESIRED_QT_VERSION to the version they
+want to use. If only one version of qt is found on the machine, then
+the DESIRED_QT_VERSION is set to that version and the matching FindQt3
+or FindQt4 module is included. Once the user sets DESIRED_QT_VERSION,
+then the FindQt3 or FindQt4 module is included.
+
+::
+
+ QT_REQUIRED if this is set to TRUE then if CMake can
+ not find Qt4 or Qt3 an error is raised
+ and a message is sent to the user.
+
+
+
+::
+
+ DESIRED_QT_VERSION OPTION is created
+ QT4_INSTALLED is set to TRUE if qt4 is found.
+ QT3_INSTALLED is set to TRUE if qt3 is found.
+#]=======================================================================]
+
+if(_findqt_testing)
+ set(_findqt_included TRUE)
+ return()
+endif()
# look for signs of qt3 installations
file(GLOB GLOB_TEMP_VAR /usr/lib*/qt-3*/bin/qmake /usr/lib*/qt3*/bin/qmake)
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index a034210d8..4a8e28b1b 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindQt3
-# -------
-#
-# Locate Qt include paths and libraries
-#
-# This module defines:
-#
-# ::
-#
-# QT_INCLUDE_DIR - where to find qt.h, etc.
-# QT_LIBRARIES - the libraries to link against to use Qt.
-# QT_DEFINITIONS - definitions to use when
-# compiling code that uses Qt.
-# QT_FOUND - If false, don't try to use Qt.
-# QT_VERSION_STRING - the version of Qt found
-#
-#
-#
-# If you need the multithreaded version of Qt, set QT_MT_REQUIRED to
-# TRUE
-#
-# Also defined, but not for general use are:
-#
-# ::
-#
-# QT_MOC_EXECUTABLE, where to find the moc tool.
-# QT_UIC_EXECUTABLE, where to find the uic tool.
-# QT_QT_LIBRARY, where to find the Qt library.
-# QT_QTMAIN_LIBRARY, where to find the qtmain
-# library. This is only required by Qt3 on Windows.
+#[=======================================================================[.rst:
+FindQt3
+-------
+
+Locate Qt include paths and libraries
+
+This module defines:
+
+::
+
+ QT_INCLUDE_DIR - where to find qt.h, etc.
+ QT_LIBRARIES - the libraries to link against to use Qt.
+ QT_DEFINITIONS - definitions to use when
+ compiling code that uses Qt.
+ QT_FOUND - If false, don't try to use Qt.
+ QT_VERSION_STRING - the version of Qt found
+
+
+
+If you need the multithreaded version of Qt, set QT_MT_REQUIRED to
+TRUE
+
+Also defined, but not for general use are:
+
+::
+
+ QT_MOC_EXECUTABLE, where to find the moc tool.
+ QT_UIC_EXECUTABLE, where to find the uic tool.
+ QT_QT_LIBRARY, where to find the Qt library.
+ QT_QTMAIN_LIBRARY, where to find the qtmain
+ library. This is only required by Qt3 on Windows.
+#]=======================================================================]
# These are around for backwards compatibility
# they will be set
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 847a798af..a145b4649 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -1,304 +1,305 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindQt4
-# -------
-#
-# Finding and Using Qt4
-# ^^^^^^^^^^^^^^^^^^^^^
-#
-# This module can be used to find Qt4. The most important issue is that
-# the Qt4 qmake is available via the system path. This qmake is then
-# used to detect basically everything else. This module defines a
-# number of :prop_tgt:`IMPORTED` targets, macros and variables.
-#
-# Typical usage could be something like:
-#
-# .. code-block:: cmake
-#
-# set(CMAKE_AUTOMOC ON)
-# set(CMAKE_INCLUDE_CURRENT_DIR ON)
-# find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
-# add_executable(myexe main.cpp)
-# target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
-#
-# .. note::
-#
-# When using :prop_tgt:`IMPORTED` targets, the qtmain.lib static library is
-# automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>`
-# executables. To disable that globally, set the
-# ``QT4_NO_LINK_QTMAIN`` variable before finding Qt4. To disable that
-# for a particular executable, set the ``QT4_NO_LINK_QTMAIN`` target
-# property to ``TRUE`` on the executable.
-#
-# Qt Build Tools
-# ^^^^^^^^^^^^^^
-#
-# Qt relies on some bundled tools for code generation, such as ``moc`` for
-# meta-object code generation,``uic`` for widget layout and population,
-# and ``rcc`` for virtual filesystem content generation. These tools may be
-# automatically invoked by :manual:`cmake(1)` if the appropriate conditions
-# are met. See :manual:`cmake-qt(7)` for more.
-#
-# Qt Macros
-# ^^^^^^^^^
-#
-# In some cases it can be necessary or useful to invoke the Qt build tools in a
-# more-manual way. Several macros are available to add targets for such uses.
-#
-# ::
-#
-# macro QT4_WRAP_CPP(outfiles inputfile ... [TARGET tgt] OPTIONS ...)
-# create moc code from a list of files containing Qt class with
-# the Q_OBJECT declaration. Per-directory preprocessor definitions
-# are also added. If the <tgt> is specified, the
-# INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
-# the <tgt> are passed to moc. Options may be given to moc, such as
-# those found when executing "moc -help".
-#
-#
-# ::
-#
-# macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
-# create code from a list of Qt designer ui files.
-# Options may be given to uic, such as those found
-# when executing "uic -help"
-#
-#
-# ::
-#
-# macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
-# create code from a list of Qt resource files.
-# Options may be given to rcc, such as those found
-# when executing "rcc -help"
-#
-#
-# ::
-#
-# macro QT4_GENERATE_MOC(inputfile outputfile [TARGET tgt])
-# creates a rule to run moc on infile and create outfile.
-# Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
-# because you need a custom filename for the moc file or something
-# similar. If the <tgt> is specified, the
-# INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
-# the <tgt> are passed to moc.
-#
-#
-# ::
-#
-# macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
-# Create the interface header and implementation files with the
-# given basename from the given interface xml file and add it to
-# the list of sources.
-#
-# You can pass additional parameters to the qdbusxml2cpp call by setting
-# properties on the input file:
-#
-# INCLUDE the given file will be included in the generate interface header
-#
-# CLASSNAME the generated class is named accordingly
-#
-# NO_NAMESPACE the generated class is not wrapped in a namespace
-#
-#
-# ::
-#
-# macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
-# Create the interface header and implementation files
-# for all listed interface xml files.
-# The basename will be automatically determined from the name
-# of the xml file.
-#
-# The source file properties described for
-# QT4_ADD_DBUS_INTERFACE also apply here.
-#
-#
-# ::
-#
-# macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname
-# [basename] [classname])
-# create a dbus adaptor (header and implementation file) from the xml file
-# describing the interface, and add it to the list of sources. The adaptor
-# forwards the calls to a parent class, defined in parentheader and named
-# parentclassname. The name of the generated files will be
-# <basename>adaptor.{cpp,h} where basename defaults to the basename of the
-# xml file.
-# If <classname> is provided, then it will be used as the classname of the
-# adaptor itself.
-#
-#
-# ::
-#
-# macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
-# generate the xml interface file from the given header.
-# If the optional argument interfacename is omitted, the name of the
-# interface file is constructed from the basename of the header with
-# the suffix .xml appended.
-# Options may be given to qdbuscpp2xml, such as those found when
-# executing "qdbuscpp2xml --help"
-#
-#
-# ::
-#
-# macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
-# ts_files ... OPTIONS ...)
-# out: qm_files
-# in: directories sources ts_files
-# options: flags to pass to lupdate, such as -extensions to specify
-# extensions for a directory scan.
-# generates commands to create .ts (vie lupdate) and .qm
-# (via lrelease) - files from directories and/or sources. The ts files are
-# created and/or updated in the source tree (unless given with full paths).
-# The qm files are generated in the build tree.
-# Updating the translations can be done by adding the qm_files
-# to the source list of your library/executable, so they are
-# always updated, or by adding a custom target to control when
-# they get updated/generated.
-#
-#
-# ::
-#
-# macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
-# out: qm_files
-# in: ts_files
-# generates commands to create .qm from .ts - files. The generated
-# filenames can be found in qm_files. The ts_files
-# must exist and are not updated in any way.
-#
-#
-# ::
-#
-# macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... [TARGET tgt])
-# The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.
-# This macro is still experimental.
-# It can be used to have moc automatically handled.
-# So if you have the files foo.h and foo.cpp, and in foo.h a
-# a class uses the Q_OBJECT macro, moc has to run on it. If you don't
-# want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
-# #include "foo.moc"
-# in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will
-# scan all listed files at cmake-time for such included moc files and if it
-# finds them cause a rule to be generated to run moc at build time on the
-# accompanying header file foo.h.
-# If a source file has the SKIP_AUTOMOC property set it will be ignored by
-# this macro.
-# If the <tgt> is specified, the INTERFACE_INCLUDE_DIRECTORIES and
-# INTERFACE_COMPILE_DEFINITIONS from the <tgt> are passed to moc.
-#
-#
-# ::
-#
-# function QT4_USE_MODULES( target [link_type] modules...)
-# This function is obsolete. Use target_link_libraries with IMPORTED targets
-# instead.
-# Make <target> use the <modules> from Qt. Using a Qt module means
-# to link to the library, add the relevant include directories for the
-# module, and add the relevant compiler defines for using the module.
-# Modules are roughly equivalent to components of Qt4, so usage would be
-# something like:
-# qt4_use_modules(myexe Core Gui Declarative)
-# to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument
-# can be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the
-# same argument to the target_link_libraries call.
-#
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# A particular Qt library may be used by using the corresponding
-# :prop_tgt:`IMPORTED` target with the :command:`target_link_libraries`
-# command:
-#
-# .. code-block:: cmake
-#
-# target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
-#
-# Using a target in this way causes :cmake(1)` to use the appropriate include
-# directories and compile definitions for the target when compiling ``myexe``.
-#
-# Targets are aware of their dependencies, so for example it is not necessary
-# to list ``Qt4::QtCore`` if another Qt library is listed, and it is not
-# necessary to list ``Qt4::QtGui`` if ``Qt4::QtDeclarative`` is listed.
-# Targets may be tested for existence in the usual way with the
-# :command:`if(TARGET)` command.
-#
-# The Qt toolkit may contain both debug and release libraries.
-# :manual:`cmake(1)` will choose the appropriate version based on the build
-# configuration.
-#
-# ``Qt4::QtCore``
-# The QtCore target
-# ``Qt4::QtGui``
-# The QtGui target
-# ``Qt4::Qt3Support``
-# The Qt3Support target
-# ``Qt4::QtAssistant``
-# The QtAssistant target
-# ``Qt4::QtAssistantClient``
-# The QtAssistantClient target
-# ``Qt4::QAxContainer``
-# The QAxContainer target (Windows only)
-# ``Qt4::QAxServer``
-# The QAxServer target (Windows only)
-# ``Qt4::QtDBus``
-# The QtDBus target
-# ``Qt4::QtDeclarative``
-# The QtDeclarative target
-# ``Qt4::QtDesigner``
-# The QtDesigner target
-# ``Qt4::QtDesignerComponents``
-# The QtDesignerComponents target
-# ``Qt4::QtHelp``
-# The QtHelp target
-# ``Qt4::QtMotif``
-# The QtMotif target
-# ``Qt4::QtMultimedia``
-# The QtMultimedia target
-# ``Qt4::QtNetwork``
-# The QtNetwork target
-# ``Qt4::QtNsPLugin``
-# The QtNsPLugin target
-# ``Qt4::QtOpenGL``
-# The QtOpenGL target
-# ``Qt4::QtScript``
-# The QtScript target
-# ``Qt4::QtScriptTools``
-# The QtScriptTools target
-# ``Qt4::QtSql``
-# The QtSql target
-# ``Qt4::QtSvg``
-# The QtSvg target
-# ``Qt4::QtTest``
-# The QtTest target
-# ``Qt4::QtUiTools``
-# The QtUiTools target
-# ``Qt4::QtWebKit``
-# The QtWebKit target
-# ``Qt4::QtXml``
-# The QtXml target
-# ``Qt4::QtXmlPatterns``
-# The QtXmlPatterns target
-# ``Qt4::phonon``
-# The phonon target
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# Below is a detailed list of variables that FindQt4.cmake sets.
-#
-# ``Qt4_FOUND``
-# If false, don't try to use Qt 4.
-# ``QT_FOUND``
-# If false, don't try to use Qt. This variable is for compatibility only.
-# ``QT4_FOUND``
-# If false, don't try to use Qt 4. This variable is for compatibility only.
-# ``QT_VERSION_MAJOR``
-# The major version of Qt found.
-# ``QT_VERSION_MINOR``
-# The minor version of Qt found.
-# ``QT_VERSION_PATCH``
-# The patch version of Qt found.
+#[=======================================================================[.rst:
+FindQt4
+-------
+
+Finding and Using Qt4
+^^^^^^^^^^^^^^^^^^^^^
+
+This module can be used to find Qt4. The most important issue is that
+the Qt4 qmake is available via the system path. This qmake is then
+used to detect basically everything else. This module defines a
+number of :prop_tgt:`IMPORTED` targets, macros and variables.
+
+Typical usage could be something like:
+
+.. code-block:: cmake
+
+ set(CMAKE_AUTOMOC ON)
+ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ find_package(Qt4 4.4.3 REQUIRED QtGui QtXml)
+ add_executable(myexe main.cpp)
+ target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
+
+.. note::
+
+ When using :prop_tgt:`IMPORTED` targets, the qtmain.lib static library is
+ automatically linked on Windows for :prop_tgt:`WIN32 <WIN32_EXECUTABLE>`
+ executables. To disable that globally, set the
+ ``QT4_NO_LINK_QTMAIN`` variable before finding Qt4. To disable that
+ for a particular executable, set the ``QT4_NO_LINK_QTMAIN`` target
+ property to ``TRUE`` on the executable.
+
+Qt Build Tools
+^^^^^^^^^^^^^^
+
+Qt relies on some bundled tools for code generation, such as ``moc`` for
+meta-object code generation,``uic`` for widget layout and population,
+and ``rcc`` for virtual filesystem content generation. These tools may be
+automatically invoked by :manual:`cmake(1)` if the appropriate conditions
+are met. See :manual:`cmake-qt(7)` for more.
+
+Qt Macros
+^^^^^^^^^
+
+In some cases it can be necessary or useful to invoke the Qt build tools in a
+more-manual way. Several macros are available to add targets for such uses.
+
+::
+
+ macro QT4_WRAP_CPP(outfiles inputfile ... [TARGET tgt] OPTIONS ...)
+ create moc code from a list of files containing Qt class with
+ the Q_OBJECT declaration. Per-directory preprocessor definitions
+ are also added. If the <tgt> is specified, the
+ INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
+ the <tgt> are passed to moc. Options may be given to moc, such as
+ those found when executing "moc -help".
+
+
+::
+
+ macro QT4_WRAP_UI(outfiles inputfile ... OPTIONS ...)
+ create code from a list of Qt designer ui files.
+ Options may be given to uic, such as those found
+ when executing "uic -help"
+
+
+::
+
+ macro QT4_ADD_RESOURCES(outfiles inputfile ... OPTIONS ...)
+ create code from a list of Qt resource files.
+ Options may be given to rcc, such as those found
+ when executing "rcc -help"
+
+
+::
+
+ macro QT4_GENERATE_MOC(inputfile outputfile [TARGET tgt])
+ creates a rule to run moc on infile and create outfile.
+ Use this if for some reason QT4_WRAP_CPP() isn't appropriate, e.g.
+ because you need a custom filename for the moc file or something
+ similar. If the <tgt> is specified, the
+ INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS from
+ the <tgt> are passed to moc.
+
+
+::
+
+ macro QT4_ADD_DBUS_INTERFACE(outfiles interface basename)
+ Create the interface header and implementation files with the
+ given basename from the given interface xml file and add it to
+ the list of sources.
+
+ You can pass additional parameters to the qdbusxml2cpp call by setting
+ properties on the input file:
+
+ INCLUDE the given file will be included in the generate interface header
+
+ CLASSNAME the generated class is named accordingly
+
+ NO_NAMESPACE the generated class is not wrapped in a namespace
+
+
+::
+
+ macro QT4_ADD_DBUS_INTERFACES(outfiles inputfile ... )
+ Create the interface header and implementation files
+ for all listed interface xml files.
+ The basename will be automatically determined from the name
+ of the xml file.
+
+ The source file properties described for
+ QT4_ADD_DBUS_INTERFACE also apply here.
+
+
+::
+
+ macro QT4_ADD_DBUS_ADAPTOR(outfiles xmlfile parentheader parentclassname
+ [basename] [classname])
+ create a dbus adaptor (header and implementation file) from the xml file
+ describing the interface, and add it to the list of sources. The adaptor
+ forwards the calls to a parent class, defined in parentheader and named
+ parentclassname. The name of the generated files will be
+ <basename>adaptor.{cpp,h} where basename defaults to the basename of the
+ xml file.
+ If <classname> is provided, then it will be used as the classname of the
+ adaptor itself.
+
+
+::
+
+ macro QT4_GENERATE_DBUS_INTERFACE( header [interfacename] OPTIONS ...)
+ generate the xml interface file from the given header.
+ If the optional argument interfacename is omitted, the name of the
+ interface file is constructed from the basename of the header with
+ the suffix .xml appended.
+ Options may be given to qdbuscpp2xml, such as those found when
+ executing "qdbuscpp2xml --help"
+
+
+::
+
+ macro QT4_CREATE_TRANSLATION( qm_files directories ... sources ...
+ ts_files ... OPTIONS ...)
+ out: qm_files
+ in: directories sources ts_files
+ options: flags to pass to lupdate, such as -extensions to specify
+ extensions for a directory scan.
+ generates commands to create .ts (vie lupdate) and .qm
+ (via lrelease) - files from directories and/or sources. The ts files are
+ created and/or updated in the source tree (unless given with full paths).
+ The qm files are generated in the build tree.
+ Updating the translations can be done by adding the qm_files
+ to the source list of your library/executable, so they are
+ always updated, or by adding a custom target to control when
+ they get updated/generated.
+
+
+::
+
+ macro QT4_ADD_TRANSLATION( qm_files ts_files ... )
+ out: qm_files
+ in: ts_files
+ generates commands to create .qm from .ts - files. The generated
+ filenames can be found in qm_files. The ts_files
+ must exist and are not updated in any way.
+
+
+::
+
+ macro QT4_AUTOMOC(sourcefile1 sourcefile2 ... [TARGET tgt])
+ The qt4_automoc macro is obsolete. Use the CMAKE_AUTOMOC feature instead.
+ This macro is still experimental.
+ It can be used to have moc automatically handled.
+ So if you have the files foo.h and foo.cpp, and in foo.h a
+ a class uses the Q_OBJECT macro, moc has to run on it. If you don't
+ want to use QT4_WRAP_CPP() (which is reliable and mature), you can insert
+ #include "foo.moc"
+ in foo.cpp and then give foo.cpp as argument to QT4_AUTOMOC(). This will
+ scan all listed files at cmake-time for such included moc files and if it
+ finds them cause a rule to be generated to run moc at build time on the
+ accompanying header file foo.h.
+ If a source file has the SKIP_AUTOMOC property set it will be ignored by
+ this macro.
+ If the <tgt> is specified, the INTERFACE_INCLUDE_DIRECTORIES and
+ INTERFACE_COMPILE_DEFINITIONS from the <tgt> are passed to moc.
+
+
+::
+
+ function QT4_USE_MODULES( target [link_type] modules...)
+ This function is obsolete. Use target_link_libraries with IMPORTED targets
+ instead.
+ Make <target> use the <modules> from Qt. Using a Qt module means
+ to link to the library, add the relevant include directories for the
+ module, and add the relevant compiler defines for using the module.
+ Modules are roughly equivalent to components of Qt4, so usage would be
+ something like:
+ qt4_use_modules(myexe Core Gui Declarative)
+ to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument
+ can be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the
+ same argument to the target_link_libraries call.
+
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+A particular Qt library may be used by using the corresponding
+:prop_tgt:`IMPORTED` target with the :command:`target_link_libraries`
+command:
+
+.. code-block:: cmake
+
+ target_link_libraries(myexe Qt4::QtGui Qt4::QtXml)
+
+Using a target in this way causes :cmake(1)` to use the appropriate include
+directories and compile definitions for the target when compiling ``myexe``.
+
+Targets are aware of their dependencies, so for example it is not necessary
+to list ``Qt4::QtCore`` if another Qt library is listed, and it is not
+necessary to list ``Qt4::QtGui`` if ``Qt4::QtDeclarative`` is listed.
+Targets may be tested for existence in the usual way with the
+:command:`if(TARGET)` command.
+
+The Qt toolkit may contain both debug and release libraries.
+:manual:`cmake(1)` will choose the appropriate version based on the build
+configuration.
+
+``Qt4::QtCore``
+ The QtCore target
+``Qt4::QtGui``
+ The QtGui target
+``Qt4::Qt3Support``
+ The Qt3Support target
+``Qt4::QtAssistant``
+ The QtAssistant target
+``Qt4::QtAssistantClient``
+ The QtAssistantClient target
+``Qt4::QAxContainer``
+ The QAxContainer target (Windows only)
+``Qt4::QAxServer``
+ The QAxServer target (Windows only)
+``Qt4::QtDBus``
+ The QtDBus target
+``Qt4::QtDeclarative``
+ The QtDeclarative target
+``Qt4::QtDesigner``
+ The QtDesigner target
+``Qt4::QtDesignerComponents``
+ The QtDesignerComponents target
+``Qt4::QtHelp``
+ The QtHelp target
+``Qt4::QtMotif``
+ The QtMotif target
+``Qt4::QtMultimedia``
+ The QtMultimedia target
+``Qt4::QtNetwork``
+ The QtNetwork target
+``Qt4::QtNsPLugin``
+ The QtNsPLugin target
+``Qt4::QtOpenGL``
+ The QtOpenGL target
+``Qt4::QtScript``
+ The QtScript target
+``Qt4::QtScriptTools``
+ The QtScriptTools target
+``Qt4::QtSql``
+ The QtSql target
+``Qt4::QtSvg``
+ The QtSvg target
+``Qt4::QtTest``
+ The QtTest target
+``Qt4::QtUiTools``
+ The QtUiTools target
+``Qt4::QtWebKit``
+ The QtWebKit target
+``Qt4::QtXml``
+ The QtXml target
+``Qt4::QtXmlPatterns``
+ The QtXmlPatterns target
+``Qt4::phonon``
+ The phonon target
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+ Below is a detailed list of variables that FindQt4.cmake sets.
+
+``Qt4_FOUND``
+ If false, don't try to use Qt 4.
+``QT_FOUND``
+ If false, don't try to use Qt. This variable is for compatibility only.
+``QT4_FOUND``
+ If false, don't try to use Qt 4. This variable is for compatibility only.
+``QT_VERSION_MAJOR``
+ The major version of Qt found.
+``QT_VERSION_MINOR``
+ The minor version of Qt found.
+``QT_VERSION_PATCH``
+ The patch version of Qt found.
+#]=======================================================================]
# Use find_package( Qt4 COMPONENTS ... ) to enable modules
if( Qt4_FIND_COMPONENTS )
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index 995d8826b..107486daa 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -1,20 +1,21 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindQuickTime
-# -------------
-#
-#
-#
-# Locate QuickTime This module defines QUICKTIME_LIBRARY
-# QUICKTIME_FOUND, if false, do not try to link to gdal
-# QUICKTIME_INCLUDE_DIR, where to find the headers
-#
-# $QUICKTIME_DIR is an environment variable that would correspond to the
-# ./configure --prefix=$QUICKTIME_DIR
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindQuickTime
+-------------
+
+
+
+Locate QuickTime This module defines QUICKTIME_LIBRARY
+QUICKTIME_FOUND, if false, do not try to link to gdal
+QUICKTIME_INCLUDE_DIR, where to find the headers
+
+$QUICKTIME_DIR is an environment variable that would correspond to the
+./configure --prefix=$QUICKTIME_DIR
+
+Created by Eric Wing.
+#]=======================================================================]
find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h QuickTime.h
HINTS
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index b2ef0761a..54d2bec9f 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindRTI
-# -------
-#
-# Try to find M&S HLA RTI libraries
-#
-# This module finds if any HLA RTI is installed and locates the standard
-# RTI include files and libraries.
-#
-# RTI is a simulation infrastructure standardized by IEEE and SISO. It
-# has a well defined C++ API that assures that simulation applications
-# are independent on a particular RTI implementation.
-#
-# ::
-#
-# http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
-#
-#
-#
-# This code sets the following variables:
-#
-# ::
-#
-# RTI_INCLUDE_DIR = the directory where RTI includes file are found
-# RTI_LIBRARIES = The libraries to link against to use RTI
-# RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
-# RTI_FOUND = Set to FALSE if any HLA RTI was not found
-#
-#
-#
-# Report problems to <certi-devel@nongnu.org>
+#[=======================================================================[.rst:
+FindRTI
+-------
+
+Try to find M&S HLA RTI libraries
+
+This module finds if any HLA RTI is installed and locates the standard
+RTI include files and libraries.
+
+RTI is a simulation infrastructure standardized by IEEE and SISO. It
+has a well defined C++ API that assures that simulation applications
+are independent on a particular RTI implementation.
+
+::
+
+ http://en.wikipedia.org/wiki/Run-Time_Infrastructure_(simulation)
+
+
+
+This code sets the following variables:
+
+::
+
+ RTI_INCLUDE_DIR = the directory where RTI includes file are found
+ RTI_LIBRARIES = The libraries to link against to use RTI
+ RTI_DEFINITIONS = -DRTI_USES_STD_FSTREAM
+ RTI_FOUND = Set to FALSE if any HLA RTI was not found
+
+
+
+Report problems to <certi-devel@nongnu.org>
+#]=======================================================================]
macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
if(NOT ${QUIET})
diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake
index bd9f8357d..58debdd2a 100644
--- a/Modules/FindRuby.cmake
+++ b/Modules/FindRuby.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindRuby
-# --------
-#
-# Find Ruby
-#
-# This module finds if Ruby is installed and determines where the
-# include files and libraries are. Ruby 1.8, 1.9, 2.0 and 2.1 are
-# supported.
-#
-# The minimum required version of Ruby can be specified using the
-# standard syntax, e.g. find_package(Ruby 1.8)
-#
-# It also determines what the name of the library is. This code sets
-# the following variables:
-#
-# ``RUBY_EXECUTABLE``
-# full path to the ruby binary
-# ``RUBY_INCLUDE_DIRS``
-# include dirs to be used when using the ruby library
-# ``RUBY_LIBRARY``
-# full path to the ruby library
-# ``RUBY_VERSION``
-# the version of ruby which was found, e.g. "1.8.7"
-# ``RUBY_FOUND``
-# set to true if ruby ws found successfully
-#
-# Also:
-#
-# ``RUBY_INCLUDE_PATH``
-# same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
+#[=======================================================================[.rst:
+FindRuby
+--------
+
+Find Ruby
+
+This module finds if Ruby is installed and determines where the
+include files and libraries are. Ruby 1.8, 1.9, 2.0 and 2.1 are
+supported.
+
+The minimum required version of Ruby can be specified using the
+standard syntax, e.g. find_package(Ruby 1.8)
+
+It also determines what the name of the library is. This code sets
+the following variables:
+
+``RUBY_EXECUTABLE``
+ full path to the ruby binary
+``RUBY_INCLUDE_DIRS``
+ include dirs to be used when using the ruby library
+``RUBY_LIBRARY``
+ full path to the ruby library
+``RUBY_VERSION``
+ the version of ruby which was found, e.g. "1.8.7"
+``RUBY_FOUND``
+ set to true if ruby ws found successfully
+
+Also:
+
+``RUBY_INCLUDE_PATH``
+ same as RUBY_INCLUDE_DIRS, only provided for compatibility reasons, don't use it
+#]=======================================================================]
# RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
# RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 341001897..281383151 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -1,75 +1,76 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSDL
-# -------
-#
-# Locate SDL library
-#
-# This module defines
-#
-# ::
-#
-# SDL_LIBRARY, the name of the library to link against
-# SDL_FOUND, if false, do not try to link to SDL
-# SDL_INCLUDE_DIR, where to find SDL.h
-# SDL_VERSION_STRING, human-readable string containing the version of SDL
-#
-#
-#
-# This module responds to the flag:
-#
-# ::
-#
-# SDL_BUILDING_LIBRARY
-# If this is defined, then no SDL_main will be linked in because
-# only applications need main().
-# Otherwise, it is assumed you are building an application and this
-# module will attempt to locate and set the proper link flags
-# as part of the returned SDL_LIBRARY variable.
-#
-#
-#
-# Don't forget to include SDLmain.h and SDLmain.m your project for the
-# OS X framework based version. (Other versions link to -lSDLmain which
-# this module will try to find on your behalf.) Also for OS X, this
-# module will automatically add the -framework Cocoa on your behalf.
-#
-#
-#
-# Additional Note: If you see an empty SDL_LIBRARY_TEMP in your
-# configuration and no SDL_LIBRARY, it means CMake did not find your SDL
-# library (SDL.dll, libsdl.so, SDL.framework, etc). Set
-# SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
-# Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this
-# value as appropriate. These values are used to generate the final
-# SDL_LIBRARY variable, but when these values are unset, SDL_LIBRARY
-# does not get created.
-#
-#
-#
-# $SDLDIR is an environment variable that would correspond to the
-# ./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02
-#
-# Modified by Eric Wing. Added code to assist with automated building
-# by using environmental variables and providing a more
-# controlled/consistent search behavior. Added new modifications to
-# recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
-# Also corrected the header search path to follow "proper" SDL
-# guidelines. Added a search for SDLmain which is needed by some
-# platforms. Added a search for threads which is needed by some
-# platforms. Added needed compile switches for MinGW.
-#
-# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of SDL_LIBRARY to
-# override this selection or set the CMake environment
-# CMAKE_INCLUDE_PATH to modify the search paths.
-#
-# Note that the header path has changed from SDL/SDL.h to just SDL.h
-# This needed to change because "proper" SDL convention is #include
-# "SDL.h", not <SDL/SDL.h>. This is done for portability reasons
-# because not all systems place things in SDL/ (see FreeBSD).
+#[=======================================================================[.rst:
+FindSDL
+-------
+
+Locate SDL library
+
+This module defines
+
+::
+
+ SDL_LIBRARY, the name of the library to link against
+ SDL_FOUND, if false, do not try to link to SDL
+ SDL_INCLUDE_DIR, where to find SDL.h
+ SDL_VERSION_STRING, human-readable string containing the version of SDL
+
+
+
+This module responds to the flag:
+
+::
+
+ SDL_BUILDING_LIBRARY
+ If this is defined, then no SDL_main will be linked in because
+ only applications need main().
+ Otherwise, it is assumed you are building an application and this
+ module will attempt to locate and set the proper link flags
+ as part of the returned SDL_LIBRARY variable.
+
+
+
+Don't forget to include SDLmain.h and SDLmain.m your project for the
+OS X framework based version. (Other versions link to -lSDLmain which
+this module will try to find on your behalf.) Also for OS X, this
+module will automatically add the -framework Cocoa on your behalf.
+
+
+
+Additional Note: If you see an empty SDL_LIBRARY_TEMP in your
+configuration and no SDL_LIBRARY, it means CMake did not find your SDL
+library (SDL.dll, libsdl.so, SDL.framework, etc). Set
+SDL_LIBRARY_TEMP to point to your SDL library, and configure again.
+Similarly, if you see an empty SDLMAIN_LIBRARY, you should set this
+value as appropriate. These values are used to generate the final
+SDL_LIBRARY variable, but when these values are unset, SDL_LIBRARY
+does not get created.
+
+
+
+$SDLDIR is an environment variable that would correspond to the
+./configure --prefix=$SDLDIR used in building SDL. l.e.galup 9-20-02
+
+Modified by Eric Wing. Added code to assist with automated building
+by using environmental variables and providing a more
+controlled/consistent search behavior. Added new modifications to
+recognize OS X frameworks and additional Unix paths (FreeBSD, etc).
+Also corrected the header search path to follow "proper" SDL
+guidelines. Added a search for SDLmain which is needed by some
+platforms. Added a search for threads which is needed by some
+platforms. Added needed compile switches for MinGW.
+
+On OSX, this will prefer the Framework version (if found) over others.
+People will have to manually change the cache values of SDL_LIBRARY to
+override this selection or set the CMake environment
+CMAKE_INCLUDE_PATH to modify the search paths.
+
+Note that the header path has changed from SDL/SDL.h to just SDL.h
+This needed to change because "proper" SDL convention is #include
+"SDL.h", not <SDL/SDL.h>. This is done for portability reasons
+because not all systems place things in SDL/ (see FreeBSD).
+#]=======================================================================]
find_path(SDL_INCLUDE_DIR SDL.h
HINTS
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 8cdaa7a05..e687b4983 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -1,40 +1,41 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSDL_image
-# -------------
-#
-# Locate SDL_image library
-#
-# This module defines:
-#
-# ::
-#
-# SDL_IMAGE_LIBRARIES, the name of the library to link against
-# SDL_IMAGE_INCLUDE_DIRS, where to find the headers
-# SDL_IMAGE_FOUND, if false, do not try to link against
-# SDL_IMAGE_VERSION_STRING - human-readable string containing the
-# version of SDL_image
-#
-#
-#
-# For backward compatibility the following variables are also set:
-#
-# ::
-#
-# SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
-# SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
-# SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
-#
-#
-#
-# $SDLDIR is an environment variable that would correspond to the
-# ./configure --prefix=$SDLDIR used in building SDL.
-#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
+#[=======================================================================[.rst:
+FindSDL_image
+-------------
+
+Locate SDL_image library
+
+This module defines:
+
+::
+
+ SDL_IMAGE_LIBRARIES, the name of the library to link against
+ SDL_IMAGE_INCLUDE_DIRS, where to find the headers
+ SDL_IMAGE_FOUND, if false, do not try to link against
+ SDL_IMAGE_VERSION_STRING - human-readable string containing the
+ version of SDL_image
+
+
+
+For backward compatibility the following variables are also set:
+
+::
+
+ SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
+ SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
+ SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
+
+
+
+$SDLDIR is an environment variable that would correspond to the
+./configure --prefix=$SDLDIR used in building SDL.
+
+Created by Eric Wing. This was influenced by the FindSDL.cmake
+module, but with modifications to recognize OS X frameworks and
+additional Unix paths (FreeBSD, etc).
+#]=======================================================================]
if(NOT SDL_IMAGE_INCLUDE_DIR AND SDLIMAGE_INCLUDE_DIR)
set(SDL_IMAGE_INCLUDE_DIR ${SDLIMAGE_INCLUDE_DIR} CACHE PATH "directory cache
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 35233d121..315400a30 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -1,40 +1,41 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSDL_mixer
-# -------------
-#
-# Locate SDL_mixer library
-#
-# This module defines:
-#
-# ::
-#
-# SDL_MIXER_LIBRARIES, the name of the library to link against
-# SDL_MIXER_INCLUDE_DIRS, where to find the headers
-# SDL_MIXER_FOUND, if false, do not try to link against
-# SDL_MIXER_VERSION_STRING - human-readable string containing the
-# version of SDL_mixer
-#
-#
-#
-# For backward compatibility the following variables are also set:
-#
-# ::
-#
-# SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
-# SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
-# SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
-#
-#
-#
-# $SDLDIR is an environment variable that would correspond to the
-# ./configure --prefix=$SDLDIR used in building SDL.
-#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
+#[=======================================================================[.rst:
+FindSDL_mixer
+-------------
+
+Locate SDL_mixer library
+
+This module defines:
+
+::
+
+ SDL_MIXER_LIBRARIES, the name of the library to link against
+ SDL_MIXER_INCLUDE_DIRS, where to find the headers
+ SDL_MIXER_FOUND, if false, do not try to link against
+ SDL_MIXER_VERSION_STRING - human-readable string containing the
+ version of SDL_mixer
+
+
+
+For backward compatibility the following variables are also set:
+
+::
+
+ SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
+ SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
+ SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
+
+
+
+$SDLDIR is an environment variable that would correspond to the
+./configure --prefix=$SDLDIR used in building SDL.
+
+Created by Eric Wing. This was influenced by the FindSDL.cmake
+module, but with modifications to recognize OS X frameworks and
+additional Unix paths (FreeBSD, etc).
+#]=======================================================================]
if(NOT SDL_MIXER_INCLUDE_DIR AND SDLMIXER_INCLUDE_DIR)
set(SDL_MIXER_INCLUDE_DIR ${SDLMIXER_INCLUDE_DIR} CACHE PATH "directory cache
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index b40694668..28cb4d6c2 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -1,39 +1,40 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSDL_net
-# -----------
-#
-# Locate SDL_net library
-#
-# This module defines:
-#
-# ::
-#
-# SDL_NET_LIBRARIES, the name of the library to link against
-# SDL_NET_INCLUDE_DIRS, where to find the headers
-# SDL_NET_FOUND, if false, do not try to link against
-# SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
-#
-#
-#
-# For backward compatibility the following variables are also set:
-#
-# ::
-#
-# SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
-# SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
-# SDLNET_FOUND (same value as SDL_NET_FOUND)
-#
-#
-#
-# $SDLDIR is an environment variable that would correspond to the
-# ./configure --prefix=$SDLDIR used in building SDL.
-#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
+#[=======================================================================[.rst:
+FindSDL_net
+-----------
+
+Locate SDL_net library
+
+This module defines:
+
+::
+
+ SDL_NET_LIBRARIES, the name of the library to link against
+ SDL_NET_INCLUDE_DIRS, where to find the headers
+ SDL_NET_FOUND, if false, do not try to link against
+ SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
+
+
+
+For backward compatibility the following variables are also set:
+
+::
+
+ SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
+ SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
+ SDLNET_FOUND (same value as SDL_NET_FOUND)
+
+
+
+$SDLDIR is an environment variable that would correspond to the
+./configure --prefix=$SDLDIR used in building SDL.
+
+Created by Eric Wing. This was influenced by the FindSDL.cmake
+module, but with modifications to recognize OS X frameworks and
+additional Unix paths (FreeBSD, etc).
+#]=======================================================================]
if(NOT SDL_NET_INCLUDE_DIR AND SDLNET_INCLUDE_DIR)
set(SDL_NET_INCLUDE_DIR ${SDLNET_INCLUDE_DIR} CACHE PATH "directory cache
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index cf33a4c2c..e2179811e 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -1,84 +1,85 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSDL_sound
-# -------------
-#
-# Locates the SDL_sound library
-#
-#
-#
-# This module depends on SDL being found and must be called AFTER
-# FindSDL.cmake is called.
-#
-# This module defines
-#
-# ::
-#
-# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
-# SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
-# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
-# to link against.
-# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
-# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
-# This is available mostly for cases this module failed to anticipate for
-# and you must add additional flags. This is marked as ADVANCED.
-# SDL_SOUND_VERSION_STRING, human-readable string containing the
-# version of SDL_sound
-#
-#
-#
-# This module also defines (but you shouldn't need to use directly)
-#
-# ::
-#
-# SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
-# against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
-#
-# And might define the following as needed
-#
-# ::
-#
-# MIKMOD_LIBRARY
-# MODPLUG_LIBRARY
-# OGG_LIBRARY
-# VORBIS_LIBRARY
-# SMPEG_LIBRARY
-# FLAC_LIBRARY
-# SPEEX_LIBRARY
-#
-#
-#
-# Typically, you should not use these variables directly, and you should
-# use SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other
-# audio libraries (if needed) to successfully compile on your system.
-#
-# Created by Eric Wing. This module is a bit more complicated than the
-# other FindSDL* family modules. The reason is that SDL_sound can be
-# compiled in a large variety of different ways which are independent of
-# platform. SDL_sound may dynamically link against other 3rd party
-# libraries to get additional codec support, such as Ogg Vorbis, SMPEG,
-# ModPlug, MikMod, FLAC, Speex, and potentially others. Under some
-# circumstances which I don't fully understand, there seems to be a
-# requirement that dependent libraries of libraries you use must also be
-# explicitly linked against in order to successfully compile. SDL_sound
-# does not currently have any system in place to know how it was
-# compiled. So this CMake module does the hard work in trying to
-# discover which 3rd party libraries are required for building (if any).
-# This module uses a brute force approach to create a test program that
-# uses SDL_sound, and then tries to build it. If the build fails, it
-# parses the error output for known symbol names to figure out which
-# libraries are needed.
-#
-# Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable that
-# would correspond to the ./configure --prefix=$SDLDIR used in building
-# SDL.
-#
-# On OSX, this will prefer the Framework version (if found) over others.
-# People will have to manually change the cache values of SDL_LIBRARY to
-# override this selectionor set the CMake environment CMAKE_INCLUDE_PATH
-# to modify the search paths.
+#[=======================================================================[.rst:
+FindSDL_sound
+-------------
+
+Locates the SDL_sound library
+
+
+
+This module depends on SDL being found and must be called AFTER
+FindSDL.cmake is called.
+
+This module defines
+
+::
+
+ SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
+ SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
+ SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
+ to link against.
+ SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
+ flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
+ This is available mostly for cases this module failed to anticipate for
+ and you must add additional flags. This is marked as ADVANCED.
+ SDL_SOUND_VERSION_STRING, human-readable string containing the
+ version of SDL_sound
+
+
+
+This module also defines (but you shouldn't need to use directly)
+
+::
+
+ SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
+ against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
+
+And might define the following as needed
+
+::
+
+ MIKMOD_LIBRARY
+ MODPLUG_LIBRARY
+ OGG_LIBRARY
+ VORBIS_LIBRARY
+ SMPEG_LIBRARY
+ FLAC_LIBRARY
+ SPEEX_LIBRARY
+
+
+
+Typically, you should not use these variables directly, and you should
+use SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other
+audio libraries (if needed) to successfully compile on your system.
+
+Created by Eric Wing. This module is a bit more complicated than the
+other FindSDL* family modules. The reason is that SDL_sound can be
+compiled in a large variety of different ways which are independent of
+platform. SDL_sound may dynamically link against other 3rd party
+libraries to get additional codec support, such as Ogg Vorbis, SMPEG,
+ModPlug, MikMod, FLAC, Speex, and potentially others. Under some
+circumstances which I don't fully understand, there seems to be a
+requirement that dependent libraries of libraries you use must also be
+explicitly linked against in order to successfully compile. SDL_sound
+does not currently have any system in place to know how it was
+compiled. So this CMake module does the hard work in trying to
+discover which 3rd party libraries are required for building (if any).
+This module uses a brute force approach to create a test program that
+uses SDL_sound, and then tries to build it. If the build fails, it
+parses the error output for known symbol names to figure out which
+libraries are needed.
+
+Responds to the $SDLDIR and $SDLSOUNDDIR environmental variable that
+would correspond to the ./configure --prefix=$SDLDIR used in building
+SDL.
+
+On OSX, this will prefer the Framework version (if found) over others.
+People will have to manually change the cache values of SDL_LIBRARY to
+override this selectionor set the CMake environment CMAKE_INCLUDE_PATH
+to modify the search paths.
+#]=======================================================================]
set(SDL_SOUND_EXTRAS "" CACHE STRING "SDL_sound extra flags")
mark_as_advanced(SDL_SOUND_EXTRAS)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index aa705f226..d5721da0a 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -1,39 +1,40 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSDL_ttf
-# -----------
-#
-# Locate SDL_ttf library
-#
-# This module defines:
-#
-# ::
-#
-# SDL_TTF_LIBRARIES, the name of the library to link against
-# SDL_TTF_INCLUDE_DIRS, where to find the headers
-# SDL_TTF_FOUND, if false, do not try to link against
-# SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
-#
-#
-#
-# For backward compatibility the following variables are also set:
-#
-# ::
-#
-# SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
-# SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
-# SDLTTF_FOUND (same value as SDL_TTF_FOUND)
-#
-#
-#
-# $SDLDIR is an environment variable that would correspond to the
-# ./configure --prefix=$SDLDIR used in building SDL.
-#
-# Created by Eric Wing. This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
+#[=======================================================================[.rst:
+FindSDL_ttf
+-----------
+
+Locate SDL_ttf library
+
+This module defines:
+
+::
+
+ SDL_TTF_LIBRARIES, the name of the library to link against
+ SDL_TTF_INCLUDE_DIRS, where to find the headers
+ SDL_TTF_FOUND, if false, do not try to link against
+ SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
+
+
+
+For backward compatibility the following variables are also set:
+
+::
+
+ SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
+ SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
+ SDLTTF_FOUND (same value as SDL_TTF_FOUND)
+
+
+
+$SDLDIR is an environment variable that would correspond to the
+./configure --prefix=$SDLDIR used in building SDL.
+
+Created by Eric Wing. This was influenced by the FindSDL.cmake
+module, but with modifications to recognize OS X frameworks and
+additional Unix paths (FreeBSD, etc).
+#]=======================================================================]
if(NOT SDL_TTF_INCLUDE_DIR AND SDLTTF_INCLUDE_DIR)
set(SDL_TTF_INCLUDE_DIR ${SDLTTF_INCLUDE_DIR} CACHE PATH "directory cache
diff --git a/Modules/FindSQLite3.cmake b/Modules/FindSQLite3.cmake
new file mode 100644
index 000000000..374d7af6c
--- /dev/null
+++ b/Modules/FindSQLite3.cmake
@@ -0,0 +1,66 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindSQLite3
+-----------
+
+Find the SQLite libraries, v3
+
+IMPORTED targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` target:
+
+``SQLite::SQLite3``
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables if found:
+
+``SQLite3_INCLUDE_DIRS``
+ where to find sqlite3.h, etc.
+``SQLite3_LIBRARIES``
+ the libraries to link against to use SQLite3.
+``SQLite3_VERSION``
+ version of the SQLite3 library found
+``SQLite3_FOUND``
+ TRUE if found
+
+#]=======================================================================]
+
+# Look for the necessary header
+find_path(SQLite3_INCLUDE_DIR NAMES sqlite3.h)
+mark_as_advanced(SQLite3_INCLUDE_DIR)
+
+# Look for the necessary library
+find_library(SQLite3_LIBRARY NAMES sqlite3 sqlite)
+mark_as_advanced(SQLite3_LIBRARY)
+
+# Extract version information from the header file
+if(SQLite3_INCLUDE_DIR)
+ file(STRINGS ${SQLite3_INCLUDE_DIR}/sqlite3.h _ver_line
+ REGEX "^#define SQLITE_VERSION *\"[0-9]+\\.[0-9]+\\.[0-9]+\""
+ LIMIT_COUNT 1)
+ string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+"
+ SQLite3_VERSION "${_ver_line}")
+ unset(_ver_line)
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(SQLite3
+ REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
+ VERSION_VAR SQLite3_VERSION)
+
+# Create the imported target
+if(SQLite3_FOUND)
+ set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
+ set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
+ if(NOT TARGET SQLite::SQLite3)
+ add_library(SQLite::SQLite3 UNKNOWN IMPORTED)
+ set_target_properties(SQLite::SQLite3 PROPERTIES
+ IMPORTED_LOCATION "${SQLite3_LIBRARY}"
+ INTERFACE_INCLUDE_DIRECTORIES "${SQLite3_INCLUDE_DIR}")
+ endif()
+endif()
diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake
index 92c032f6a..fc0ed009d 100644
--- a/Modules/FindSWIG.cmake
+++ b/Modules/FindSWIG.cmake
@@ -1,29 +1,30 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSWIG
-# --------
-#
-# Find SWIG
-#
-# This module finds an installed SWIG. It sets the following variables:
-#
-# ::
-#
-# SWIG_FOUND - set to true if SWIG is found
-# SWIG_DIR - the directory where swig is installed
-# SWIG_EXECUTABLE - the path to the swig executable
-# SWIG_VERSION - the version number of the swig executable
-#
-#
-#
-# The minimum required version of SWIG can be specified using the
-# standard syntax, e.g. find_package(SWIG 1.1)
-#
-# All information is collected from the SWIG_EXECUTABLE so the version
-# to be found can be changed from the command line by means of setting
-# SWIG_EXECUTABLE
+#[=======================================================================[.rst:
+FindSWIG
+--------
+
+Find SWIG
+
+This module finds an installed SWIG. It sets the following variables:
+
+::
+
+ SWIG_FOUND - set to true if SWIG is found
+ SWIG_DIR - the directory where swig is installed
+ SWIG_EXECUTABLE - the path to the swig executable
+ SWIG_VERSION - the version number of the swig executable
+
+
+
+The minimum required version of SWIG can be specified using the
+standard syntax, e.g. find_package(SWIG 1.1)
+
+All information is collected from the SWIG_EXECUTABLE so the version
+to be found can be changed from the command line by means of setting
+SWIG_EXECUTABLE
+#]=======================================================================]
find_program(SWIG_EXECUTABLE NAMES swig3.0 swig2.0 swig)
diff --git a/Modules/FindSelfPackers.cmake b/Modules/FindSelfPackers.cmake
index ac2c7cf88..1abbcbd7a 100644
--- a/Modules/FindSelfPackers.cmake
+++ b/Modules/FindSelfPackers.cmake
@@ -1,19 +1,20 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSelfPackers
-# ---------------
-#
-# Find upx
-#
-# This module looks for some executable packers (i.e. software that
-# compress executables or shared libs into on-the-fly self-extracting
-# executables or shared libs. Examples:
-#
-# ::
-#
-# UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
+#[=======================================================================[.rst:
+FindSelfPackers
+---------------
+
+Find upx
+
+This module looks for some executable packers (i.e. software that
+compress executables or shared libs into on-the-fly self-extracting
+executables or shared libs. Examples:
+
+::
+
+ UPX: http://wildsau.idv.uni-linz.ac.at/mfx/upx.html
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index d1ce2002a..7d495059a 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -1,123 +1,124 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSquish
-# ----------
-#
-# -- Typical Use
-#
-#
-#
-# This module can be used to find Squish. Currently Squish versions 3
-# and 4 are supported.
-#
-# ::
-#
-# SQUISH_FOUND If false, don't try to use Squish
-# SQUISH_VERSION The full version of Squish found
-# SQUISH_VERSION_MAJOR The major version of Squish found
-# SQUISH_VERSION_MINOR The minor version of Squish found
-# SQUISH_VERSION_PATCH The patch version of Squish found
-#
-#
-#
-# ::
-#
-# SQUISH_INSTALL_DIR The Squish installation directory
-# (containing bin, lib, etc)
-# SQUISH_SERVER_EXECUTABLE The squishserver executable
-# SQUISH_CLIENT_EXECUTABLE The squishrunner executable
-#
-#
-#
-# ::
-#
-# SQUISH_INSTALL_DIR_FOUND Was the install directory found?
-# SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
-# SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
-#
-#
-#
-# It provides the function squish_v4_add_test() for adding a squish test
-# to cmake using Squish 4.x:
-#
-# ::
-#
-# squish_v4_add_test(cmakeTestName
-# AUT targetName SUITE suiteName TEST squishTestName
-# [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] )
-#
-#
-#
-# The arguments have the following meaning:
-#
-# ``cmakeTestName``
-# this will be used as the first argument for add_test()
-# ``AUT targetName``
-# the name of the cmake target which will be used as AUT, i.e. the
-# executable which will be tested.
-# ``SUITE suiteName``
-# this is either the full path to the squish suite, or just the
-# last directory of the suite, i.e. the suite name. In this case
-# the CMakeLists.txt which calls squish_add_test() must be located
-# in the parent directory of the suite directory.
-# ``TEST squishTestName``
-# the name of the squish test, i.e. the name of the subdirectory
-# of the test inside the suite directory.
-# ``SETTINGSGROUP group``
-# if specified, the given settings group will be used for executing the test.
-# If not specified, the groupname will be "CTest_<username>"
-# ``PRE_COMMAND command``
-# if specified, the given command will be executed before starting the squish test.
-# ``POST_COMMAND command``
-# same as PRE_COMMAND, but after the squish test has been executed.
-#
-#
-#
-# ::
-#
-# enable_testing()
-# find_package(Squish 4.0)
-# if (SQUISH_FOUND)
-# squish_v4_add_test(myTestName
-# AUT myApp
-# SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite
-# TEST someSquishTest
-# SETTINGSGROUP myGroup
-# )
-# endif ()
-#
-#
-#
-#
-#
-# For users of Squish version 3.x the macro squish_v3_add_test() is
-# provided:
-#
-# ::
-#
-# squish_v3_add_test(testName applicationUnderTest testCase envVars testWrapper)
-# Use this macro to add a test using Squish 3.x.
-#
-#
-#
-# ::
-#
-# enable_testing()
-# find_package(Squish)
-# if (SQUISH_FOUND)
-# squish_v3_add_test(myTestName myApplication testCase envVars testWrapper)
-# endif ()
-#
-#
-#
-# macro SQUISH_ADD_TEST(testName applicationUnderTest testCase envVars
-# testWrapper)
-#
-# ::
-#
-# This is deprecated. Use SQUISH_V3_ADD_TEST() if you are using Squish 3.x instead.
+#[=======================================================================[.rst:
+FindSquish
+----------
+
+-- Typical Use
+
+
+
+This module can be used to find Squish. Currently Squish versions 3
+and 4 are supported.
+
+::
+
+ SQUISH_FOUND If false, don't try to use Squish
+ SQUISH_VERSION The full version of Squish found
+ SQUISH_VERSION_MAJOR The major version of Squish found
+ SQUISH_VERSION_MINOR The minor version of Squish found
+ SQUISH_VERSION_PATCH The patch version of Squish found
+
+
+
+::
+
+ SQUISH_INSTALL_DIR The Squish installation directory
+ (containing bin, lib, etc)
+ SQUISH_SERVER_EXECUTABLE The squishserver executable
+ SQUISH_CLIENT_EXECUTABLE The squishrunner executable
+
+
+
+::
+
+ SQUISH_INSTALL_DIR_FOUND Was the install directory found?
+ SQUISH_SERVER_EXECUTABLE_FOUND Was the server executable found?
+ SQUISH_CLIENT_EXECUTABLE_FOUND Was the client executable found?
+
+
+
+It provides the function squish_v4_add_test() for adding a squish test
+to cmake using Squish 4.x:
+
+::
+
+ squish_v4_add_test(cmakeTestName
+ AUT targetName SUITE suiteName TEST squishTestName
+ [SETTINGSGROUP group] [PRE_COMMAND command] [POST_COMMAND command] )
+
+
+
+The arguments have the following meaning:
+
+``cmakeTestName``
+ this will be used as the first argument for add_test()
+``AUT targetName``
+ the name of the cmake target which will be used as AUT, i.e. the
+ executable which will be tested.
+``SUITE suiteName``
+ this is either the full path to the squish suite, or just the
+ last directory of the suite, i.e. the suite name. In this case
+ the CMakeLists.txt which calls squish_add_test() must be located
+ in the parent directory of the suite directory.
+``TEST squishTestName``
+ the name of the squish test, i.e. the name of the subdirectory
+ of the test inside the suite directory.
+``SETTINGSGROUP group``
+ if specified, the given settings group will be used for executing the test.
+ If not specified, the groupname will be "CTest_<username>"
+``PRE_COMMAND command``
+ if specified, the given command will be executed before starting the squish test.
+``POST_COMMAND command``
+ same as PRE_COMMAND, but after the squish test has been executed.
+
+
+
+::
+
+ enable_testing()
+ find_package(Squish 4.0)
+ if (SQUISH_FOUND)
+ squish_v4_add_test(myTestName
+ AUT myApp
+ SUITE ${CMAKE_SOURCE_DIR}/tests/mySuite
+ TEST someSquishTest
+ SETTINGSGROUP myGroup
+ )
+ endif ()
+
+
+
+
+
+For users of Squish version 3.x the macro squish_v3_add_test() is
+provided:
+
+::
+
+ squish_v3_add_test(testName applicationUnderTest testCase envVars testWrapper)
+ Use this macro to add a test using Squish 3.x.
+
+
+
+::
+
+ enable_testing()
+ find_package(Squish)
+ if (SQUISH_FOUND)
+ squish_v3_add_test(myTestName myApplication testCase envVars testWrapper)
+ endif ()
+
+
+
+macro SQUISH_ADD_TEST(testName applicationUnderTest testCase envVars
+testWrapper)
+
+::
+
+ This is deprecated. Use SQUISH_V3_ADD_TEST() if you are using Squish 3.x instead.
+#]=======================================================================]
set(SQUISH_INSTALL_DIR_STRING "Directory containing the bin, doc, and lib directories for Squish; this should be the root of the installation directory.")
set(SQUISH_SERVER_EXECUTABLE_STRING "The squishserver executable program.")
diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake
index e18ae880f..ce280e277 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -1,68 +1,69 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindSubversion
-# --------------
-#
-# Extract information from a subversion working copy
-#
-# The module defines the following variables:
-#
-# ::
-#
-# Subversion_SVN_EXECUTABLE - path to svn command line client
-# Subversion_VERSION_SVN - version of svn command line client
-# Subversion_FOUND - true if the command line client was found
-# SUBVERSION_FOUND - same as Subversion_FOUND, set for compatibility reasons
-#
-#
-#
-# The minimum required version of Subversion can be specified using the
-# standard syntax, e.g. ``find_package(Subversion 1.4)``.
-#
-# If the command line client executable is found two macros are defined:
-#
-# ::
-#
-# Subversion_WC_INFO(<dir> <var-prefix> [IGNORE_SVN_FAILURE])
-# Subversion_WC_LOG(<dir> <var-prefix>)
-#
-# ``Subversion_WC_INFO`` extracts information of a subversion working copy at a
-# given location. This macro defines the following variables if running
-# Subversion's ``info`` command on ``<dir>`` succeeds; otherwise a
-# ``SEND_ERROR`` message is generated. The error can be ignored by providing the
-# ``IGNORE_SVN_FAILURE`` option, which causes these variables to remain
-# undefined.
-#
-# ::
-#
-# <var-prefix>_WC_URL - url of the repository (at <dir>)
-# <var-prefix>_WC_ROOT - root url of the repository
-# <var-prefix>_WC_REVISION - current revision
-# <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
-# <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
-# <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
-# <var-prefix>_WC_INFO - output of command `svn info <dir>'
-#
-# ``Subversion_WC_LOG`` retrieves the log message of the base revision of a
-# subversion working copy at a given location. This macro defines the variable:
-#
-# ::
-#
-# <var-prefix>_LAST_CHANGED_LOG - last log of base revision
-#
-# Example usage:
-#
-# ::
-#
-# find_package(Subversion)
-# if(SUBVERSION_FOUND)
-# Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
-# message("Current revision is ${Project_WC_REVISION}")
-# Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
-# message("Last changed log is ${Project_LAST_CHANGED_LOG}")
-# endif()
+#[=======================================================================[.rst:
+FindSubversion
+--------------
+
+Extract information from a subversion working copy
+
+The module defines the following variables:
+
+::
+
+ Subversion_SVN_EXECUTABLE - path to svn command line client
+ Subversion_VERSION_SVN - version of svn command line client
+ Subversion_FOUND - true if the command line client was found
+ SUBVERSION_FOUND - same as Subversion_FOUND, set for compatibility reasons
+
+
+
+The minimum required version of Subversion can be specified using the
+standard syntax, e.g. ``find_package(Subversion 1.4)``.
+
+If the command line client executable is found two macros are defined:
+
+::
+
+ Subversion_WC_INFO(<dir> <var-prefix> [IGNORE_SVN_FAILURE])
+ Subversion_WC_LOG(<dir> <var-prefix>)
+
+``Subversion_WC_INFO`` extracts information of a subversion working copy at a
+given location. This macro defines the following variables if running
+Subversion's ``info`` command on ``<dir>`` succeeds; otherwise a
+``SEND_ERROR`` message is generated. The error can be ignored by providing the
+``IGNORE_SVN_FAILURE`` option, which causes these variables to remain
+undefined.
+
+::
+
+ <var-prefix>_WC_URL - url of the repository (at <dir>)
+ <var-prefix>_WC_ROOT - root url of the repository
+ <var-prefix>_WC_REVISION - current revision
+ <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
+ <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
+ <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
+ <var-prefix>_WC_INFO - output of command `svn info <dir>'
+
+``Subversion_WC_LOG`` retrieves the log message of the base revision of a
+subversion working copy at a given location. This macro defines the variable:
+
+::
+
+ <var-prefix>_LAST_CHANGED_LOG - last log of base revision
+
+Example usage:
+
+::
+
+ find_package(Subversion)
+ if(SUBVERSION_FOUND)
+ Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project)
+ message("Current revision is ${Project_WC_REVISION}")
+ Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project)
+ message("Last changed log is ${Project_LAST_CHANGED_LOG}")
+ endif()
+#]=======================================================================]
find_program(Subversion_SVN_EXECUTABLE svn
PATHS
diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake
index ad16e0de1..be47c39a0 100644
--- a/Modules/FindTCL.cmake
+++ b/Modules/FindTCL.cmake
@@ -1,48 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindTCL
-# -------
-#
-# TK_INTERNAL_PATH was removed.
-#
-# This module finds if Tcl is installed and determines where the include
-# files and libraries are. It also determines what the name of the
-# library is. This code sets the following variables:
-#
-# ::
-#
-# TCL_FOUND = Tcl was found
-# TK_FOUND = Tk was found
-# TCLTK_FOUND = Tcl and Tk were found
-# TCL_LIBRARY = path to Tcl library (tcl tcl80)
-# TCL_INCLUDE_PATH = path to where tcl.h can be found
-# TCL_TCLSH = path to tclsh binary (tcl tcl80)
-# TK_LIBRARY = path to Tk library (tk tk80 etc)
-# TK_INCLUDE_PATH = path to where tk.h can be found
-# TK_WISH = full path to the wish executable
-#
-#
-#
-# In an effort to remove some clutter and clear up some issues for
-# people who are not necessarily Tcl/Tk gurus/developers, some
-# variables were moved or removed. Changes compared to CMake 2.4 are:
-#
-# ::
-#
-# => they were only useful for people writing Tcl/Tk extensions.
-# => these libs are not packaged by default with Tcl/Tk distributions.
-# Even when Tcl/Tk is built from source, several flavors of debug libs
-# are created and there is no real reason to pick a single one
-# specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
-# Let's leave that choice to the user by allowing him to assign
-# TCL_LIBRARY to any Tcl library, debug or not.
-# => this ended up being only a Win32 variable, and there is a lot of
-# confusion regarding the location of this file in an installed Tcl/Tk
-# tree anyway (see 8.5 for example). If you need the internal path at
-# this point it is safer you ask directly where the *source* tree is
-# and dig from there.
+#[=======================================================================[.rst:
+FindTCL
+-------
+
+TK_INTERNAL_PATH was removed.
+
+This module finds if Tcl is installed and determines where the include
+files and libraries are. It also determines what the name of the
+library is. This code sets the following variables:
+
+::
+
+ TCL_FOUND = Tcl was found
+ TK_FOUND = Tk was found
+ TCLTK_FOUND = Tcl and Tk were found
+ TCL_LIBRARY = path to Tcl library (tcl tcl80)
+ TCL_INCLUDE_PATH = path to where tcl.h can be found
+ TCL_TCLSH = path to tclsh binary (tcl tcl80)
+ TK_LIBRARY = path to Tk library (tk tk80 etc)
+ TK_INCLUDE_PATH = path to where tk.h can be found
+ TK_WISH = full path to the wish executable
+
+
+
+In an effort to remove some clutter and clear up some issues for
+people who are not necessarily Tcl/Tk gurus/developers, some
+variables were moved or removed. Changes compared to CMake 2.4 are:
+
+::
+
+ => they were only useful for people writing Tcl/Tk extensions.
+ => these libs are not packaged by default with Tcl/Tk distributions.
+ Even when Tcl/Tk is built from source, several flavors of debug libs
+ are created and there is no real reason to pick a single one
+ specifically (say, amongst tcl84g, tcl84gs, or tcl84sgx).
+ Let's leave that choice to the user by allowing him to assign
+ TCL_LIBRARY to any Tcl library, debug or not.
+ => this ended up being only a Win32 variable, and there is a lot of
+ confusion regarding the location of this file in an installed Tcl/Tk
+ tree anyway (see 8.5 for example). If you need the internal path at
+ this point it is safer you ask directly where the *source* tree is
+ and dig from there.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindFrameworks.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindTclsh.cmake)
diff --git a/Modules/FindTIFF.cmake b/Modules/FindTIFF.cmake
index b622ca61c..63ca936c4 100644
--- a/Modules/FindTIFF.cmake
+++ b/Modules/FindTIFF.cmake
@@ -1,43 +1,44 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindTIFF
-# --------
-#
-# Find the TIFF library (libtiff).
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``TIFF::TIFF``
-# The TIFF library, if found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``TIFF_FOUND``
-# true if the TIFF headers and libraries were found
-# ``TIFF_INCLUDE_DIR``
-# the directory containing the TIFF headers
-# ``TIFF_INCLUDE_DIRS``
-# the directory containing the TIFF headers
-# ``TIFF_LIBRARIES``
-# TIFF libraries to be linked
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``TIFF_INCLUDE_DIR``
-# the directory containing the TIFF headers
-# ``TIFF_LIBRARY``
-# the path to the TIFF library
+#[=======================================================================[.rst:
+FindTIFF
+--------
+
+Find the TIFF library (libtiff).
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``TIFF::TIFF``
+ The TIFF library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``TIFF_FOUND``
+ true if the TIFF headers and libraries were found
+``TIFF_INCLUDE_DIR``
+ the directory containing the TIFF headers
+``TIFF_INCLUDE_DIRS``
+ the directory containing the TIFF headers
+``TIFF_LIBRARIES``
+ TIFF libraries to be linked
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``TIFF_INCLUDE_DIR``
+ the directory containing the TIFF headers
+``TIFF_LIBRARY``
+ the path to the TIFF library
+#]=======================================================================]
find_path(TIFF_INCLUDE_DIR tiff.h)
diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake
index db0a7a176..8f634809e 100644
--- a/Modules/FindTclStub.cmake
+++ b/Modules/FindTclStub.cmake
@@ -1,48 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindTclStub
-# -----------
-#
-# TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
-#
-# This module finds Tcl stub libraries. It first finds Tcl include
-# files and libraries by calling FindTCL.cmake. How to Use the Tcl
-# Stubs Library:
-#
-# ::
-#
-# http://tcl.activestate.com/doc/howto/stubs.html
-#
-# Using Stub Libraries:
-#
-# ::
-#
-# http://safari.oreilly.com/0130385603/ch48lev1sec3
-#
-# This code sets the following variables:
-#
-# ::
-#
-# TCL_STUB_LIBRARY = path to Tcl stub library
-# TK_STUB_LIBRARY = path to Tk stub library
-# TTK_STUB_LIBRARY = path to ttk stub library
-#
-#
-#
-# In an effort to remove some clutter and clear up some issues for
-# people who are not necessarily Tcl/Tk gurus/developers, some
-# variables were moved or removed. Changes compared to CMake 2.4 are:
-#
-# ::
-#
-# => these libs are not packaged by default with Tcl/Tk distributions.
-# Even when Tcl/Tk is built from source, several flavors of debug libs
-# are created and there is no real reason to pick a single one
-# specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
-# Let's leave that choice to the user by allowing him to assign
-# TCL_STUB_LIBRARY to any Tcl library, debug or not.
+#[=======================================================================[.rst:
+FindTclStub
+-----------
+
+TCL_STUB_LIBRARY_DEBUG and TK_STUB_LIBRARY_DEBUG were removed.
+
+This module finds Tcl stub libraries. It first finds Tcl include
+files and libraries by calling FindTCL.cmake. How to Use the Tcl
+Stubs Library:
+
+::
+
+ http://tcl.activestate.com/doc/howto/stubs.html
+
+Using Stub Libraries:
+
+::
+
+ http://safari.oreilly.com/0130385603/ch48lev1sec3
+
+This code sets the following variables:
+
+::
+
+ TCL_STUB_LIBRARY = path to Tcl stub library
+ TK_STUB_LIBRARY = path to Tk stub library
+ TTK_STUB_LIBRARY = path to ttk stub library
+
+
+
+In an effort to remove some clutter and clear up some issues for
+people who are not necessarily Tcl/Tk gurus/developers, some
+variables were moved or removed. Changes compared to CMake 2.4 are:
+
+::
+
+ => these libs are not packaged by default with Tcl/Tk distributions.
+ Even when Tcl/Tk is built from source, several flavors of debug libs
+ are created and there is no real reason to pick a single one
+ specifically (say, amongst tclstub84g, tclstub84gs, or tclstub84sgx).
+ Let's leave that choice to the user by allowing him to assign
+ TCL_STUB_LIBRARY to any Tcl library, debug or not.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindTCL.cmake)
diff --git a/Modules/FindTclsh.cmake b/Modules/FindTclsh.cmake
index 9bf935d8e..e3bd11040 100644
--- a/Modules/FindTclsh.cmake
+++ b/Modules/FindTclsh.cmake
@@ -1,23 +1,24 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindTclsh
-# ---------
-#
-# Find tclsh
-#
-# This module finds if TCL is installed and determines where the include
-# files and libraries are. It also determines what the name of the
-# library is. This code sets the following variables:
-#
-# ::
-#
-# TCLSH_FOUND = TRUE if tclsh has been found
-# TCL_TCLSH = the path to the tclsh executable
-#
-# In cygwin, look for the cygwin version first. Don't look for it later
-# to avoid finding the cygwin version on a Win32 build.
+#[=======================================================================[.rst:
+FindTclsh
+---------
+
+Find tclsh
+
+This module finds if TCL is installed and determines where the include
+files and libraries are. It also determines what the name of the
+library is. This code sets the following variables:
+
+::
+
+ TCLSH_FOUND = TRUE if tclsh has been found
+ TCL_TCLSH = the path to the tclsh executable
+
+In cygwin, look for the cygwin version first. Don't look for it later
+to avoid finding the cygwin version on a Win32 build.
+#]=======================================================================]
if(CYGWIN)
find_program(TCL_TCLSH NAMES cygtclsh83 cygtclsh80)
diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake
index 75e83ea4a..919392ab9 100644
--- a/Modules/FindThreads.cmake
+++ b/Modules/FindThreads.cmake
@@ -1,44 +1,41 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindThreads
-# -----------
-#
-# This module determines the thread library of the system.
-#
-# The following variables are set
-#
-# ::
-#
-# CMAKE_THREAD_LIBS_INIT - the thread library
-# CMAKE_USE_SPROC_INIT - are we using sproc?
-# CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
-# CMAKE_USE_PTHREADS_INIT - are we using pthreads
-# CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
-#
-# The following import target is created
-#
-# ::
-#
-# Threads::Threads
-#
-# For systems with multiple thread libraries, caller can set
-#
-# ::
-#
-# CMAKE_THREAD_PREFER_PTHREAD
-#
-# If the use of the -pthread compiler and linker flag is preferred then the
-# caller can set
-#
-# ::
-#
-# THREADS_PREFER_PTHREAD_FLAG
-#
-# Please note that the compiler flag can only be used with the imported
-# target. Use of both the imported target as well as this switch is highly
-# recommended for new code.
+#[=======================================================================[.rst:
+FindThreads
+-----------
+
+This module determines the thread library of the system.
+
+The following variables are set
+
+::
+
+ CMAKE_THREAD_LIBS_INIT - the thread library
+ CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
+ CMAKE_USE_PTHREADS_INIT - are we using pthreads
+ CMAKE_HP_PTHREADS_INIT - are we using hp pthreads
+
+The following import target is created
+
+::
+
+ Threads::Threads
+
+If the use of the -pthread compiler and linker flag is preferred then the
+caller can set
+
+::
+
+ THREADS_PREFER_PTHREAD_FLAG
+
+The compiler flag can only be used with the imported
+target. Use of both the imported target as well as this switch is highly
+recommended for new code.
+
+This module is not needed for C++11 and later if threading is done using
+``std::thread`` from the standard library.
+#]=======================================================================]
include (CheckLibraryExists)
include (CheckSymbolExists)
@@ -54,12 +51,6 @@ else()
message(FATAL_ERROR "FindThreads only works if either C or CXX language is enabled")
endif()
-# Do we have sproc?
-if(CMAKE_SYSTEM_NAME MATCHES IRIX AND NOT CMAKE_THREAD_PREFER_PTHREAD)
- include (CheckIncludeFiles)
- CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
-endif()
-
# Internal helper macro.
# Do NOT even think about using it outside of this file!
macro(_check_threads_lib LIBNAME FUNCNAME VARNAME)
@@ -112,50 +103,45 @@ macro(_check_pthreads_flag)
endif()
endmacro()
-if(CMAKE_HAVE_SPROC_H AND NOT CMAKE_THREAD_PREFER_PTHREAD)
- # We have sproc
- set(CMAKE_USE_SPROC_INIT 1)
+# Do we have pthreads?
+if(CMAKE_C_COMPILER_LOADED)
+ CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
else()
- # Do we have pthreads?
- if(CMAKE_C_COMPILER_LOADED)
- CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
- else()
- CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H)
- endif()
- if(CMAKE_HAVE_PTHREAD_H)
-
- #
- # We have pthread.h
- # Let's check for the library now.
- #
- set(CMAKE_HAVE_THREADS_LIBRARY)
- if(NOT THREADS_HAVE_PTHREAD_ARG)
- # Check if pthread functions are in normal C library
- CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
- if(CMAKE_HAVE_LIBC_CREATE)
- set(CMAKE_THREAD_LIBS_INIT "")
- set(CMAKE_HAVE_THREADS_LIBRARY 1)
- set(Threads_FOUND TRUE)
- else()
-
- # Check for -pthread first if enabled. This is the recommended
- # way, but not backwards compatible as one must also pass -pthread
- # as compiler flag then.
- if (THREADS_PREFER_PTHREAD_FLAG)
- _check_pthreads_flag()
- endif ()
-
- _check_threads_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE)
- _check_threads_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE)
- if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
- # On sun also check for -lthread
- _check_threads_lib(thread thr_create CMAKE_HAVE_THR_CREATE)
- endif()
+ CHECK_INCLUDE_FILE_CXX("pthread.h" CMAKE_HAVE_PTHREAD_H)
+endif()
+if(CMAKE_HAVE_PTHREAD_H)
+
+ #
+ # We have pthread.h
+ # Let's check for the library now.
+ #
+ set(CMAKE_HAVE_THREADS_LIBRARY)
+ if(NOT THREADS_HAVE_PTHREAD_ARG)
+ # Check if pthread functions are in normal C library.
+ CHECK_SYMBOL_EXISTS(pthread_create pthread.h CMAKE_HAVE_LIBC_CREATE)
+ if(CMAKE_HAVE_LIBC_CREATE)
+ set(CMAKE_THREAD_LIBS_INIT "")
+ set(CMAKE_HAVE_THREADS_LIBRARY 1)
+ set(Threads_FOUND TRUE)
+ else()
+
+ # Check for -pthread first if enabled. This is the recommended
+ # way, but not backwards compatible as one must also pass -pthread
+ # as compiler flag then.
+ if (THREADS_PREFER_PTHREAD_FLAG)
+ _check_pthreads_flag()
+ endif ()
+
+ _check_threads_lib(pthreads pthread_create CMAKE_HAVE_PTHREADS_CREATE)
+ _check_threads_lib(pthread pthread_create CMAKE_HAVE_PTHREAD_CREATE)
+ if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
+ # On sun also check for -lthread
+ _check_threads_lib(thread thr_create CMAKE_HAVE_THR_CREATE)
endif()
endif()
-
- _check_pthreads_flag()
endif()
+
+ _check_pthreads_flag()
endif()
if(CMAKE_THREAD_LIBS_INIT OR CMAKE_HAVE_LIBC_CREATE)
diff --git a/Modules/FindUnixCommands.cmake b/Modules/FindUnixCommands.cmake
index 45047a949..3a735f79b 100644
--- a/Modules/FindUnixCommands.cmake
+++ b/Modules/FindUnixCommands.cmake
@@ -1,14 +1,15 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindUnixCommands
-# ----------------
-#
-# Find Unix commands, including the ones from Cygwin
-#
-# This module looks for the Unix commands bash, cp, gzip, mv, rm, and tar
-# and stores the result in the variables BASH, CP, GZIP, MV, RM, and TAR.
+#[=======================================================================[.rst:
+FindUnixCommands
+----------------
+
+Find Unix commands, including the ones from Cygwin
+
+This module looks for the Unix commands bash, cp, gzip, mv, rm, and tar
+and stores the result in the variables BASH, CP, GZIP, MV, RM, and TAR.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindVulkan.cmake b/Modules/FindVulkan.cmake
index 4c60ed7da..b1201b4ef 100644
--- a/Modules/FindVulkan.cmake
+++ b/Modules/FindVulkan.cmake
@@ -1,32 +1,33 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindVulkan
-# ----------
-#
-# Try to find Vulkan
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``Vulkan::Vulkan``, if
-# Vulkan has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables::
-#
-# Vulkan_FOUND - True if Vulkan was found
-# Vulkan_INCLUDE_DIRS - include directories for Vulkan
-# Vulkan_LIBRARIES - link against this library to use Vulkan
-#
-# The module will also define two cache variables::
-#
-# Vulkan_INCLUDE_DIR - the Vulkan include directory
-# Vulkan_LIBRARY - the path to the Vulkan library
-#
+#[=======================================================================[.rst:
+FindVulkan
+----------
+
+Try to find Vulkan
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``Vulkan::Vulkan``, if
+Vulkan has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables::
+
+ Vulkan_FOUND - True if Vulkan was found
+ Vulkan_INCLUDE_DIRS - include directories for Vulkan
+ Vulkan_LIBRARIES - link against this library to use Vulkan
+
+The module will also define two cache variables::
+
+ Vulkan_INCLUDE_DIR - the Vulkan include directory
+ Vulkan_LIBRARY - the path to the Vulkan library
+
+#]=======================================================================]
if(WIN32)
find_path(Vulkan_INCLUDE_DIR
diff --git a/Modules/FindWget.cmake b/Modules/FindWget.cmake
index 4fcb2fa37..bd01ec201 100644
--- a/Modules/FindWget.cmake
+++ b/Modules/FindWget.cmake
@@ -1,18 +1,19 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindWget
-# --------
-#
-# Find wget
-#
-# This module looks for wget. This module defines the following values:
-#
-# ::
-#
-# WGET_EXECUTABLE: the full path to the wget tool.
-# WGET_FOUND: True if wget has been found.
+#[=======================================================================[.rst:
+FindWget
+--------
+
+Find wget
+
+This module looks for wget. This module defines the following values:
+
+::
+
+ WGET_EXECUTABLE: the full path to the wget tool.
+ WGET_FOUND: True if wget has been found.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake)
diff --git a/Modules/FindWish.cmake b/Modules/FindWish.cmake
index b64b04138..b332bde9b 100644
--- a/Modules/FindWish.cmake
+++ b/Modules/FindWish.cmake
@@ -1,23 +1,24 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindWish
-# --------
-#
-# Find wish installation
-#
-# This module finds if TCL is installed and determines where the include
-# files and libraries are. It also determines what the name of the
-# library is. This code sets the following variables:
-#
-# ::
-#
-# TK_WISH = the path to the wish executable
-#
-#
-#
-# if UNIX is defined, then it will look for the cygwin version first
+#[=======================================================================[.rst:
+FindWish
+--------
+
+Find wish installation
+
+This module finds if TCL is installed and determines where the include
+files and libraries are. It also determines what the name of the
+library is. This code sets the following variables:
+
+::
+
+ TK_WISH = the path to the wish executable
+
+
+
+if UNIX is defined, then it will look for the cygwin version first
+#]=======================================================================]
if(UNIX)
find_program(TK_WISH cygwish80 )
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index f7dfc8257..b28dd125d 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -1,58 +1,59 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindX11
-# -------
-#
-# Find X11 installation
-#
-# Try to find X11 on UNIX systems. The following values are defined
-#
-# ::
-#
-# X11_FOUND - True if X11 is available
-# X11_INCLUDE_DIR - include directories to use X11
-# X11_LIBRARIES - link against these to use X11
-#
-# and also the following more fine grained variables:
-#
-# ::
-#
-# X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND
-# X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND
-# X11_X11_INCLUDE_PATH, X11_X11_LIB
-# X11_Xaccessrules_INCLUDE_PATH, X11_Xaccess_FOUND
-# X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
-# X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND
-# X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND
-# X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND
-# X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND
-# X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND
-# X11_Xext_LIB, X11_Xext_FOUND
-# X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
-# X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
-# X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
-# X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
-# X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND
-# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
-# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
-# X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
-# X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND
-# X11_Xinput_INCLUDE_PATH, X11_Xinput_LIB, X11_Xinput_FOUND
-# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
-# X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
-# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
-# X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND
-# X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
-# X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
-# X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
-# X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND
-# X11_Xscreensaver_INCLUDE_PATH, X11_Xscreensaver_LIB, X11_Xscreensaver_FOUND
-# X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND
-# X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND
-# X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND
-# X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
+#[=======================================================================[.rst:
+FindX11
+-------
+
+Find X11 installation
+
+Try to find X11 on UNIX systems. The following values are defined
+
+::
+
+ X11_FOUND - True if X11 is available
+ X11_INCLUDE_DIR - include directories to use X11
+ X11_LIBRARIES - link against these to use X11
+
+and also the following more fine grained variables and targets:
+
+::
+
+ X11_ICE_INCLUDE_PATH, X11_ICE_LIB, X11_ICE_FOUND, X11::ICE
+ X11_SM_INCLUDE_PATH, X11_SM_LIB, X11_SM_FOUND, X11::SM
+ X11_X11_INCLUDE_PATH, X11_X11_LIB, X11::X11
+ X11_Xaccessrules_INCLUDE_PATH,
+ X11_Xaccessstr_INCLUDE_PATH, X11_Xaccess_FOUND
+ X11_Xau_INCLUDE_PATH, X11_Xau_LIB, X11_Xau_FOUND, X11::Xau
+ X11_Xcomposite_INCLUDE_PATH, X11_Xcomposite_LIB, X11_Xcomposite_FOUND, X11::Xcomposite
+ X11_Xcursor_INCLUDE_PATH, X11_Xcursor_LIB, X11_Xcursor_FOUND, X11::Xcursor
+ X11_Xdamage_INCLUDE_PATH, X11_Xdamage_LIB, X11_Xdamage_FOUND, X11::Xdamage
+ X11_Xdmcp_INCLUDE_PATH, X11_Xdmcp_LIB, X11_Xdmcp_FOUND, X11::Xdmcp
+ X11_Xext_INCLUDE_PATH, X11_Xext_LIB, X11_Xext_FOUND, X11::Xext
+ X11_Xxf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_Xxf86misc_FOUND, X11::Xxf86misc
+ X11_Xxf86vm_INCLUDE_PATH, X11_Xxf86vm_LIB X11_Xxf86vm_FOUND, X11::Xxf86vm
+ X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND, X11::Xfixes
+ X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND, X11::Xft
+ X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND, X11::Xi
+ X11_Xinerama_INCLUDE_PATH, X11_Xinerama_LIB, X11_Xinerama_FOUND, X11::Xinerama
+ X11_Xkb_INCLUDE_PATH,
+ X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND, X11::Xkb
+ X11_xkbfile_INCLUDE_PATH, X11_xkbfile_LIB, X11_xkbfile_FOUND, X11::xkbfile
+ X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND, X11::Xmu
+ X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND, X11::Xpm
+ X11_Xtst_INCLUDE_PATH, X11_Xtst_LIB, X11_Xtst_FOUND, X11::Xtst
+ X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND, X11::Xrandr
+ X11_Xrender_INCLUDE_PATH, X11_Xrender_LIB, X11_Xrender_FOUND, X11::Xrender
+ X11_XRes_INCLUDE_PATH, X11_XRes_LIB, X11_XRes_FOUND, X11::XRes
+ X11_Xss_INCLUDE_PATH, X11_Xss_LIB, X11_Xss_FOUND, X11::Xss
+ X11_Xt_INCLUDE_PATH, X11_Xt_LIB, X11_Xt_FOUND, X11::Xt
+ X11_Xutil_INCLUDE_PATH, X11_Xutil_FOUND, X11::Xutil
+ X11_Xv_INCLUDE_PATH, X11_Xv_LIB, X11_Xv_FOUND, X11::Xv
+ X11_dpms_INCLUDE_PATH, (in X11_Xext_LIB), X11_dpms_FOUND
+ X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
+ X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
+ X11_XSync_INCLUDE_PATH, (in X11_Xext_LIB), X11_XSync_FOUND
+#]=======================================================================]
if (UNIX)
set(X11_FOUND 0)
@@ -97,31 +98,38 @@ if (UNIX)
find_path(X11_Xcursor_INCLUDE_PATH X11/Xcursor/Xcursor.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xdamage_INCLUDE_PATH X11/extensions/Xdamage.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xdmcp_INCLUDE_PATH X11/Xdmcp.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xext_INCLUDE_PATH X11/extensions/Xext.h ${X11_INC_SEARCH_PATH})
find_path(X11_dpms_INCLUDE_PATH X11/extensions/dpms.h ${X11_INC_SEARCH_PATH})
- find_path(X11_xf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH})
- find_path(X11_xf86vmode_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xxf86misc_INCLUDE_PATH X11/extensions/xf86misc.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xxf86vm_INCLUDE_PATH X11/extensions/xf86vmode.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xfixes_INCLUDE_PATH X11/extensions/Xfixes.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xft_INCLUDE_PATH X11/Xft/Xft.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xi_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xinerama_INCLUDE_PATH X11/extensions/Xinerama.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xinput_INCLUDE_PATH X11/extensions/XInput.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH})
- find_path(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xtst_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
find_path(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xrandr_INCLUDE_PATH X11/extensions/Xrandr.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xrender_INCLUDE_PATH X11/extensions/Xrender.h ${X11_INC_SEARCH_PATH})
find_path(X11_XRes_INCLUDE_PATH X11/extensions/XRes.h ${X11_INC_SEARCH_PATH})
- find_path(X11_Xscreensaver_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
+ find_path(X11_Xss_INCLUDE_PATH X11/extensions/scrnsaver.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xshape_INCLUDE_PATH X11/extensions/shape.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xutil_INCLUDE_PATH X11/Xutil.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xt_INCLUDE_PATH X11/Intrinsic.h ${X11_INC_SEARCH_PATH})
find_path(X11_Xv_INCLUDE_PATH X11/extensions/Xvlib.h ${X11_INC_SEARCH_PATH})
find_path(X11_XSync_INCLUDE_PATH X11/extensions/sync.h ${X11_INC_SEARCH_PATH})
+ # Backwards compatibility.
+ set(X11_Xinput_INCLUDE_PATH "${X11_Xi_INCLUDE_PATH}")
+ set(X11_xf86misc_INCLUDE_PATH "${X11_Xxf86misc_INCLUDE_PATH}")
+ set(X11_xf86vmode_INCLUDE_PATH "${X11_Xxf8vm_INCLUDE_PATH}")
+ set(X11_Xkbfile_INCLUDE_PATH "${X11_xkbfile_INCLUDE_PATH}")
+ set(X11_XTest_INCLUDE_PATH "${X11_Xtst_INCLUDE_PATH}")
+ set(X11_Xscreensaver_INCLUDE_PATH "${X11_Xss_INCLUDE_PATH}")
find_library(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
@@ -138,20 +146,25 @@ if (UNIX)
find_library(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
find_library(X11_Xi_LIB Xi ${X11_LIB_SEARCH_PATH})
find_library(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
+ find_library(X11_xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
find_library(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
find_library(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
find_library(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
find_library(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
find_library(X11_XRes_LIB XRes ${X11_LIB_SEARCH_PATH})
- find_library(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xss_LIB Xss ${X11_LIB_SEARCH_PATH})
find_library(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
- find_library(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
+ find_library(X11_Xtst_LIB Xtst ${X11_LIB_SEARCH_PATH})
find_library(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH})
find_library(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH})
find_library(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})
+ # Backwards compatibility.
+ set(X11_Xinput_LIB "${X11_Xi_LIB}")
+ set(X11_Xkbfile_LIB "${X11_xkbfile_LIB}")
+ set(X11_XTest_LIB "${X11_Xtst_LIB}")
+ set(X11_Xscreensaver_LIB "${X11_Xss_LIB}")
+
set(X11_LIBRARY_DIR "")
if(X11_X11_LIB)
get_filename_component(X11_LIBRARY_DIR ${X11_X11_LIB} PATH)
@@ -159,31 +172,31 @@ if (UNIX)
set(X11_INCLUDE_DIR) # start with empty list
if(X11_X11_INCLUDE_PATH)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_X11_INCLUDE_PATH})
endif()
if(X11_Xlib_INCLUDE_PATH)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xlib_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xlib_INCLUDE_PATH})
endif()
if(X11_Xutil_INCLUDE_PATH)
set(X11_Xutil_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xutil_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xutil_INCLUDE_PATH})
endif()
if(X11_Xshape_INCLUDE_PATH)
set(X11_Xshape_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xshape_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xshape_INCLUDE_PATH})
endif()
set(X11_LIBRARIES) # start with empty list
if(X11_X11_LIB)
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_X11_LIB})
+ list(APPEND X11_LIBRARIES ${X11_X11_LIB})
endif()
if(X11_Xext_LIB)
set(X11_Xext_FOUND TRUE)
- set(X11_LIBRARIES ${X11_LIBRARIES} ${X11_Xext_LIB})
+ list(APPEND X11_LIBRARIES ${X11_Xext_LIB})
endif()
if(X11_Xt_LIB AND X11_Xt_INCLUDE_PATH)
@@ -191,13 +204,17 @@ if (UNIX)
endif()
if(X11_Xft_LIB AND X11_Xft_INCLUDE_PATH)
- set(X11_Xft_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xft_INCLUDE_PATH})
+ find_package(Freetype QUIET)
+ find_package(Fontconfig QUIET)
+ if (FREETYPE_FOUND AND Fontconfig_FOUND)
+ set(X11_Xft_FOUND TRUE)
+ endif ()
+ list(APPEND X11_INCLUDE_DIR ${X11_Xft_INCLUDE_PATH})
endif()
if(X11_Xv_LIB AND X11_Xv_INCLUDE_PATH)
set(X11_Xv_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xv_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xv_INCLUDE_PATH})
endif()
if (X11_Xau_LIB AND X11_Xau_INCLUDE_PATH)
@@ -206,118 +223,124 @@ if (UNIX)
if (X11_Xdmcp_INCLUDE_PATH AND X11_Xdmcp_LIB)
set(X11_Xdmcp_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdmcp_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xdmcp_INCLUDE_PATH})
endif ()
if (X11_Xaccessrules_INCLUDE_PATH AND X11_Xaccessstr_INCLUDE_PATH)
set(X11_Xaccess_FOUND TRUE)
set(X11_Xaccess_INCLUDE_PATH ${X11_Xaccessstr_INCLUDE_PATH})
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xaccess_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xaccess_INCLUDE_PATH})
endif ()
if (X11_Xpm_INCLUDE_PATH AND X11_Xpm_LIB)
set(X11_Xpm_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xpm_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xpm_INCLUDE_PATH})
endif ()
if (X11_Xcomposite_INCLUDE_PATH AND X11_Xcomposite_LIB)
set(X11_Xcomposite_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcomposite_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xcomposite_INCLUDE_PATH})
endif ()
if (X11_Xdamage_INCLUDE_PATH AND X11_Xdamage_LIB)
set(X11_Xdamage_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xdamage_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xdamage_INCLUDE_PATH})
endif ()
if (X11_XShm_INCLUDE_PATH)
set(X11_XShm_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XShm_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_XShm_INCLUDE_PATH})
endif ()
- if (X11_XTest_INCLUDE_PATH AND X11_XTest_LIB)
+ if (X11_Xtst_INCLUDE_PATH AND X11_Xtst_LIB)
+ set(X11_Xtst_FOUND TRUE)
+ # Backwards compatibility.
set(X11_XTest_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XTest_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xtst_INCLUDE_PATH})
endif ()
if (X11_Xi_INCLUDE_PATH AND X11_Xi_LIB)
set(X11_Xi_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xi_INCLUDE_PATH})
+ # Backwards compatibility.
+ set(X11_Xinput_FOUND TRUE)
+ list(APPEND X11_INCLUDE_DIR ${X11_Xi_INCLUDE_PATH})
endif ()
if (X11_Xinerama_INCLUDE_PATH AND X11_Xinerama_LIB)
set(X11_Xinerama_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinerama_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xinerama_INCLUDE_PATH})
endif ()
if (X11_Xfixes_INCLUDE_PATH AND X11_Xfixes_LIB)
set(X11_Xfixes_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xfixes_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xfixes_INCLUDE_PATH})
endif ()
if (X11_Xrender_INCLUDE_PATH AND X11_Xrender_LIB)
set(X11_Xrender_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrender_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xrender_INCLUDE_PATH})
endif ()
if (X11_XRes_INCLUDE_PATH AND X11_XRes_LIB)
set(X11_XRes_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XRes_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_XRes_INCLUDE_PATH})
endif ()
if (X11_Xrandr_INCLUDE_PATH AND X11_Xrandr_LIB)
set(X11_Xrandr_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xrandr_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xrandr_INCLUDE_PATH})
endif ()
- if (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
+ if (X11_Xxf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
+ set(X11_Xxf86misc_FOUND TRUE)
+ # Backwards compatibility.
set(X11_xf86misc_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xxf86misc_INCLUDE_PATH})
endif ()
- if (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
+ if (X11_Xxf86vm_INCLUDE_PATH AND X11_Xxf86vm_LIB)
+ set(X11_Xxf86vm_FOUND TRUE)
+ # Backwards compatibility.
set(X11_xf86vmode_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xxf86vm_INCLUDE_PATH})
endif ()
if (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
set(X11_Xcursor_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xcursor_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xcursor_INCLUDE_PATH})
endif ()
- if (X11_Xscreensaver_INCLUDE_PATH AND X11_Xscreensaver_LIB)
+ if (X11_Xss_INCLUDE_PATH AND X11_Xss_LIB)
+ set(X11_Xss_FOUND TRUE)
set(X11_Xscreensaver_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xscreensaver_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xss_INCLUDE_PATH})
endif ()
if (X11_dpms_INCLUDE_PATH)
set(X11_dpms_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_dpms_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_dpms_INCLUDE_PATH})
endif ()
if (X11_Xkb_INCLUDE_PATH AND X11_Xkblib_INCLUDE_PATH AND X11_Xlib_INCLUDE_PATH)
set(X11_Xkb_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkb_INCLUDE_PATH} )
+ list(APPEND X11_INCLUDE_DIR ${X11_Xkb_INCLUDE_PATH} )
endif ()
- if (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+ if (X11_xkbfile_INCLUDE_PATH AND X11_xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
+ set(X11_xkbfile_FOUND TRUE)
+ # Backwards compatibility.
set(X11_Xkbfile_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
+ list(APPEND X11_INCLUDE_DIR ${X11_xkbfile_INCLUDE_PATH} )
endif ()
if (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
set(X11_Xmu_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
- endif ()
-
- if (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
- set(X11_Xinput_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_Xmu_INCLUDE_PATH})
endif ()
if (X11_XSync_INCLUDE_PATH)
set(X11_XSync_FOUND TRUE)
- set(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_XSync_INCLUDE_PATH})
+ list(APPEND X11_INCLUDE_DIR ${X11_XSync_INCLUDE_PATH})
endif ()
if(X11_ICE_LIB AND X11_ICE_INCLUDE_PATH)
@@ -339,6 +362,11 @@ if (UNIX)
set(X11_FOUND 1)
endif ()
+ include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+ find_package_handle_standard_args(X11
+ REQUIRED_VARS X11_X11_INCLUDE_PATH X11_X11_LIB
+ HANDLE_COMPONENTS)
+
if(X11_FOUND)
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/CheckLibraryExists.cmake)
@@ -351,69 +379,69 @@ if (UNIX)
set(X11_X_EXTRA_LIBS "")
# See if XOpenDisplay in X11 works by itself.
- CHECK_LIBRARY_EXISTS("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
+ check_library_exists("${X11_LIBRARIES}" "XOpenDisplay" "${X11_LIBRARY_DIR}" X11_LIB_X11_SOLO)
if(NOT X11_LIB_X11_SOLO)
# Find library needed for dnet_ntoa.
- CHECK_LIBRARY_EXISTS("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
+ check_library_exists("dnet" "dnet_ntoa" "" X11_LIB_DNET_HAS_DNET_NTOA)
if (X11_LIB_DNET_HAS_DNET_NTOA)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet)
+ list(APPEND X11_X_EXTRA_LIBS -ldnet)
else ()
- CHECK_LIBRARY_EXISTS("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
+ check_library_exists("dnet_stub" "dnet_ntoa" "" X11_LIB_DNET_STUB_HAS_DNET_NTOA)
if (X11_LIB_DNET_STUB_HAS_DNET_NTOA)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -ldnet_stub)
+ list(APPEND X11_X_EXTRA_LIBS -ldnet_stub)
endif ()
endif ()
endif()
# Find library needed for gethostbyname.
- CHECK_FUNCTION_EXISTS("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
+ check_function_exists("gethostbyname" CMAKE_HAVE_GETHOSTBYNAME)
if(NOT CMAKE_HAVE_GETHOSTBYNAME)
- CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
+ check_library_exists("nsl" "gethostbyname" "" CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
if (CMAKE_LIB_NSL_HAS_GETHOSTBYNAME)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lnsl)
+ list(APPEND X11_X_EXTRA_LIBS -lnsl)
else ()
- CHECK_LIBRARY_EXISTS("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
+ check_library_exists("bsd" "gethostbyname" "" CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
if (CMAKE_LIB_BSD_HAS_GETHOSTBYNAME)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lbsd)
+ list(APPEND X11_X_EXTRA_LIBS -lbsd)
endif ()
endif ()
endif()
# Find library needed for connect.
- CHECK_FUNCTION_EXISTS("connect" CMAKE_HAVE_CONNECT)
+ check_function_exists("connect" CMAKE_HAVE_CONNECT)
if(NOT CMAKE_HAVE_CONNECT)
- CHECK_LIBRARY_EXISTS("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
+ check_library_exists("socket" "connect" "" CMAKE_LIB_SOCKET_HAS_CONNECT)
if (CMAKE_LIB_SOCKET_HAS_CONNECT)
- set (X11_X_EXTRA_LIBS -lsocket ${X11_X_EXTRA_LIBS})
+ list(INSERT X11_X_EXTRA_LIBS 0 -lsocket)
endif ()
endif()
# Find library needed for remove.
- CHECK_FUNCTION_EXISTS("remove" CMAKE_HAVE_REMOVE)
+ check_function_exists("remove" CMAKE_HAVE_REMOVE)
if(NOT CMAKE_HAVE_REMOVE)
- CHECK_LIBRARY_EXISTS("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
+ check_library_exists("posix" "remove" "" CMAKE_LIB_POSIX_HAS_REMOVE)
if (CMAKE_LIB_POSIX_HAS_REMOVE)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lposix)
+ list(APPEND X11_X_EXTRA_LIBS -lposix)
endif ()
endif()
# Find library needed for shmat.
- CHECK_FUNCTION_EXISTS("shmat" CMAKE_HAVE_SHMAT)
+ check_function_exists("shmat" CMAKE_HAVE_SHMAT)
if(NOT CMAKE_HAVE_SHMAT)
- CHECK_LIBRARY_EXISTS("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
+ check_library_exists("ipc" "shmat" "" CMAKE_LIB_IPS_HAS_SHMAT)
if (CMAKE_LIB_IPS_HAS_SHMAT)
- set (X11_X_EXTRA_LIBS ${X11_X_EXTRA_LIBS} -lipc)
+ list(APPEND X11_X_EXTRA_LIBS -lipc)
endif ()
endif()
endif()
if (X11_ICE_FOUND)
- CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
+ check_library_exists("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
if(CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
set (X11_X_PRE_LIBS ${X11_ICE_LIB})
if(X11_SM_LIB)
- set (X11_X_PRE_LIBS ${X11_SM_LIB} ${X11_X_PRE_LIBS})
+ list(INSERT X11_X_PRE_LIBS 0 ${X11_SM_LIB})
endif()
endif()
endif ()
@@ -421,18 +449,222 @@ if (UNIX)
# Build the final list of libraries.
set(X11_LIBRARIES ${X11_X_PRE_LIBS} ${X11_LIBRARIES} ${X11_X_EXTRA_LIBS})
- include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage.cmake)
- FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
- "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
- else ()
- if (X11_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find X11")
+ if (NOT TARGET X11::X11)
+ add_library(X11::X11 UNKNOWN IMPORTED)
+ set_target_properties(X11::X11 PROPERTIES
+ IMPORTED_LOCATION "${X11_X11_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_X11_INCLUDE_PATH}")
endif ()
endif ()
+ if (X11_ICE_FOUND AND NOT TARGET X11::ICE)
+ add_library(X11::ICE UNKNOWN IMPORTED)
+ set_target_properties(X11::ICE PROPERTIES
+ IMPORTED_LOCATION "${X11_ICE_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_ICE_INCLUDE_PATH}")
+ endif ()
+
+ if (X11_SM_FOUND AND NOT TARGET X11::SM)
+ add_library(X11::SM UNKNOWN IMPORTED)
+ set_target_properties(X11::SM PROPERTIES
+ IMPORTED_LOCATION "${X11_SM_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_SM_INCLUDE_PATH}")
+ endif ()
+
+ if (X11_Xau_FOUND AND NOT TARGET X11::Xau)
+ add_library(X11::Xau UNKNOWN IMPORTED)
+ set_target_properties(X11::Xau PROPERTIES
+ IMPORTED_LOCATION "${X11_Xau_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xau_INCLUDE_PATH}")
+ endif ()
+
+ if (X11_Xcomposite_FOUND AND NOT TARGET X11::Xcomposite)
+ add_library(X11::Xcomposite UNKNOWN IMPORTED)
+ set_target_properties(X11::Xcomposite PROPERTIES
+ IMPORTED_LOCATION "${X11_Xcomposite_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xcomposite_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_Xcursor_FOUND AND NOT TARGET X11::Xcursor)
+ add_library(X11::Xcursor UNKNOWN IMPORTED)
+ set_target_properties(X11::Xcursor PROPERTIES
+ IMPORTED_LOCATION "${X11_Xcursor_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xcursor_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xrender;X11::Xfixes;X11::X11")
+ endif ()
+
+ if (X11_Xdamage_FOUND AND NOT TARGET X11::Xdamage)
+ add_library(X11::Xdamage UNKNOWN IMPORTED)
+ set_target_properties(X11::Xdamage PROPERTIES
+ IMPORTED_LOCATION "${X11_Xdamage_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xdamage_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xfixes;X11::X11")
+ endif ()
+
+ if (X11_Xdmcp_FOUND AND NOT TARGET X11::Xdmcp)
+ add_library(X11::Xdmcp UNKNOWN IMPORTED)
+ set_target_properties(X11::Xdmcp PROPERTIES
+ IMPORTED_LOCATION "${X11_Xdmcp_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xdmcp_INCLUDE_PATH}")
+ endif ()
+
+ if (X11_Xext_FOUND AND NOT TARGET X11::Xext)
+ add_library(X11::Xext UNKNOWN IMPORTED)
+ set_target_properties(X11::Xext PROPERTIES
+ IMPORTED_LOCATION "${X11_Xext_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xext_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_Xxf86misc_FOUND AND NOT TARGET X11::Xxf86misc)
+ add_library(X11::Xxf86misc UNKNOWN IMPORTED)
+ set_target_properties(X11::Xxf86misc PROPERTIES
+ IMPORTED_LOCATION "${X11_Xxf86misc_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xxf86misc_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11;X11::Xext")
+ endif ()
+
+ if (X11_Xxf86vm_FOUND AND NOT TARGET X11::Xxf86vm)
+ add_library(X11::Xxf86vm UNKNOWN IMPORTED)
+ set_target_properties(X11::Xxf86vm PROPERTIES
+ IMPORTED_LOCATION "${X11_Xxf86vm_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xxf86vm_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11;X11::Xext")
+ endif ()
+
+ if (X11_Xfixes_FOUND AND NOT TARGET X11::Xfixes)
+ add_library(X11::Xfixes UNKNOWN IMPORTED)
+ set_target_properties(X11::Xfixes PROPERTIES
+ IMPORTED_LOCATION "${X11_Xfixes_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xfixes_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_Xft_FOUND AND NOT TARGET X11::Xft)
+ add_library(X11::Xft UNKNOWN IMPORTED)
+ set_target_properties(X11::Xft PROPERTIES
+ IMPORTED_LOCATION "${X11_Xft_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xft_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xrender;X11::X11;Fontconfig::Fontconfig;Freetype::Freetype")
+ endif ()
+
+ if (X11_Xi_FOUND AND NOT TARGET X11::Xi)
+ add_library(X11::Xi UNKNOWN IMPORTED)
+ set_target_properties(X11::Xi PROPERTIES
+ IMPORTED_LOCATION "${X11_Xi_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xi_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11")
+ endif ()
+
+ if (X11_Xinerama_FOUND AND NOT TARGET X11::Xinerama)
+ add_library(X11::Xinerama UNKNOWN IMPORTED)
+ set_target_properties(X11::Xinerama PROPERTIES
+ IMPORTED_LOCATION "${X11_Xinerama_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xinerama_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11")
+ endif ()
+
+ if (X11_Xkb_FOUND AND NOT TARGET X11::Xkb)
+ add_library(X11::Xkb INTERFACE IMPORTED)
+ set_target_properties(X11::Xkb PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xkb_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_xkbfile_FOUND AND NOT TARGET X11::xkbfile)
+ add_library(X11::xkbfile UNKNOWN IMPORTED)
+ set_target_properties(X11::xkbfile PROPERTIES
+ IMPORTED_LOCATION "${X11_xkbfile_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_xkbfile_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_Xmu_FOUND AND NOT TARGET X11::Xmu)
+ add_library(X11::Xmu UNKNOWN IMPORTED)
+ set_target_properties(X11::Xmu PROPERTIES
+ IMPORTED_LOCATION "${X11_Xmu_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xmu_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xt;X11::Xext;X11::X11")
+ endif ()
+
+ if (X11_Xpm_FOUND AND NOT TARGET X11::Xpm)
+ add_library(X11::Xpm UNKNOWN IMPORTED)
+ set_target_properties(X11::Xpm PROPERTIES
+ IMPORTED_LOCATION "${X11_Xpm_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xpm_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_Xtst_FOUND AND NOT TARGET X11::Xtst)
+ add_library(X11::Xtst UNKNOWN IMPORTED)
+ set_target_properties(X11::Xtst PROPERTIES
+ IMPORTED_LOCATION "${X11_Xtst_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xtst_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xi;X11::Xext;X11::X11")
+ endif ()
+
+ if (X11_Xrandr_FOUND AND NOT TARGET X11::Xrandr)
+ add_library(X11::Xrandr UNKNOWN IMPORTED)
+ set_target_properties(X11::Xrandr PROPERTIES
+ IMPORTED_LOCATION "${X11_Xrandr_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xrandr_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xrender;X11::Xext;X11::X11")
+ endif ()
+
+ if (X11_Xrender_FOUND AND NOT TARGET X11::Xrender)
+ add_library(X11::Xrender UNKNOWN IMPORTED)
+ set_target_properties(X11::Xrender PROPERTIES
+ IMPORTED_LOCATION "${X11_Xrender_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xrender_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_XRes_FOUND AND NOT TARGET X11::XRes)
+ add_library(X11::XRes UNKNOWN IMPORTED)
+ set_target_properties(X11::XRes PROPERTIES
+ IMPORTED_LOCATION "${X11_XRes_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_XRes_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11")
+ endif ()
+
+ if (X11_Xss_FOUND AND NOT TARGET X11::Xss)
+ add_library(X11::Xss UNKNOWN IMPORTED)
+ set_target_properties(X11::Xss PROPERTIES
+ IMPORTED_LOCATION "${X11_Xss_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xss_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11")
+ endif ()
+
+ if (X11_Xt_FOUND AND NOT TARGET X11::Xt)
+ add_library(X11::Xt UNKNOWN IMPORTED)
+ set_target_properties(X11::Xt PROPERTIES
+ IMPORTED_LOCATION "${X11_Xt_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xt_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::ICE;X11::SM;X11::X11")
+ endif ()
+
+ if (X11_Xutil_FOUND AND NOT TARGET X11::Xutil)
+ add_library(X11::Xutil INTERFACE IMPORTED)
+ set_target_properties(X11::Xutil PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xutil_INCLUDE_PATH}"
+ # libX11 contains the implementations for functions in the Xutil.h
+ # header.
+ INTERFACE_LINK_LIBRARIES "X11::X11")
+ endif ()
+
+ if (X11_Xv_FOUND AND NOT TARGET X11::Xv)
+ add_library(X11::Xv UNKNOWN IMPORTED)
+ set_target_properties(X11::Xv PROPERTIES
+ IMPORTED_LOCATION "${X11_Xv_LIB}"
+ INTERFACE_INCLUDE_DIRECTORIES "${X11_Xv_INCLUDE_PATH}"
+ INTERFACE_LINK_LIBRARIES "X11::Xext;X11::X11")
+ endif ()
+
mark_as_advanced(
X11_X11_INCLUDE_PATH
X11_X11_LIB
+ X11_Xext_INCLUDE_PATH
X11_Xext_LIB
X11_Xau_LIB
X11_Xau_INCLUDE_PATH
@@ -440,7 +672,6 @@ if (UNIX)
X11_Xutil_INCLUDE_PATH
X11_Xcomposite_INCLUDE_PATH
X11_Xcomposite_LIB
- X11_Xaccess_INCLUDE_PATH
X11_Xfixes_LIB
X11_Xfixes_INCLUDE_PATH
X11_Xrandr_LIB
@@ -452,15 +683,15 @@ if (UNIX)
X11_XRes_LIB
X11_XRes_INCLUDE_PATH
X11_Xxf86misc_LIB
- X11_xf86misc_INCLUDE_PATH
+ X11_Xxf86misc_INCLUDE_PATH
X11_Xxf86vm_LIB
- X11_xf86vmode_INCLUDE_PATH
+ X11_Xxf86vm_INCLUDE_PATH
X11_Xi_LIB
X11_Xi_INCLUDE_PATH
X11_Xinerama_LIB
X11_Xinerama_INCLUDE_PATH
- X11_XTest_LIB
- X11_XTest_INCLUDE_PATH
+ X11_Xtst_LIB
+ X11_Xtst_INCLUDE_PATH
X11_Xcursor_LIB
X11_Xcursor_INCLUDE_PATH
X11_dpms_INCLUDE_PATH
@@ -473,16 +704,14 @@ if (UNIX)
X11_Xdmcp_INCLUDE_PATH
X11_Xkb_INCLUDE_PATH
X11_Xkblib_INCLUDE_PATH
- X11_Xkbfile_INCLUDE_PATH
- X11_Xkbfile_LIB
+ X11_xkbfile_INCLUDE_PATH
+ X11_xkbfile_LIB
X11_Xmu_INCLUDE_PATH
X11_Xmu_LIB
- X11_Xscreensaver_INCLUDE_PATH
- X11_Xscreensaver_LIB
+ X11_Xss_INCLUDE_PATH
+ X11_Xss_LIB
X11_Xpm_INCLUDE_PATH
X11_Xpm_LIB
- X11_Xinput_LIB
- X11_Xinput_INCLUDE_PATH
X11_Xft_LIB
X11_Xft_INCLUDE_PATH
X11_Xshape_INCLUDE_PATH
@@ -498,5 +727,3 @@ if (UNIX)
set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_SAVE})
set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
endif ()
-
-# X11_FIND_REQUIRED_<component> could be checked too
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake
index e7ae9197d..69e6df22b 100644
--- a/Modules/FindXMLRPC.cmake
+++ b/Modules/FindXMLRPC.cmake
@@ -1,35 +1,36 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindXMLRPC
-# ----------
-#
-# Find xmlrpc
-#
-# Find the native XMLRPC headers and libraries.
-#
-# ::
-#
-# XMLRPC_INCLUDE_DIRS - where to find xmlrpc.h, etc.
-# XMLRPC_LIBRARIES - List of libraries when using xmlrpc.
-# XMLRPC_FOUND - True if xmlrpc found.
-#
-# XMLRPC modules may be specified as components for this find module.
-# Modules may be listed by running "xmlrpc-c-config". Modules include:
-#
-# ::
-#
-# c++ C++ wrapper code
-# libwww-client libwww-based client
-# cgi-server CGI-based server
-# abyss-server ABYSS-based server
-#
-# Typical usage:
-#
-# ::
-#
-# find_package(XMLRPC REQUIRED libwww-client)
+#[=======================================================================[.rst:
+FindXMLRPC
+----------
+
+Find xmlrpc
+
+Find the native XMLRPC headers and libraries.
+
+::
+
+ XMLRPC_INCLUDE_DIRS - where to find xmlrpc.h, etc.
+ XMLRPC_LIBRARIES - List of libraries when using xmlrpc.
+ XMLRPC_FOUND - True if xmlrpc found.
+
+XMLRPC modules may be specified as components for this find module.
+Modules may be listed by running "xmlrpc-c-config". Modules include:
+
+::
+
+ c++ C++ wrapper code
+ libwww-client libwww-based client
+ cgi-server CGI-based server
+ abyss-server ABYSS-based server
+
+Typical usage:
+
+::
+
+ find_package(XMLRPC REQUIRED libwww-client)
+#]=======================================================================]
# First find the config script from which to obtain other values.
find_program(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
diff --git a/Modules/FindXalanC.cmake b/Modules/FindXalanC.cmake
index 1951b49e1..3adaa44d3 100644
--- a/Modules/FindXalanC.cmake
+++ b/Modules/FindXalanC.cmake
@@ -1,45 +1,46 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindXalanC
-# -----------
-#
-# Find the Apache Xalan-C++ XSL transform processor headers and libraries.
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``XalanC::XalanC``
-# The Xalan-C++ ``xalan-c`` library, if found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``XalanC_FOUND``
-# true if the Xalan headers and libraries were found
-# ``XalanC_VERSION``
-# Xalan release version
-# ``XalanC_INCLUDE_DIRS``
-# the directory containing the Xalan headers; note
-# ``XercesC_INCLUDE_DIRS`` is also required
-# ``XalanC_LIBRARIES``
-# Xalan libraries to be linked; note ``XercesC_LIBRARIES`` is also
-# required
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``XalanC_INCLUDE_DIR``
-# the directory containing the Xalan headers
-# ``XalanC_LIBRARY``
-# the Xalan library
+#[=======================================================================[.rst:
+FindXalanC
+-----------
+
+Find the Apache Xalan-C++ XSL transform processor headers and libraries.
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``XalanC::XalanC``
+ The Xalan-C++ ``xalan-c`` library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``XalanC_FOUND``
+ true if the Xalan headers and libraries were found
+``XalanC_VERSION``
+ Xalan release version
+``XalanC_INCLUDE_DIRS``
+ the directory containing the Xalan headers; note
+ ``XercesC_INCLUDE_DIRS`` is also required
+``XalanC_LIBRARIES``
+ Xalan libraries to be linked; note ``XercesC_LIBRARIES`` is also
+ required
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``XalanC_INCLUDE_DIR``
+ the directory containing the Xalan headers
+``XalanC_LIBRARY``
+ the Xalan library
+#]=======================================================================]
# Written by Roger Leigh <rleigh@codelibre.net>
@@ -75,7 +76,7 @@ find_path(XalanC_INCLUDE_DIR
DOC "Xalan-C++ include directory")
mark_as_advanced(XalanC_INCLUDE_DIR)
-if(XalanC_INCLUDE_DIR)
+if(XalanC_INCLUDE_DIR AND EXISTS "${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp")
_XalanC_GET_VERSION("${XalanC_INCLUDE_DIR}/xalanc/Include/XalanVersion.hpp")
endif()
diff --git a/Modules/FindXercesC.cmake b/Modules/FindXercesC.cmake
index 55db7aeb7..47bfd6288 100644
--- a/Modules/FindXercesC.cmake
+++ b/Modules/FindXercesC.cmake
@@ -1,43 +1,44 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindXercesC
-# -----------
-#
-# Find the Apache Xerces-C++ validating XML parser headers and libraries.
-#
-# Imported targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following :prop_tgt:`IMPORTED` targets:
-#
-# ``XercesC::XercesC``
-# The Xerces-C++ ``xerces-c`` library, if found.
-#
-# Result variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module will set the following variables in your project:
-#
-# ``XercesC_FOUND``
-# true if the Xerces headers and libraries were found
-# ``XercesC_VERSION``
-# Xerces release version
-# ``XercesC_INCLUDE_DIRS``
-# the directory containing the Xerces headers
-# ``XercesC_LIBRARIES``
-# Xerces libraries to be linked
-#
-# Cache variables
-# ^^^^^^^^^^^^^^^
-#
-# The following cache variables may also be set:
-#
-# ``XercesC_INCLUDE_DIR``
-# the directory containing the Xerces headers
-# ``XercesC_LIBRARY``
-# the Xerces library
+#[=======================================================================[.rst:
+FindXercesC
+-----------
+
+Find the Apache Xerces-C++ validating XML parser headers and libraries.
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``XercesC::XercesC``
+ The Xerces-C++ ``xerces-c`` library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``XercesC_FOUND``
+ true if the Xerces headers and libraries were found
+``XercesC_VERSION``
+ Xerces release version
+``XercesC_INCLUDE_DIRS``
+ the directory containing the Xerces headers
+``XercesC_LIBRARIES``
+ Xerces libraries to be linked
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``XercesC_INCLUDE_DIR``
+ the directory containing the Xerces headers
+``XercesC_LIBRARY``
+ the Xerces library
+#]=======================================================================]
# Written by Roger Leigh <rleigh@codelibre.net>
@@ -73,7 +74,7 @@ find_path(XercesC_INCLUDE_DIR
DOC "Xerces-C++ include directory")
mark_as_advanced(XercesC_INCLUDE_DIR)
-if(XercesC_INCLUDE_DIR)
+if(XercesC_INCLUDE_DIR AND EXISTS "${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
_XercesC_GET_VERSION("${XercesC_INCLUDE_DIR}/xercesc/util/XercesVersion.hpp")
endif()
diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake
index 1a4635a7d..790eb423c 100644
--- a/Modules/FindZLIB.cmake
+++ b/Modules/FindZLIB.cmake
@@ -1,53 +1,54 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindZLIB
-# --------
-#
-# Find the native ZLIB includes and library.
-#
-# IMPORTED Targets
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
-# ZLIB has been found.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ::
-#
-# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
-# ZLIB_LIBRARIES - List of libraries when using zlib.
-# ZLIB_FOUND - True if zlib found.
-#
-# ::
-#
-# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
-# ZLIB_VERSION_MAJOR - The major version of zlib
-# ZLIB_VERSION_MINOR - The minor version of zlib
-# ZLIB_VERSION_PATCH - The patch version of zlib
-# ZLIB_VERSION_TWEAK - The tweak version of zlib
-#
-# Backward Compatibility
-# ^^^^^^^^^^^^^^^^^^^^^^
-#
-# The following variable are provided for backward compatibility
-#
-# ::
-#
-# ZLIB_MAJOR_VERSION - The major version of zlib
-# ZLIB_MINOR_VERSION - The minor version of zlib
-# ZLIB_PATCH_VERSION - The patch version of zlib
-#
-# Hints
-# ^^^^^
-#
-# A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
-# module where to look.
+#[=======================================================================[.rst:
+FindZLIB
+--------
+
+Find the native ZLIB includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if
+ZLIB has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
+ ZLIB_LIBRARIES - List of libraries when using zlib.
+ ZLIB_FOUND - True if zlib found.
+
+::
+
+ ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
+ ZLIB_VERSION_MAJOR - The major version of zlib
+ ZLIB_VERSION_MINOR - The minor version of zlib
+ ZLIB_VERSION_PATCH - The patch version of zlib
+ ZLIB_VERSION_TWEAK - The tweak version of zlib
+
+Backward Compatibility
+^^^^^^^^^^^^^^^^^^^^^^
+
+The following variable are provided for backward compatibility
+
+::
+
+ ZLIB_MAJOR_VERSION - The major version of zlib
+ ZLIB_MINOR_VERSION - The minor version of zlib
+ ZLIB_PATCH_VERSION - The patch version of zlib
+
+Hints
+^^^^^
+
+A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this
+module where to look.
+#]=======================================================================]
set(_ZLIB_SEARCHES)
diff --git a/Modules/Findosg.cmake b/Modules/Findosg.cmake
index 474ea82b5..bb2845489 100644
--- a/Modules/Findosg.cmake
+++ b/Modules/Findosg.cmake
@@ -1,42 +1,43 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# Findosg
-# -------
-#
-#
-#
-#
-#
-# NOTE: It is highly recommended that you use the new
-# FindOpenSceneGraph.cmake introduced in CMake 2.6.3 and not use this
-# Find module directly.
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osg This module defines
-#
-# OSG_FOUND - Was the Osg found? OSG_INCLUDE_DIR - Where to find the
-# headers OSG_LIBRARIES - The libraries to link against for the OSG (use
-# this)
-#
-# OSG_LIBRARY - The OSG library OSG_LIBRARY_DEBUG - The OSG debug
-# library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+Findosg
+-------
+
+
+
+
+
+NOTE: It is highly recommended that you use the new
+FindOpenSceneGraph.cmake introduced in CMake 2.6.3 and not use this
+Find module directly.
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osg This module defines
+
+OSG_FOUND - Was the Osg found? OSG_INCLUDE_DIR - Where to find the
+headers OSG_LIBRARIES - The libraries to link against for the OSG (use
+this)
+
+OSG_LIBRARY - The OSG library OSG_LIBRARY_DEBUG - The OSG debug
+library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgAnimation.cmake b/Modules/FindosgAnimation.cmake
index 5b26b6485..65e301649 100644
--- a/Modules/FindosgAnimation.cmake
+++ b/Modules/FindosgAnimation.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgAnimation
-# ----------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgAnimation This module defines
-#
-# OSGANIMATION_FOUND - Was osgAnimation found? OSGANIMATION_INCLUDE_DIR
-# - Where to find the headers OSGANIMATION_LIBRARIES - The libraries to
-# link against for the OSG (use this)
-#
-# OSGANIMATION_LIBRARY - The OSG library OSGANIMATION_LIBRARY_DEBUG -
-# The OSG debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgAnimation
+----------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgAnimation This module defines
+
+OSGANIMATION_FOUND - Was osgAnimation found? OSGANIMATION_INCLUDE_DIR
+- Where to find the headers OSGANIMATION_LIBRARIES - The libraries to
+link against for the OSG (use this)
+
+OSGANIMATION_LIBRARY - The OSG library OSGANIMATION_LIBRARY_DEBUG -
+The OSG debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgDB.cmake b/Modules/FindosgDB.cmake
index 6ddf53ce0..d0789badb 100644
--- a/Modules/FindosgDB.cmake
+++ b/Modules/FindosgDB.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgDB
-# ---------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgDB This module defines
-#
-# OSGDB_FOUND - Was osgDB found? OSGDB_INCLUDE_DIR - Where to find the
-# headers OSGDB_LIBRARIES - The libraries to link against for the osgDB
-# (use this)
-#
-# OSGDB_LIBRARY - The osgDB library OSGDB_LIBRARY_DEBUG - The osgDB
-# debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgDB
+---------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgDB This module defines
+
+OSGDB_FOUND - Was osgDB found? OSGDB_INCLUDE_DIR - Where to find the
+headers OSGDB_LIBRARIES - The libraries to link against for the osgDB
+(use this)
+
+OSGDB_LIBRARY - The osgDB library OSGDB_LIBRARY_DEBUG - The osgDB
+debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgFX.cmake b/Modules/FindosgFX.cmake
index e4bc276d7..438fab7d5 100644
--- a/Modules/FindosgFX.cmake
+++ b/Modules/FindosgFX.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgFX
-# ---------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgFX This module defines
-#
-# OSGFX_FOUND - Was osgFX found? OSGFX_INCLUDE_DIR - Where to find the
-# headers OSGFX_LIBRARIES - The libraries to link against for the osgFX
-# (use this)
-#
-# OSGFX_LIBRARY - The osgFX library OSGFX_LIBRARY_DEBUG - The osgFX
-# debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgFX
+---------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgFX This module defines
+
+OSGFX_FOUND - Was osgFX found? OSGFX_INCLUDE_DIR - Where to find the
+headers OSGFX_LIBRARIES - The libraries to link against for the osgFX
+(use this)
+
+OSGFX_LIBRARY - The osgFX library OSGFX_LIBRARY_DEBUG - The osgFX
+debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgGA.cmake b/Modules/FindosgGA.cmake
index 97adeb7af..7b6ef30a2 100644
--- a/Modules/FindosgGA.cmake
+++ b/Modules/FindosgGA.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgGA
-# ---------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgGA This module defines
-#
-# OSGGA_FOUND - Was osgGA found? OSGGA_INCLUDE_DIR - Where to find the
-# headers OSGGA_LIBRARIES - The libraries to link against for the osgGA
-# (use this)
-#
-# OSGGA_LIBRARY - The osgGA library OSGGA_LIBRARY_DEBUG - The osgGA
-# debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgGA
+---------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgGA This module defines
+
+OSGGA_FOUND - Was osgGA found? OSGGA_INCLUDE_DIR - Where to find the
+headers OSGGA_LIBRARIES - The libraries to link against for the osgGA
+(use this)
+
+OSGGA_LIBRARY - The osgGA library OSGGA_LIBRARY_DEBUG - The osgGA
+debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgIntrospection.cmake b/Modules/FindosgIntrospection.cmake
index e735942c3..625e4c26e 100644
--- a/Modules/FindosgIntrospection.cmake
+++ b/Modules/FindosgIntrospection.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgIntrospection
-# --------------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgINTROSPECTION This module defines
-#
-# OSGINTROSPECTION_FOUND - Was osgIntrospection found?
-# OSGINTROSPECTION_INCLUDE_DIR - Where to find the headers
-# OSGINTROSPECTION_LIBRARIES - The libraries to link for
-# osgIntrospection (use this)
-#
-# OSGINTROSPECTION_LIBRARY - The osgIntrospection library
-# OSGINTROSPECTION_LIBRARY_DEBUG - The osgIntrospection debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgIntrospection
+--------------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgINTROSPECTION This module defines
+
+OSGINTROSPECTION_FOUND - Was osgIntrospection found?
+OSGINTROSPECTION_INCLUDE_DIR - Where to find the headers
+OSGINTROSPECTION_LIBRARIES - The libraries to link for
+osgIntrospection (use this)
+
+OSGINTROSPECTION_LIBRARY - The osgIntrospection library
+OSGINTROSPECTION_LIBRARY_DEBUG - The osgIntrospection debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgManipulator.cmake b/Modules/FindosgManipulator.cmake
index b88f1a414..857ff5d57 100644
--- a/Modules/FindosgManipulator.cmake
+++ b/Modules/FindosgManipulator.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgManipulator
-# ------------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgManipulator This module defines
-#
-# OSGMANIPULATOR_FOUND - Was osgManipulator found?
-# OSGMANIPULATOR_INCLUDE_DIR - Where to find the headers
-# OSGMANIPULATOR_LIBRARIES - The libraries to link for osgManipulator
-# (use this)
-#
-# OSGMANIPULATOR_LIBRARY - The osgManipulator library
-# OSGMANIPULATOR_LIBRARY_DEBUG - The osgManipulator debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgManipulator
+------------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgManipulator This module defines
+
+OSGMANIPULATOR_FOUND - Was osgManipulator found?
+OSGMANIPULATOR_INCLUDE_DIR - Where to find the headers
+OSGMANIPULATOR_LIBRARIES - The libraries to link for osgManipulator
+(use this)
+
+OSGMANIPULATOR_LIBRARY - The osgManipulator library
+OSGMANIPULATOR_LIBRARY_DEBUG - The osgManipulator debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgParticle.cmake b/Modules/FindosgParticle.cmake
index 059746a61..91a30dc7e 100644
--- a/Modules/FindosgParticle.cmake
+++ b/Modules/FindosgParticle.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgParticle
-# ---------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgParticle This module defines
-#
-# OSGPARTICLE_FOUND - Was osgParticle found? OSGPARTICLE_INCLUDE_DIR -
-# Where to find the headers OSGPARTICLE_LIBRARIES - The libraries to
-# link for osgParticle (use this)
-#
-# OSGPARTICLE_LIBRARY - The osgParticle library
-# OSGPARTICLE_LIBRARY_DEBUG - The osgParticle debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgParticle
+---------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgParticle This module defines
+
+OSGPARTICLE_FOUND - Was osgParticle found? OSGPARTICLE_INCLUDE_DIR -
+Where to find the headers OSGPARTICLE_LIBRARIES - The libraries to
+link for osgParticle (use this)
+
+OSGPARTICLE_LIBRARY - The osgParticle library
+OSGPARTICLE_LIBRARY_DEBUG - The osgParticle debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgPresentation.cmake b/Modules/FindosgPresentation.cmake
index 84a410526..eae75d638 100644
--- a/Modules/FindosgPresentation.cmake
+++ b/Modules/FindosgPresentation.cmake
@@ -1,38 +1,39 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgPresentation
-# -------------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgPresentation This module defines
-#
-# OSGPRESENTATION_FOUND - Was osgPresentation found?
-# OSGPRESENTATION_INCLUDE_DIR - Where to find the headers
-# OSGPRESENTATION_LIBRARIES - The libraries to link for osgPresentation
-# (use this)
-#
-# OSGPRESENTATION_LIBRARY - The osgPresentation library
-# OSGPRESENTATION_LIBRARY_DEBUG - The osgPresentation debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing. Modified to work with osgPresentation by Robert
-# Osfield, January 2012.
+#[=======================================================================[.rst:
+FindosgPresentation
+-------------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgPresentation This module defines
+
+OSGPRESENTATION_FOUND - Was osgPresentation found?
+OSGPRESENTATION_INCLUDE_DIR - Where to find the headers
+OSGPRESENTATION_LIBRARIES - The libraries to link for osgPresentation
+(use this)
+
+OSGPRESENTATION_LIBRARY - The osgPresentation library
+OSGPRESENTATION_LIBRARY_DEBUG - The osgPresentation debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing. Modified to work with osgPresentation by Robert
+Osfield, January 2012.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgProducer.cmake b/Modules/FindosgProducer.cmake
index e5700bfc4..33b9f7311 100644
--- a/Modules/FindosgProducer.cmake
+++ b/Modules/FindosgProducer.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgProducer
-# ---------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgProducer This module defines
-#
-# OSGPRODUCER_FOUND - Was osgProducer found? OSGPRODUCER_INCLUDE_DIR -
-# Where to find the headers OSGPRODUCER_LIBRARIES - The libraries to
-# link for osgProducer (use this)
-#
-# OSGPRODUCER_LIBRARY - The osgProducer library
-# OSGPRODUCER_LIBRARY_DEBUG - The osgProducer debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgProducer
+---------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgProducer This module defines
+
+OSGPRODUCER_FOUND - Was osgProducer found? OSGPRODUCER_INCLUDE_DIR -
+Where to find the headers OSGPRODUCER_LIBRARIES - The libraries to
+link for osgProducer (use this)
+
+OSGPRODUCER_LIBRARY - The osgProducer library
+OSGPRODUCER_LIBRARY_DEBUG - The osgProducer debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgQt.cmake b/Modules/FindosgQt.cmake
index 04a2393e5..cf356303c 100644
--- a/Modules/FindosgQt.cmake
+++ b/Modules/FindosgQt.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgQt
-# ---------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgQt This module defines
-#
-# OSGQT_FOUND - Was osgQt found? OSGQT_INCLUDE_DIR - Where to find the
-# headers OSGQT_LIBRARIES - The libraries to link for osgQt (use this)
-#
-# OSGQT_LIBRARY - The osgQt library OSGQT_LIBRARY_DEBUG - The osgQt
-# debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing. Modified to work with osgQt by Robert Osfield,
-# January 2012.
+#[=======================================================================[.rst:
+FindosgQt
+---------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgQt This module defines
+
+OSGQT_FOUND - Was osgQt found? OSGQT_INCLUDE_DIR - Where to find the
+headers OSGQT_LIBRARIES - The libraries to link for osgQt (use this)
+
+OSGQT_LIBRARY - The osgQt library OSGQT_LIBRARY_DEBUG - The osgQt
+debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing. Modified to work with osgQt by Robert Osfield,
+January 2012.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgShadow.cmake b/Modules/FindosgShadow.cmake
index 0a7ba2379..0049c4e1d 100644
--- a/Modules/FindosgShadow.cmake
+++ b/Modules/FindosgShadow.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgShadow
-# -------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgShadow This module defines
-#
-# OSGSHADOW_FOUND - Was osgShadow found? OSGSHADOW_INCLUDE_DIR - Where
-# to find the headers OSGSHADOW_LIBRARIES - The libraries to link for
-# osgShadow (use this)
-#
-# OSGSHADOW_LIBRARY - The osgShadow library OSGSHADOW_LIBRARY_DEBUG -
-# The osgShadow debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgShadow
+-------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgShadow This module defines
+
+OSGSHADOW_FOUND - Was osgShadow found? OSGSHADOW_INCLUDE_DIR - Where
+to find the headers OSGSHADOW_LIBRARIES - The libraries to link for
+osgShadow (use this)
+
+OSGSHADOW_LIBRARY - The osgShadow library OSGSHADOW_LIBRARY_DEBUG -
+The osgShadow debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgSim.cmake b/Modules/FindosgSim.cmake
index 15426a273..43ba54211 100644
--- a/Modules/FindosgSim.cmake
+++ b/Modules/FindosgSim.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgSim
-# ----------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgSim This module defines
-#
-# OSGSIM_FOUND - Was osgSim found? OSGSIM_INCLUDE_DIR - Where to find
-# the headers OSGSIM_LIBRARIES - The libraries to link for osgSim (use
-# this)
-#
-# OSGSIM_LIBRARY - The osgSim library OSGSIM_LIBRARY_DEBUG - The osgSim
-# debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgSim
+----------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgSim This module defines
+
+OSGSIM_FOUND - Was osgSim found? OSGSIM_INCLUDE_DIR - Where to find
+the headers OSGSIM_LIBRARIES - The libraries to link for osgSim (use
+this)
+
+OSGSIM_LIBRARY - The osgSim library OSGSIM_LIBRARY_DEBUG - The osgSim
+debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgTerrain.cmake b/Modules/FindosgTerrain.cmake
index 04eae1450..c6f5b690a 100644
--- a/Modules/FindosgTerrain.cmake
+++ b/Modules/FindosgTerrain.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgTerrain
-# --------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgTerrain This module defines
-#
-# OSGTERRAIN_FOUND - Was osgTerrain found? OSGTERRAIN_INCLUDE_DIR -
-# Where to find the headers OSGTERRAIN_LIBRARIES - The libraries to link
-# for osgTerrain (use this)
-#
-# OSGTERRAIN_LIBRARY - The osgTerrain library OSGTERRAIN_LIBRARY_DEBUG -
-# The osgTerrain debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgTerrain
+--------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgTerrain This module defines
+
+OSGTERRAIN_FOUND - Was osgTerrain found? OSGTERRAIN_INCLUDE_DIR -
+Where to find the headers OSGTERRAIN_LIBRARIES - The libraries to link
+for osgTerrain (use this)
+
+OSGTERRAIN_LIBRARY - The osgTerrain library OSGTERRAIN_LIBRARY_DEBUG -
+The osgTerrain debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgText.cmake b/Modules/FindosgText.cmake
index 1e2d9fdfd..fd3c2324f 100644
--- a/Modules/FindosgText.cmake
+++ b/Modules/FindosgText.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgText
-# -----------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgText This module defines
-#
-# OSGTEXT_FOUND - Was osgText found? OSGTEXT_INCLUDE_DIR - Where to find
-# the headers OSGTEXT_LIBRARIES - The libraries to link for osgText (use
-# this)
-#
-# OSGTEXT_LIBRARY - The osgText library OSGTEXT_LIBRARY_DEBUG - The
-# osgText debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgText
+-----------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgText This module defines
+
+OSGTEXT_FOUND - Was osgText found? OSGTEXT_INCLUDE_DIR - Where to find
+the headers OSGTEXT_LIBRARIES - The libraries to link for osgText (use
+this)
+
+OSGTEXT_LIBRARY - The osgText library OSGTEXT_LIBRARY_DEBUG - The
+osgText debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgUtil.cmake b/Modules/FindosgUtil.cmake
index 13e0b803e..e84727aef 100644
--- a/Modules/FindosgUtil.cmake
+++ b/Modules/FindosgUtil.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgUtil
-# -----------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgUtil This module defines
-#
-# OSGUTIL_FOUND - Was osgUtil found? OSGUTIL_INCLUDE_DIR - Where to find
-# the headers OSGUTIL_LIBRARIES - The libraries to link for osgUtil (use
-# this)
-#
-# OSGUTIL_LIBRARY - The osgUtil library OSGUTIL_LIBRARY_DEBUG - The
-# osgUtil debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgUtil
+-----------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgUtil This module defines
+
+OSGUTIL_FOUND - Was osgUtil found? OSGUTIL_INCLUDE_DIR - Where to find
+the headers OSGUTIL_LIBRARIES - The libraries to link for osgUtil (use
+this)
+
+OSGUTIL_LIBRARY - The osgUtil library OSGUTIL_LIBRARY_DEBUG - The
+osgUtil debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgViewer.cmake b/Modules/FindosgViewer.cmake
index a91c49c14..2174357ec 100644
--- a/Modules/FindosgViewer.cmake
+++ b/Modules/FindosgViewer.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgViewer
-# -------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgViewer This module defines
-#
-# OSGVIEWER_FOUND - Was osgViewer found? OSGVIEWER_INCLUDE_DIR - Where
-# to find the headers OSGVIEWER_LIBRARIES - The libraries to link for
-# osgViewer (use this)
-#
-# OSGVIEWER_LIBRARY - The osgViewer library OSGVIEWER_LIBRARY_DEBUG -
-# The osgViewer debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgViewer
+-------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgViewer This module defines
+
+OSGVIEWER_FOUND - Was osgViewer found? OSGVIEWER_INCLUDE_DIR - Where
+to find the headers OSGVIEWER_LIBRARIES - The libraries to link for
+osgViewer (use this)
+
+OSGVIEWER_LIBRARY - The osgViewer library OSGVIEWER_LIBRARY_DEBUG -
+The osgViewer debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgVolume.cmake b/Modules/FindosgVolume.cmake
index 1178ed37d..35defef6b 100644
--- a/Modules/FindosgVolume.cmake
+++ b/Modules/FindosgVolume.cmake
@@ -1,36 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgVolume
-# -------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgVolume This module defines
-#
-# OSGVOLUME_FOUND - Was osgVolume found? OSGVOLUME_INCLUDE_DIR - Where
-# to find the headers OSGVOLUME_LIBRARIES - The libraries to link for
-# osgVolume (use this)
-#
-# OSGVOLUME_LIBRARY - The osgVolume library OSGVOLUME_LIBRARY_DEBUG -
-# The osgVolume debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# Created by Eric Wing.
+#[=======================================================================[.rst:
+FindosgVolume
+-------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgVolume This module defines
+
+OSGVOLUME_FOUND - Was osgVolume found? OSGVOLUME_INCLUDE_DIR - Where
+to find the headers OSGVOLUME_LIBRARIES - The libraries to link for
+osgVolume (use this)
+
+OSGVOLUME_LIBRARY - The osgVolume library OSGVOLUME_LIBRARY_DEBUG -
+The osgVolume debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+Created by Eric Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/FindosgWidget.cmake b/Modules/FindosgWidget.cmake
index 78999ec3f..c7aae448e 100644
--- a/Modules/FindosgWidget.cmake
+++ b/Modules/FindosgWidget.cmake
@@ -1,37 +1,38 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindosgWidget
-# -------------
-#
-#
-#
-# This is part of the Findosg* suite used to find OpenSceneGraph
-# components. Each component is separate and you must opt in to each
-# module. You must also opt into OpenGL and OpenThreads (and Producer
-# if needed) as these modules won't do it for you. This is to allow you
-# control over your own system piece by piece in case you need to opt
-# out of certain components or change the Find behavior for a particular
-# module (perhaps because the default FindOpenGL.cmake module doesn't
-# work with your system as an example). If you want to use a more
-# convenient module that includes everything, use the
-# FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
-#
-# Locate osgWidget This module defines
-#
-# OSGWIDGET_FOUND - Was osgWidget found? OSGWIDGET_INCLUDE_DIR - Where
-# to find the headers OSGWIDGET_LIBRARIES - The libraries to link for
-# osgWidget (use this)
-#
-# OSGWIDGET_LIBRARY - The osgWidget library OSGWIDGET_LIBRARY_DEBUG -
-# The osgWidget debug library
-#
-# $OSGDIR is an environment variable that would correspond to the
-# ./configure --prefix=$OSGDIR used in building osg.
-#
-# FindosgWidget.cmake tweaked from Findosg* suite as created by Eric
-# Wing.
+#[=======================================================================[.rst:
+FindosgWidget
+-------------
+
+
+
+This is part of the Findosg* suite used to find OpenSceneGraph
+components. Each component is separate and you must opt in to each
+module. You must also opt into OpenGL and OpenThreads (and Producer
+if needed) as these modules won't do it for you. This is to allow you
+control over your own system piece by piece in case you need to opt
+out of certain components or change the Find behavior for a particular
+module (perhaps because the default FindOpenGL.cmake module doesn't
+work with your system as an example). If you want to use a more
+convenient module that includes everything, use the
+FindOpenSceneGraph.cmake instead of the Findosg*.cmake modules.
+
+Locate osgWidget This module defines
+
+OSGWIDGET_FOUND - Was osgWidget found? OSGWIDGET_INCLUDE_DIR - Where
+to find the headers OSGWIDGET_LIBRARIES - The libraries to link for
+osgWidget (use this)
+
+OSGWIDGET_LIBRARY - The osgWidget library OSGWIDGET_LIBRARY_DEBUG -
+The osgWidget debug library
+
+$OSGDIR is an environment variable that would correspond to the
+./configure --prefix=$OSGDIR used in building osg.
+
+FindosgWidget.cmake tweaked from Findosg* suite as created by Eric
+Wing.
+#]=======================================================================]
# Header files are presumed to be included like
# #include <osg/PositionAttitudeTransform>
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index adaeb6b1d..40df4d5dd 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -1,17 +1,18 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# Findosg_functions
-# -----------------
-#
-#
-#
-#
-#
-# This CMake file contains two macros to assist with searching for OSG
-# libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
-# documentation.
+#[=======================================================================[.rst:
+Findosg_functions
+-----------------
+
+
+
+
+
+This CMake file contains two macros to assist with searching for OSG
+libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
+documentation.
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index f2d628543..c813ead47 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -1,111 +1,112 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindwxWidgets
-# -------------
-#
-# Find a wxWidgets (a.k.a., wxWindows) installation.
-#
-# This module finds if wxWidgets is installed and selects a default
-# configuration to use. wxWidgets is a modular library. To specify the
-# modules that you will use, you need to name them as components to the
-# package:
-#
-# find_package(wxWidgets COMPONENTS core base ...)
-#
-# There are two search branches: a windows style and a unix style. For
-# windows, the following variables are searched for and set to defaults
-# in case of multiple choices. Change them if the defaults are not
-# desired (i.e., these are the only variables you should change to
-# select a configuration):
-#
-# ::
-#
-# wxWidgets_ROOT_DIR - Base wxWidgets directory
-# (e.g., C:/wxWidgets-2.6.3).
-# wxWidgets_LIB_DIR - Path to wxWidgets libraries
-# (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
-# wxWidgets_CONFIGURATION - Configuration to use
-# (e.g., msw, mswd, mswu, mswunivud, etc.)
-# wxWidgets_EXCLUDE_COMMON_LIBRARIES
-# - Set to TRUE to exclude linking of
-# commonly required libs (e.g., png tiff
-# jpeg zlib regex expat).
-#
-#
-#
-# For unix style it uses the wx-config utility. You can select between
-# debug/release, unicode/ansi, universal/non-universal, and
-# static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
-# the following variables:
-#
-# ::
-#
-# wxWidgets_USE_DEBUG
-# wxWidgets_USE_UNICODE
-# wxWidgets_USE_UNIVERSAL
-# wxWidgets_USE_STATIC
-#
-#
-#
-# There is also a wxWidgets_CONFIG_OPTIONS variable for all other
-# options that need to be passed to the wx-config utility. For example,
-# to use the base toolkit found in the /usr/local path, set the variable
-# (before calling the FIND_PACKAGE command) as such:
-#
-# ::
-#
-# set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
-#
-#
-#
-# The following are set after the configuration is done for both windows
-# and unix style:
-#
-# ::
-#
-# wxWidgets_FOUND - Set to TRUE if wxWidgets was found.
-# wxWidgets_INCLUDE_DIRS - Include directories for WIN32
-# i.e., where to find "wx/wx.h" and
-# "wx/setup.h"; possibly empty for unices.
-# wxWidgets_LIBRARIES - Path to the wxWidgets libraries.
-# wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for
-# rpath on UNIX. Typically an empty string
-# in WIN32 environment.
-# wxWidgets_DEFINITIONS - Contains defines required to compile/link
-# against WX, e.g. WXUSINGDLL
-# wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
-# against WX debug builds, e.g. __WXDEBUG__
-# wxWidgets_CXX_FLAGS - Include dirs and compiler flags for
-# unices, empty on WIN32. Essentially
-# "`wx-config --cxxflags`".
-# wxWidgets_USE_FILE - Convenience include file.
-#
-#
-#
-# Sample usage:
-#
-# ::
-#
-# # Note that for MinGW users the order of libs is important!
-# find_package(wxWidgets COMPONENTS net gl core base)
-# if(wxWidgets_FOUND)
-# include(${wxWidgets_USE_FILE})
-# # and for each of your dependent executable/library targets:
-# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
-# endif()
-#
-#
-#
-# If wxWidgets is required (i.e., not an optional part):
-#
-# ::
-#
-# find_package(wxWidgets REQUIRED net gl core base)
-# include(${wxWidgets_USE_FILE})
-# # and for each of your dependent executable/library targets:
-# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+#[=======================================================================[.rst:
+FindwxWidgets
+-------------
+
+Find a wxWidgets (a.k.a., wxWindows) installation.
+
+This module finds if wxWidgets is installed and selects a default
+configuration to use. wxWidgets is a modular library. To specify the
+modules that you will use, you need to name them as components to the
+package:
+
+find_package(wxWidgets COMPONENTS core base ... OPTIONAL_COMPONENTS net ...)
+
+There are two search branches: a windows style and a unix style. For
+windows, the following variables are searched for and set to defaults
+in case of multiple choices. Change them if the defaults are not
+desired (i.e., these are the only variables you should change to
+select a configuration):
+
+::
+
+ wxWidgets_ROOT_DIR - Base wxWidgets directory
+ (e.g., C:/wxWidgets-2.6.3).
+ wxWidgets_LIB_DIR - Path to wxWidgets libraries
+ (e.g., C:/wxWidgets-2.6.3/lib/vc_lib).
+ wxWidgets_CONFIGURATION - Configuration to use
+ (e.g., msw, mswd, mswu, mswunivud, etc.)
+ wxWidgets_EXCLUDE_COMMON_LIBRARIES
+ - Set to TRUE to exclude linking of
+ commonly required libs (e.g., png tiff
+ jpeg zlib regex expat).
+
+
+
+For unix style it uses the wx-config utility. You can select between
+debug/release, unicode/ansi, universal/non-universal, and
+static/shared in the QtDialog or ccmake interfaces by turning ON/OFF
+the following variables:
+
+::
+
+ wxWidgets_USE_DEBUG
+ wxWidgets_USE_UNICODE
+ wxWidgets_USE_UNIVERSAL
+ wxWidgets_USE_STATIC
+
+
+
+There is also a wxWidgets_CONFIG_OPTIONS variable for all other
+options that need to be passed to the wx-config utility. For example,
+to use the base toolkit found in the /usr/local path, set the variable
+(before calling the FIND_PACKAGE command) as such:
+
+::
+
+ set(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
+
+
+
+The following are set after the configuration is done for both windows
+and unix style:
+
+::
+
+ wxWidgets_FOUND - Set to TRUE if wxWidgets was found.
+ wxWidgets_INCLUDE_DIRS - Include directories for WIN32
+ i.e., where to find "wx/wx.h" and
+ "wx/setup.h"; possibly empty for unices.
+ wxWidgets_LIBRARIES - Path to the wxWidgets libraries.
+ wxWidgets_LIBRARY_DIRS - compile time link dirs, useful for
+ rpath on UNIX. Typically an empty string
+ in WIN32 environment.
+ wxWidgets_DEFINITIONS - Contains defines required to compile/link
+ against WX, e.g. WXUSINGDLL
+ wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link
+ against WX debug builds, e.g. __WXDEBUG__
+ wxWidgets_CXX_FLAGS - Include dirs and compiler flags for
+ unices, empty on WIN32. Essentially
+ "`wx-config --cxxflags`".
+ wxWidgets_USE_FILE - Convenience include file.
+
+
+
+Sample usage:
+
+::
+
+ # Note that for MinGW users the order of libs is important!
+ find_package(wxWidgets COMPONENTS gl core base OPTIONAL_COMPONENTS net)
+ if(wxWidgets_FOUND)
+ include(${wxWidgets_USE_FILE})
+ # and for each of your dependent executable/library targets:
+ target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+ endif()
+
+
+
+If wxWidgets is required (i.e., not an optional part):
+
+::
+
+ find_package(wxWidgets REQUIRED gl core base OPTIONAL_COMPONENTS net)
+ include(${wxWidgets_USE_FILE})
+ # and for each of your dependent executable/library targets:
+ target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+#]=======================================================================]
#
# FIXME: check this and provide a correct sample usage...
@@ -396,6 +397,9 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
list(APPEND wxWidgets_LIBRARIES
debug ${WX_${LIB}d} optimized ${WX_${LIB}}
)
+ set(wxWidgets_${LIB}_FOUND TRUE)
+ elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
+ DBG_MSG_V("- ignored optional missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
else()
DBG_MSG_V("- not found due to missing WX_${LIB}=${WX_${LIB}} or WX_${LIB}d=${WX_${LIB}d}")
set(wxWidgets_FOUND FALSE)
@@ -408,9 +412,11 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
if(WX_${LIB}${_DBG})
DBG_MSG_V("Found ${LIB}${_DBG}")
list(APPEND wxWidgets_LIBRARIES ${WX_${LIB}${_DBG}})
+ set(wxWidgets_${LIB}_FOUND TRUE)
+ elseif(NOT wxWidgets_FIND_REQUIRED_${LIB})
+ DBG_MSG_V("- ignored optional missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
else()
- DBG_MSG_V(
- "- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
+ DBG_MSG_V("- not found due to missing WX_${LIB}${_DBG}=${WX_${LIB}${_DBG}}")
set(wxWidgets_FOUND FALSE)
endif()
endforeach()
@@ -803,11 +809,24 @@ else()
# - NOTE: wx-config doesn't verify that the libs requested exist
# it just produces the names. Maybe a TRY_COMPILE would
# be useful here...
- string(REPLACE ";" ","
- wxWidgets_FIND_COMPONENTS "${wxWidgets_FIND_COMPONENTS}")
+ unset(_cmp_req)
+ unset(_cmp_opt)
+ foreach(_cmp IN LISTS wxWidgets_FIND_COMPONENTS)
+ if(wxWidgets_FIND_REQUIRED_${_cmp})
+ list(APPEND _cmp_req "${_cmp}")
+ else()
+ list(APPEND _cmp_opt "${_cmp}")
+ endif()
+ endforeach()
+ DBG_MSG_V("wxWidgets required components : ${_cmp_req}")
+ DBG_MSG_V("wxWidgets optional components : ${_cmp_opt}")
+ if(DEFINED _cmp_opt)
+ string(REPLACE ";" "," _cmp_opt "--optional-libs ${_cmp_opt}")
+ endif()
+ string(REPLACE ";" "," _cmp_req "${_cmp_req}")
execute_process(
COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
- ${wxWidgets_SELECT_OPTIONS} --libs ${wxWidgets_FIND_COMPONENTS}
+ ${wxWidgets_SELECT_OPTIONS} --libs ${_cmp_req} ${_cmp_opt}
OUTPUT_VARIABLE wxWidgets_LIBRARIES
RESULT_VARIABLE RET
ERROR_QUIET
@@ -833,8 +852,10 @@ else()
else()
set(wxWidgets_FOUND FALSE)
- DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${wxWidgets_FIND_COMPONENTS} FAILED with RET=${RET}")
+ DBG_MSG("${wxWidgets_CONFIG_EXECUTABLE} --libs ${_cmp_req} ${_cmp_opt} FAILED with RET=${RET}")
endif()
+ unset(_cmp_req)
+ unset(_cmp_opt)
endif()
# When using wx-config in MSYS, the include paths are UNIX style paths which may or may
@@ -960,10 +981,18 @@ DBG_MSG("wxWidgets_USE_FILE : ${wxWidgets_USE_FILE}")
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+# FIXME: set wxWidgets_<comp>_FOUND for wx-config branch
+# and use HANDLE_COMPONENTS on Unix too
+if(wxWidgets_FIND_STYLE STREQUAL "win32")
+ set(wxWidgets_HANDLE_COMPONENTS "HANDLE_COMPONENTS")
+endif()
+
find_package_handle_standard_args(wxWidgets
REQUIRED_VARS wxWidgets_LIBRARIES wxWidgets_INCLUDE_DIRS
VERSION_VAR wxWidgets_VERSION_STRING
+ ${wxWidgets_HANDLE_COMPONENTS}
)
+unset(wxWidgets_HANDLE_COMPONENTS)
#=====================================================================
# Macros for use in wxWidgets apps.
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index 115cdc6fe..35840f5f9 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -1,84 +1,87 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindwxWindows
-# -------------
-#
-# Find wxWindows (wxWidgets) installation
-#
-# This module finds if wxWindows/wxWidgets is installed and determines
-# where the include files and libraries are. It also determines what
-# the name of the library is. Please note this file is DEPRECATED and
-# replaced by FindwxWidgets.cmake. This code sets the following
-# variables:
-#
-# ::
-#
-# WXWINDOWS_FOUND = system has WxWindows
-# WXWINDOWS_LIBRARIES = path to the wxWindows libraries
-# on Unix/Linux with additional
-# linker flags from
-# "wx-config --libs"
-# CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
-# essentially "`wx-config --cxxflags`"
-# on Linux
-# WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
-# WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
-# Unix
-# WXWINDOWS_DEFINITIONS = extra defines
-#
-#
-#
-# OPTIONS If you need OpenGL support please
-#
-# ::
-#
-# set(WXWINDOWS_USE_GL 1)
-#
-# in your CMakeLists.txt *before* you include this file.
-#
-# ::
-#
-# HAVE_ISYSTEM - true required to replace -I by -isystem on g++
-#
-#
-#
-# For convenience include Use_wxWindows.cmake in your project's
-# CMakeLists.txt using
-# include(${CMAKE_CURRENT_LIST_DIR}/Use_wxWindows.cmake).
-#
-# USAGE
-#
-# ::
-#
-# set(WXWINDOWS_USE_GL 1)
-# find_package(wxWindows)
-#
-#
-#
-# NOTES wxWidgets 2.6.x is supported for monolithic builds e.g.
-# compiled in wx/build/msw dir as:
-#
-# ::
-#
-# nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
-#
-#
-#
-# DEPRECATED
-#
-# ::
-#
-# CMAKE_WX_CAN_COMPILE
-# WXWINDOWS_LIBRARY
-# CMAKE_WX_CXX_FLAGS
-# WXWINDOWS_INCLUDE_PATH
-#
-#
-#
-# AUTHOR Jan Woetzel <http://www.mip.informatik.uni-kiel.de/~jw>
-# (07/2003-01/2006)
+#[=======================================================================[.rst:
+FindwxWindows
+-------------
+
+.. deprecated:: 3.0
+
+ Replaced by :module:`FindwxWidgets`.
+
+Find wxWindows (wxWidgets) installation
+
+This module finds if wxWindows/wxWidgets is installed and determines
+where the include files and libraries are. It also determines what
+the name of the library is. This code sets the following variables:
+
+::
+
+ WXWINDOWS_FOUND = system has WxWindows
+ WXWINDOWS_LIBRARIES = path to the wxWindows libraries
+ on Unix/Linux with additional
+ linker flags from
+ "wx-config --libs"
+ CMAKE_WXWINDOWS_CXX_FLAGS = Compiler flags for wxWindows,
+ essentially "`wx-config --cxxflags`"
+ on Linux
+ WXWINDOWS_INCLUDE_DIR = where to find "wx/wx.h" and "wx/setup.h"
+ WXWINDOWS_LINK_DIRECTORIES = link directories, useful for rpath on
+ Unix
+ WXWINDOWS_DEFINITIONS = extra defines
+
+
+
+OPTIONS If you need OpenGL support please
+
+::
+
+ set(WXWINDOWS_USE_GL 1)
+
+in your CMakeLists.txt *before* you include this file.
+
+::
+
+ HAVE_ISYSTEM - true required to replace -I by -isystem on g++
+
+
+
+For convenience include Use_wxWindows.cmake in your project's
+CMakeLists.txt using
+include(${CMAKE_CURRENT_LIST_DIR}/Use_wxWindows.cmake).
+
+USAGE
+
+::
+
+ set(WXWINDOWS_USE_GL 1)
+ find_package(wxWindows)
+
+
+
+NOTES wxWidgets 2.6.x is supported for monolithic builds e.g.
+compiled in wx/build/msw dir as:
+
+::
+
+ nmake -f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 MONOLITHIC=1
+
+
+
+DEPRECATED
+
+::
+
+ CMAKE_WX_CAN_COMPILE
+ WXWINDOWS_LIBRARY
+ CMAKE_WX_CXX_FLAGS
+ WXWINDOWS_INCLUDE_PATH
+
+
+
+AUTHOR Jan Woetzel <http://www.mip.informatik.uni-kiel.de/~jw>
+(07/2003-01/2006)
+#]=======================================================================]
# ------------------------------------------------------------------
#
diff --git a/Modules/GNUInstallDirs.cmake b/Modules/GNUInstallDirs.cmake
index 3dfcf8c95..4db4e18fd 100644
--- a/Modules/GNUInstallDirs.cmake
+++ b/Modules/GNUInstallDirs.cmake
@@ -1,127 +1,128 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# GNUInstallDirs
-# --------------
-#
-# Define GNU standard installation directories
-#
-# Provides install directory variables as defined by the
-# `GNU Coding Standards`_.
-#
-# .. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# Inclusion of this module defines the following variables:
-#
-# ``CMAKE_INSTALL_<dir>``
-#
-# Destination for files of a given type. This value may be passed to
-# the ``DESTINATION`` options of :command:`install` commands for the
-# corresponding file type.
-#
-# ``CMAKE_INSTALL_FULL_<dir>``
-#
-# The absolute path generated from the corresponding ``CMAKE_INSTALL_<dir>``
-# value. If the value is not already an absolute path, an absolute path
-# is constructed typically by prepending the value of the
-# :variable:`CMAKE_INSTALL_PREFIX` variable. However, there are some
-# `special cases`_ as documented below.
-#
-# where ``<dir>`` is one of:
-#
-# ``BINDIR``
-# user executables (``bin``)
-# ``SBINDIR``
-# system admin executables (``sbin``)
-# ``LIBEXECDIR``
-# program executables (``libexec``)
-# ``SYSCONFDIR``
-# read-only single-machine data (``etc``)
-# ``SHAREDSTATEDIR``
-# modifiable architecture-independent data (``com``)
-# ``LOCALSTATEDIR``
-# modifiable single-machine data (``var``)
-# ``RUNSTATEDIR``
-# run-time variable data (``LOCALSTATEDIR/run``)
-# ``LIBDIR``
-# object code libraries (``lib`` or ``lib64``
-# or ``lib/<multiarch-tuple>`` on Debian)
-# ``INCLUDEDIR``
-# C header files (``include``)
-# ``OLDINCLUDEDIR``
-# C header files for non-gcc (``/usr/include``)
-# ``DATAROOTDIR``
-# read-only architecture-independent data root (``share``)
-# ``DATADIR``
-# read-only architecture-independent data (``DATAROOTDIR``)
-# ``INFODIR``
-# info documentation (``DATAROOTDIR/info``)
-# ``LOCALEDIR``
-# locale-dependent data (``DATAROOTDIR/locale``)
-# ``MANDIR``
-# man documentation (``DATAROOTDIR/man``)
-# ``DOCDIR``
-# documentation root (``DATAROOTDIR/doc/PROJECT_NAME``)
-#
-# If the includer does not define a value the above-shown default will be
-# used and the value will appear in the cache for editing by the user.
-#
-# Special Cases
-# ^^^^^^^^^^^^^
-#
-# The following values of :variable:`CMAKE_INSTALL_PREFIX` are special:
-#
-# ``/``
-#
-# For ``<dir>`` other than the ``SYSCONFDIR``, ``LOCALSTATEDIR`` and
-# ``RUNSTATEDIR``, the value of ``CMAKE_INSTALL_<dir>`` is prefixed
-# with ``usr/`` if it is not user-specified as an absolute path.
-# For example, the ``INCLUDEDIR`` value ``include`` becomes ``usr/include``.
-# This is required by the `GNU Coding Standards`_, which state:
-#
-# When building the complete GNU system, the prefix will be empty
-# and ``/usr`` will be a symbolic link to ``/``.
-#
-# ``/usr``
-#
-# For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
-# ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
-# prepending just ``/`` to the value of ``CMAKE_INSTALL_<dir>``
-# if it is not user-specified as an absolute path.
-# For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc``.
-# This is required by the `GNU Coding Standards`_.
-#
-# ``/opt/...``
-#
-# For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
-# ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
-# *appending* the prefix to the value of ``CMAKE_INSTALL_<dir>``
-# if it is not user-specified as an absolute path.
-# For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc/opt/...``.
-# This is defined by the `Filesystem Hierarchy Standard`_.
-#
-# .. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
-#
-# Macros
-# ^^^^^^
-#
-# .. command:: GNUInstallDirs_get_absolute_install_dir
-#
-# ::
-#
-# GNUInstallDirs_get_absolute_install_dir(absvar var)
-#
-# Set the given variable ``absvar`` to the absolute path contained
-# within the variable ``var``. This is to allow the computation of an
-# absolute path, accounting for all the special cases documented
-# above. While this macro is used to compute the various
-# ``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
-# allow users who create additional path variables to also compute
-# absolute paths where necessary, using the same logic.
+#[=======================================================================[.rst:
+GNUInstallDirs
+--------------
+
+Define GNU standard installation directories
+
+Provides install directory variables as defined by the
+`GNU Coding Standards`_.
+
+.. _`GNU Coding Standards`: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+Inclusion of this module defines the following variables:
+
+``CMAKE_INSTALL_<dir>``
+
+ Destination for files of a given type. This value may be passed to
+ the ``DESTINATION`` options of :command:`install` commands for the
+ corresponding file type.
+
+``CMAKE_INSTALL_FULL_<dir>``
+
+ The absolute path generated from the corresponding ``CMAKE_INSTALL_<dir>``
+ value. If the value is not already an absolute path, an absolute path
+ is constructed typically by prepending the value of the
+ :variable:`CMAKE_INSTALL_PREFIX` variable. However, there are some
+ `special cases`_ as documented below.
+
+where ``<dir>`` is one of:
+
+``BINDIR``
+ user executables (``bin``)
+``SBINDIR``
+ system admin executables (``sbin``)
+``LIBEXECDIR``
+ program executables (``libexec``)
+``SYSCONFDIR``
+ read-only single-machine data (``etc``)
+``SHAREDSTATEDIR``
+ modifiable architecture-independent data (``com``)
+``LOCALSTATEDIR``
+ modifiable single-machine data (``var``)
+``RUNSTATEDIR``
+ run-time variable data (``LOCALSTATEDIR/run``)
+``LIBDIR``
+ object code libraries (``lib`` or ``lib64``
+ or ``lib/<multiarch-tuple>`` on Debian)
+``INCLUDEDIR``
+ C header files (``include``)
+``OLDINCLUDEDIR``
+ C header files for non-gcc (``/usr/include``)
+``DATAROOTDIR``
+ read-only architecture-independent data root (``share``)
+``DATADIR``
+ read-only architecture-independent data (``DATAROOTDIR``)
+``INFODIR``
+ info documentation (``DATAROOTDIR/info``)
+``LOCALEDIR``
+ locale-dependent data (``DATAROOTDIR/locale``)
+``MANDIR``
+ man documentation (``DATAROOTDIR/man``)
+``DOCDIR``
+ documentation root (``DATAROOTDIR/doc/PROJECT_NAME``)
+
+If the includer does not define a value the above-shown default will be
+used and the value will appear in the cache for editing by the user.
+
+Special Cases
+^^^^^^^^^^^^^
+
+The following values of :variable:`CMAKE_INSTALL_PREFIX` are special:
+
+``/``
+
+ For ``<dir>`` other than the ``SYSCONFDIR``, ``LOCALSTATEDIR`` and
+ ``RUNSTATEDIR``, the value of ``CMAKE_INSTALL_<dir>`` is prefixed
+ with ``usr/`` if it is not user-specified as an absolute path.
+ For example, the ``INCLUDEDIR`` value ``include`` becomes ``usr/include``.
+ This is required by the `GNU Coding Standards`_, which state:
+
+ When building the complete GNU system, the prefix will be empty
+ and ``/usr`` will be a symbolic link to ``/``.
+
+``/usr``
+
+ For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
+ ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
+ prepending just ``/`` to the value of ``CMAKE_INSTALL_<dir>``
+ if it is not user-specified as an absolute path.
+ For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc``.
+ This is required by the `GNU Coding Standards`_.
+
+``/opt/...``
+
+ For ``<dir>`` equal to ``SYSCONFDIR``, ``LOCALSTATEDIR`` or
+ ``RUNSTATEDIR``, the ``CMAKE_INSTALL_FULL_<dir>`` is computed by
+ *appending* the prefix to the value of ``CMAKE_INSTALL_<dir>``
+ if it is not user-specified as an absolute path.
+ For example, the ``SYSCONFDIR`` value ``etc`` becomes ``/etc/opt/...``.
+ This is defined by the `Filesystem Hierarchy Standard`_.
+
+.. _`Filesystem Hierarchy Standard`: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html
+
+Macros
+^^^^^^
+
+.. command:: GNUInstallDirs_get_absolute_install_dir
+
+ ::
+
+ GNUInstallDirs_get_absolute_install_dir(absvar var)
+
+ Set the given variable ``absvar`` to the absolute path contained
+ within the variable ``var``. This is to allow the computation of an
+ absolute path, accounting for all the special cases documented
+ above. While this macro is used to compute the various
+ ``CMAKE_INSTALL_FULL_<dir>`` variables, it is exposed publicly to
+ allow users who create additional path variables to also compute
+ absolute paths where necessary, using the same logic.
+#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
@@ -276,14 +277,18 @@ _GNUInstallDirs_cache_path(CMAKE_INSTALL_DATAROOTDIR "share"
_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}"
"Read-only architecture-independent data (DATAROOTDIR)")
-if(CMAKE_SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$")
+if(CMAKE_SYSTEM_NAME MATCHES "^(([^kF].*)?BSD|DragonFly)$")
_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "info"
"Info documentation (info)")
- _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "man"
- "Man documentation (man)")
else()
_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info"
"Info documentation (DATAROOTDIR/info)")
+endif()
+
+if(CMAKE_SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$")
+ _GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "man"
+ "Man documentation (man)")
+else()
_GNUInstallDirs_cache_path_fallback(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man"
"Man documentation (DATAROOTDIR/man)")
endif()
diff --git a/Modules/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index e6dcd00f7..f2e452766 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -1,189 +1,190 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# GenerateExportHeader
-# --------------------
-#
-# Function for generation of export macros for libraries
-#
-# This module provides the function GENERATE_EXPORT_HEADER().
-#
-# The ``GENERATE_EXPORT_HEADER`` function can be used to generate a file
-# suitable for preprocessor inclusion which contains EXPORT macros to be
-# used in library classes::
-#
-# GENERATE_EXPORT_HEADER( LIBRARY_TARGET
-# [BASE_NAME <base_name>]
-# [EXPORT_MACRO_NAME <export_macro_name>]
-# [EXPORT_FILE_NAME <export_file_name>]
-# [DEPRECATED_MACRO_NAME <deprecated_macro_name>]
-# [NO_EXPORT_MACRO_NAME <no_export_macro_name>]
-# [INCLUDE_GUARD_NAME <include_guard_name>]
-# [STATIC_DEFINE <static_define>]
-# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
-# [DEFINE_NO_DEPRECATED]
-# [PREFIX_NAME <prefix_name>]
-# [CUSTOM_CONTENT_FROM_VARIABLE <variable>]
-# )
-#
-#
-# The target properties :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>`
-# and :prop_tgt:`VISIBILITY_INLINES_HIDDEN` can be used to add the appropriate
-# compile flags for targets. See the documentation of those target properties,
-# and the convenience variables
-# :variable:`CMAKE_CXX_VISIBILITY_PRESET <CMAKE_<LANG>_VISIBILITY_PRESET>` and
-# :variable:`CMAKE_VISIBILITY_INLINES_HIDDEN`.
-#
-# By default ``GENERATE_EXPORT_HEADER()`` generates macro names in a file
-# name determined by the name of the library. This means that in the
-# simplest case, users of ``GenerateExportHeader`` will be equivalent to:
-#
-# .. code-block:: cmake
-#
-# set(CMAKE_CXX_VISIBILITY_PRESET hidden)
-# set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-# add_library(somelib someclass.cpp)
-# generate_export_header(somelib)
-# install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
-# install(FILES
-# someclass.h
-# ${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}
-# )
-#
-#
-# And in the ABI header files:
-#
-# .. code-block:: c++
-#
-# #include "somelib_export.h"
-# class SOMELIB_EXPORT SomeClass {
-# ...
-# };
-#
-#
-# The CMake fragment will generate a file in the
-# ``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
-# macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
-# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``.
-# They will be followed by content taken from the variable specified by
-# the ``CUSTOM_CONTENT_FROM_VARIABLE`` option, if any.
-# The resulting file should be installed with other headers in the library.
-#
-# The ``BASE_NAME`` argument can be used to override the file name and the
-# names used for the macros:
-#
-# .. code-block:: cmake
-#
-# add_library(somelib someclass.cpp)
-# generate_export_header(somelib
-# BASE_NAME other_name
-# )
-#
-#
-# Generates a file called ``other_name_export.h`` containing the macros
-# ``OTHER_NAME_EXPORT``, ``OTHER_NAME_NO_EXPORT`` and ``OTHER_NAME_DEPRECATED``
-# etc.
-#
-# The ``BASE_NAME`` may be overridden by specifying other options in the
-# function. For example:
-#
-# .. code-block:: cmake
-#
-# add_library(somelib someclass.cpp)
-# generate_export_header(somelib
-# EXPORT_MACRO_NAME OTHER_NAME_EXPORT
-# )
-#
-#
-# creates the macro ``OTHER_NAME_EXPORT`` instead of ``SOMELIB_EXPORT``, but
-# other macros and the generated file name is as default:
-#
-# .. code-block:: cmake
-#
-# add_library(somelib someclass.cpp)
-# generate_export_header(somelib
-# DEPRECATED_MACRO_NAME KDE_DEPRECATED
-# )
-#
-#
-# creates the macro ``KDE_DEPRECATED`` instead of ``SOMELIB_DEPRECATED``.
-#
-# If ``LIBRARY_TARGET`` is a static library, macros are defined without
-# values.
-#
-# If the same sources are used to create both a shared and a static
-# library, the uppercased symbol ``${BASE_NAME}_STATIC_DEFINE`` should be
-# used when building the static library:
-#
-# .. code-block:: cmake
-#
-# add_library(shared_variant SHARED ${lib_SRCS})
-# add_library(static_variant ${lib_SRCS})
-# generate_export_header(shared_variant BASE_NAME libshared_and_static)
-# set_target_properties(static_variant PROPERTIES
-# COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
-#
-# This will cause the export macros to expand to nothing when building
-# the static library.
-#
-# If ``DEFINE_NO_DEPRECATED`` is specified, then a macro
-# ``${BASE_NAME}_NO_DEPRECATED`` will be defined This macro can be used to
-# remove deprecated code from preprocessor output:
-#
-# .. code-block:: cmake
-#
-# option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
-# if (EXCLUDE_DEPRECATED)
-# set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
-# endif()
-# generate_export_header(somelib ${NO_BUILD_DEPRECATED})
-#
-#
-# And then in somelib:
-#
-# .. code-block:: c++
-#
-# class SOMELIB_EXPORT SomeClass
-# {
-# public:
-# #ifndef SOMELIB_NO_DEPRECATED
-# SOMELIB_DEPRECATED void oldMethod();
-# #endif
-# };
-#
-# .. code-block:: c++
-#
-# #ifndef SOMELIB_NO_DEPRECATED
-# void SomeClass::oldMethod() { }
-# #endif
-#
-#
-# If ``PREFIX_NAME`` is specified, the argument will be used as a prefix to
-# all generated macros.
-#
-# For example:
-#
-# .. code-block:: cmake
-#
-# generate_export_header(somelib PREFIX_NAME VTK_)
-#
-# Generates the macros ``VTK_SOMELIB_EXPORT`` etc.
-#
-# ::
-#
-# ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
-#
-# The ``ADD_COMPILER_EXPORT_FLAGS`` function adds ``-fvisibility=hidden`` to
-# :variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` if supported, and is a no-op
-# on Windows which does not need extra compiler flags for exporting support.
-# You may optionally pass a single argument to ``ADD_COMPILER_EXPORT_FLAGS``
-# that will be populated with the ``CXX_FLAGS`` required to enable visibility
-# support for the compiler/architecture in use.
-#
-# This function is deprecated. Set the target properties
-# :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>` and
-# :prop_tgt:`VISIBILITY_INLINES_HIDDEN` instead.
+#[=======================================================================[.rst:
+GenerateExportHeader
+--------------------
+
+Function for generation of export macros for libraries
+
+This module provides the function GENERATE_EXPORT_HEADER().
+
+The ``GENERATE_EXPORT_HEADER`` function can be used to generate a file
+suitable for preprocessor inclusion which contains EXPORT macros to be
+used in library classes::
+
+ GENERATE_EXPORT_HEADER( LIBRARY_TARGET
+ [BASE_NAME <base_name>]
+ [EXPORT_MACRO_NAME <export_macro_name>]
+ [EXPORT_FILE_NAME <export_file_name>]
+ [DEPRECATED_MACRO_NAME <deprecated_macro_name>]
+ [NO_EXPORT_MACRO_NAME <no_export_macro_name>]
+ [INCLUDE_GUARD_NAME <include_guard_name>]
+ [STATIC_DEFINE <static_define>]
+ [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
+ [DEFINE_NO_DEPRECATED]
+ [PREFIX_NAME <prefix_name>]
+ [CUSTOM_CONTENT_FROM_VARIABLE <variable>]
+ )
+
+
+The target properties :prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>`
+and :prop_tgt:`VISIBILITY_INLINES_HIDDEN` can be used to add the appropriate
+compile flags for targets. See the documentation of those target properties,
+and the convenience variables
+:variable:`CMAKE_CXX_VISIBILITY_PRESET <CMAKE_<LANG>_VISIBILITY_PRESET>` and
+:variable:`CMAKE_VISIBILITY_INLINES_HIDDEN`.
+
+By default ``GENERATE_EXPORT_HEADER()`` generates macro names in a file
+name determined by the name of the library. This means that in the
+simplest case, users of ``GenerateExportHeader`` will be equivalent to:
+
+.. code-block:: cmake
+
+ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+ set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+ add_library(somelib someclass.cpp)
+ generate_export_header(somelib)
+ install(TARGETS somelib DESTINATION ${LIBRARY_INSTALL_DIR})
+ install(FILES
+ someclass.h
+ ${PROJECT_BINARY_DIR}/somelib_export.h DESTINATION ${INCLUDE_INSTALL_DIR}
+ )
+
+
+And in the ABI header files:
+
+.. code-block:: c++
+
+ #include "somelib_export.h"
+ class SOMELIB_EXPORT SomeClass {
+ ...
+ };
+
+
+The CMake fragment will generate a file in the
+``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
+macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
+``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``.
+They will be followed by content taken from the variable specified by
+the ``CUSTOM_CONTENT_FROM_VARIABLE`` option, if any.
+The resulting file should be installed with other headers in the library.
+
+The ``BASE_NAME`` argument can be used to override the file name and the
+names used for the macros:
+
+.. code-block:: cmake
+
+ add_library(somelib someclass.cpp)
+ generate_export_header(somelib
+ BASE_NAME other_name
+ )
+
+
+Generates a file called ``other_name_export.h`` containing the macros
+``OTHER_NAME_EXPORT``, ``OTHER_NAME_NO_EXPORT`` and ``OTHER_NAME_DEPRECATED``
+etc.
+
+The ``BASE_NAME`` may be overridden by specifying other options in the
+function. For example:
+
+.. code-block:: cmake
+
+ add_library(somelib someclass.cpp)
+ generate_export_header(somelib
+ EXPORT_MACRO_NAME OTHER_NAME_EXPORT
+ )
+
+
+creates the macro ``OTHER_NAME_EXPORT`` instead of ``SOMELIB_EXPORT``, but
+other macros and the generated file name is as default:
+
+.. code-block:: cmake
+
+ add_library(somelib someclass.cpp)
+ generate_export_header(somelib
+ DEPRECATED_MACRO_NAME KDE_DEPRECATED
+ )
+
+
+creates the macro ``KDE_DEPRECATED`` instead of ``SOMELIB_DEPRECATED``.
+
+If ``LIBRARY_TARGET`` is a static library, macros are defined without
+values.
+
+If the same sources are used to create both a shared and a static
+library, the uppercased symbol ``${BASE_NAME}_STATIC_DEFINE`` should be
+used when building the static library:
+
+.. code-block:: cmake
+
+ add_library(shared_variant SHARED ${lib_SRCS})
+ add_library(static_variant ${lib_SRCS})
+ generate_export_header(shared_variant BASE_NAME libshared_and_static)
+ set_target_properties(static_variant PROPERTIES
+ COMPILE_FLAGS -DLIBSHARED_AND_STATIC_STATIC_DEFINE)
+
+This will cause the export macros to expand to nothing when building
+the static library.
+
+If ``DEFINE_NO_DEPRECATED`` is specified, then a macro
+``${BASE_NAME}_NO_DEPRECATED`` will be defined This macro can be used to
+remove deprecated code from preprocessor output:
+
+.. code-block:: cmake
+
+ option(EXCLUDE_DEPRECATED "Exclude deprecated parts of the library" FALSE)
+ if (EXCLUDE_DEPRECATED)
+ set(NO_BUILD_DEPRECATED DEFINE_NO_DEPRECATED)
+ endif()
+ generate_export_header(somelib ${NO_BUILD_DEPRECATED})
+
+
+And then in somelib:
+
+.. code-block:: c++
+
+ class SOMELIB_EXPORT SomeClass
+ {
+ public:
+ #ifndef SOMELIB_NO_DEPRECATED
+ SOMELIB_DEPRECATED void oldMethod();
+ #endif
+ };
+
+.. code-block:: c++
+
+ #ifndef SOMELIB_NO_DEPRECATED
+ void SomeClass::oldMethod() { }
+ #endif
+
+
+If ``PREFIX_NAME`` is specified, the argument will be used as a prefix to
+all generated macros.
+
+For example:
+
+.. code-block:: cmake
+
+ generate_export_header(somelib PREFIX_NAME VTK_)
+
+Generates the macros ``VTK_SOMELIB_EXPORT`` etc.
+
+::
+
+ ADD_COMPILER_EXPORT_FLAGS( [<output_variable>] )
+
+The ``ADD_COMPILER_EXPORT_FLAGS`` function adds ``-fvisibility=hidden`` to
+:variable:`CMAKE_CXX_FLAGS <CMAKE_<LANG>_FLAGS>` if supported, and is a no-op
+on Windows which does not need extra compiler flags for exporting support.
+You may optionally pass a single argument to ``ADD_COMPILER_EXPORT_FLAGS``
+that will be populated with the ``CXX_FLAGS`` required to enable visibility
+support for the compiler/architecture in use.
+
+This function is deprecated. Set the target properties
+:prop_tgt:`CXX_VISIBILITY_PRESET <<LANG>_VISIBILITY_PRESET>` and
+:prop_tgt:`VISIBILITY_INLINES_HIDDEN` instead.
+#]=======================================================================]
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index ca710090f..fa6d75ae4 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -1,169 +1,173 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# GetPrerequisites
-# ----------------
-#
-# Functions to analyze and list executable file prerequisites.
-#
-# This module provides functions to list the .dll, .dylib or .so files
-# that an executable or shared library file depends on. (Its
-# prerequisites.)
-#
-# It uses various tools to obtain the list of required shared library
-# files:
-#
-# ::
-#
-# dumpbin (Windows)
-# objdump (MinGW on Windows)
-# ldd (Linux/Unix)
-# otool (Mac OSX)
-#
-# The following functions are provided by this module:
-#
-# ::
-#
-# get_prerequisites
-# list_prerequisites
-# list_prerequisites_by_glob
-# gp_append_unique
-# is_file_executable
-# gp_item_default_embedded_path
-# (projects can override with gp_item_default_embedded_path_override)
-# gp_resolve_item
-# (projects can override with gp_resolve_item_override)
-# gp_resolved_file_type
-# (projects can override with gp_resolved_file_type_override)
-# gp_file_type
-#
-# Requires CMake 2.6 or greater because it uses function, break, return
-# and PARENT_SCOPE.
-#
-# ::
-#
-# GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
-# <exepath> <dirs> [<rpaths>])
-#
-# Get the list of shared library files required by <target>. The list
-# in the variable named <prerequisites_var> should be empty on first
-# entry to this function. On exit, <prerequisites_var> will contain the
-# list of required shared library files.
-#
-# <target> is the full path to an executable file. <prerequisites_var>
-# is the name of a CMake variable to contain the results.
-# <exclude_system> must be 0 or 1 indicating whether to include or
-# exclude "system" prerequisites. If <recurse> is set to 1 all
-# prerequisites will be found recursively, if set to 0 only direct
-# prerequisites are listed. <exepath> is the path to the top level
-# executable used for @executable_path replacment on the Mac. <dirs> is
-# a list of paths where libraries might be found: these paths are
-# searched first when a target without any path info is given. Then
-# standard system locations are also searched: PATH, Framework
-# locations, /usr/lib...
-#
-# ::
-#
-# LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
-#
-# Print a message listing the prerequisites of <target>.
-#
-# <target> is the name of a shared library or executable target or the
-# full path to a shared library or executable file. If <recurse> is set
-# to 1 all prerequisites will be found recursively, if set to 0 only
-# direct prerequisites are listed. <exclude_system> must be 0 or 1
-# indicating whether to include or exclude "system" prerequisites. With
-# <verbose> set to 0 only the full path names of the prerequisites are
-# printed, set to 1 extra informatin will be displayed.
-#
-# ::
-#
-# LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
-#
-# Print the prerequisites of shared library and executable files
-# matching a globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE and
-# <glob_exp> is a globbing expression used with "file(GLOB" or
-# "file(GLOB_RECURSE" to retrieve a list of matching files. If a
-# matching file is executable, its prerequisites are listed.
-#
-# Any additional (optional) arguments provided are passed along as the
-# optional arguments to the list_prerequisites calls.
-#
-# ::
-#
-# GP_APPEND_UNIQUE(<list_var> <value>)
-#
-# Append <value> to the list variable <list_var> only if the value is
-# not already in the list.
-#
-# ::
-#
-# IS_FILE_EXECUTABLE(<file> <result_var>)
-#
-# Return 1 in <result_var> if <file> is a binary executable, 0
-# otherwise.
-#
-# ::
-#
-# GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
-#
-# Return the path that others should refer to the item by when the item
-# is embedded inside a bundle.
-#
-# Override on a per-project basis by providing a project-specific
-# gp_item_default_embedded_path_override function.
-#
-# ::
-#
-# GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>
-# [<rpaths>])
-#
-# Resolve an item into an existing full path file.
-#
-# Override on a per-project basis by providing a project-specific
-# gp_resolve_item_override function.
-#
-# ::
-#
-# GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>
-# [<rpaths>])
-#
-# Return the type of <file> with respect to <original_file>. String
-# describing type of prerequisite is returned in variable named
-# <type_var>.
-#
-# Use <exepath> and <dirs> if necessary to resolve non-absolute <file>
-# values -- but only for non-embedded items.
-#
-# Possible types are:
-#
-# ::
-#
-# system
-# local
-# embedded
-# other
-#
-# Override on a per-project basis by providing a project-specific
-# gp_resolved_file_type_override function.
-#
-# ::
-#
-# GP_FILE_TYPE(<original_file> <file> <type_var>)
-#
-# Return the type of <file> with respect to <original_file>. String
-# describing type of prerequisite is returned in variable named
-# <type_var>.
-#
-# Possible types are:
-#
-# ::
-#
-# system
-# local
-# embedded
-# other
+#[=======================================================================[.rst:
+GetPrerequisites
+----------------
+
+Functions to analyze and list executable file prerequisites.
+
+This module provides functions to list the .dll, .dylib or .so files
+that an executable or shared library file depends on. (Its
+prerequisites.)
+
+It uses various tools to obtain the list of required shared library
+files:
+
+::
+
+ dumpbin (Windows)
+ objdump (MinGW on Windows)
+ ldd (Linux/Unix)
+ otool (Mac OSX)
+
+The following functions are provided by this module:
+
+::
+
+ get_prerequisites
+ list_prerequisites
+ list_prerequisites_by_glob
+ gp_append_unique
+ is_file_executable
+ gp_item_default_embedded_path
+ (projects can override with gp_item_default_embedded_path_override)
+ gp_resolve_item
+ (projects can override with gp_resolve_item_override)
+ gp_resolved_file_type
+ (projects can override with gp_resolved_file_type_override)
+ gp_file_type
+
+Requires CMake 2.6 or greater because it uses function, break, return
+and PARENT_SCOPE.
+
+::
+
+ GET_PREREQUISITES(<target> <prerequisites_var> <exclude_system> <recurse>
+ <exepath> <dirs> [<rpaths>])
+
+Get the list of shared library files required by <target>. The list
+in the variable named <prerequisites_var> should be empty on first
+entry to this function. On exit, <prerequisites_var> will contain the
+list of required shared library files.
+
+<target> is the full path to an executable file. <prerequisites_var>
+is the name of a CMake variable to contain the results.
+<exclude_system> must be 0 or 1 indicating whether to include or
+exclude "system" prerequisites. If <recurse> is set to 1 all
+prerequisites will be found recursively, if set to 0 only direct
+prerequisites are listed. <exepath> is the path to the top level
+executable used for @executable_path replacment on the Mac. <dirs> is
+a list of paths where libraries might be found: these paths are
+searched first when a target without any path info is given. Then
+standard system locations are also searched: PATH, Framework
+locations, /usr/lib...
+
+The variable GET_PREREQUISITES_VERBOSE can be set to true to enable verbose
+output.
+
+::
+
+ LIST_PREREQUISITES(<target> [<recurse> [<exclude_system> [<verbose>]]])
+
+Print a message listing the prerequisites of <target>.
+
+<target> is the name of a shared library or executable target or the
+full path to a shared library or executable file. If <recurse> is set
+to 1 all prerequisites will be found recursively, if set to 0 only
+direct prerequisites are listed. <exclude_system> must be 0 or 1
+indicating whether to include or exclude "system" prerequisites. With
+<verbose> set to 0 only the full path names of the prerequisites are
+printed, set to 1 extra informatin will be displayed.
+
+::
+
+ LIST_PREREQUISITES_BY_GLOB(<glob_arg> <glob_exp>)
+
+Print the prerequisites of shared library and executable files
+matching a globbing pattern. <glob_arg> is GLOB or GLOB_RECURSE and
+<glob_exp> is a globbing expression used with "file(GLOB" or
+"file(GLOB_RECURSE" to retrieve a list of matching files. If a
+matching file is executable, its prerequisites are listed.
+
+Any additional (optional) arguments provided are passed along as the
+optional arguments to the list_prerequisites calls.
+
+::
+
+ GP_APPEND_UNIQUE(<list_var> <value>)
+
+Append <value> to the list variable <list_var> only if the value is
+not already in the list.
+
+::
+
+ IS_FILE_EXECUTABLE(<file> <result_var>)
+
+Return 1 in <result_var> if <file> is a binary executable, 0
+otherwise.
+
+::
+
+ GP_ITEM_DEFAULT_EMBEDDED_PATH(<item> <default_embedded_path_var>)
+
+Return the path that others should refer to the item by when the item
+is embedded inside a bundle.
+
+Override on a per-project basis by providing a project-specific
+gp_item_default_embedded_path_override function.
+
+::
+
+ GP_RESOLVE_ITEM(<context> <item> <exepath> <dirs> <resolved_item_var>
+ [<rpaths>])
+
+Resolve an item into an existing full path file.
+
+Override on a per-project basis by providing a project-specific
+gp_resolve_item_override function.
+
+::
+
+ GP_RESOLVED_FILE_TYPE(<original_file> <file> <exepath> <dirs> <type_var>
+ [<rpaths>])
+
+Return the type of <file> with respect to <original_file>. String
+describing type of prerequisite is returned in variable named
+<type_var>.
+
+Use <exepath> and <dirs> if necessary to resolve non-absolute <file>
+values -- but only for non-embedded items.
+
+Possible types are:
+
+::
+
+ system
+ local
+ embedded
+ other
+
+Override on a per-project basis by providing a project-specific
+gp_resolved_file_type_override function.
+
+::
+
+ GP_FILE_TYPE(<original_file> <file> <type_var>)
+
+Return the type of <file> with respect to <original_file>. String
+describing type of prerequisite is returned in variable named
+<type_var>.
+
+Possible types are:
+
+::
+
+ system
+ local
+ embedded
+ other
+#]=======================================================================]
function(gp_append_unique list_var value)
set(contains 0)
@@ -643,6 +647,10 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(rpaths "")
endif()
+ if(GET_PREREQUISITES_VERBOSE)
+ set(verbose 1)
+ endif()
+
if(NOT IS_ABSOLUTE "${target}")
message("warning: target '${target}' is not absolute...")
endif()
@@ -652,6 +660,15 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
return()
endif()
+ # Check for a script by extension (.bat,.sh,...) or if the file starts with "#!" (shebang)
+ file(READ ${target} file_contents LIMIT 5)
+ if(target MATCHES "\\.(bat|c?sh|bash|ksh|cmd)$" OR file_contents MATCHES "^#!")
+ message(STATUS "GetPrequisites(${target}) : ignoring script file")
+ # Clear var
+ set(${prerequisites_var} "" PARENT_SCOPE)
+ return()
+ endif()
+
set(gp_cmd_paths ${gp_cmd_paths}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]/../../VC/bin"
"$ENV{VS140COMNTOOLS}/../../VC/bin"
@@ -710,25 +727,25 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(gp_cmd_maybe_filter) # optional command to pre-filter gp_tool results
- if(gp_tool STREQUAL "ldd")
+ if(gp_tool MATCHES "ldd$")
set(gp_cmd_args "")
set(gp_regex "^[\t ]*[^\t ]+ => ([^\t\(]+) .*${eol_char}$")
set(gp_regex_error "not found${eol_char}$")
set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$")
set(gp_regex_cmp_count 1)
- elseif(gp_tool STREQUAL "otool")
+ elseif(gp_tool MATCHES "otool$")
set(gp_cmd_args "-L")
set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$")
set(gp_regex_error "")
set(gp_regex_fallback "")
set(gp_regex_cmp_count 3)
- elseif(gp_tool STREQUAL "dumpbin")
+ elseif(gp_tool MATCHES "dumpbin$")
set(gp_cmd_args "/dependents")
set(gp_regex "^ ([^ ].*[Dd][Ll][Ll])${eol_char}$")
set(gp_regex_error "")
set(gp_regex_fallback "")
set(gp_regex_cmp_count 1)
- elseif(gp_tool STREQUAL "objdump")
+ elseif(gp_tool MATCHES "objdump$")
set(gp_cmd_args "-p")
set(gp_regex "^\t*DLL Name: (.*\\.[Dd][Ll][Ll])${eol_char}$")
set(gp_regex_error "")
@@ -751,7 +768,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
endif()
- if(gp_tool STREQUAL "dumpbin")
+ if(gp_tool MATCHES "dumpbin$")
# When running dumpbin, it also needs the "Common7/IDE" directory in the
# PATH. It will already be in the PATH if being run from a Visual Studio
# command prompt. Add it to the PATH here in case we are running from a
@@ -780,7 +797,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
# </setup-gp_tool-vars>
- if(gp_tool STREQUAL "ldd")
+ if(gp_tool MATCHES "ldd$")
set(old_ld_env "$ENV{LD_LIBRARY_PATH}")
set(new_ld_env "${exepath}")
foreach(dir ${dirs})
@@ -805,7 +822,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
ERROR_VARIABLE gp_ev
)
- if(gp_tool STREQUAL "dumpbin")
+ if(gp_tool MATCHES "dumpbin$")
# Exclude delay load dependencies under windows (they are listed in dumpbin output after the message below)
string(FIND "${gp_cmd_ov}" "Image has the following delay load dependencies" gp_delayload_pos)
if (${gp_delayload_pos} GREATER -1)
@@ -819,7 +836,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
endif()
if(NOT gp_rv STREQUAL "0")
- if(gp_tool STREQUAL "dumpbin")
+ if(gp_tool MATCHES "dumpbin$")
# dumpbin error messages seem to go to stdout
message(FATAL_ERROR "${gp_cmd} failed: ${gp_rv}\n${gp_ev}\n${gp_cmd_ov}")
else()
@@ -827,7 +844,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
endif()
endif()
- if(gp_tool STREQUAL "ldd")
+ if(gp_tool MATCHES "ldd$")
set(ENV{LD_LIBRARY_PATH} "${old_ld_env}")
endif()
@@ -847,9 +864,9 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
# check for install id and remove it from list, since otool -L can include a
# reference to itself
set(gp_install_id)
- if(gp_tool STREQUAL "otool")
+ if(gp_tool MATCHES "otool$")
execute_process(
- COMMAND otool -D ${target}
+ COMMAND ${gp_cmd} -D ${target}
RESULT_VARIABLE otool_rv
OUTPUT_VARIABLE gp_install_id_ov
ERROR_VARIABLE otool_ev
diff --git a/Modules/GoogleTestAddTests.cmake b/Modules/GoogleTestAddTests.cmake
index 5a4bdcad3..4abbbecf7 100644
--- a/Modules/GoogleTestAddTests.cmake
+++ b/Modules/GoogleTestAddTests.cmake
@@ -30,6 +30,7 @@ if(NOT EXISTS "${TEST_EXECUTABLE}")
endif()
execute_process(
COMMAND ${TEST_EXECUTOR} "${TEST_EXECUTABLE}" --gtest_list_tests
+ WORKING_DIRECTORY "${TEST_WORKING_DIR}"
TIMEOUT ${TEST_DISCOVERY_TIMEOUT}
OUTPUT_VARIABLE output
RESULT_VARIABLE result
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index b5e5d69f8..5ba8687ec 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -1,60 +1,61 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# InstallRequiredSystemLibraries
-# ------------------------------
-#
-# Include this module to search for compiler-provided system runtime
-# libraries and add install rules for them. Some optional variables
-# may be set prior to including the module to adjust behavior:
-#
-# ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS``
-# Specify additional runtime libraries that may not be detected.
-# After inclusion any detected libraries will be appended to this.
-#
-# ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP``
-# Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to
-# allow the includer to specify its own install rule, using the value of
-# ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries.
-#
-# ``CMAKE_INSTALL_DEBUG_LIBRARIES``
-# Set to TRUE to install the debug runtime libraries when available
-# with MSVC tools.
-#
-# ``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY``
-# Set to TRUE to install only the debug runtime libraries with MSVC
-# tools even if the release runtime libraries are also available.
-#
-# ``CMAKE_INSTALL_UCRT_LIBRARIES``
-# Set to TRUE to install the Windows Universal CRT libraries for
-# app-local deployment (e.g. to Windows XP). This is meaningful
-# only with MSVC from Visual Studio 2015 or higher.
-#
-# One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
-# to an absolute path to tell CMake to look for Windows 10 SDKs in
-# a custom location. The specified directory is expected to contain
-# ``Redist/ucrt/DLLs/*`` directories.
-#
-# ``CMAKE_INSTALL_MFC_LIBRARIES``
-# Set to TRUE to install the MSVC MFC runtime libraries.
-#
-# ``CMAKE_INSTALL_OPENMP_LIBRARIES``
-# Set to TRUE to install the MSVC OpenMP runtime libraries
-#
-# ``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
-# Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
-# option. If not specified, the default is ``bin`` on Windows
-# and ``lib`` elsewhere.
-#
-# ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
-# Set to TRUE to disable warnings about required library files that
-# do not exist. (For example, Visual Studio Express editions may
-# not provide the redistributable files.)
-#
-# ``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
-# Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
-# option. If not specified, no such option will be used.
+#[=======================================================================[.rst:
+InstallRequiredSystemLibraries
+------------------------------
+
+Include this module to search for compiler-provided system runtime
+libraries and add install rules for them. Some optional variables
+may be set prior to including the module to adjust behavior:
+
+``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS``
+ Specify additional runtime libraries that may not be detected.
+ After inclusion any detected libraries will be appended to this.
+
+``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP``
+ Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to
+ allow the includer to specify its own install rule, using the value of
+ ``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries.
+
+``CMAKE_INSTALL_DEBUG_LIBRARIES``
+ Set to TRUE to install the debug runtime libraries when available
+ with MSVC tools.
+
+``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY``
+ Set to TRUE to install only the debug runtime libraries with MSVC
+ tools even if the release runtime libraries are also available.
+
+``CMAKE_INSTALL_UCRT_LIBRARIES``
+ Set to TRUE to install the Windows Universal CRT libraries for
+ app-local deployment (e.g. to Windows XP). This is meaningful
+ only with MSVC from Visual Studio 2015 or higher.
+
+ One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
+ to an absolute path to tell CMake to look for Windows 10 SDKs in
+ a custom location. The specified directory is expected to contain
+ ``Redist/ucrt/DLLs/*`` directories.
+
+``CMAKE_INSTALL_MFC_LIBRARIES``
+ Set to TRUE to install the MSVC MFC runtime libraries.
+
+``CMAKE_INSTALL_OPENMP_LIBRARIES``
+ Set to TRUE to install the MSVC OpenMP runtime libraries
+
+``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
+ Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
+ option. If not specified, the default is ``bin`` on Windows
+ and ``lib`` elsewhere.
+
+``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
+ Set to TRUE to disable warnings about required library files that
+ do not exist. (For example, Visual Studio Express editions may
+ not provide the redistributable files.)
+
+``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
+ Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
+ option. If not specified, no such option will be used.
+#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
diff --git a/Modules/Internal/CMakeCheckCompilerFlag.cmake b/Modules/Internal/CMakeCheckCompilerFlag.cmake
new file mode 100644
index 000000000..9c8dfb617
--- /dev/null
+++ b/Modules/Internal/CMakeCheckCompilerFlag.cmake
@@ -0,0 +1,158 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=[
+
+NOTE: This function is used internally by CMake. Projects should not include
+ this file directly.
+
+The cmake_check_compiler_flag() function can be used to compile and link a
+source file to check whether a specific compiler or linker flag is supported.
+The function does not use the try_compile() command so as to avoid infinite
+recursion. It may not work for all platforms or toolchains, the caller is
+responsible for ensuring it is only called in valid situations.
+
+ cmake_check_compiler_flag(<lang> <flag> <result>
+ [SRC_EXT <ext>] [COMMAND_PATTERN <pattern>]
+ [FAIL_REGEX <regex> ...]
+ [OUTPUT_VARIABLE <output>])
+
+Parameters:
+ <lang> - Language to check.
+ <flag> - The flag to add to the compile/link command line.
+ <result> - Boolean output variable. It will be stored in the cache as an
+ internal variable and if true, will cause future tests that assign
+ to that variable to be bypassed.
+
+Optional parameters:
+ SRC_EXT - Overrides the extension of the source file used for the
+ check. Defaults are 'c' (C), 'cxx' (CXX), 'F' (Fortran).
+ COMMAND_PATTERN - Pattern to be used for the command line. The default is
+ '<FLAG> -o <OUTPUT> <SOURCE>'
+ FAIL_REGEX - List of additional regular expressions that, if matched by
+ the output, give a failed result for the check. A common
+ set of regular expressions will be included in addition to
+ those given by FAIL_REGEX.
+ OUTPUT_VARIABLE - Set <output> variable with details about any error.
+#]=]
+
+include_guard(GLOBAL)
+include(CMakeCheckCompilerFlagCommonPatterns)
+
+function(CMAKE_CHECK_COMPILER_FLAG lang flag result)
+ # Cache results between runs similar to check_<lang>_source_compiles()
+ if(DEFINED ${result})
+ return()
+ endif()
+
+ set(comment "Is the '${flag}' option(s) supported")
+ string(REPLACE ";" " " comment "${comment}")
+
+ if (NOT lang MATCHES "^(C|CXX|Fortran|ASM)$")
+ # other possible languages are not supported
+ # log message to keep trace of this problem...
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Function 'CMAKE_CHECK_COMPILER_FLAG' called with unsupported language: ${lang}\n")
+ set(${result} FALSE CACHE INTERNAL ${comment})
+ return()
+ endif()
+ if (lang STREQUAL "ASM")
+ # assume ASM compiler is a multi-language compiler, so supports C language as well
+ set(check_lang C)
+ else()
+ set(check_lang ${lang})
+ endif()
+
+ cmake_parse_arguments(CCCF "" "SRC_EXT;COMMAND_PATTERN;OUTPUT_VARIABLE" "FAIL_REGEX" ${ARGN})
+
+ if (NOT CCCF_COMMAND_PATTERN)
+ set (CCCF_COMMAND_PATTERN "<FLAG> -o <OUTPUT> <SOURCE>")
+ endif()
+
+ list (APPEND CCCF_FAIL_REGEX "argument unused during compilation") # clang
+ if (check_lang STREQUAL "C")
+ list(APPEND CCCF_FAIL_REGEX
+ "command line option .* is valid for .* but not for C") # GNU
+ elseif(check_lang STREQUAL "CXX")
+ list(APPEND CCCF_FAIL_REGEX
+ "command line option .* is valid for .* but not for C\\+\\+") # GNU
+ elseif(check_lang STREQUAL "Fortran")
+ list(APPEND CCCF_FAIL_REGEX
+ "command line option .* is valid for .* but not for Fortran") # GNU
+ endif()
+
+ # Add patterns for common errors
+ check_compiler_flag_common_patterns(COMPILER_FLAG_COMMON_PATTERNS)
+ foreach(arg IN LISTS COMPILER_FLAG_COMMON_PATTERNS)
+ if(arg MATCHES "^FAIL_REGEX$")
+ continue()
+ endif()
+ list(APPEND CCCF_FAIL_REGEX "${arg}")
+ endforeach()
+
+ if(NOT CCCF_SRC_EXT)
+ if (check_lang STREQUAL "C")
+ set(CCCF_SRC_EXT c)
+ elseif(check_lang STREQUAL "CXX")
+ set(CCCF_SRC_EXT cxx)
+ elseif(check_lang STREQUAL "Fortran")
+ set(CCCF_SRC_EXT F)
+ endif()
+ endif()
+
+ if (CCCF_OUTPUT_VARIABLE)
+ unset(${CCCF_OUTPUT_VARIABLE} PARENT_SCOPE)
+ endif()
+
+ # Compute the directory in which to run the test.
+ set(COMPILER_FLAG_DIR "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp")
+ # Compute source and output files.
+ set(COMPILER_FLAG_SRC
+ "${COMPILER_FLAG_DIR}/CompilerFlag${lang}.${CCCF_SRC_EXT}")
+ if(check_lang STREQUAL "Fortran")
+ file(WRITE "${COMPILER_FLAG_SRC}"
+ " program simple\n end program simple\n")
+ else()
+ file(WRITE "${COMPILER_FLAG_SRC}" "int main (void)\n{ return 0; }\n")
+ endif()
+ get_filename_component(COMPILER_FLAG_EXE "${COMPILER_FLAG_SRC}" NAME_WE)
+ string(APPEND COMPILER_FLAG_EXE "${CMAKE_EXECUTABLE_SUFFIX}")
+
+ # Build command line
+ separate_arguments(CCCF_COMMAND_PATTERN UNIX_COMMAND
+ "${CCCF_COMMAND_PATTERN}")
+ list(TRANSFORM CCCF_COMMAND_PATTERN REPLACE "<SOURCE>" "${COMPILER_FLAG_SRC}")
+ list(TRANSFORM CCCF_COMMAND_PATTERN REPLACE "<OUTPUT>" "${COMPILER_FLAG_EXE}")
+ list(TRANSFORM CCCF_COMMAND_PATTERN REPLACE "<FLAG>" "${flag}")
+
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" -E env LC_ALL=C LC_MESSAGES=C LANG=C
+ "${CMAKE_${lang}_COMPILER}" ${CCCF_COMMAND_PATTERN}
+ WORKING_DIRECTORY "${COMPILER_FLAG_DIR}"
+ OUTPUT_VARIABLE COMPILER_FLAG_OUTPUT
+ ERROR_VARIABLE COMPILER_FLAG_OUTPUT
+ RESULT_VARIABLE COMPILER_FLAG_RESULT)
+
+ # Record result in the cache so we can avoid re-testing every CMake run
+ if (COMPILER_FLAG_RESULT)
+ set(${result} FALSE CACHE INTERNAL ${comment})
+ else()
+ foreach(regex IN LISTS CCCF_FAIL_REGEX)
+ if(COMPILER_FLAG_OUTPUT MATCHES "${regex}")
+ set(${result} FALSE CACHE INTERNAL ${comment})
+ endif()
+ endforeach()
+ endif()
+ if (DEFINED ${result})
+ file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ "Determining if the ${flag} option "
+ "is supported for ${lang} language failed with the following output:\n"
+ "${COMPILER_FLAG_OUTPUT}\n")
+ if (CCCF_OUTPUT_VARIABLE)
+ set(${CCCF_OUTPUT_VARIABLE} "${COMPILER_FLAG_OUTPUT}" PARENT_SCOPE)
+ endif()
+ return()
+ endif()
+
+ set(${result} TRUE CACHE INTERNAL ${comment})
+endfunction()
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index 3042a16f8..89dc6f024 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -482,13 +482,16 @@ function(cpack_deb_prepare_package_vars)
endif()
if(CPACK_DEBIAN_ARCHIVE_TYPE)
- set(archive_types_ "paxr;gnutar")
- if(NOT CPACK_DEBIAN_ARCHIVE_TYPE IN_LIST archive_types_)
+ if(CPACK_DEBIAN_ARCHIVE_TYPE STREQUAL "paxr")
+ message(DEPRECATION "CPACK_DEBIAN_ARCHIVE_TYPE set to old and invalid "
+ "type 'paxr', mapping to 'gnutar'")
+ set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
+ elseif(NOT CPACK_DEBIAN_ARCHIVE_TYPE STREQUAL "gnutar")
message(FATAL_ERROR "CPACK_DEBIAN_ARCHIVE_TYPE set to unsupported"
"type ${CPACK_DEBIAN_ARCHIVE_TYPE}")
endif()
else()
- set(CPACK_DEBIAN_ARCHIVE_TYPE "paxr")
+ set(CPACK_DEBIAN_ARCHIVE_TYPE "gnutar")
endif()
# Compression: (recommended)
diff --git a/Modules/MacroAddFileDependencies.cmake b/Modules/MacroAddFileDependencies.cmake
index db2681478..39393d6cc 100644
--- a/Modules/MacroAddFileDependencies.cmake
+++ b/Modules/MacroAddFileDependencies.cmake
@@ -1,19 +1,20 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# MacroAddFileDependencies
-# ------------------------
-#
-# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
-#
-# Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There
-# are usually better ways to specify the correct dependencies.
-#
-# MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
-# convenience wrapper around the OBJECT_DEPENDS source file property.
-# You can just use set_property(SOURCE <file> APPEND PROPERTY
-# OBJECT_DEPENDS depend_files) instead.
+#[=======================================================================[.rst:
+MacroAddFileDependencies
+------------------------
+
+MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...)
+
+Using the macro MACRO_ADD_FILE_DEPENDENCIES() is discouraged. There
+are usually better ways to specify the correct dependencies.
+
+MACRO_ADD_FILE_DEPENDENCIES(<_file> depend_files...) is just a
+convenience wrapper around the OBJECT_DEPENDS source file property.
+You can just use set_property(SOURCE <file> APPEND PROPERTY
+OBJECT_DEPENDS depend_files) instead.
+#]=======================================================================]
macro (MACRO_ADD_FILE_DEPENDENCIES _file)
diff --git a/Modules/Platform/Android/abi-common.cmake b/Modules/Platform/Android/abi-common.cmake
index 10fb8972d..a0b47f4e6 100644
--- a/Modules/Platform/Android/abi-common.cmake
+++ b/Modules/Platform/Android/abi-common.cmake
@@ -12,10 +12,6 @@ if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
-if(CMAKE_POSITION_INDEPENDENT_CODE)
- string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -fPIE -pie")
-endif()
-
string(APPEND _ANDROID_ABI_INIT_EXE_LDFLAGS " -Wl,--gc-sections")
if(NOT _ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc)
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 784c8c676..ca90712dc 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -27,6 +27,9 @@ macro(__cygwin_compiler_gnu lang)
# No -fPIC on cygwin
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
+ set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE "")
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
# Initialize C link type selection flags. These flags are used when
diff --git a/Modules/Platform/Darwin-Initialize.cmake b/Modules/Platform/Darwin-Initialize.cmake
index 3db77aacb..2d797f68f 100644
--- a/Modules/Platform/Darwin-Initialize.cmake
+++ b/Modules/Platform/Darwin-Initialize.cmake
@@ -34,7 +34,7 @@ string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*$" "\\1"
# CMAKE_OSX_DEPLOYMENT_TARGET
# Set cache variable - end user may change this during ccmake or cmake-gui configure.
-if(_CURRENT_OSX_VERSION VERSION_GREATER 10.3)
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND _CURRENT_OSX_VERSION VERSION_GREATER 10.3)
set(CMAKE_OSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}" CACHE STRING
"Minimum OS X version to target for deployment (at runtime); newer APIs weak linked. Set to empty string for default value.")
endif()
@@ -49,6 +49,12 @@ elseif(NOT "x$ENV{SDKROOT}" STREQUAL "x" AND
(NOT "x$ENV{SDKROOT}" MATCHES "/" OR IS_DIRECTORY "$ENV{SDKROOT}"))
# Use the value of SDKROOT from the environment.
set(_CMAKE_OSX_SYSROOT_DEFAULT "$ENV{SDKROOT}")
+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 watchOS)
+ set(_CMAKE_OSX_SYSROOT_DEFAULT "watchos")
elseif("${CMAKE_GENERATOR}" MATCHES Xcode
OR CMAKE_OSX_DEPLOYMENT_TARGET
OR CMAKE_OSX_ARCHITECTURES MATCHES "[^;]"
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 727baa6e1..5590433a3 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -1,5 +1,13 @@
set(APPLE 1)
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS")
+ set(CMAKE_MACOSX_BUNDLE ON)
+
+ set(CMAKE_FIND_ROOT_PATH "${_CMAKE_OSX_SYSROOT_PATH}")
+ set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+endif()
+
# Darwin versions:
# 6.x == Mac OSX 10.2 (Jaguar)
# 7.x == Mac OSX 10.3 (Panther)
@@ -206,7 +214,7 @@ include(Platform/UnixPaths)
if(_CMAKE_OSX_SYSROOT_PATH AND EXISTS ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${_CMAKE_OSX_SYSROOT_PATH}/usr)
foreach(lang C CXX)
- list(APPEND CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
+ list(APPEND _CMAKE_${lang}_IMPLICIT_INCLUDE_DIRECTORIES_INIT ${_CMAKE_OSX_SYSROOT_PATH}/usr/include)
endforeach()
endif()
list(APPEND CMAKE_SYSTEM_PREFIX_PATH
diff --git a/Modules/Platform/DragonFly.cmake b/Modules/Platform/DragonFly.cmake
index c22677b9d..12e5f3ccc 100644
--- a/Modules/Platform/DragonFly.cmake
+++ b/Modules/Platform/DragonFly.cmake
@@ -3,3 +3,7 @@
# see http://archive.netbsd.se/?ml=dfbsd-users&a=2007-07&m=4678361
include(Platform/FreeBSD)
+
+# DragonFly BSD requires -z origin to enable $ORIGIN expansion in RPATH.
+# This is not required for FreeBSD since 10.2-RELEASE.
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-z,origin,-rpath,")
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index ce4d3ce49..4a4c00dc4 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -1,11 +1,14 @@
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+# PIE link options are managed in Compiler/<compiler>.cmake file
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
+# Does not require -z origin since 10.2-RELEASE
+set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
diff --git a/Modules/Platform/Fuchsia.cmake b/Modules/Platform/Fuchsia.cmake
index 896da7bfb..4b1380506 100644
--- a/Modules/Platform/Fuchsia.cmake
+++ b/Modules/Platform/Fuchsia.cmake
@@ -3,6 +3,9 @@ set(FUCHSIA 1)
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
+set(CMAKE_C_LINK_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE} "-pie")
+set(CMAKE_C_LINK_OPTIONS_NO_PIE "-no-pie")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
diff --git a/Modules/Platform/GHS-MULTI-Initialize.cmake b/Modules/Platform/GHS-MULTI-Initialize.cmake
index 9b384df8a..25004c60b 100644
--- a/Modules/Platform/GHS-MULTI-Initialize.cmake
+++ b/Modules/Platform/GHS-MULTI-Initialize.cmake
@@ -9,6 +9,9 @@ mark_as_advanced(GHS_OS_ROOT)
set(GHS_OS_DIR "NOTFOUND" CACHE PATH "GHS platform OS directory")
mark_as_advanced(GHS_OS_DIR)
+set(GHS_OS_DIR_OPTION "-os_dir " CACHE STRING "GHS compiler os option")
+mark_as_advanced(GHS_OS_DIR)
+
#set GHS_OS_DIR if not set by user
if ( NOT GHS_OS_DIR )
if (EXISTS ${GHS_OS_ROOT})
@@ -23,8 +26,11 @@ if ( NOT GHS_OS_DIR )
endif ()
#filter based on platform name
- if (GHS_TARGET_PLATFORM STREQUAL "integrity")
+ if (GHS_TARGET_PLATFORM MATCHES "integrity")
list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z].*")
+ else() #fall-back for standalone
+ unset(GHS_CANDIDATE_OS_DIRS)
+ set(GHS_OS_DIR "IGNORE")
endif ()
if (GHS_CANDIDATE_OS_DIRS)
diff --git a/Modules/Platform/Haiku.cmake b/Modules/Platform/Haiku.cmake
index dfc2664d3..7e0af6166 100644
--- a/Modules/Platform/Haiku.cmake
+++ b/Modules/Platform/Haiku.cmake
@@ -11,6 +11,7 @@ set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake
deleted file mode 100644
index 12b0f3774..000000000
--- a/Modules/Platform/IRIX.cmake
+++ /dev/null
@@ -1,53 +0,0 @@
-set(CMAKE_DL_LIBS "")
-set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
-if(NOT CMAKE_COMPILER_IS_GNUCXX)
- set(CMAKE_CXX_CREATE_STATIC_LIBRARY
- "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
- set (CMAKE_CXX_FLAGS_INIT "")
- set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
- set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
- set (CMAKE_C_FLAGS_INIT "")
-endif()
-# set flags for gcc support
-include(Platform/UnixPaths)
-
-if(NOT CMAKE_COMPILER_IS_GNUCC)
- set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_C_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-if(NOT CMAKE_COMPILER_IS_GNUCXX)
- set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-if(NOT CMAKE_COMPILER_IS_GNUG77)
- set (CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE "<CMAKE_Fortran_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_Fortran_COMPILER> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-# Initialize C link type selection flags. These flags are used when
-# building a shared library, shared module, or executable that links
-# to other libraries to select whether to use the static or shared
-# versions of the libraries.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
- set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach()
-
-# The IRIX linker needs to find transitive shared library dependencies
-# in the -L path.
-set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake
deleted file mode 100644
index ee9b96e89..000000000
--- a/Modules/Platform/IRIX64.cmake
+++ /dev/null
@@ -1,73 +0,0 @@
-set(CMAKE_DL_LIBS "")
-set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -rdata_shared")
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
-set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
-set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
-if(NOT CMAKE_COMPILER_IS_GNUCC)
- # Set default flags init.
- set(CMAKE_C_FLAGS_INIT "")
- set(CMAKE_CXX_FLAGS_INIT "")
- set(CMAKE_Fortran_FLAGS_INIT "")
- set(CMAKE_EXE_LINKER_FLAGS_INIT "")
- set(CMAKE_SHARED_LINKER_FLAGS_INIT "")
- set(CMAKE_MODULE_LINKER_FLAGS_INIT "")
-
- # If no -o32, -n32, or -64 flag is given, set a reasonable default.
- if("$ENV{CFLAGS} $ENV{CXXFLAGS} $ENV{LDFLAGS}" MATCHES "-([no]32|64)")
- else()
- # Check if this is a 64-bit CMake.
- if(CMAKE_FILE_SELF MATCHES "^CMAKE_FILE_SELF$")
- exec_program(file ARGS ${CMAKE_COMMAND} OUTPUT_VARIABLE CMAKE_FILE_SELF)
- set(CMAKE_FILE_SELF "${CMAKE_FILE_SELF}" CACHE INTERNAL
- "Output of file command on ${CMAKE_COMMAND}.")
- endif()
-
- # Set initial flags to match cmake executable.
- if(CMAKE_FILE_SELF MATCHES " 64-bit ")
- set(CMAKE_C_FLAGS_INIT "-64")
- set(CMAKE_CXX_FLAGS_INIT "-64")
- set(CMAKE_Fortran_FLAGS_INIT "-64")
- set(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
- set(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
- set(CMAKE_MODULE_LINKER_FLAGS_INIT "-64")
- endif()
- endif()
-
- # Set remaining defaults.
- set(CMAKE_CXX_CREATE_STATIC_LIBRARY
- "<CMAKE_CXX_COMPILER> -ar -o <TARGET> <OBJECTS>")
- set (CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
- set (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-O3 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG")
- set (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
-endif()
-include(Platform/UnixPaths)
-
-if(NOT CMAKE_COMPILER_IS_GNUCC)
- set (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_C_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-if(NOT CMAKE_COMPILER_IS_GNUCXX)
- set (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
- set (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
- "<CMAKE_CXX_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE>"
- "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
- )
-endif()
-
-# Initialize C link type selection flags. These flags are used when
-# building a shared library, shared module, or executable that links
-# to other libraries to select whether to use the static or shared
-# versions of the libraries.
-foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
- set(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
- set(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
-endforeach()
-
-# The IRIX linker needs to find transitive shared library dependencies
-# in the -L path.
-set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
diff --git a/Modules/Platform/Linux-Intel.cmake b/Modules/Platform/Linux-Intel.cmake
index f712e2b5f..3b5ca59ca 100644
--- a/Modules/Platform/Linux-Intel.cmake
+++ b/Modules/Platform/Linux-Intel.cmake
@@ -23,6 +23,12 @@ endif()
macro(__linux_compiler_intel lang)
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
+ set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+ if (NOT CMAKE_${lang}_COMPILER_VERSION VERSION_LESS 13.0)
+ set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER YES)
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE ${CMAKE_${lang}_COMPILE_OPTIONS_PIE} "-pie")
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "-no-pie")
+ endif()
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
diff --git a/Modules/Platform/Linux-PGI.cmake b/Modules/Platform/Linux-PGI.cmake
index db032c292..034165454 100644
--- a/Modules/Platform/Linux-PGI.cmake
+++ b/Modules/Platform/Linux-PGI.cmake
@@ -12,6 +12,9 @@ macro(__linux_compiler_pgi lang)
# Shared library compile and link flags.
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
+ set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE "")
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC")
set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared")
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS " ")
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index 1f8c1b4c1..b5d5464ea 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -1,6 +1,7 @@
set(CMAKE_DL_LIBS "dl")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
+set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake
index 1004eb310..d99cb4a77 100644
--- a/Modules/Platform/NetBSD.cmake
+++ b/Modules/Platform/NetBSD.cmake
@@ -1,11 +1,13 @@
set(CMAKE_DL_LIBS "")
set(CMAKE_C_COMPILE_OPTIONS_PIC "-fPIC")
set(CMAKE_C_COMPILE_OPTIONS_PIE "-fPIE")
+# PIE link options are managed in Compiler/<compiler>.cmake file
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,") # -rpath
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
+set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG "-Wl,-rpath-link,")
set(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
set(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic")
diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake
index 6466a0a01..97e2a6a83 100644
--- a/Modules/Platform/OpenBSD.cmake
+++ b/Modules/Platform/OpenBSD.cmake
@@ -15,6 +15,10 @@ if(NOT CMAKE_PLATFORM_RUNTIME_PATH)
"${LDCONFIG_HINTS}")
endif()
+# OpenBSD requires -z origin to enable $ORIGIN expansion in RPATH.
+# This is not required for NetBSD.
+set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-z,origin,-rpath,")
+
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
# OpenBSD has no multilib
diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake
index c37a113d3..e3b0a0516 100644
--- a/Modules/Platform/SINIX.cmake
+++ b/Modules/Platform/SINIX.cmake
@@ -1,4 +1,7 @@
set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+set(CMAKE_C_LINK_OPTIONS_PIE "")
+set(CMAKE_C_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
include(Platform/UnixPaths)
diff --git a/Modules/Platform/SunOS-GNU.cmake b/Modules/Platform/SunOS-GNU.cmake
index 485f23533..47334d6cb 100644
--- a/Modules/Platform/SunOS-GNU.cmake
+++ b/Modules/Platform/SunOS-GNU.cmake
@@ -11,6 +11,7 @@ set(__SUNOS_COMPILER_GNU 1)
macro(__sunos_compiler_gnu lang)
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-R")
set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":")
+ set(CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN "\$ORIGIN")
set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "-Wl,-h")
# Initialize C link type selection flags. These flags are used when
diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake
index 1ec96aea2..bd1ffce3a 100644
--- a/Modules/Platform/UNIX_SV.cmake
+++ b/Modules/Platform/UNIX_SV.cmake
@@ -1,5 +1,8 @@
set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+set(CMAKE_C_LINK_OPTIONS_PIE "")
+set(CMAKE_C_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-Bexport")
include(Platform/UnixPaths)
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 328d3c6d3..97f744d52 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -63,16 +63,29 @@ list(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/lib /lib32 /lib64 /usr/lib /usr/lib32 /usr/lib64
)
-list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+if(CMAKE_SYSROOT_COMPILE)
+ set(_cmake_sysroot_compile "${CMAKE_SYSROOT_COMPILE}")
+else()
+ set(_cmake_sysroot_compile "${CMAKE_SYSROOT}")
+endif()
+
+# Default per-language values. These may be later replaced after
+# parsing the implicit directory information from compiler output.
+set(_CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES}
+ "${_cmake_sysroot_compile}/usr/include"
)
-list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+set(_CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}
+ "${_cmake_sysroot_compile}/usr/include"
)
-list(APPEND CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES
- /usr/include
+set(_CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES_INIT
+ ${CMAKE_CUDA_IMPLICIT_INCLUDE_DIRECTORIES}
+ "${_cmake_sysroot_compile}/usr/include"
)
+unset(_cmake_sysroot_compile)
+
# Enable use of lib32 and lib64 search path variants by default.
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS TRUE)
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)
diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake
index e649bd2a4..94888d9c0 100644
--- a/Modules/Platform/UnixWare.cmake
+++ b/Modules/Platform/UnixWare.cmake
@@ -1,5 +1,8 @@
set(CMAKE_C_COMPILE_OPTIONS_PIC -K PIC)
set(CMAKE_C_COMPILE_OPTIONS_PIE "")
+set(_CMAKE_C_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+set(CMAKE_C_LINK_OPTIONS_PIE "")
+set(CMAKE_C_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
include(Platform/UnixPaths)
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index cfb325b9d..71189b169 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -72,6 +72,9 @@ macro(__windows_compiler_gnu lang)
# No -fPIC on Windows
set(CMAKE_${lang}_COMPILE_OPTIONS_PIC "")
set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "")
+ set(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER NO)
+ set(CMAKE_${lang}_LINK_OPTIONS_PIE "")
+ set(CMAKE_${lang}_LINK_OPTIONS_NO_PIE "")
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "")
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
diff --git a/Modules/Platform/Windows-Intel-C.cmake b/Modules/Platform/Windows-Intel-C.cmake
index 767fec541..06d8f50ff 100644
--- a/Modules/Platform/Windows-Intel-C.cmake
+++ b/Modules/Platform/Windows-Intel-C.cmake
@@ -1,2 +1,4 @@
include(Platform/Windows-Intel)
__windows_compiler_intel(C)
+set(CMAKE_NINJA_DEPTYPE_C intel) # special value handled by CMake
+set(CMAKE_DEPFILE_FLAGS_C "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
index 84cd303ec..666de6ee4 100644
--- a/Modules/Platform/Windows-Intel-CXX.cmake
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -1,3 +1,5 @@
include(Platform/Windows-Intel)
set(_COMPILE_CXX " /TP")
__windows_compiler_intel(CXX)
+set(CMAKE_NINJA_DEPTYPE_CXX intel) # special value handled by CMake
+set(CMAKE_DEPFILE_FLAGS_CXX "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index ae180ed7c..2daf313bc 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -298,8 +298,8 @@ unset(_MACHINE_ARCH_FLAG)
macro(__windows_compiler_msvc lang)
if(NOT MSVC_VERSION LESS 1400)
# for 2005 make sure the manifest is put in the dll with mt
- set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ")
- set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ")
+ 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()
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}")
@@ -366,12 +366,15 @@ macro(__windows_compiler_msvc lang)
endif()
set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON)
set(CMAKE_NINJA_DEPTYPE_${lang} msvc)
+ __windows_compiler_msvc_enable_rc("${_PLATFORM_DEFINES} ${_PLATFORM_DEFINES_${lang}}")
+endmacro()
+macro(__windows_compiler_msvc_enable_rc flags)
if(NOT CMAKE_RC_COMPILER_INIT)
set(CMAKE_RC_COMPILER_INIT rc)
endif()
if(NOT CMAKE_RC_FLAGS_INIT)
- string(APPEND CMAKE_RC_FLAGS_INIT " ${_PLATFORM_DEFINES} ${_PLATFORM_DEFINES_${lang}}")
+ string(APPEND CMAKE_RC_FLAGS_INIT " ${flags}")
endif()
if(NOT CMAKE_RC_FLAGS_DEBUG_INIT)
string(APPEND CMAKE_RC_FLAGS_DEBUG_INIT " /D_DEBUG")
diff --git a/Modules/Platform/Windows-NVIDIA-CUDA.cmake b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
index ba1638f87..6a2667aa6 100644
--- a/Modules/Platform/Windows-NVIDIA-CUDA.cmake
+++ b/Modules/Platform/Windows-NVIDIA-CUDA.cmake
@@ -17,8 +17,8 @@ endforeach()
set(CMAKE_CUDA_LINK_EXECUTABLE
"<CMAKE_CUDA_HOST_LINK_LAUNCHER> <LINK_FLAGS> <OBJECTS> /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_LIBRARIES>${__IMPLICT_LINKS}")
-set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ")
-set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe --intdir=<OBJECT_DIR> --manifests <MANIFESTS> -- ")
+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> -- ")
set(CMAKE_CUDA_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>${__IMPLICT_LINKS} ${CMAKE_END_TEMP_FILE}")
@@ -67,3 +67,5 @@ string(APPEND CMAKE_CUDA_FLAGS_RELWITHDEBINFO_INIT " -Xcompiler=\"-MD -Zi -O2 -O
string(APPEND CMAKE_CUDA_FLAGS_MINSIZEREL_INIT " -Xcompiler=\"-MD -O1 -Ob1\" -DNDEBUG")
set(CMAKE_CUDA_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+
+__windows_compiler_msvc_enable_rc("${_PLATFORM_DEFINES} ${_PLATFORM_DEFINES_CXX}")
diff --git a/Modules/Platform/iOS-Determine-CXX.cmake b/Modules/Platform/iOS-Determine-CXX.cmake
new file mode 100644
index 000000000..ac80fa62d
--- /dev/null
+++ b/Modules/Platform/iOS-Determine-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin-Determine-CXX)
diff --git a/Modules/Platform/iOS-Initialize.cmake b/Modules/Platform/iOS-Initialize.cmake
new file mode 100644
index 000000000..301ca4cbd
--- /dev/null
+++ b/Modules/Platform/iOS-Initialize.cmake
@@ -0,0 +1,9 @@
+include(Platform/Darwin-Initialize)
+
+if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/iPhone(OS|Simulator)")
+ message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an iOS SDK")
+endif()
+
+set(IOS 1)
+
+set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY)
diff --git a/Modules/Platform/iOS.cmake b/Modules/Platform/iOS.cmake
new file mode 100644
index 000000000..850ddc241
--- /dev/null
+++ b/Modules/Platform/iOS.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin)
diff --git a/Modules/Platform/tvOS-Determine-CXX.cmake b/Modules/Platform/tvOS-Determine-CXX.cmake
new file mode 100644
index 000000000..ac80fa62d
--- /dev/null
+++ b/Modules/Platform/tvOS-Determine-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin-Determine-CXX)
diff --git a/Modules/Platform/tvOS-Initialize.cmake b/Modules/Platform/tvOS-Initialize.cmake
new file mode 100644
index 000000000..6834c8031
--- /dev/null
+++ b/Modules/Platform/tvOS-Initialize.cmake
@@ -0,0 +1,7 @@
+include(Platform/Darwin-Initialize)
+
+if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/AppleTV(OS|Simulator)")
+ message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an tvOS SDK")
+endif()
+
+set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY)
diff --git a/Modules/Platform/tvOS.cmake b/Modules/Platform/tvOS.cmake
new file mode 100644
index 000000000..850ddc241
--- /dev/null
+++ b/Modules/Platform/tvOS.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin)
diff --git a/Modules/Platform/watchOS-Determine-CXX.cmake b/Modules/Platform/watchOS-Determine-CXX.cmake
new file mode 100644
index 000000000..ac80fa62d
--- /dev/null
+++ b/Modules/Platform/watchOS-Determine-CXX.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin-Determine-CXX)
diff --git a/Modules/Platform/watchOS-Initialize.cmake b/Modules/Platform/watchOS-Initialize.cmake
new file mode 100644
index 000000000..2f396d394
--- /dev/null
+++ b/Modules/Platform/watchOS-Initialize.cmake
@@ -0,0 +1,7 @@
+include(Platform/Darwin-Initialize)
+
+if(NOT _CMAKE_OSX_SYSROOT_PATH MATCHES "/Watch(OS|Simulator)")
+ message(FATAL_ERROR "${CMAKE_OSX_SYSROOT} is not an watchOS SDK")
+endif()
+
+set(_CMAKE_FEATURE_DETECTION_TARGET_TYPE STATIC_LIBRARY)
diff --git a/Modules/Platform/watchOS.cmake b/Modules/Platform/watchOS.cmake
new file mode 100644
index 000000000..850ddc241
--- /dev/null
+++ b/Modules/Platform/watchOS.cmake
@@ -0,0 +1 @@
+include(Platform/Darwin)
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index 8a37884b7..e4b4e5372 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -1,44 +1,45 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# ProcessorCount
-# --------------
-#
-# ProcessorCount(var)
-#
-# Determine the number of processors/cores and save value in ${var}
-#
-# Sets the variable named ${var} to the number of physical cores
-# available on the machine if the information can be determined.
-# Otherwise it is set to 0. Currently this functionality is implemented
-# for AIX, cygwin, FreeBSD, HPUX, IRIX, Linux, macOS, QNX, Sun and
-# Windows.
-#
-# This function is guaranteed to return a positive integer (>=1) if it
-# succeeds. It returns 0 if there's a problem determining the processor
-# count.
-#
-# Example use, in a ctest -S dashboard script:
-#
-# ::
-#
-# include(ProcessorCount)
-# ProcessorCount(N)
-# if(NOT N EQUAL 0)
-# set(CTEST_BUILD_FLAGS -j${N})
-# set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
-# endif()
-#
-#
-#
-# This function is intended to offer an approximation of the value of
-# the number of compute cores available on the current machine, such
-# that you may use that value for parallel building and parallel
-# testing. It is meant to help utilize as much of the machine as seems
-# reasonable. Of course, knowledge of what else might be running on the
-# machine simultaneously should be used when deciding whether to request
-# a machine's full capacity all for yourself.
+#[=======================================================================[.rst:
+ProcessorCount
+--------------
+
+ProcessorCount(var)
+
+Determine the number of processors/cores and save value in ${var}
+
+Sets the variable named ${var} to the number of physical cores
+available on the machine if the information can be determined.
+Otherwise it is set to 0. Currently this functionality is implemented
+for AIX, cygwin, FreeBSD, HPUX, Linux, macOS, QNX, Sun and
+Windows.
+
+This function is guaranteed to return a positive integer (>=1) if it
+succeeds. It returns 0 if there's a problem determining the processor
+count.
+
+Example use, in a ctest -S dashboard script:
+
+::
+
+ include(ProcessorCount)
+ ProcessorCount(N)
+ if(NOT N EQUAL 0)
+ set(CTEST_BUILD_FLAGS -j${N})
+ set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
+ endif()
+
+
+
+This function is intended to offer an approximation of the value of
+the number of compute cores available on the current machine, such
+that you may use that value for parallel building and parallel
+testing. It is meant to help utilize as much of the machine as seems
+reasonable. Of course, knowledge of what else might be running on the
+machine simultaneously should be used when deciding whether to request
+a machine's full capacity all for yourself.
+#]=======================================================================]
# A more reliable way might be to compile a small C program that uses the CPUID
# instruction, but that again requires compiler support or compiling assembler
@@ -114,22 +115,6 @@ function(ProcessorCount var)
endif()
if(NOT count)
- # IRIX (systems with hinv):
- find_program(ProcessorCount_cmd_hinv hinv
- PATHS /sbin)
- mark_as_advanced(ProcessorCount_cmd_hinv)
- if(ProcessorCount_cmd_hinv)
- execute_process(COMMAND ${ProcessorCount_cmd_hinv}
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE
- OUTPUT_VARIABLE hinv_output)
- string(REGEX MATCHALL "([0-9]+) .* Processors" procs "${hinv_output}")
- set(count "${CMAKE_MATCH_1}")
- #message("ProcessorCount: trying hinv '${ProcessorCount_cmd_hinv}'")
- endif()
- endif()
-
- if(NOT count)
# AIX (systems with lsconf):
find_program(ProcessorCount_cmd_lsconf lsconf
PATHS /usr/sbin)
diff --git a/Modules/Qt4ConfigDependentSettings.cmake b/Modules/Qt4ConfigDependentSettings.cmake
index e21ecf42e..4699ecdad 100644
--- a/Modules/Qt4ConfigDependentSettings.cmake
+++ b/Modules/Qt4ConfigDependentSettings.cmake
@@ -1,13 +1,14 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# Qt4ConfigDependentSettings
-# --------------------------
-#
-#
-#
-# This file is included by FindQt4.cmake, don't include it directly.
+#[=======================================================================[.rst:
+Qt4ConfigDependentSettings
+--------------------------
+
+
+
+This file is included by FindQt4.cmake, don't include it directly.
+#]=======================================================================]
###############################################
#
@@ -255,7 +256,6 @@ if(Q_WS_X11)
# X11 libraries Qt always depends on
set(QT_QTGUI_LIB_DEPENDENCIES ${QT_QTGUI_LIB_DEPENDENCIES} ${X11_Xext_LIB} ${X11_X11_LIB})
- set(CMAKE_THREAD_PREFER_PTHREAD 1)
find_package(Threads)
if(CMAKE_USE_PTHREADS_INIT)
set(QT_QTCORE_LIB_DEPENDENCIES ${QT_QTCORE_LIB_DEPENDENCIES} ${CMAKE_THREAD_LIBS_INIT})
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index a2c8d853c..5c489709d 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -1,13 +1,14 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# Qt4Macros
-# ---------
-#
-#
-#
-# This file is included by FindQt4.cmake, don't include it directly.
+#[=======================================================================[.rst:
+Qt4Macros
+---------
+
+
+
+This file is included by FindQt4.cmake, don't include it directly.
+#]=======================================================================]
######################################
#
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index fe3bb00a6..4c0e9a8c0 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -1,36 +1,45 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# SelectLibraryConfigurations
-# ---------------------------
-#
-#
-#
-# select_library_configurations( basename )
-#
-# This macro takes a library base name as an argument, and will choose
-# good values for basename_LIBRARY, basename_LIBRARIES,
-# basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
-# has been found and set. If only basename_LIBRARY_RELEASE is defined,
-# basename_LIBRARY will be set to the release value, and
-# basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG-NOTFOUND.
-# If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
-# take the debug value, and basename_LIBRARY_RELEASE will be set to
-# basename_LIBRARY_RELEASE-NOTFOUND.
-#
-# If the generator supports configuration types, then basename_LIBRARY
-# and basename_LIBRARIES will be set with debug and optimized flags
-# specifying the library to be used for the given configuration. If no
-# build type has been set or the generator in use does not support
-# configuration types, then basename_LIBRARY and basename_LIBRARIES will
-# take only the release value, or the debug value if the release one is
-# not set.
+#[=======================================================================[.rst:
+SelectLibraryConfigurations
+---------------------------
+
+.. code-block:: cmake
+
+ select_library_configurations(basename)
+
+This macro takes a library base name as an argument, and will choose
+good values for the variables
+
+::
+
+ basename_LIBRARY
+ basename_LIBRARIES
+ basename_LIBRARY_DEBUG
+ basename_LIBRARY_RELEASE
+
+depending on what has been found and set.
+
+If only ``basename_LIBRARY_RELEASE`` is defined, ``basename_LIBRARY`` will
+be set to the release value, and ``basename_LIBRARY_DEBUG`` will be set
+to ``basename_LIBRARY_DEBUG-NOTFOUND``. If only ``basename_LIBRARY_DEBUG``
+is defined, then ``basename_LIBRARY`` will take the debug value, and
+``basename_LIBRARY_RELEASE`` will be set to ``basename_LIBRARY_RELEASE-NOTFOUND``.
+
+If the generator supports configuration types, then ``basename_LIBRARY``
+and ``basename_LIBRARIES`` will be set with debug and optimized flags
+specifying the library to be used for the given configuration. If no
+build type has been set or the generator in use does not support
+configuration types, then ``basename_LIBRARY`` and ``basename_LIBRARIES``
+will take only the release value, or the debug value if the release one
+is not set.
+#]=======================================================================]
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
-macro( select_library_configurations basename )
+macro(select_library_configurations basename)
if(NOT ${basename}_LIBRARY_RELEASE)
set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake
index c0e1bea59..2a80be56f 100644
--- a/Modules/SquishTestScript.cmake
+++ b/Modules/SquishTestScript.cmake
@@ -1,21 +1,22 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# SquishTestScript
-# ----------------
-#
-#
-#
-#
-#
-# This script launches a GUI test using Squish. You should not call the
-# script directly; instead, you should access it via the SQUISH_ADD_TEST
-# macro that is defined in FindSquish.cmake.
-#
-# This script starts the Squish server, launches the test on the client,
-# and finally stops the squish server. If any of these steps fail
-# (including if the tests do not pass) then a fatal error is raised.
+#[=======================================================================[.rst:
+SquishTestScript
+----------------
+
+
+
+
+
+This script launches a GUI test using Squish. You should not call the
+script directly; instead, you should access it via the SQUISH_ADD_TEST
+macro that is defined in FindSquish.cmake.
+
+This script starts the Squish server, launches the test on the client,
+and finally stops the squish server. If any of these steps fail
+(including if the tests do not pass) then a fatal error is raised.
+#]=======================================================================]
# print out the variable that we are using
message(STATUS "squish_aut='${squish_aut}'")
diff --git a/Modules/TestBigEndian.cmake b/Modules/TestBigEndian.cmake
index 9a4bce535..0c6e188c0 100644
--- a/Modules/TestBigEndian.cmake
+++ b/Modules/TestBigEndian.cmake
@@ -1,18 +1,19 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# TestBigEndian
-# -------------
-#
-# Define macro to determine endian type
-#
-# Check if the system is big endian or little endian
-#
-# ::
-#
-# TEST_BIG_ENDIAN(VARIABLE)
-# VARIABLE - variable to store the result to
+#[=======================================================================[.rst:
+TestBigEndian
+-------------
+
+Define macro to determine endian type
+
+Check if the system is big endian or little endian
+
+::
+
+ TEST_BIG_ENDIAN(VARIABLE)
+ VARIABLE - variable to store the result to
+#]=======================================================================]
include(CheckTypeSize)
diff --git a/Modules/TestCXXAcceptsFlag.cmake b/Modules/TestCXXAcceptsFlag.cmake
index 10019ec68..92a362e2f 100644
--- a/Modules/TestCXXAcceptsFlag.cmake
+++ b/Modules/TestCXXAcceptsFlag.cmake
@@ -1,22 +1,25 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# TestCXXAcceptsFlag
-# ------------------
-#
-# Deprecated. See :module:`CheckCXXCompilerFlag`.
-#
-# Check if the CXX compiler accepts a flag.
-#
-# .. code-block:: cmake
-#
-# CHECK_CXX_ACCEPTS_FLAG(<flags> <variable>)
-#
-# ``<flags>``
-# the flags to try
-# ``<variable>``
-# variable to store the result
+#[=======================================================================[.rst:
+TestCXXAcceptsFlag
+------------------
+
+.. deprecated:: 3.0
+
+ See :module:`CheckCXXCompilerFlag`.
+
+Check if the CXX compiler accepts a flag.
+
+.. code-block:: cmake
+
+ CHECK_CXX_ACCEPTS_FLAG(<flags> <variable>)
+
+``<flags>``
+ the flags to try
+``<variable>``
+ variable to store the result
+#]=======================================================================]
macro(CHECK_CXX_ACCEPTS_FLAG FLAGS VARIABLE)
if(NOT DEFINED ${VARIABLE})
diff --git a/Modules/TestForANSIForScope.cmake b/Modules/TestForANSIForScope.cmake
index 7d2aad61b..272e4ec8b 100644
--- a/Modules/TestForANSIForScope.cmake
+++ b/Modules/TestForANSIForScope.cmake
@@ -1,18 +1,19 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# TestForANSIForScope
-# -------------------
-#
-# Check for ANSI for scope support
-#
-# Check if the compiler restricts the scope of variables declared in a
-# for-init-statement to the loop body.
-#
-# ::
-#
-# CMAKE_NO_ANSI_FOR_SCOPE - holds result
+#[=======================================================================[.rst:
+TestForANSIForScope
+-------------------
+
+Check for ANSI for scope support
+
+Check if the compiler restricts the scope of variables declared in a
+for-init-statement to the loop body.
+
+::
+
+ CMAKE_NO_ANSI_FOR_SCOPE - holds result
+#]=======================================================================]
if(NOT DEFINED CMAKE_ANSI_FOR_SCOPE)
message(STATUS "Check for ANSI scope")
diff --git a/Modules/TestForANSIStreamHeaders.cmake b/Modules/TestForANSIStreamHeaders.cmake
index e890c677f..e532a71b7 100644
--- a/Modules/TestForANSIStreamHeaders.cmake
+++ b/Modules/TestForANSIStreamHeaders.cmake
@@ -1,18 +1,19 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# TestForANSIStreamHeaders
-# ------------------------
-#
-# Test for compiler support of ANSI stream headers iostream, etc.
-#
-# check if the compiler supports the standard ANSI iostream header
-# (without the .h)
-#
-# ::
-#
-# CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
+#[=======================================================================[.rst:
+TestForANSIStreamHeaders
+------------------------
+
+Test for compiler support of ANSI stream headers iostream, etc.
+
+check if the compiler supports the standard ANSI iostream header
+(without the .h)
+
+::
+
+ CMAKE_NO_ANSI_STREAM_HEADERS - defined by the results
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CheckIncludeFileCXX.cmake)
diff --git a/Modules/TestForSSTREAM.cmake b/Modules/TestForSSTREAM.cmake
index 0bfbfbbbd..e70df00ab 100644
--- a/Modules/TestForSSTREAM.cmake
+++ b/Modules/TestForSSTREAM.cmake
@@ -1,17 +1,18 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# TestForSSTREAM
-# --------------
-#
-# Test for compiler support of ANSI sstream header
-#
-# check if the compiler supports the standard ANSI sstream header
-#
-# ::
-#
-# CMAKE_NO_ANSI_STRING_STREAM - defined by the results
+#[=======================================================================[.rst:
+TestForSSTREAM
+--------------
+
+Test for compiler support of ANSI sstream header
+
+check if the compiler supports the standard ANSI sstream header
+
+::
+
+ CMAKE_NO_ANSI_STRING_STREAM - defined by the results
+#]=======================================================================]
if(NOT DEFINED CMAKE_HAS_ANSI_STRING_STREAM)
message(STATUS "Check for sstream")
diff --git a/Modules/TestForSTDNamespace.cmake b/Modules/TestForSTDNamespace.cmake
index 3ae80c744..703e631eb 100644
--- a/Modules/TestForSTDNamespace.cmake
+++ b/Modules/TestForSTDNamespace.cmake
@@ -1,17 +1,18 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# TestForSTDNamespace
-# -------------------
-#
-# Test for std:: namespace support
-#
-# check if the compiler supports std:: on stl classes
-#
-# ::
-#
-# CMAKE_NO_STD_NAMESPACE - defined by the results
+#[=======================================================================[.rst:
+TestForSTDNamespace
+-------------------
+
+Test for std:: namespace support
+
+check if the compiler supports std:: on stl classes
+
+::
+
+ CMAKE_NO_STD_NAMESPACE - defined by the results
+#]=======================================================================]
if(NOT DEFINED CMAKE_STD_NAMESPACE)
message(STATUS "Check for STD namespace")
diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake
index 700bfe6cc..9f848475b 100644
--- a/Modules/UseEcos.cmake
+++ b/Modules/UseEcos.cmake
@@ -1,32 +1,33 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# UseEcos
-# -------
-#
-# This module defines variables and macros required to build eCos application.
-#
-# This file contains the following macros:
-# ECOS_ADD_INCLUDE_DIRECTORIES() - add the eCos include dirs
-# ECOS_ADD_EXECUTABLE(name source1 ... sourceN ) - create an eCos
-# executable ECOS_ADJUST_DIRECTORY(VAR source1 ... sourceN ) - adjusts
-# the path of the source files and puts the result into VAR
-#
-# Macros for selecting the toolchain: ECOS_USE_ARM_ELF_TOOLS() - enable
-# the ARM ELF toolchain for the directory where it is called
-# ECOS_USE_I386_ELF_TOOLS() - enable the i386 ELF toolchain for the
-# directory where it is called ECOS_USE_PPC_EABI_TOOLS() - enable the
-# PowerPC toolchain for the directory where it is called
-#
-# It contains the following variables: ECOS_DEFINITIONS
-# ECOSCONFIG_EXECUTABLE ECOS_CONFIG_FILE - defaults to ecos.ecc, if your
-# eCos configuration file has a different name, adjust this variable for
-# internal use only:
-#
-# ::
-#
-# ECOS_ADD_TARGET_LIB
+#[=======================================================================[.rst:
+UseEcos
+-------
+
+This module defines variables and macros required to build eCos application.
+
+This file contains the following macros:
+ECOS_ADD_INCLUDE_DIRECTORIES() - add the eCos include dirs
+ECOS_ADD_EXECUTABLE(name source1 ... sourceN ) - create an eCos
+executable ECOS_ADJUST_DIRECTORY(VAR source1 ... sourceN ) - adjusts
+the path of the source files and puts the result into VAR
+
+Macros for selecting the toolchain: ECOS_USE_ARM_ELF_TOOLS() - enable
+the ARM ELF toolchain for the directory where it is called
+ECOS_USE_I386_ELF_TOOLS() - enable the i386 ELF toolchain for the
+directory where it is called ECOS_USE_PPC_EABI_TOOLS() - enable the
+PowerPC toolchain for the directory where it is called
+
+It contains the following variables: ECOS_DEFINITIONS
+ECOSCONFIG_EXECUTABLE ECOS_CONFIG_FILE - defaults to ecos.ecc, if your
+eCos configuration file has a different name, adjust this variable for
+internal use only:
+
+::
+
+ ECOS_ADD_TARGET_LIB
+#]=======================================================================]
# first check that ecosconfig is available
find_program(ECOSCONFIG_EXECUTABLE NAMES ecosconfig)
@@ -190,8 +191,8 @@ macro(ECOS_ADD_EXECUTABLE _exe_NAME )
set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <OBJECTS> -o <TARGET> ${_ecos_EXTRA_LIBS} -nostdlib -nostartfiles -L${CMAKE_CURRENT_BINARY_DIR}/ecos/install/lib -Ttarget.ld ${ECOS_LD_MCPU}")
# some strict compiler flags
- set (CMAKE_C_FLAGS "-Wstrict-prototypes")
- set (CMAKE_CXX_FLAGS "-Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-prototypes")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual -fno-rtti -Wctor-dtor-privacy -fno-strict-aliasing -fno-exceptions")
add_executable(${_exe_NAME} ${ARGN})
set_target_properties(${_exe_NAME} PROPERTIES SUFFIX ".elf")
diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake
index 6e2c51100..5600b4c1c 100644
--- a/Modules/UseJava.cmake
+++ b/Modules/UseJava.cmake
@@ -1,438 +1,439 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# UseJava
-# -------
-#
-# Use Module for Java
-#
-# This file provides functions for Java. It is assumed that
-# FindJava.cmake has already been loaded. See FindJava.cmake for
-# information on how to load Java into your CMake project.
-#
-# ::
-#
-# add_jar(target_name
-# [SOURCES] source1 [source2 ...] [resource1 ...]
-# [INCLUDE_JARS jar1 [jar2 ...]]
-# [ENTRY_POINT entry]
-# [VERSION version]
-# [OUTPUT_NAME name]
-# [OUTPUT_DIR dir]
-# [GENERATE_NATIVE_HEADERS target [DESTINATION dir]]
-# )
-#
-# This command creates a <target_name>.jar. It compiles the given
-# source files (source) and adds the given resource files (resource) to
-# the jar file. Source files can be java files or listing files
-# (prefixed by '@'). If only resource files are given then just a jar file
-# is created. The list of include jars are added to the classpath when
-# compiling the java sources and also to the dependencies of the target.
-# INCLUDE_JARS also accepts other target names created by add_jar. For
-# backwards compatibility, jar files listed as sources are ignored (as
-# they have been since the first version of this module).
-#
-# The default OUTPUT_DIR can also be changed by setting the variable
-# CMAKE_JAVA_TARGET_OUTPUT_DIR.
-#
-# Optionally, using option GENERATE_NATIVE_HEADERS, native header files can be generated
-# for methods declared as native. These files provide the connective glue that allow your
-# Java and C code to interact. An INTERFACE target will be created for an easy usage
-# of generated files. Sub-option DESTINATION can be used to specify output directory for
-# generated header files.
-#
-# GENERATE_NATIVE_HEADERS option requires, at least, version 1.8 of the JDK.
-#
-# Additional instructions:
-#
-# ::
-#
-# To add compile flags to the target you can set these flags with
-# the following variable:
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
-#
-#
-#
-# ::
-#
-# To add a path or a jar file to the class path you can do this
-# with the CMAKE_JAVA_INCLUDE_PATH variable.
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
-#
-#
-#
-# ::
-#
-# To use a different output name for the target you can set it with:
-#
-#
-#
-# ::
-#
-# add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
-#
-#
-#
-# ::
-#
-# To use a different output directory than CMAKE_CURRENT_BINARY_DIR
-# you can set it with:
-#
-#
-#
-# ::
-#
-# add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
-#
-#
-#
-# ::
-#
-# To define an entry point in your jar you can set it with the ENTRY_POINT
-# named argument:
-#
-#
-#
-# ::
-#
-# add_jar(example ENTRY_POINT com/examples/MyProject/Main)
-#
-#
-#
-# ::
-#
-# To define a custom manifest for the jar, you can set it with the manifest
-# named argument:
-#
-#
-#
-# ::
-#
-# add_jar(example MANIFEST /path/to/manifest)
-#
-#
-#
-# ::
-#
-# To add a VERSION to the target output name you can set it using
-# the VERSION named argument to add_jar. This will create a jar file with the
-# name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
-# pointing to the jar with the version information.
-#
-#
-#
-# ::
-#
-# add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
-#
-#
-#
-# ::
-#
-# If the target is a JNI library, utilize the following commands to
-# create a JNI symbolic link:
-#
-#
-#
-# ::
-#
-# set(CMAKE_JNI_TARGET TRUE)
-# add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
-# install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
-# install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
-#
-#
-#
-# ::
-#
-# If a single target needs to produce more than one jar from its
-# java source code, to prevent the accumulation of duplicate class
-# files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
-# to calling the add_jar() function:
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
-# add_jar(foo foo.java)
-#
-#
-#
-# ::
-#
-# set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
-# add_jar(bar bar.java)
-#
-#
-#
-# ::
-#
-# For an optimum usage of option GENERATE_NATIVE_HEADERS, it is recommended to
-# include module JNI before any call to add_jar. The produced target for native
-# headers can then be used to compile C/C++ sources with command
-# target_link_libraries.
-#
-#
-# ::
-#
-# find_package(JNI)
-# add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
-# add_library(bar bar.cpp)
-# target_link_libraries(bar PRIVATE foo-native)
-#
-#
-# Target Properties:
-#
-# ::
-#
-# The add_jar() function sets some target properties. You can get these
-# properties with the
-# get_property(TARGET <target_name> PROPERTY <propery_name>)
-# command.
-#
-#
-#
-# ::
-#
-# INSTALL_FILES The files which should be installed. This is used by
-# install_jar().
-# JNI_SYMLINK The JNI symlink which should be installed.
-# This is used by install_jni_symlink().
-# JAR_FILE The location of the jar file so that you can include
-# it.
-# CLASSDIR The directory where the class files can be found. For
-# example to use them with javah.
-#
-# ::
-#
-# find_jar(<VAR>
-# name | NAMES name1 [name2 ...]
-# [PATHS path1 [path2 ... ENV var]]
-# [VERSIONS version1 [version2]]
-# [DOC "cache documentation string"]
-# )
-#
-# This command is used to find a full path to the named jar. A cache
-# entry named by <VAR> is created to stor the result of this command.
-# If the full path to a jar is found the result is stored in the
-# variable and the search will not repeated unless the variable is
-# cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and
-# the search will be attempted again next time find_jar is invoked with
-# the same variable. The name of the full path to a file that is
-# searched for is specified by the names listed after NAMES argument.
-# Additional search locations can be specified after the PATHS argument.
-# If you require special a version of a jar file you can specify it with
-# the VERSIONS argument. The argument after DOC will be used for the
-# documentation string in the cache.
-#
-# ::
-#
-# install_jar(target_name destination)
-# install_jar(target_name DESTINATION destination [COMPONENT component])
-#
-# This command installs the TARGET_NAME files to the given DESTINATION.
-# It should be called in the same scope as add_jar() or it will fail.
-#
-# Target Properties:
-#
-# ::
-#
-# The install_jar() function sets the INSTALL_DESTINATION target property
-# on jars so installed. This property holds the DESTINATION as described
-# above, and is used by install_jar_exports(). You can get this property
-# with the
-# get_property(TARGET <target_name> PROPERTY INSTALL_DESTINATION)
-# command.
-#
-#
-#
-# ::
-#
-# install_jni_symlink(target_name destination)
-# install_jni_symlink(target_name DESTINATION destination [COMPONENT component])
-#
-# This command installs the TARGET_NAME JNI symlinks to the given
-# DESTINATION. It should be called in the same scope as add_jar() or it
-# will fail.
-#
-# ::
-#
-# install_jar_exports(TARGETS jars...
-# [NAMESPACE <namespace>]
-# FILE <filename>
-# DESTINATION <dir> [COMPONENT <component>])
-#
-# This command installs a target export file ``<filename>`` for the named jar
-# targets to the given ``DESTINATION``. Its function is similar to that of
-# :command:`install(EXPORTS ...)`.
-#
-# ::
-#
-# export_jars(TARGETS jars...
-# [NAMESPACE <namespace>]
-# FILE <filename>)
-#
-# This command writes a target export file ``<filename>`` for the named jar
-# targets. Its function is similar to that of :command:`export(...)`.
-#
-# ::
-#
-# create_javadoc(<VAR>
-# PACKAGES pkg1 [pkg2 ...]
-# [SOURCEPATH <sourcepath>]
-# [CLASSPATH <classpath>]
-# [INSTALLPATH <install path>]
-# [DOCTITLE "the documentation title"]
-# [WINDOWTITLE "the title of the document"]
-# [AUTHOR TRUE|FALSE]
-# [USE TRUE|FALSE]
-# [VERSION TRUE|FALSE]
-# )
-#
-# Create java documentation based on files or packages. For more
-# details please read the javadoc manpage.
-#
-# There are two main signatures for create_javadoc. The first signature
-# works with package names on a path with source files:
-#
-# ::
-#
-# Example:
-# create_javadoc(my_example_doc
-# PACKAGES com.example.foo com.example.bar
-# SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
-# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
-# WINDOWTITLE "My example"
-# DOCTITLE "<h1>My example</h1>"
-# AUTHOR TRUE
-# USE TRUE
-# VERSION TRUE
-# )
-#
-#
-#
-# The second signature for create_javadoc works on a given list of
-# files.
-#
-# ::
-#
-# create_javadoc(<VAR>
-# FILES file1 [file2 ...]
-# [CLASSPATH <classpath>]
-# [INSTALLPATH <install path>]
-# [DOCTITLE "the documentation title"]
-# [WINDOWTITLE "the title of the document"]
-# [AUTHOR TRUE|FALSE]
-# [USE TRUE|FALSE]
-# [VERSION TRUE|FALSE]
-# )
-#
-#
-#
-# Example:
-#
-# ::
-#
-# create_javadoc(my_example_doc
-# FILES ${example_SRCS}
-# CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
-# WINDOWTITLE "My example"
-# DOCTITLE "<h1>My example</h1>"
-# AUTHOR TRUE
-# USE TRUE
-# VERSION TRUE
-# )
-#
-#
-#
-# Both signatures share most of the options. These options are the same
-# as what you can find in the javadoc manpage. Please look at the
-# manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and VERSION.
-#
-# The documentation will be by default installed to
-#
-# ::
-#
-# ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
-#
-#
-#
-# if you don't set the INSTALLPATH.
-#
-# ::
-#
-# create_javah(TARGET <target>
-# GENERATED_FILES <VAR>
-# CLASSES <class>...
-# [CLASSPATH <classpath>...]
-# [DEPENDS <depend>...]
-# [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
-# )
-#
-# Create C header files from java classes. These files provide the connective glue
-# that allow your Java and C code to interact.
-#
-# This command will no longer be supported starting with version 10 of the JDK due
-# to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
-# Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead.
-#
-# There are two main signatures for create_javah. The first signature
-# returns generated files through variable specified by GENERATED_FILES option:
-#
-# ::
-#
-# Example:
-# Create_javah(GENERATED_FILES files_headers
-# CLASSES org.cmake.HelloWorld
-# CLASSPATH hello.jar
-# )
-#
-#
-#
-# The second signature for create_javah creates a target which encapsulates
-# header files generation.
-#
-# ::
-#
-# Example:
-# Create_javah(TARGET target_headers
-# CLASSES org.cmake.HelloWorld
-# CLASSPATH hello.jar
-# )
-#
-#
-#
-# Both signatures share same options.
-#
-# ``CLASSES <class>...``
-# Specifies Java classes used to generate headers.
-#
-# ``CLASSPATH <classpath>...``
-# Specifies various paths to look up classes. Here .class files, jar files or targets
-# created by command add_jar can be used.
-#
-# ``DEPENDS <depend>...``
-# Targets on which the javah target depends
-#
-# ``OUTPUT_NAME <path>``
-# Concatenates the resulting header files for all the classes listed by option CLASSES
-# into <path>. Same behavior as option '-o' of javah tool.
-#
-# ``OUTPUT_DIR <path>``
-# Sets the directory where the header files will be generated. Same behavior as option
-# '-d' of javah tool. If not specified, ${CMAKE_CURRENT_BINARY_DIR} is used as output directory.
+#[=======================================================================[.rst:
+UseJava
+-------
+
+Use Module for Java
+
+This file provides functions for Java. It is assumed that
+FindJava.cmake has already been loaded. See FindJava.cmake for
+information on how to load Java into your CMake project.
+
+::
+
+ add_jar(target_name
+ [SOURCES] source1 [source2 ...] [resource1 ...]
+ [INCLUDE_JARS jar1 [jar2 ...]]
+ [ENTRY_POINT entry]
+ [VERSION version]
+ [OUTPUT_NAME name]
+ [OUTPUT_DIR dir]
+ [GENERATE_NATIVE_HEADERS target [DESTINATION dir]]
+ )
+
+This command creates a <target_name>.jar. It compiles the given
+source files (source) and adds the given resource files (resource) to
+the jar file. Source files can be java files or listing files
+(prefixed by '@'). If only resource files are given then just a jar file
+is created. The list of include jars are added to the classpath when
+compiling the java sources and also to the dependencies of the target.
+INCLUDE_JARS also accepts other target names created by add_jar. For
+backwards compatibility, jar files listed as sources are ignored (as
+they have been since the first version of this module).
+
+The default OUTPUT_DIR can also be changed by setting the variable
+CMAKE_JAVA_TARGET_OUTPUT_DIR.
+
+Optionally, using option GENERATE_NATIVE_HEADERS, native header files can be generated
+for methods declared as native. These files provide the connective glue that allow your
+Java and C code to interact. An INTERFACE target will be created for an easy usage
+of generated files. Sub-option DESTINATION can be used to specify output directory for
+generated header files.
+
+GENERATE_NATIVE_HEADERS option requires, at least, version 1.8 of the JDK.
+
+Additional instructions:
+
+::
+
+ To add compile flags to the target you can set these flags with
+ the following variable:
+
+
+
+::
+
+ set(CMAKE_JAVA_COMPILE_FLAGS -nowarn)
+
+
+
+::
+
+ To add a path or a jar file to the class path you can do this
+ with the CMAKE_JAVA_INCLUDE_PATH variable.
+
+
+
+::
+
+ set(CMAKE_JAVA_INCLUDE_PATH /usr/share/java/shibboleet.jar)
+
+
+
+::
+
+ To use a different output name for the target you can set it with:
+
+
+
+::
+
+ add_jar(foobar foobar.java OUTPUT_NAME shibboleet.jar)
+
+
+
+::
+
+ To use a different output directory than CMAKE_CURRENT_BINARY_DIR
+ you can set it with:
+
+
+
+::
+
+ add_jar(foobar foobar.java OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
+
+
+
+::
+
+ To define an entry point in your jar you can set it with the ENTRY_POINT
+ named argument:
+
+
+
+::
+
+ add_jar(example ENTRY_POINT com/examples/MyProject/Main)
+
+
+
+::
+
+ To define a custom manifest for the jar, you can set it with the manifest
+ named argument:
+
+
+
+::
+
+ add_jar(example MANIFEST /path/to/manifest)
+
+
+
+::
+
+ To add a VERSION to the target output name you can set it using
+ the VERSION named argument to add_jar. This will create a jar file with the
+ name shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
+ pointing to the jar with the version information.
+
+
+
+::
+
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+
+
+
+::
+
+ If the target is a JNI library, utilize the following commands to
+ create a JNI symbolic link:
+
+
+
+::
+
+ set(CMAKE_JNI_TARGET TRUE)
+ add_jar(shibboleet shibbotleet.java VERSION 1.2.0)
+ install_jar(shibboleet ${LIB_INSTALL_DIR}/shibboleet)
+ install_jni_symlink(shibboleet ${JAVA_LIB_INSTALL_DIR})
+
+
+
+::
+
+ If a single target needs to produce more than one jar from its
+ java source code, to prevent the accumulation of duplicate class
+ files in subsequent jars, set/reset CMAKE_JAR_CLASSES_PREFIX prior
+ to calling the add_jar() function:
+
+
+
+::
+
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/foo)
+ add_jar(foo foo.java)
+
+
+
+::
+
+ set(CMAKE_JAR_CLASSES_PREFIX com/redhat/bar)
+ add_jar(bar bar.java)
+
+
+
+::
+
+ For an optimum usage of option GENERATE_NATIVE_HEADERS, it is recommended to
+ include module JNI before any call to add_jar. The produced target for native
+ headers can then be used to compile C/C++ sources with command
+ target_link_libraries.
+
+
+::
+
+ find_package(JNI)
+ add_jar(foo foo.java GENERATE_NATIVE_HEADERS foo-native)
+ add_library(bar bar.cpp)
+ target_link_libraries(bar PRIVATE foo-native)
+
+
+Target Properties:
+
+::
+
+ The add_jar() function sets some target properties. You can get these
+ properties with the
+ get_property(TARGET <target_name> PROPERTY <propery_name>)
+ command.
+
+
+
+::
+
+ INSTALL_FILES The files which should be installed. This is used by
+ install_jar().
+ JNI_SYMLINK The JNI symlink which should be installed.
+ This is used by install_jni_symlink().
+ JAR_FILE The location of the jar file so that you can include
+ it.
+ CLASSDIR The directory where the class files can be found. For
+ example to use them with javah.
+
+::
+
+ find_jar(<VAR>
+ name | NAMES name1 [name2 ...]
+ [PATHS path1 [path2 ... ENV var]]
+ [VERSIONS version1 [version2]]
+ [DOC "cache documentation string"]
+ )
+
+This command is used to find a full path to the named jar. A cache
+entry named by <VAR> is created to stor the result of this command.
+If the full path to a jar is found the result is stored in the
+variable and the search will not repeated unless the variable is
+cleared. If nothing is found, the result will be <VAR>-NOTFOUND, and
+the search will be attempted again next time find_jar is invoked with
+the same variable. The name of the full path to a file that is
+searched for is specified by the names listed after NAMES argument.
+Additional search locations can be specified after the PATHS argument.
+If you require special a version of a jar file you can specify it with
+the VERSIONS argument. The argument after DOC will be used for the
+documentation string in the cache.
+
+::
+
+ install_jar(target_name destination)
+ install_jar(target_name DESTINATION destination [COMPONENT component])
+
+This command installs the TARGET_NAME files to the given DESTINATION.
+It should be called in the same scope as add_jar() or it will fail.
+
+Target Properties:
+
+::
+
+ The install_jar() function sets the INSTALL_DESTINATION target property
+ on jars so installed. This property holds the DESTINATION as described
+ above, and is used by install_jar_exports(). You can get this property
+ with the
+ get_property(TARGET <target_name> PROPERTY INSTALL_DESTINATION)
+ command.
+
+
+
+::
+
+ install_jni_symlink(target_name destination)
+ install_jni_symlink(target_name DESTINATION destination [COMPONENT component])
+
+This command installs the TARGET_NAME JNI symlinks to the given
+DESTINATION. It should be called in the same scope as add_jar() or it
+will fail.
+
+::
+
+ install_jar_exports(TARGETS jars...
+ [NAMESPACE <namespace>]
+ FILE <filename>
+ DESTINATION <dir> [COMPONENT <component>])
+
+This command installs a target export file ``<filename>`` for the named jar
+targets to the given ``DESTINATION``. Its function is similar to that of
+:command:`install(EXPORTS ...)`.
+
+::
+
+ export_jars(TARGETS jars...
+ [NAMESPACE <namespace>]
+ FILE <filename>)
+
+This command writes a target export file ``<filename>`` for the named jar
+targets. Its function is similar to that of :command:`export(...)`.
+
+::
+
+ create_javadoc(<VAR>
+ PACKAGES pkg1 [pkg2 ...]
+ [SOURCEPATH <sourcepath>]
+ [CLASSPATH <classpath>]
+ [INSTALLPATH <install path>]
+ [DOCTITLE "the documentation title"]
+ [WINDOWTITLE "the title of the document"]
+ [AUTHOR TRUE|FALSE]
+ [USE TRUE|FALSE]
+ [VERSION TRUE|FALSE]
+ )
+
+Create java documentation based on files or packages. For more
+details please read the javadoc manpage.
+
+There are two main signatures for create_javadoc. The first signature
+works with package names on a path with source files:
+
+::
+
+ Example:
+ create_javadoc(my_example_doc
+ PACKAGES com.example.foo com.example.bar
+ SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}"
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+
+
+The second signature for create_javadoc works on a given list of
+files.
+
+::
+
+ create_javadoc(<VAR>
+ FILES file1 [file2 ...]
+ [CLASSPATH <classpath>]
+ [INSTALLPATH <install path>]
+ [DOCTITLE "the documentation title"]
+ [WINDOWTITLE "the title of the document"]
+ [AUTHOR TRUE|FALSE]
+ [USE TRUE|FALSE]
+ [VERSION TRUE|FALSE]
+ )
+
+
+
+Example:
+
+::
+
+ create_javadoc(my_example_doc
+ FILES ${example_SRCS}
+ CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH}
+ WINDOWTITLE "My example"
+ DOCTITLE "<h1>My example</h1>"
+ AUTHOR TRUE
+ USE TRUE
+ VERSION TRUE
+ )
+
+
+
+Both signatures share most of the options. These options are the same
+as what you can find in the javadoc manpage. Please look at the
+manpage for CLASSPATH, DOCTITLE, WINDOWTITLE, AUTHOR, USE and VERSION.
+
+The documentation will be by default installed to
+
+::
+
+ ${CMAKE_INSTALL_PREFIX}/share/javadoc/<VAR>
+
+
+
+if you don't set the INSTALLPATH.
+
+::
+
+ create_javah(TARGET <target>
+ GENERATED_FILES <VAR>
+ CLASSES <class>...
+ [CLASSPATH <classpath>...]
+ [DEPENDS <depend>...]
+ [OUTPUT_NAME <path>|OUTPUT_DIR <path>]
+ )
+
+Create C header files from java classes. These files provide the connective glue
+that allow your Java and C code to interact.
+
+This command will no longer be supported starting with version 10 of the JDK due
+to the `suppression of javah tool <http://openjdk.java.net/jeps/313>`_.
+Command ``add_jar(GENERATE_NATIVE_HEADERS)`` must be used instead.
+
+There are two main signatures for create_javah. The first signature
+returns generated files through variable specified by GENERATED_FILES option:
+
+::
+
+ Example:
+ Create_javah(GENERATED_FILES files_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
+
+
+
+The second signature for create_javah creates a target which encapsulates
+header files generation.
+
+::
+
+ Example:
+ Create_javah(TARGET target_headers
+ CLASSES org.cmake.HelloWorld
+ CLASSPATH hello.jar
+ )
+
+
+
+Both signatures share same options.
+
+ ``CLASSES <class>...``
+ Specifies Java classes used to generate headers.
+
+ ``CLASSPATH <classpath>...``
+ Specifies various paths to look up classes. Here .class files, jar files or targets
+ created by command add_jar can be used.
+
+ ``DEPENDS <depend>...``
+ Targets on which the javah target depends
+
+ ``OUTPUT_NAME <path>``
+ Concatenates the resulting header files for all the classes listed by option CLASSES
+ into <path>. Same behavior as option '-o' of javah tool.
+
+ ``OUTPUT_DIR <path>``
+ Sets the directory where the header files will be generated. Same behavior as option
+ '-d' of javah tool. If not specified, ${CMAKE_CURRENT_BINARY_DIR} is used as output directory.
+#]=======================================================================]
function (__java_copy_file src dest comment)
add_custom_command(
@@ -445,7 +446,7 @@ function (__java_copy_file src dest comment)
endfunction ()
function(__java_lcat VAR)
- foreach(_line ${ARGN})
+ foreach(_line IN LISTS ARGN)
string(APPEND ${VAR} "${_line}\n")
endforeach()
@@ -567,7 +568,7 @@ function(add_jar _TARGET_NAME)
set(CMAKE_JAVA_INCLUDE_FLAG_SEP ":")
endif()
- foreach (JAVA_INCLUDE_DIR ${CMAKE_JAVA_INCLUDE_PATH})
+ foreach (JAVA_INCLUDE_DIR IN LISTS CMAKE_JAVA_INCLUDE_PATH)
string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach()
@@ -591,7 +592,7 @@ function(add_jar _TARGET_NAME)
set(_JAVA_COMPILE_DEPENDS)
set(_JAVA_RESOURCE_FILES)
set(_JAVA_RESOURCE_FILES_RELATIVE)
- foreach(_JAVA_SOURCE_FILE ${_JAVA_SOURCE_FILES})
+ foreach(_JAVA_SOURCE_FILE IN LISTS _JAVA_SOURCE_FILES)
get_filename_component(_JAVA_EXT ${_JAVA_SOURCE_FILE} EXT)
get_filename_component(_JAVA_FILE ${_JAVA_SOURCE_FILE} NAME_WE)
get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH)
@@ -606,7 +607,7 @@ function(add_jar _TARGET_NAME)
file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
- if (${_BIN_LEN} LESS ${_SRC_LEN})
+ if (_BIN_LEN LESS _SRC_LEN)
set(_JAVA_REL_PATH ${_JAVA_REL_BINARY_PATH})
else ()
set(_JAVA_REL_PATH ${_JAVA_REL_SOURCE_PATH})
@@ -636,14 +637,14 @@ function(add_jar _TARGET_NAME)
endif ()
endforeach()
- foreach(_JAVA_INCLUDE_JAR ${_add_jar_INCLUDE_JARS})
+ foreach(_JAVA_INCLUDE_JAR IN LISTS _add_jar_INCLUDE_JARS)
if (TARGET ${_JAVA_INCLUDE_JAR})
get_target_property(_JAVA_JAR_PATH ${_JAVA_INCLUDE_JAR} JAR_FILE)
if (_JAVA_JAR_PATH)
string(APPEND CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_FLAG_SEP}${_JAVA_JAR_PATH}")
list(APPEND CMAKE_JAVA_INCLUDE_PATH ${_JAVA_JAR_PATH})
list(APPEND _JAVA_DEPENDS ${_JAVA_INCLUDE_JAR})
- list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_INCLUDE_JAR})
+ list(APPEND _JAVA_COMPILE_DEPENDS ${_JAVA_JAR_PATH})
else ()
message(SEND_ERROR "add_jar: INCLUDE_JARS target ${_JAVA_INCLUDE_JAR} is not a jar")
endif ()
@@ -704,7 +705,7 @@ function(add_jar _TARGET_NAME)
# create the jar file
set(_JAVA_JAR_OUTPUT_PATH
- ${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
+ "${_add_jar_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME}")
if (CMAKE_JNI_TARGET)
add_custom_command(
OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
@@ -902,15 +903,15 @@ function (find_jar VARIABLE)
set(_state "name")
- foreach (arg ${ARGN})
- if (${_state} STREQUAL "name")
- if (${arg} STREQUAL "VERSIONS")
+ foreach (arg IN LISTS ARGN)
+ if (_state STREQUAL "name")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_names ${arg})
@@ -918,22 +919,22 @@ function (find_jar VARIABLE)
set(_jar_doc "Finding ${arg} jar")
endif ()
endif ()
- elseif (${_state} STREQUAL "versions")
- if (${arg} STREQUAL "NAMES")
+ elseif (_state STREQUAL "versions")
+ if (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_versions ${_jar_versions} ${arg})
endif ()
- elseif (${_state} STREQUAL "names")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "names")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_names ${_jar_names} ${arg})
@@ -941,22 +942,22 @@ function (find_jar VARIABLE)
set(_jar_doc "Finding ${arg} jar")
endif ()
endif ()
- elseif (${_state} STREQUAL "paths")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "paths")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "DOC")
+ elseif (arg STREQUAL "DOC")
set(_state "doc")
else ()
set(_jar_paths ${_jar_paths} ${arg})
endif ()
- elseif (${_state} STREQUAL "doc")
- if (${arg} STREQUAL "VERSIONS")
+ elseif (_state STREQUAL "doc")
+ if (arg STREQUAL "VERSIONS")
set(_state "versions")
- elseif (${arg} STREQUAL "NAMES")
+ elseif (arg STREQUAL "NAMES")
set(_state "names")
- elseif (${arg} STREQUAL "PATHS")
+ elseif (arg STREQUAL "PATHS")
set(_state "paths")
else ()
set(_jar_doc ${arg})
@@ -968,8 +969,8 @@ function (find_jar VARIABLE)
message(FATAL_ERROR "find_jar: No name to search for given")
endif ()
- foreach (jar_name ${_jar_names})
- foreach (version ${_jar_versions})
+ foreach (jar_name IN LISTS _jar_names)
+ foreach (version IN LISTS _jar_versions)
set(_jar_files ${_jar_files} ${jar_name}-${version}.jar)
endforeach ()
set(_jar_files ${_jar_files} ${jar_name}.jar)
@@ -996,252 +997,252 @@ function(create_javadoc _target)
set(_state "package")
- foreach (arg ${ARGN})
- if (${_state} STREQUAL "package")
- if (${arg} STREQUAL "PACKAGES")
+ foreach (arg IN LISTS ARGN)
+ if (_state STREQUAL "package")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_packages ${arg})
set(_state "packages")
endif ()
- elseif (${_state} STREQUAL "packages")
- if (${arg} STREQUAL "FILES")
+ elseif (_state STREQUAL "packages")
+ if (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_packages ${arg})
endif ()
- elseif (${_state} STREQUAL "files")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "files")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_files ${arg})
endif ()
- elseif (${_state} STREQUAL "sourcepath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "sourcepath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_sourcepath ${arg})
endif ()
- elseif (${_state} STREQUAL "classpath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "classpath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
list(APPEND _javadoc_classpath ${arg})
endif ()
- elseif (${_state} STREQUAL "installpath")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "installpath")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_installpath ${arg})
endif ()
- elseif (${_state} STREQUAL "doctitle")
+ elseif (_state STREQUAL "doctitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_doctitle ${arg})
endif ()
- elseif (${_state} STREQUAL "windowtitle")
+ elseif (_state STREQUAL "windowtitle")
if (${arg} STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_windowtitle ${arg})
endif ()
- elseif (${_state} STREQUAL "author")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "author")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_author ${arg})
endif ()
- elseif (${_state} STREQUAL "use")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "use")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_use ${arg})
endif ()
- elseif (${_state} STREQUAL "version")
- if (${arg} STREQUAL "PACKAGES")
+ elseif (_state STREQUAL "version")
+ if (arg STREQUAL "PACKAGES")
set(_state "packages")
- elseif (${arg} STREQUAL "FILES")
+ elseif (arg STREQUAL "FILES")
set(_state "files")
- elseif (${arg} STREQUAL "SOURCEPATH")
+ elseif (arg STREQUAL "SOURCEPATH")
set(_state "sourcepath")
- elseif (${arg} STREQUAL "CLASSPATH")
+ elseif (arg STREQUAL "CLASSPATH")
set(_state "classpath")
- elseif (${arg} STREQUAL "INSTALLPATH")
+ elseif (arg STREQUAL "INSTALLPATH")
set(_state "installpath")
- elseif (${arg} STREQUAL "DOCTITLE")
+ elseif (arg STREQUAL "DOCTITLE")
set(_state "doctitle")
- elseif (${arg} STREQUAL "WINDOWTITLE")
+ elseif (arg STREQUAL "WINDOWTITLE")
set(_state "windowtitle")
- elseif (${arg} STREQUAL "AUTHOR")
+ elseif (arg STREQUAL "AUTHOR")
set(_state "author")
- elseif (${arg} STREQUAL "USE")
+ elseif (arg STREQUAL "USE")
set(_state "use")
- elseif (${arg} STREQUAL "VERSION")
+ elseif (arg STREQUAL "VERSION")
set(_state "version")
else ()
set(_javadoc_version ${arg})
@@ -1254,7 +1255,7 @@ function(create_javadoc _target)
if (_javadoc_sourcepath)
set(_start TRUE)
- foreach(_path ${_javadoc_sourcepath})
+ foreach(_path IN LISTS _javadoc_sourcepath)
if (_start)
set(_sourcepath ${_path})
set(_start FALSE)
@@ -1267,7 +1268,7 @@ function(create_javadoc _target)
if (_javadoc_classpath)
set(_start TRUE)
- foreach(_path ${_javadoc_classpath})
+ foreach(_path IN LISTS _javadoc_classpath)
if (_start)
set(_classpath ${_path})
set(_start FALSE)
@@ -1434,7 +1435,7 @@ function(export_jars)
# Set content of generated exports file
string(REPLACE ";" " " __targets__ "${_export_jars_TARGETS}")
set(__targetdefs__ "")
- foreach(_target ${_export_jars_TARGETS})
+ foreach(_target IN LISTS _export_jars_TARGETS)
get_target_property(_jarpath ${_target} JAR_FILE)
get_filename_component(_jarpath ${_jarpath} PATH)
__java_export_jar(__targetdefs__ ${_target} "${_jarpath}")
@@ -1472,7 +1473,7 @@ function(install_jar_exports)
endif()
# Determine relative path from installed export file to install prefix
- if(IS_ABSOLUTE ${_install_jar_exports_DESTINATION})
+ if(IS_ABSOLUTE "${_install_jar_exports_DESTINATION}")
file(RELATIVE_PATH _relpath
${_install_jar_exports_DESTINATION}
${CMAKE_INSTALL_PREFIX}
@@ -1491,7 +1492,7 @@ function(install_jar_exports)
# Set content of generated exports file
string(REPLACE ";" " " __targets__ "${_install_jar_exports_TARGETS}")
set(__targetdefs__ "set(_prefix \${CMAKE_CURRENT_LIST_DIR}/${_relpath})\n\n")
- foreach(_target ${_install_jar_exports_TARGETS})
+ foreach(_target IN LISTS _install_jar_exports_TARGETS)
get_target_property(_dir ${_target} INSTALL_DESTINATION)
__java_export_jar(__targetdefs__ ${_target} "\${_prefix}/${_dir}")
endforeach()
diff --git a/Modules/UseJavaClassFilelist.cmake b/Modules/UseJavaClassFilelist.cmake
index c2f9afa4f..1c4baa9d4 100644
--- a/Modules/UseJavaClassFilelist.cmake
+++ b/Modules/UseJavaClassFilelist.cmake
@@ -1,17 +1,18 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# UseJavaClassFilelist
-# --------------------
-#
-#
-#
-#
-#
-# This script create a list of compiled Java class files to be added to
-# a jar file. This avoids including cmake files which get created in
-# the binary directory.
+#[=======================================================================[.rst:
+UseJavaClassFilelist
+--------------------
+
+
+
+
+
+This script create a list of compiled Java class files to be added to
+a jar file. This avoids including cmake files which get created in
+the binary directory.
+#]=======================================================================]
if (CMAKE_JAVA_CLASS_OUTPUT_PATH)
if (EXISTS "${CMAKE_JAVA_CLASS_OUTPUT_PATH}")
diff --git a/Modules/UseJavaSymlinks.cmake b/Modules/UseJavaSymlinks.cmake
index 358b9ef5c..3969f54fa 100644
--- a/Modules/UseJavaSymlinks.cmake
+++ b/Modules/UseJavaSymlinks.cmake
@@ -1,15 +1,16 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# UseJavaSymlinks
-# ---------------
-#
-#
-#
-#
-#
-# Helper script for UseJava.cmake
+#[=======================================================================[.rst:
+UseJavaSymlinks
+---------------
+
+
+
+
+
+Helper script for UseJava.cmake
+#]=======================================================================]
if (UNIX AND _JAVA_TARGET_OUTPUT_LINK)
if (_JAVA_TARGET_OUTPUT_NAME)
diff --git a/Modules/UsePkgConfig.cmake b/Modules/UsePkgConfig.cmake
index 28618eb10..32d228dab 100644
--- a/Modules/UsePkgConfig.cmake
+++ b/Modules/UsePkgConfig.cmake
@@ -1,24 +1,25 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# UsePkgConfig
-# ------------
-#
-# Obsolete pkg-config module for CMake, use FindPkgConfig instead.
-#
-#
-#
-# This module defines the following macro:
-#
-# PKGCONFIG(package includedir libdir linkflags cflags)
-#
-# Calling PKGCONFIG will fill the desired information into the 4 given
-# arguments, e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR
-# LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config was NOT
-# found or the specified software package doesn't exist, the variable
-# will be empty when the function returns, otherwise they will contain
-# the respective information
+#[=======================================================================[.rst:
+UsePkgConfig
+------------
+
+Obsolete pkg-config module for CMake, use FindPkgConfig instead.
+
+
+
+This module defines the following macro:
+
+PKGCONFIG(package includedir libdir linkflags cflags)
+
+Calling PKGCONFIG will fill the desired information into the 4 given
+arguments, e.g. PKGCONFIG(libart-2.0 LIBART_INCLUDE_DIR
+LIBART_LINK_DIR LIBART_LINK_FLAGS LIBART_CFLAGS) if pkg-config was NOT
+found or the specified software package doesn't exist, the variable
+will be empty when the function returns, otherwise they will contain
+the respective information
+#]=======================================================================]
find_program(PKGCONFIG_EXECUTABLE NAMES pkg-config )
diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake
index c8eab7766..dc2348ed1 100644
--- a/Modules/UseQt4.cmake
+++ b/Modules/UseQt4.cmake
@@ -1,15 +1,16 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# UseQt4
-# ------
-#
-# Use Module for QT4
-#
-# Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake has
-# already been loaded. See FindQt.cmake for information on how to load
-# Qt 4 into your CMake project.
+#[=======================================================================[.rst:
+UseQt4
+------
+
+Use Module for QT4
+
+Sets up C and C++ to use Qt 4. It is assumed that FindQt.cmake has
+already been loaded. See FindQt.cmake for information on how to load
+Qt 4 into your CMake project.
+#]=======================================================================]
add_definitions(${QT_DEFINITIONS})
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>)
diff --git a/Modules/UseSWIG.cmake b/Modules/UseSWIG.cmake
index 82fbc4bbc..18ea55c42 100644
--- a/Modules/UseSWIG.cmake
+++ b/Modules/UseSWIG.cmake
@@ -75,7 +75,8 @@ Defines the following command for use with ``SWIG``:
``SOURCES``
List of sources for the library. Files with extension ``.i`` will be
identified as sources for the ``SWIG`` tool. Other files will be handled in
- the standard way.
+ the standard way. This behavior can be overriden by specifying the variable
+ ``SWIG_SOURCE_FILE_EXTENSIONS``.
.. note::
@@ -142,6 +143,11 @@ ensure generated files will receive the required settings.
set_property(SOURCE mymod.i PROPERTY SWIG_MODULE_NAME mymod_realname)
+ .. note::
+
+ If policy :policy:`CMP0086` is set to ``NEW``, ``-module <module_name>``
+ is passed to ``SWIG`` compiler.
+
Target library properties can be set to apply same configuration to all SWIG
input files.
@@ -217,15 +223,31 @@ as well as ``SWIG``:
``SWIG_MODULE_<name>_EXTRA_DEPS``
Specify extra dependencies for the generated module for ``<name>``.
+
+``SWIG_SOURCE_FILE_EXTENSIONS``
+ Specify a list of source file extensions to override the default
+ behavior of considering only ``.i`` files as sources for the ``SWIG``
+ tool. For example:
+
+ .. code-block:: cmake
+
+ set(SWIG_SOURCE_FILE_EXTENSIONS ".i" ".swg")
#]=======================================================================]
cmake_policy(GET CMP0078 target_name_policy)
+cmake_policy(GET CMP0086 module_name_policy)
+
cmake_policy (VERSION 3.12)
if (target_name_policy)
# respect user choice regarding CMP0078 policy
cmake_policy(SET CMP0078 ${target_name_policy})
endif()
+if (module_name_policy)
+ # respect user choice regarding CMP0086 policy
+ cmake_policy(SET CMP0086 ${module_name_policy})
+endif()
unset(target_name_policy)
+unset(module_name_policy)
set(SWIG_CXX_EXTENSION "cxx")
set(SWIG_EXTRA_LIBRARIES "")
@@ -426,6 +448,19 @@ function(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
list (APPEND swig_special_flags "-c++")
endif()
+ cmake_policy(GET CMP0086 module_name_policy)
+ if (module_name_policy STREQUAL "NEW")
+ get_source_file_property(module_name "${infile}" SWIG_MODULE_NAME)
+ if (module_name)
+ list (APPEND swig_special_flags "-module" "${module_name}")
+ endif()
+ else()
+ if (NOT module_name_policy)
+ cmake_policy(GET_WARNING CMP0086 _cmp0086_warning)
+ message(AUTHOR_WARNING "${_cmp0086_warning}\n")
+ endif()
+ endif()
+
set (swig_extra_flags)
if(SWIG_MODULE_${name}_LANGUAGE STREQUAL "CSHARP")
if(NOT ("-dllimport" IN_LIST swig_source_file_flags OR "-dllimport" IN_LIST SWIG_MODULE_${name}_EXTRA_FLAGS))
@@ -561,11 +596,8 @@ function(SWIG_ADD_LIBRARY name)
set (UseSWIG_TARGET_NAME_PREFERENCE STANDARD)
else()
if (NOT target_name_policy)
- message(AUTHOR_WARNING
- "Policy CMP0078 is not set. "
- "Run \"cmake --help-policy CMP0078\" for policy details. "
- "Use the cmake_policy command to set the policy and suppress this warning."
- )
+ cmake_policy(GET_WARNING CMP0078 _cmp0078_warning)
+ message(AUTHOR_WARNING "${_cmp0078_warning}\n")
endif()
if (NOT DEFINED UseSWIG_TARGET_NAME_PREFERENCE)
set (UseSWIG_TARGET_NAME_PREFERENCE LEGACY)
@@ -637,8 +669,20 @@ function(SWIG_ADD_LIBRARY name)
set(CMAKE_SWIG_OUTDIR "${outputdir}")
set(SWIG_OUTFILE_DIR "${outfiledir}")
+ # See if the user has specified source extensions for swig files?
+ if (NOT DEFINED SWIG_SOURCE_FILE_EXTENSIONS)
+ # Assume the default (*.i) file extension for Swig source files
+ set(SWIG_SOURCE_FILE_EXTENSIONS ".i")
+ endif()
+
+ # Generate a regex out of file extensions.
+ string(REGEX REPLACE "([$^.*+?|()-])" "\\\\\\1" swig_source_ext_regex "${SWIG_SOURCE_FILE_EXTENSIONS}")
+ list (JOIN swig_source_ext_regex "|" swig_source_ext_regex)
+ string (PREPEND swig_source_ext_regex "(")
+ string (APPEND swig_source_ext_regex ")$")
+
set(swig_dot_i_sources ${_SAM_SOURCES})
- list(FILTER swig_dot_i_sources INCLUDE REGEX "\\.i$")
+ list(FILTER swig_dot_i_sources INCLUDE REGEX ${swig_source_ext_regex})
if (NOT swig_dot_i_sources)
message(FATAL_ERROR "SWIG_ADD_LIBRARY: no SWIG interface files specified")
endif()
diff --git a/Modules/Use_wxWindows.cmake b/Modules/Use_wxWindows.cmake
index bd8cc01c1..782874c10 100644
--- a/Modules/Use_wxWindows.cmake
+++ b/Modules/Use_wxWindows.cmake
@@ -1,35 +1,37 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# Use_wxWindows
-# -------------
-#
-#
-#
-#
-# This convenience include finds if wxWindows is installed and set the
-# appropriate libs, incdirs, flags etc. author Jan Woetzel <jw -at-
-# mip.informatik.uni-kiel.de> (07/2003)
-#
-# USAGE:
-#
-# ::
-#
-# just include Use_wxWindows.cmake
-# in your projects CMakeLists.txt
-#
-# include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
-#
-# ::
-#
-# if you are sure you need GL then
-#
-# set(WXWINDOWS_USE_GL 1)
-#
-# ::
-#
-# *before* you include this file.
+#[=======================================================================[.rst:
+Use_wxWindows
+-------------
+
+.. deprecated:: 2.8.10
+
+ Use ``find_package(wxWidgets)`` and ``include(${wxWidgets_USE_FILE})`` instead.
+
+This convenience include finds if wxWindows is installed and set the
+appropriate libs, incdirs, flags etc. author Jan Woetzel <jw -at-
+mip.informatik.uni-kiel.de> (07/2003)
+
+USAGE:
+
+::
+
+ just include Use_wxWindows.cmake
+ in your projects CMakeLists.txt
+
+include( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
+
+::
+
+ if you are sure you need GL then
+
+set(WXWINDOWS_USE_GL 1)
+
+::
+
+ *before* you include this file.
+#]=======================================================================]
# -----------------------------------------------------
# 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
@@ -65,4 +67,3 @@ if(WXWINDOWS_FOUND)
else()
message(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
endif()
-
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index a50d03d53..eed041021 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -1,41 +1,42 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# UsewxWidgets
-# ------------
-#
-# Convenience include for using wxWidgets library.
-#
-# Determines if wxWidgets was FOUND and sets the appropriate libs,
-# incdirs, flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are
-# called.
-#
-# USAGE
-#
-# ::
-#
-# # Note that for MinGW users the order of libs is important!
-# find_package(wxWidgets REQUIRED net gl core base)
-# include(${wxWidgets_USE_FILE})
-# # and for each of your dependent executable/library targets:
-# target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
-#
-#
-#
-# DEPRECATED
-#
-# ::
-#
-# LINK_LIBRARIES is not called in favor of adding dependencies per target.
-#
-#
-#
-# AUTHOR
-#
-# ::
-#
-# Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
+#[=======================================================================[.rst:
+UsewxWidgets
+------------
+
+Convenience include for using wxWidgets library.
+
+Determines if wxWidgets was FOUND and sets the appropriate libs,
+incdirs, flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are
+called.
+
+USAGE
+
+::
+
+ # Note that for MinGW users the order of libs is important!
+ find_package(wxWidgets REQUIRED net gl core base)
+ include(${wxWidgets_USE_FILE})
+ # and for each of your dependent executable/library targets:
+ target_link_libraries(<YourTarget> ${wxWidgets_LIBRARIES})
+
+
+
+DEPRECATED
+
+::
+
+ LINK_LIBRARIES is not called in favor of adding dependencies per target.
+
+
+
+AUTHOR
+
+::
+
+ Jan Woetzel <jw -at- mip.informatik.uni-kiel.de>
+#]=======================================================================]
# debug message and logging.
# comment these out for distribution
diff --git a/Modules/WriteBasicConfigVersionFile.cmake b/Modules/WriteBasicConfigVersionFile.cmake
index 2f7c80ab8..45f9e587a 100644
--- a/Modules/WriteBasicConfigVersionFile.cmake
+++ b/Modules/WriteBasicConfigVersionFile.cmake
@@ -1,26 +1,29 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# WriteBasicConfigVersionFile
-# ---------------------------
-#
-#
-#
-# ::
-#
-# WRITE_BASIC_CONFIG_VERSION_FILE( filename
-# [VERSION major.minor.patch]
-# COMPATIBILITY (AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion)
-# )
-#
-#
-#
-# Deprecated, see WRITE_BASIC_PACKAGE_VERSION_FILE(), it is identical.
+#[=======================================================================[.rst:
+WriteBasicConfigVersionFile
+---------------------------
+
+.. deprecated:: 3.0
+
+ Use the identical command :command:`write_basic_package_version_file()`
+ from module :module:`CMakePackageConfigHelpers`.
+
+::
+
+ WRITE_BASIC_CONFIG_VERSION_FILE( filename
+ [VERSION major.minor.patch]
+ COMPATIBILITY (AnyNewerVersion|SameMajorVersion|SameMinorVersion|ExactVersion)
+ [ARCH_INDEPENDENT]
+ )
+
+
+#]=======================================================================]
function(WRITE_BASIC_CONFIG_VERSION_FILE _filename)
- set(options )
+ set(options ARCH_INDEPENDENT )
set(oneValueArgs VERSION COMPATIBILITY )
set(multiValueArgs )
diff --git a/Modules/WriteCompilerDetectionHeader.cmake b/Modules/WriteCompilerDetectionHeader.cmake
index 3718e9ddf..21ccd7ca8 100644
--- a/Modules/WriteCompilerDetectionHeader.cmake
+++ b/Modules/WriteCompilerDetectionHeader.cmake
@@ -1,236 +1,236 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# WriteCompilerDetectionHeader
-# ----------------------------
-#
-# This module provides the function write_compiler_detection_header().
-#
-# The ``WRITE_COMPILER_DETECTION_HEADER`` function can be used to generate
-# a file suitable for preprocessor inclusion which contains macros to be
-# used in source code::
-#
-# write_compiler_detection_header(
-# FILE <file>
-# PREFIX <prefix>
-# [OUTPUT_FILES_VAR <output_files_var> OUTPUT_DIR <output_dir>]
-# COMPILERS <compiler> [...]
-# FEATURES <feature> [...]
-# [BARE_FEATURES <feature> [...]]
-# [VERSION <version>]
-# [PROLOG <prolog>]
-# [EPILOG <epilog>]
-# [ALLOW_UNKNOWN_COMPILERS]
-# [ALLOW_UNKNOWN_COMPILER_VERSIONS]
-# )
-#
-# The ``write_compiler_detection_header`` function generates the
-# file ``<file>`` with macros which all have the prefix ``<prefix>``.
-#
-# By default, all content is written directly to the ``<file>``. The
-# ``OUTPUT_FILES_VAR`` may be specified to cause the compiler-specific
-# content to be written to separate files. The separate files are then
-# available in the ``<output_files_var>`` and may be consumed by the caller
-# for installation for example. The ``OUTPUT_DIR`` specifies a relative
-# path from the main ``<file>`` to the compiler-specific files. For example:
-#
-# .. code-block:: cmake
-#
-# write_compiler_detection_header(
-# FILE climbingstats_compiler_detection.h
-# PREFIX ClimbingStats
-# OUTPUT_FILES_VAR support_files
-# OUTPUT_DIR compilers
-# COMPILERS GNU Clang MSVC Intel
-# FEATURES cxx_variadic_templates
-# )
-# install(FILES
-# ${CMAKE_CURRENT_BINARY_DIR}/climbingstats_compiler_detection.h
-# DESTINATION include
-# )
-# install(FILES
-# ${support_files}
-# DESTINATION include/compilers
-# )
-#
-#
-# ``VERSION`` may be used to specify the API version to be generated.
-# Future versions of CMake may introduce alternative APIs. A given
-# API is selected by any ``<version>`` value greater than or equal
-# to the version of CMake that introduced the given API and less
-# than the version of CMake that introduced its succeeding API.
-# The value of the :variable:`CMAKE_MINIMUM_REQUIRED_VERSION`
-# variable is used if no explicit version is specified.
-# (As of CMake version |release| there is only one API version.)
-#
-# ``PROLOG`` may be specified as text content to write at the start of the
-# header. ``EPILOG`` may be specified as text content to write at the end
-# of the header
-#
-# At least one ``<compiler>`` and one ``<feature>`` must be listed. Compilers
-# which are known to CMake, but not specified are detected and a preprocessor
-# ``#error`` is generated for them. A preprocessor macro matching
-# ``<PREFIX>_COMPILER_IS_<compiler>`` is generated for each compiler
-# known to CMake to contain the value ``0`` or ``1``.
-#
-# Possible compiler identifiers are documented with the
-# :variable:`CMAKE_<LANG>_COMPILER_ID` variable.
-# Available features in this version of CMake are listed in the
-# :prop_gbl:`CMAKE_C_KNOWN_FEATURES` and
-# :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties.
-# The ``{c,cxx}_std_*`` meta-features are ignored if requested.
-#
-# See the :manual:`cmake-compile-features(7)` manual for information on
-# compile features.
-#
-# ``BARE_FEATURES`` will define the compatibility macros with the name used in
-# newer versions of the language standard, so the code can use the new feature
-# name unconditionally.
-#
-# ``ALLOW_UNKNOWN_COMPILERS`` and ``ALLOW_UNKNOWN_COMPILER_VERSIONS`` cause
-# the module to generate conditions that treat unknown compilers as simply
-# lacking all features. Without these options the default behavior is to
-# generate a ``#error`` for unknown compilers and versions.
-#
-# Feature Test Macros
-# ===================
-#
-# For each compiler, a preprocessor macro is generated matching
-# ``<PREFIX>_COMPILER_IS_<compiler>`` which has the content either ``0``
-# or ``1``, depending on the compiler in use. Preprocessor macros for
-# compiler version components are generated matching
-# ``<PREFIX>_COMPILER_VERSION_MAJOR`` ``<PREFIX>_COMPILER_VERSION_MINOR``
-# and ``<PREFIX>_COMPILER_VERSION_PATCH`` containing decimal values
-# for the corresponding compiler version components, if defined.
-#
-# A preprocessor test is generated based on the compiler version
-# denoting whether each feature is enabled. A preprocessor macro
-# matching ``<PREFIX>_COMPILER_<FEATURE>``, where ``<FEATURE>`` is the
-# upper-case ``<feature>`` name, is generated to contain the value
-# ``0`` or ``1`` depending on whether the compiler in use supports the
-# feature:
-#
-# .. code-block:: cmake
-#
-# write_compiler_detection_header(
-# FILE climbingstats_compiler_detection.h
-# PREFIX ClimbingStats
-# COMPILERS GNU Clang AppleClang MSVC Intel
-# FEATURES cxx_variadic_templates
-# )
-#
-# .. code-block:: c++
-#
-# #if ClimbingStats_COMPILER_CXX_VARIADIC_TEMPLATES
-# template<typename... T>
-# void someInterface(T t...) { /* ... */ }
-# #else
-# // Compatibility versions
-# template<typename T1>
-# void someInterface(T1 t1) { /* ... */ }
-# template<typename T1, typename T2>
-# void someInterface(T1 t1, T2 t2) { /* ... */ }
-# template<typename T1, typename T2, typename T3>
-# void someInterface(T1 t1, T2 t2, T3 t3) { /* ... */ }
-# #endif
-#
-# Symbol Macros
-# =============
-#
-# Some additional symbol-defines are created for particular features for
-# use as symbols which may be conditionally defined empty:
-#
-# .. code-block:: c++
-#
-# class MyClass ClimbingStats_FINAL
-# {
-# ClimbingStats_CONSTEXPR int someInterface() { return 42; }
-# };
-#
-# The ``ClimbingStats_FINAL`` macro will expand to ``final`` if the
-# compiler (and its flags) support the ``cxx_final`` feature, and the
-# ``ClimbingStats_CONSTEXPR`` macro will expand to ``constexpr``
-# if ``cxx_constexpr`` is supported.
-#
-# If ``BARE_FEATURES cxx_final`` was given as argument the ``final`` keyword
-# will be defined for old compilers, too.
-#
-# The following features generate corresponding symbol defines and if they
-# are available as ``BARE_FEATURES``:
-#
-# ========================== =================================== ================= ======
-# Feature Define Symbol bare
-# ========================== =================================== ================= ======
-# ``c_restrict`` ``<PREFIX>_RESTRICT`` ``restrict`` yes
-# ``cxx_constexpr`` ``<PREFIX>_CONSTEXPR`` ``constexpr`` yes
-# ``cxx_deleted_functions`` ``<PREFIX>_DELETED_FUNCTION`` ``= delete``
-# ``cxx_extern_templates`` ``<PREFIX>_EXTERN_TEMPLATE`` ``extern``
-# ``cxx_final`` ``<PREFIX>_FINAL`` ``final`` yes
-# ``cxx_noexcept`` ``<PREFIX>_NOEXCEPT`` ``noexcept`` yes
-# ``cxx_noexcept`` ``<PREFIX>_NOEXCEPT_EXPR(X)`` ``noexcept(X)``
-# ``cxx_override`` ``<PREFIX>_OVERRIDE`` ``override`` yes
-# ========================== =================================== ================= ======
-#
-# Compatibility Implementation Macros
-# ===================================
-#
-# Some features are suitable for wrapping in a macro with a backward
-# compatibility implementation if the compiler does not support the feature.
-#
-# When the ``cxx_static_assert`` feature is not provided by the compiler,
-# a compatibility implementation is available via the
-# ``<PREFIX>_STATIC_ASSERT(COND)`` and
-# ``<PREFIX>_STATIC_ASSERT_MSG(COND, MSG)`` function-like macros. The macros
-# expand to ``static_assert`` where that compiler feature is available, and
-# to a compatibility implementation otherwise. In the first form, the
-# condition is stringified in the message field of ``static_assert``. In
-# the second form, the message ``MSG`` is passed to the message field of
-# ``static_assert``, or ignored if using the backward compatibility
-# implementation.
-#
-# The ``cxx_attribute_deprecated`` feature provides a macro definition
-# ``<PREFIX>_DEPRECATED``, which expands to either the standard
-# ``[[deprecated]]`` attribute or a compiler-specific decorator such
-# as ``__attribute__((__deprecated__))`` used by GNU compilers.
-#
-# The ``cxx_alignas`` feature provides a macro definition
-# ``<PREFIX>_ALIGNAS`` which expands to either the standard ``alignas``
-# decorator or a compiler-specific decorator such as
-# ``__attribute__ ((__aligned__))`` used by GNU compilers.
-#
-# The ``cxx_alignof`` feature provides a macro definition
-# ``<PREFIX>_ALIGNOF`` which expands to either the standard ``alignof``
-# decorator or a compiler-specific decorator such as ``__alignof__``
-# used by GNU compilers.
-#
-# ============================= ================================ ===================== ======
-# Feature Define Symbol bare
-# ============================= ================================ ===================== ======
-# ``cxx_alignas`` ``<PREFIX>_ALIGNAS`` ``alignas``
-# ``cxx_alignof`` ``<PREFIX>_ALIGNOF`` ``alignof``
-# ``cxx_nullptr`` ``<PREFIX>_NULLPTR`` ``nullptr`` yes
-# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT`` ``static_assert``
-# ``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT_MSG`` ``static_assert``
-# ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED`` ``[[deprecated]]``
-# ``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED_MSG`` ``[[deprecated]]``
-# ``cxx_thread_local`` ``<PREFIX>_THREAD_LOCAL`` ``thread_local``
-# ============================= ================================ ===================== ======
-#
-# A use-case which arises with such deprecation macros is the deprecation
-# of an entire library. In that case, all public API in the library may
-# be decorated with the ``<PREFIX>_DEPRECATED`` macro. This results in
-# very noisy build output when building the library itself, so the macro
-# may be may be defined to empty in that case when building the deprecated
-# library:
-#
-# .. code-block:: cmake
-#
-# add_library(compat_support ${srcs})
-# target_compile_definitions(compat_support
-# PRIVATE
-# CompatSupport_DEPRECATED=
-# )
+#[=======================================================================[.rst:
+WriteCompilerDetectionHeader
+----------------------------
+
+This module provides the function write_compiler_detection_header().
+
+This function can be used to generate a file suitable for preprocessor
+inclusion which contains macros to be used in source code::
+
+ write_compiler_detection_header(
+ FILE <file>
+ PREFIX <prefix>
+ [OUTPUT_FILES_VAR <output_files_var> OUTPUT_DIR <output_dir>]
+ COMPILERS <compiler> [...]
+ FEATURES <feature> [...]
+ [BARE_FEATURES <feature> [...]]
+ [VERSION <version>]
+ [PROLOG <prolog>]
+ [EPILOG <epilog>]
+ [ALLOW_UNKNOWN_COMPILERS]
+ [ALLOW_UNKNOWN_COMPILER_VERSIONS]
+ )
+
+This generates the file ``<file>`` with macros which all have the prefix
+``<prefix>``.
+
+By default, all content is written directly to the ``<file>``. The
+``OUTPUT_FILES_VAR`` may be specified to cause the compiler-specific
+content to be written to separate files. The separate files are then
+available in the ``<output_files_var>`` and may be consumed by the caller
+for installation for example. The ``OUTPUT_DIR`` specifies a relative
+path from the main ``<file>`` to the compiler-specific files. For example:
+
+.. code-block:: cmake
+
+ write_compiler_detection_header(
+ FILE climbingstats_compiler_detection.h
+ PREFIX ClimbingStats
+ OUTPUT_FILES_VAR support_files
+ OUTPUT_DIR compilers
+ COMPILERS GNU Clang MSVC Intel
+ FEATURES cxx_variadic_templates
+ )
+ install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/climbingstats_compiler_detection.h
+ DESTINATION include
+ )
+ install(FILES
+ ${support_files}
+ DESTINATION include/compilers
+ )
+
+
+``VERSION`` may be used to specify the API version to be generated.
+Future versions of CMake may introduce alternative APIs. A given
+API is selected by any ``<version>`` value greater than or equal
+to the version of CMake that introduced the given API and less
+than the version of CMake that introduced its succeeding API.
+The value of the :variable:`CMAKE_MINIMUM_REQUIRED_VERSION`
+variable is used if no explicit version is specified.
+(As of CMake version |release| there is only one API version.)
+
+``PROLOG`` may be specified as text content to write at the start of the
+header. ``EPILOG`` may be specified as text content to write at the end
+of the header
+
+At least one ``<compiler>`` and one ``<feature>`` must be listed. Compilers
+which are known to CMake, but not specified are detected and a preprocessor
+``#error`` is generated for them. A preprocessor macro matching
+``<PREFIX>_COMPILER_IS_<compiler>`` is generated for each compiler
+known to CMake to contain the value ``0`` or ``1``.
+
+Possible compiler identifiers are documented with the
+:variable:`CMAKE_<LANG>_COMPILER_ID` variable.
+Available features in this version of CMake are listed in the
+:prop_gbl:`CMAKE_C_KNOWN_FEATURES` and
+:prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` global properties.
+The ``{c,cxx}_std_*`` meta-features are ignored if requested.
+
+See the :manual:`cmake-compile-features(7)` manual for information on
+compile features.
+
+``BARE_FEATURES`` will define the compatibility macros with the name used in
+newer versions of the language standard, so the code can use the new feature
+name unconditionally.
+
+``ALLOW_UNKNOWN_COMPILERS`` and ``ALLOW_UNKNOWN_COMPILER_VERSIONS`` cause
+the module to generate conditions that treat unknown compilers as simply
+lacking all features. Without these options the default behavior is to
+generate a ``#error`` for unknown compilers and versions.
+
+Feature Test Macros
+===================
+
+For each compiler, a preprocessor macro is generated matching
+``<PREFIX>_COMPILER_IS_<compiler>`` which has the content either ``0``
+or ``1``, depending on the compiler in use. Preprocessor macros for
+compiler version components are generated matching
+``<PREFIX>_COMPILER_VERSION_MAJOR`` ``<PREFIX>_COMPILER_VERSION_MINOR``
+and ``<PREFIX>_COMPILER_VERSION_PATCH`` containing decimal values
+for the corresponding compiler version components, if defined.
+
+A preprocessor test is generated based on the compiler version
+denoting whether each feature is enabled. A preprocessor macro
+matching ``<PREFIX>_COMPILER_<FEATURE>``, where ``<FEATURE>`` is the
+upper-case ``<feature>`` name, is generated to contain the value
+``0`` or ``1`` depending on whether the compiler in use supports the
+feature:
+
+.. code-block:: cmake
+
+ write_compiler_detection_header(
+ FILE climbingstats_compiler_detection.h
+ PREFIX ClimbingStats
+ COMPILERS GNU Clang AppleClang MSVC Intel
+ FEATURES cxx_variadic_templates
+ )
+
+.. code-block:: c++
+
+ #if ClimbingStats_COMPILER_CXX_VARIADIC_TEMPLATES
+ template<typename... T>
+ void someInterface(T t...) { /* ... */ }
+ #else
+ // Compatibility versions
+ template<typename T1>
+ void someInterface(T1 t1) { /* ... */ }
+ template<typename T1, typename T2>
+ void someInterface(T1 t1, T2 t2) { /* ... */ }
+ template<typename T1, typename T2, typename T3>
+ void someInterface(T1 t1, T2 t2, T3 t3) { /* ... */ }
+ #endif
+
+Symbol Macros
+=============
+
+Some additional symbol-defines are created for particular features for
+use as symbols which may be conditionally defined empty:
+
+.. code-block:: c++
+
+ class MyClass ClimbingStats_FINAL
+ {
+ ClimbingStats_CONSTEXPR int someInterface() { return 42; }
+ };
+
+The ``ClimbingStats_FINAL`` macro will expand to ``final`` if the
+compiler (and its flags) support the ``cxx_final`` feature, and the
+``ClimbingStats_CONSTEXPR`` macro will expand to ``constexpr``
+if ``cxx_constexpr`` is supported.
+
+If ``BARE_FEATURES cxx_final`` was given as argument the ``final`` keyword
+will be defined for old compilers, too.
+
+The following features generate corresponding symbol defines and if they
+are available as ``BARE_FEATURES``:
+
+========================== =================================== ================= ======
+ Feature Define Symbol bare
+========================== =================================== ================= ======
+``c_restrict`` ``<PREFIX>_RESTRICT`` ``restrict`` yes
+``cxx_constexpr`` ``<PREFIX>_CONSTEXPR`` ``constexpr`` yes
+``cxx_deleted_functions`` ``<PREFIX>_DELETED_FUNCTION`` ``= delete``
+``cxx_extern_templates`` ``<PREFIX>_EXTERN_TEMPLATE`` ``extern``
+``cxx_final`` ``<PREFIX>_FINAL`` ``final`` yes
+``cxx_noexcept`` ``<PREFIX>_NOEXCEPT`` ``noexcept`` yes
+``cxx_noexcept`` ``<PREFIX>_NOEXCEPT_EXPR(X)`` ``noexcept(X)``
+``cxx_override`` ``<PREFIX>_OVERRIDE`` ``override`` yes
+========================== =================================== ================= ======
+
+Compatibility Implementation Macros
+===================================
+
+Some features are suitable for wrapping in a macro with a backward
+compatibility implementation if the compiler does not support the feature.
+
+When the ``cxx_static_assert`` feature is not provided by the compiler,
+a compatibility implementation is available via the
+``<PREFIX>_STATIC_ASSERT(COND)`` and
+``<PREFIX>_STATIC_ASSERT_MSG(COND, MSG)`` function-like macros. The macros
+expand to ``static_assert`` where that compiler feature is available, and
+to a compatibility implementation otherwise. In the first form, the
+condition is stringified in the message field of ``static_assert``. In
+the second form, the message ``MSG`` is passed to the message field of
+``static_assert``, or ignored if using the backward compatibility
+implementation.
+
+The ``cxx_attribute_deprecated`` feature provides a macro definition
+``<PREFIX>_DEPRECATED``, which expands to either the standard
+``[[deprecated]]`` attribute or a compiler-specific decorator such
+as ``__attribute__((__deprecated__))`` used by GNU compilers.
+
+The ``cxx_alignas`` feature provides a macro definition
+``<PREFIX>_ALIGNAS`` which expands to either the standard ``alignas``
+decorator or a compiler-specific decorator such as
+``__attribute__ ((__aligned__))`` used by GNU compilers.
+
+The ``cxx_alignof`` feature provides a macro definition
+``<PREFIX>_ALIGNOF`` which expands to either the standard ``alignof``
+decorator or a compiler-specific decorator such as ``__alignof__``
+used by GNU compilers.
+
+============================= ================================ ===================== ======
+ Feature Define Symbol bare
+============================= ================================ ===================== ======
+``cxx_alignas`` ``<PREFIX>_ALIGNAS`` ``alignas``
+``cxx_alignof`` ``<PREFIX>_ALIGNOF`` ``alignof``
+``cxx_nullptr`` ``<PREFIX>_NULLPTR`` ``nullptr`` yes
+``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT`` ``static_assert``
+``cxx_static_assert`` ``<PREFIX>_STATIC_ASSERT_MSG`` ``static_assert``
+``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED`` ``[[deprecated]]``
+``cxx_attribute_deprecated`` ``<PREFIX>_DEPRECATED_MSG`` ``[[deprecated]]``
+``cxx_thread_local`` ``<PREFIX>_THREAD_LOCAL`` ``thread_local``
+============================= ================================ ===================== ======
+
+A use-case which arises with such deprecation macros is the deprecation
+of an entire library. In that case, all public API in the library may
+be decorated with the ``<PREFIX>_DEPRECATED`` macro. This results in
+very noisy build output when building the library itself, so the macro
+may be may be defined to empty in that case when building the deprecated
+library:
+
+.. code-block:: cmake
+
+ add_library(compat_support ${srcs})
+ target_compile_definitions(compat_support
+ PRIVATE
+ CompatSupport_DEPRECATED=
+ )
+#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CMakeCompilerIdDetection.cmake)
diff --git a/README.rst b/README.rst
index f1dbd9d1a..775463e9f 100644
--- a/README.rst
+++ b/README.rst
@@ -62,13 +62,13 @@ within the CMake source directory or any other build directory of your
choice. Once this has finished successfully, run ``make`` and
``make install``. In summary::
- $ ./bootstrap && make && make install
+ $ ./bootstrap && make && sudo make install
Windows
^^^^^^^
You need to download and install a binary release of CMake in order to build
-CMake. You can get these releases from the `CMake Download Page`_ . Then
+CMake. You can get these releases from the `CMake Download Page`_. Then
proceed with the instructions below.
.. _`CMake Download Page`: https://cmake.org/cmake/resources/software.html
@@ -83,6 +83,13 @@ For instructions how to do this, see documentation on `Running CMake`_.
.. _`Running CMake`: https://cmake.org/cmake/help/runningcmake.html
+To build the documentation, install `Sphinx`_ and configure CMake with
+``-DSPHINX_HTML=ON`` and/or ``-DSPHINX_MAN=ON`` to enable the "html" or
+"man" builder. Add ``-DSPHINX_EXECUTABLE=/path/to/sphinx-build`` if the
+tool is not found automatically.
+
+.. _`Sphinx`: http://sphinx-doc.org
+
Reporting Bugs
==============
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 8aff8f6b2..1c06052fd 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -31,6 +31,16 @@ else()
set(CMAKE_USE_ELF_PARSER)
endif()
+if(NOT CMake_DEFAULT_RECURSION_LIMIT)
+ if(DEFINED ENV{DASHBOARD_TEST_FROM_CTEST})
+ set(CMake_DEFAULT_RECURSION_LIMIT 100)
+ elseif(MINGW)
+ set(CMake_DEFAULT_RECURSION_LIMIT 400)
+ else()
+ set(CMake_DEFAULT_RECURSION_LIMIT 1000)
+ endif()
+endif()
+
if(APPLE)
set(CMAKE_USE_MACH_PARSER 1)
endif()
@@ -207,6 +217,14 @@ set(SRCS
cmExtraKateGenerator.h
cmExtraSublimeTextGenerator.cxx
cmExtraSublimeTextGenerator.h
+ cmFileAPI.cxx
+ cmFileAPI.h
+ cmFileAPICache.cxx
+ cmFileAPICache.h
+ cmFileAPICodemodel.cxx
+ cmFileAPICodemodel.h
+ cmFileAPICMakeFiles.cxx
+ cmFileAPICMakeFiles.h
cmFileLock.cxx
cmFileLock.h
cmFileLockPool.cxx
@@ -260,6 +278,8 @@ set(SRCS
cmInstallFilesGenerator.cxx
cmInstallScriptGenerator.h
cmInstallScriptGenerator.cxx
+ cmInstallSubdirectoryGenerator.h
+ cmInstallSubdirectoryGenerator.cxx
cmInstallTargetGenerator.h
cmInstallTargetGenerator.cxx
cmInstallDirectoryGenerator.h
@@ -288,6 +308,7 @@ set(SRCS
cmMakefileExecutableTargetGenerator.cxx
cmMakefileLibraryTargetGenerator.cxx
cmMakefileUtilityTargetGenerator.cxx
+ cmMessageType.h
cmMessenger.cxx
cmMessenger.h
cmMSVC60LinkLineComputer.cxx
@@ -318,6 +339,8 @@ set(SRCS
cmQtAutoGen.h
cmQtAutoGenerator.cxx
cmQtAutoGenerator.h
+ cmQtAutoGenGlobalInitializer.cxx
+ cmQtAutoGenGlobalInitializer.h
cmQtAutoGenInitializer.cxx
cmQtAutoGenInitializer.h
cmQtAutoGeneratorMocUic.cxx
@@ -371,6 +394,9 @@ set(SRCS
cmXMLWriter.h
cmake.cxx
cmake.h
+ cm_string_view.cxx
+ cm_string_view.hxx
+ cm_static_string_view.hxx
cmCommand.cxx
cmCommand.h
@@ -562,6 +588,8 @@ set(SRCS
cmSiteNameCommand.h
cmSourceGroupCommand.cxx
cmSourceGroupCommand.h
+ cmString.cxx
+ cmString.hxx
cmStringReplaceHelper.cxx
cmStringCommand.cxx
cmStringCommand.h
@@ -679,10 +707,10 @@ if (WIN32)
cmGlobalVisualStudio12Generator.cxx
cmGlobalVisualStudio14Generator.h
cmGlobalVisualStudio14Generator.cxx
- cmGlobalVisualStudio15Generator.h
- cmGlobalVisualStudio15Generator.cxx
cmGlobalVisualStudioGenerator.cxx
cmGlobalVisualStudioGenerator.h
+ cmGlobalVisualStudioVersionedGenerator.h
+ cmGlobalVisualStudioVersionedGenerator.cxx
cmIDEFlagTable.h
cmIDEOptions.cxx
cmIDEOptions.h
@@ -810,7 +838,6 @@ target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})
#
include_directories(
"${CMake_SOURCE_DIR}/Source/CTest"
- ${CMAKE_XMLRPC_INCLUDES}
${CMAKE_CURL_INCLUDES}
)
#
@@ -876,7 +903,7 @@ set(CTEST_SRCS cmCTest.cxx
# Build CTestLib
add_library(CTestLib ${CTEST_SRCS})
-target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES} ${CMAKE_XMLRPC_LIBRARIES})
+target_link_libraries(CTestLib CMakeLib ${CMAKE_CURL_LIBRARIES})
#
# CPack
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index fcd262572..0a264b915 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
-set(CMake_VERSION_MINOR 13)
-set(CMake_VERSION_PATCH 5)
+set(CMake_VERSION_MINOR 14)
+set(CMake_VERSION_PATCH 1)
#set(CMake_VERSION_RC 0)
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 180c92eed..9102e3e20 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -21,9 +21,7 @@ cmCPackIFWGenerator::cmCPackIFWGenerator()
this->Generator = this;
}
-cmCPackIFWGenerator::~cmCPackIFWGenerator()
-{
-}
+cmCPackIFWGenerator::~cmCPackIFWGenerator() = default;
int cmCPackIFWGenerator::PackageFiles()
{
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 8f492afde..01e3ea4a7 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -16,9 +16,7 @@
#include <stddef.h>
#include <utility>
-cmCPackIFWInstaller::cmCPackIFWInstaller()
-{
-}
+cmCPackIFWInstaller::cmCPackIFWInstaller() = default;
void cmCPackIFWInstaller::printSkippedOptionWarning(
const std::string& optionName, const std::string& optionValue)
@@ -288,8 +286,7 @@ protected:
content = cmSystemTools::TrimWhitespace(content);
std::string source = this->basePath + "/" + content;
std::string destination = this->path + "/" + content;
- if (!cmSystemTools::CopyFileIfDifferent(source.data(),
- destination.data())) {
+ if (!cmSystemTools::CopyFileIfDifferent(source, destination)) {
this->hasErrors = true;
}
}
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 67e279c6b..a1a52b185 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -24,9 +24,7 @@ cmCPackIFWPackage::CompareStruct::CompareStruct()
}
//------------------------------------------------------- DependenceStruct ---
-cmCPackIFWPackage::DependenceStruct::DependenceStruct()
-{
-}
+cmCPackIFWPackage::DependenceStruct::DependenceStruct() = default;
cmCPackIFWPackage::DependenceStruct::DependenceStruct(
const std::string& dependence)
@@ -359,7 +357,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
if (this->IsSetToEmpty(option)) {
this->DisplayName.clear();
} else if (const char* value = this->GetOption(option)) {
- this->ExpandListArgument(value, this->DisplayName);
+ cmCPackIFWPackage::ExpandListArgument(value, this->DisplayName);
}
// Description
@@ -367,7 +365,7 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix)
if (this->IsSetToEmpty(option)) {
this->Description.clear();
} else if (const char* value = this->GetOption(option)) {
- this->ExpandListArgument(value, this->Description);
+ cmCPackIFWPackage::ExpandListArgument(value, this->Description);
}
// Release date
diff --git a/Source/CPack/IFW/cmCPackIFWRepository.cxx b/Source/CPack/IFW/cmCPackIFWRepository.cxx
index 987cad89e..8042167ed 100644
--- a/Source/CPack/IFW/cmCPackIFWRepository.cxx
+++ b/Source/CPack/IFW/cmCPackIFWRepository.cxx
@@ -200,7 +200,7 @@ bool cmCPackIFWRepository::PatchUpdatesXml()
fout.Close();
- return cmSystemTools::RenameFile(updatesPatchXml.data(), updatesXml.data());
+ return cmSystemTools::RenameFile(updatesPatchXml, updatesXml);
}
void cmCPackIFWRepository::WriteRepositoryConfig(cmXMLWriter& xout)
diff --git a/Source/CPack/OSXScriptLauncher.cxx b/Source/CPack/OSXScriptLauncher.cxx
index d3de02b47..4966d09f2 100644
--- a/Source/CPack/OSXScriptLauncher.cxx
+++ b/Source/CPack/OSXScriptLauncher.cxx
@@ -46,8 +46,7 @@ int main(int argc, char* argv[])
// get the file system path of the url as a cstring
// in an encoding suitable for posix apis
- if (CFURLGetFileSystemRepresentation(scriptFileURL, true, path, PATH_MAX) ==
- false) {
+ if (!CFURLGetFileSystemRepresentation(scriptFileURL, true, path, PATH_MAX)) {
DebugError("CFURLGetFileSystemRepresentation failed");
return 1;
}
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index 128a04de8..f8c76449b 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -28,20 +28,20 @@ public:
~cmCPackWIXGenerator();
protected:
- virtual int InitializeInternal();
+ int InitializeInternal() override;
- virtual int PackageFiles();
+ int PackageFiles() override;
- virtual const char* GetOutputExtension() { return ".msi"; }
+ const char* GetOutputExtension() override { return ".msi"; }
- virtual enum CPackSetDestdirSupport SupportsSetDestdir() const
+ enum CPackSetDestdirSupport SupportsSetDestdir() const override
{
return SETDESTDIR_UNSUPPORTED;
}
- virtual bool SupportsAbsoluteDestination() const { return false; }
+ bool SupportsAbsoluteDestination() const override { return false; }
- virtual bool SupportsComponentInstallation() const { return true; }
+ bool SupportsComponentInstallation() const override { return true; }
private:
typedef std::map<std::string, std::string> id_map_t;
diff --git a/Source/CPack/cmCPack7zGenerator.cxx b/Source/CPack/cmCPack7zGenerator.cxx
index f0c41a2a1..741377012 100644
--- a/Source/CPack/cmCPack7zGenerator.cxx
+++ b/Source/CPack/cmCPack7zGenerator.cxx
@@ -10,6 +10,4 @@ cmCPack7zGenerator::cmCPack7zGenerator()
{
}
-cmCPack7zGenerator::~cmCPack7zGenerator()
-{
-}
+cmCPack7zGenerator::~cmCPack7zGenerator() = default;
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index ee1070fe5..98fb29d14 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -10,6 +10,7 @@
#include "cmWorkingDirectory.h"
#include <cstring>
+#include <map>
#include <ostream>
#include <utility>
#include <vector>
@@ -21,9 +22,7 @@ cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t,
this->ArchiveFormat = format;
}
-cmCPackArchiveGenerator::~cmCPackArchiveGenerator()
-{
-}
+cmCPackArchiveGenerator::~cmCPackArchiveGenerator() = default;
std::string cmCPackArchiveGenerator::GetArchiveComponentFileName(
const std::string& component, bool isGroupName)
@@ -111,13 +110,15 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(
return 0; \
} \
cmArchiveWrite archive(gf, this->Compress, this->ArchiveFormat); \
- if (!(archive)) { \
- cmCPackLogger(cmCPackLog::LOG_ERROR, \
- "Problem to create archive <" \
- << (filename) << ">, ERROR = " << (archive).GetError() \
- << std::endl); \
- return 0; \
- }
+ do { \
+ if (!(archive)) { \
+ cmCPackLogger(cmCPackLog::LOG_ERROR, \
+ "Problem to create archive <" \
+ << (filename) << ">, ERROR = " << (archive).GetError() \
+ << std::endl); \
+ return 0; \
+ } \
+ } while (false)
int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
{
diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index f8fd108d3..3a476f44b 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -8,13 +8,9 @@
#include "cmCPackLog.h"
#include "cmSystemTools.h"
-cmCPackBundleGenerator::cmCPackBundleGenerator()
-{
-}
+cmCPackBundleGenerator::cmCPackBundleGenerator() = default;
-cmCPackBundleGenerator::~cmCPackBundleGenerator()
-{
-}
+cmCPackBundleGenerator::~cmCPackBundleGenerator() = default;
int cmCPackBundleGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index ea0ee5815..635de490a 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -23,17 +23,15 @@ namespace {
class DebGenerator
{
public:
- DebGenerator(cmCPackLog* logger, std::string const& outputName,
- std::string const& workDir, std::string const& topLevelDir,
- std::string const& temporaryDir,
+ DebGenerator(cmCPackLog* logger, std::string outputName, std::string workDir,
+ std::string topLevelDir, std::string temporaryDir,
const char* debianCompressionType,
const char* debianArchiveType,
- std::map<std::string, std::string> const& controlValues,
- bool genShLibs, std::string const& shLibsFilename,
- bool genPostInst, std::string const& postInst, bool genPostRm,
- std::string const& postRm, const char* controlExtra,
- bool permissionStrctPolicy,
- std::vector<std::string> const& packageFiles);
+ std::map<std::string, std::string> controlValues,
+ bool genShLibs, std::string shLibsFilename, bool genPostInst,
+ std::string postInst, bool genPostRm, std::string postRm,
+ const char* controlExtra, bool permissionStrctPolicy,
+ std::vector<std::string> packageFiles);
bool generate() const;
@@ -66,31 +64,29 @@ private:
};
DebGenerator::DebGenerator(
- cmCPackLog* logger, std::string const& outputName,
- std::string const& workDir, std::string const& topLevelDir,
- std::string const& temporaryDir, const char* debianCompressionType,
- const char* debianArchiveType,
- std::map<std::string, std::string> const& controlValues, bool genShLibs,
- std::string const& shLibsFilename, bool genPostInst,
- std::string const& postInst, bool genPostRm, std::string const& postRm,
- const char* controlExtra, bool permissionStrictPolicy,
- std::vector<std::string> const& packageFiles)
+ cmCPackLog* logger, std::string outputName, std::string workDir,
+ std::string topLevelDir, std::string temporaryDir,
+ const char* debianCompressionType, const char* debianArchiveType,
+ std::map<std::string, std::string> controlValues, bool genShLibs,
+ std::string shLibsFilename, bool genPostInst, std::string postInst,
+ bool genPostRm, std::string postRm, const char* controlExtra,
+ bool permissionStrictPolicy, std::vector<std::string> packageFiles)
: Logger(logger)
- , OutputName(outputName)
- , WorkDir(workDir)
- , TopLevelDir(topLevelDir)
- , TemporaryDir(temporaryDir)
- , DebianArchiveType(debianArchiveType ? debianArchiveType : "paxr")
- , ControlValues(controlValues)
+ , OutputName(std::move(outputName))
+ , WorkDir(std::move(workDir))
+ , TopLevelDir(std::move(topLevelDir))
+ , TemporaryDir(std::move(temporaryDir))
+ , DebianArchiveType(debianArchiveType ? debianArchiveType : "gnutar")
+ , ControlValues(std::move(controlValues))
, GenShLibs(genShLibs)
- , ShLibsFilename(shLibsFilename)
+ , ShLibsFilename(std::move(shLibsFilename))
, GenPostInst(genPostInst)
- , PostInst(postInst)
+ , PostInst(std::move(postInst))
, GenPostRm(genPostRm)
- , PostRm(postRm)
+ , PostRm(std::move(postRm))
, ControlExtra(controlExtra)
, PermissionStrictPolicy(permissionStrictPolicy)
- , PackageFiles(packageFiles)
+ , PackageFiles(std::move(packageFiles))
{
if (!debianCompressionType) {
debianCompressionType = "gzip";
@@ -436,13 +432,9 @@ bool DebGenerator::generateDeb() const
} // end anonymous namespace
-cmCPackDebGenerator::cmCPackDebGenerator()
-{
-}
+cmCPackDebGenerator::cmCPackDebGenerator() = default;
-cmCPackDebGenerator::~cmCPackDebGenerator()
-{
-}
+cmCPackDebGenerator::~cmCPackDebGenerator() = default;
int cmCPackDebGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 561652305..013ad8163 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -62,17 +62,15 @@ cmCPackDragNDropGenerator::cmCPackDragNDropGenerator()
this->componentPackageMethod = ONE_PACKAGE;
}
-cmCPackDragNDropGenerator::~cmCPackDragNDropGenerator()
-{
-}
+cmCPackDragNDropGenerator::~cmCPackDragNDropGenerator() = default;
int cmCPackDragNDropGenerator::InitializeInternal()
{
// Starting with Xcode 4.3, look in "/Applications/Xcode.app" first:
//
std::vector<std::string> paths;
- paths.push_back("/Applications/Xcode.app/Contents/Developer/Tools");
- paths.push_back("/Developer/Tools");
+ paths.emplace_back("/Applications/Xcode.app/Contents/Developer/Tools");
+ paths.emplace_back("/Developer/Tools");
const std::string hdiutil_path =
cmSystemTools::FindProgram("hdiutil", std::vector<std::string>(), false);
@@ -212,8 +210,7 @@ int cmCPackDragNDropGenerator::PackageFiles()
bool cmCPackDragNDropGenerator::CopyFile(std::ostringstream& source,
std::ostringstream& target)
{
- if (!cmSystemTools::CopyFileIfDifferent(source.str().c_str(),
- target.str().c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(source.str(), target.str())) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
"Error copying " << source.str() << " to " << target.str()
<< std::endl);
@@ -533,7 +530,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
cmSystemTools::ExpandListArgument(cpack_dmg_languages, languages);
}
- cmGeneratedFileStream ofs(sla_r.c_str());
+ cmGeneratedFileStream ofs(sla_r);
ofs << "#include <CoreServices/CoreServices.r>\n\n";
if (oldStyle) {
ofs << SLAHeader;
diff --git a/Source/CPack/cmCPackExternalGenerator.cxx b/Source/CPack/cmCPackExternalGenerator.cxx
index 9f7b236a1..9dc985331 100644
--- a/Source/CPack/cmCPackExternalGenerator.cxx
+++ b/Source/CPack/cmCPackExternalGenerator.cxx
@@ -13,6 +13,7 @@
#include "cmsys/FStream.hxx"
+#include <map>
#include <utility>
#include <vector>
@@ -67,7 +68,7 @@ int cmCPackExternalGenerator::PackageFiles()
return 0;
}
- int res = this->MakefileMap->ReadListFile(packageScript);
+ bool res = this->MakefileMap->ReadListFile(packageScript);
if (cmSystemTools::GetErrorOccuredFlag() || !res) {
return 0;
diff --git a/Source/CPack/cmCPackFreeBSDGenerator.cxx b/Source/CPack/cmCPackFreeBSDGenerator.cxx
index 14334149e..fcf8af1f8 100644
--- a/Source/CPack/cmCPackFreeBSDGenerator.cxx
+++ b/Source/CPack/cmCPackFreeBSDGenerator.cxx
@@ -17,6 +17,7 @@
#include <pkg.h>
#include <algorithm>
+#include <utility>
cmCPackFreeBSDGenerator::cmCPackFreeBSDGenerator()
: cmCPackArchiveGenerator(cmArchiveWrite::CompressXZ, "paxr")
@@ -30,9 +31,7 @@ int cmCPackFreeBSDGenerator::InitializeInternal()
return this->Superclass::InitializeInternal();
}
-cmCPackFreeBSDGenerator::~cmCPackFreeBSDGenerator()
-{
-}
+cmCPackFreeBSDGenerator::~cmCPackFreeBSDGenerator() = default;
// This is a wrapper, for use only in stream-based output,
// that will output a string in UCL escaped fashion (in particular,
@@ -55,8 +54,7 @@ cmGeneratedFileStream& operator<<(cmGeneratedFileStream& s,
const EscapeQuotes& v)
{
s << '"';
- for (std::string::size_type i = 0; i < v.value.length(); ++i) {
- char c = v.value[i];
+ for (char c : v.value) {
switch (c) {
case '\n':
s << "\\n";
@@ -98,12 +96,12 @@ class ManifestKey
public:
std::string key;
- ManifestKey(const std::string& k)
- : key(k)
+ ManifestKey(std::string k)
+ : key(std::move(k))
{
}
- virtual ~ManifestKey() {}
+ virtual ~ManifestKey() = default;
// Output the value associated with this key to the stream @p s.
// Format is to be decided by subclasses.
@@ -116,9 +114,9 @@ class ManifestKeyValue : public ManifestKey
public:
std::string value;
- ManifestKeyValue(const std::string& k, const std::string& v)
+ ManifestKeyValue(const std::string& k, std::string v)
: ManifestKey(k)
- , value(v)
+ , value(std::move(v))
{
}
@@ -148,8 +146,8 @@ public:
ManifestKeyListValue& operator<<(const std::vector<std::string>& v)
{
- for (VList::const_iterator it = v.begin(); it != v.end(); ++it) {
- (*this) << (*it);
+ for (std::string const& e : v) {
+ (*this) << e;
}
return *this;
}
@@ -159,9 +157,9 @@ public:
bool with_comma = false;
s << '[';
- for (VList::const_iterator it = value.begin(); it != value.end(); ++it) {
+ for (std::string const& elem : value) {
s << (with_comma ? ',' : ' ');
- s << EscapeQuotes(*it);
+ s << EscapeQuotes(elem);
with_comma = true;
}
s << " ]";
@@ -182,8 +180,8 @@ public:
void write_value(cmGeneratedFileStream& s) const override
{
s << "{\n";
- for (VList::const_iterator it = value.begin(); it != value.end(); ++it) {
- s << " \"" << *it << "\": {\"origin\": \"" << *it << "\"},\n";
+ for (std::string const& elem : value) {
+ s << " \"" << elem << "\": {\"origin\": \"" << elem << "\"},\n";
}
s << '}';
}
@@ -206,9 +204,8 @@ std::string cmCPackFreeBSDGenerator::var_lookup(const char* var_name)
const char* pv = this->GetOption(var_name);
if (!pv) {
return std::string();
- } else {
- return pv;
}
+ return pv;
}
// Produce UCL in the given @p manifest file for the common
@@ -234,7 +231,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
cmSystemTools::ExpandListArgument(
var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE"), licenses);
std::string licenselogic("single");
- if (licenses.size() < 1) {
+ if (licenses.empty()) {
cmSystemTools::SetFatalErrorOccured();
} else if (licenses.size() > 1) {
licenselogic = var_lookup("CPACK_FREEBSD_PACKAGE_LICENSE_LOGIC");
@@ -249,7 +246,7 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
std::vector<std::string> deps;
cmSystemTools::ExpandListArgument(var_lookup("CPACK_FREEBSD_PACKAGE_DEPS"),
deps);
- if (deps.size() > 0) {
+ if (!deps.empty()) {
manifest << (ManifestKeyDepsValue("deps") << deps);
}
}
@@ -259,13 +256,8 @@ void cmCPackFreeBSDGenerator::write_manifest_fields(
static bool ignore_file(const std::string& filename)
{
struct stat statbuf;
-
- if (!((stat(filename.c_str(), &statbuf) >= 0) &&
- ((statbuf.st_mode & S_IFMT) == S_IFREG))) {
- return true;
- }
- // May be other reasons to return false
- return false;
+ return stat(filename.c_str(), &statbuf) < 0 ||
+ (statbuf.st_mode & S_IFMT) != S_IFREG;
}
// Write the given list of @p files to the manifest stream @p s,
@@ -277,13 +269,9 @@ void write_manifest_files(cmGeneratedFileStream& s,
const std::string& toplevel,
const std::vector<std::string>& files)
{
- const char* c_toplevel = toplevel.c_str();
- std::vector<std::string>::const_iterator it;
-
s << "\"files\": {\n";
- for (it = files.begin(); it != files.end(); ++it) {
- s << " \"/" << cmSystemTools::RelativePath(c_toplevel, it->c_str())
- << "\": \""
+ for (std::string const& file : files) {
+ s << " \"/" << cmSystemTools::RelativePath(toplevel, file) << "\": \""
<< "<sha256>"
<< "\",\n";
}
@@ -313,7 +301,7 @@ int cmCPackFreeBSDGenerator::PackageFiles()
std::string manifestname = toplevel + "/+MANIFEST";
{
- cmGeneratedFileStream manifest(manifestname.c_str());
+ cmGeneratedFileStream manifest(manifestname);
manifest << "{\n";
write_manifest_fields(manifest);
write_manifest_files(manifest, toplevel, files);
@@ -340,16 +328,15 @@ int cmCPackFreeBSDGenerator::PackageFiles()
std::string output_dir =
cmSystemTools::CollapseCombinedPath(toplevel, "../");
pkg_create_from_manifest(output_dir.c_str(), ::TXZ, toplevel.c_str(),
- manifestname.c_str(), NULL);
+ manifestname.c_str(), nullptr);
std::string broken_suffix = std::string("-") +
var_lookup("CPACK_TOPLEVEL_TAG") + std::string(GetOutputExtension());
- for (std::vector<std::string>::iterator it = packageFileNames.begin();
- it != packageFileNames.end(); ++it) {
- cmCPackLogger(cmCPackLog::LOG_DEBUG, "Packagefile " << *it << std::endl);
- if (has_suffix(*it, broken_suffix)) {
- it->replace(it->size() - broken_suffix.size(), std::string::npos,
- GetOutputExtension());
+ for (std::string& name : packageFileNames) {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Packagefile " << name << std::endl);
+ if (has_suffix(name, broken_suffix)) {
+ name.replace(name.size() - broken_suffix.size(), std::string::npos,
+ GetOutputExtension());
break;
}
}
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index acd665095..57c054590 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -18,6 +18,7 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmVersion.h"
#include "cmWorkingDirectory.h"
@@ -42,12 +43,6 @@ cmCPackGenerator::~cmCPackGenerator()
this->MakefileMap = nullptr;
}
-void cmCPackGeneratorProgress(const char* msg, float prog, void* ptr)
-{
- cmCPackGenerator* self = static_cast<cmCPackGenerator*>(ptr);
- self->DisplayVerboseOutput(msg, prog);
-}
-
void cmCPackGenerator::DisplayVerboseOutput(const char* msg, float progress)
{
(void)progress;
@@ -391,8 +386,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
std::move(inFileRelative));
}
/* If it is not a symlink then do a plain copy */
- else if (!(cmSystemTools::CopyFileIfDifferent(inFile.c_str(),
- filePath.c_str()) &&
+ else if (!(cmSystemTools::CopyFileIfDifferent(inFile, filePath) &&
cmSystemTools::CopyFileTime(inFile.c_str(),
filePath.c_str()))) {
cmCPackLogger(cmCPackLog::LOG_ERROR,
@@ -497,7 +491,7 @@ int cmCPackGenerator::InstallProjectViaInstallScript(
tempInstallDirectory.c_str());
this->SetOptionIfNotSet("CMAKE_CURRENT_SOURCE_DIR",
tempInstallDirectory.c_str());
- int res = this->MakefileMap->ReadListFile(installScript.c_str());
+ bool res = this->MakefileMap->ReadListFile(installScript);
if (cmSystemTools::GetErrorOccuredFlag() || !res) {
return 0;
}
@@ -690,12 +684,14 @@ int cmCPackGenerator::InstallCMakeProject(
"- Install component: " << component << std::endl);
}
- cmake cm(cmake::RoleScript);
+ cmake cm(cmake::RoleScript, cmState::CPack);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cm.AddCMakePaths();
- cm.SetProgressCallback(cmCPackGeneratorProgress, this);
+ cm.SetProgressCallback([this](const char* msg, float prog) {
+ this->DisplayVerboseOutput(msg, prog);
+ });
cm.SetTrace(this->Trace);
cm.SetTraceExpand(this->TraceExpand);
cmGlobalGenerator gg(&cm);
@@ -850,7 +846,7 @@ int cmCPackGenerator::InstallCMakeProject(
mf.AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION", "1");
}
// do installation
- int res = mf.ReadListFile(installFile.c_str());
+ bool res = mf.ReadListFile(installFile);
// forward definition of CMAKE_ABSOLUTE_DESTINATION_FILES
// to CPack (may be used by generators like CPack RPM or DEB)
// in order to transparently handle ABSOLUTE PATH
@@ -926,7 +922,7 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName)
{
bool retval;
std::string fullPath = this->MakefileMap->GetModulesFile(moduleName);
- retval = this->MakefileMap->ReadListFile(fullPath.c_str());
+ retval = this->MakefileMap->ReadListFile(fullPath);
// include FATAL_ERROR and ERROR in the return status
retval = retval && (!cmSystemTools::GetErrorOccuredFlag());
return retval;
@@ -1035,7 +1031,8 @@ int cmCPackGenerator::DoPackage()
* may update this during PackageFiles.
* (either putting several names or updating the provided one)
*/
- packageFileNames.push_back(tempPackageFileName ? tempPackageFileName : "");
+ packageFileNames.emplace_back(tempPackageFileName ? tempPackageFileName
+ : "");
toplevel = tempDirectory;
{ // scope that enables package generators to run internal scripts with
// latest CMake policies enabled
@@ -1075,8 +1072,7 @@ int cmCPackGenerator::DoPackage()
<< (tempPackageFileName ? tempPackageFileName : "(NULL)")
<< " to " << (packageFileName ? packageFileName : "(NULL)")
<< std::endl);
- if (!cmSystemTools::CopyFileIfDifferent(tempPackageFileName,
- packageFileName)) {
+ if (!cmSystemTools::CopyFileIfDifferent(pkgFileName, tmpPF)) {
cmCPackLogger(
cmCPackLog::LOG_ERROR,
"Problem copying the package: "
diff --git a/Source/CPack/cmCPackNSISGenerator.cxx b/Source/CPack/cmCPackNSISGenerator.cxx
index f75a750fe..37ea66e76 100644
--- a/Source/CPack/cmCPackNSISGenerator.cxx
+++ b/Source/CPack/cmCPackNSISGenerator.cxx
@@ -30,9 +30,7 @@ cmCPackNSISGenerator::cmCPackNSISGenerator(bool nsis64)
Nsis64 = nsis64;
}
-cmCPackNSISGenerator::~cmCPackNSISGenerator()
-{
-}
+cmCPackNSISGenerator::~cmCPackNSISGenerator() = default;
int cmCPackNSISGenerator::PackageFiles()
{
@@ -223,7 +221,8 @@ int cmCPackNSISGenerator::PackageFiles()
if (!group.second.Description.empty()) {
groupDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" +
group.first + "} \"" +
- this->TranslateNewlines(group.second.Description) + "\"\n";
+ cmCPackNSISGenerator::TranslateNewlines(group.second.Description) +
+ "\"\n";
}
}
@@ -253,7 +252,8 @@ int cmCPackNSISGenerator::PackageFiles()
if (!comp.second.Description.empty()) {
componentDescriptions += " !insertmacro MUI_DESCRIPTION_TEXT ${" +
comp.first + "} \"" +
- this->TranslateNewlines(comp.second.Description) + "\"\n";
+ cmCPackNSISGenerator::TranslateNewlines(comp.second.Description) +
+ "\"\n";
}
}
@@ -608,7 +608,7 @@ bool cmCPackNSISGenerator::GetListOfSubdirectories(
}
}
}
- dirs.push_back(topdir);
+ dirs.emplace_back(topdir);
return true;
}
diff --git a/Source/CPack/cmCPackOSXX11Generator.cxx b/Source/CPack/cmCPackOSXX11Generator.cxx
index dab72832c..486633c90 100644
--- a/Source/CPack/cmCPackOSXX11Generator.cxx
+++ b/Source/CPack/cmCPackOSXX11Generator.cxx
@@ -11,13 +11,9 @@
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
-cmCPackOSXX11Generator::cmCPackOSXX11Generator()
-{
-}
+cmCPackOSXX11Generator::cmCPackOSXX11Generator() = default;
-cmCPackOSXX11Generator::~cmCPackOSXX11Generator()
-{
-}
+cmCPackOSXX11Generator::~cmCPackOSXX11Generator() = default;
int cmCPackOSXX11Generator::PackageFiles()
{
@@ -169,7 +165,7 @@ int cmCPackOSXX11Generator::PackageFiles()
numTries--;
}
if (!res || retVal) {
- cmGeneratedFileStream ofs(tmpFile.c_str());
+ cmGeneratedFileStream ofs(tmpFile);
ofs << "# Run command: " << dmgCmd.str() << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index bdda38660..ae227aab1 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -15,9 +15,7 @@ cmCPackPKGGenerator::cmCPackPKGGenerator()
this->componentPackageMethod = ONE_PACKAGE;
}
-cmCPackPKGGenerator::~cmCPackPKGGenerator()
-{
-}
+cmCPackPKGGenerator::~cmCPackPKGGenerator() = default;
bool cmCPackPKGGenerator::SupportsComponentInstallation() const
{
@@ -225,7 +223,8 @@ void cmCPackPKGGenerator::CreateChoice(const cmCPackComponent& component,
xout.Content(this->GetPackageName(component));
} else {
xout.Content("file:./");
- xout.Content(relativePackageLocation);
+ xout.Content(cmSystemTools::EncodeURL(relativePackageLocation,
+ /*escapeSlashes=*/false));
}
xout.EndElement(); // pkg-ref
}
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 5b1a641a0..246178d8f 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -30,9 +30,7 @@ cmCPackPackageMakerGenerator::cmCPackPackageMakerGenerator()
this->PackageCompatibilityVersion = getVersion(10, 4);
}
-cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator()
-{
-}
+cmCPackPackageMakerGenerator::~cmCPackPackageMakerGenerator() = default;
bool cmCPackPackageMakerGenerator::SupportsComponentInstallation() const
{
@@ -307,7 +305,7 @@ int cmCPackPackageMakerGenerator::PackageFiles()
numTries--;
}
if (!res || retVal) {
- cmGeneratedFileStream ofs(tmpFile.c_str());
+ cmGeneratedFileStream ofs(tmpFile);
ofs << "# Run command: " << dmgCmd.str() << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
@@ -340,16 +338,16 @@ int cmCPackPackageMakerGenerator::InitializeInternal()
// If found, save result in the CPACK_INSTALLER_PROGRAM variable.
std::vector<std::string> paths;
- paths.push_back("/Applications/Xcode.app/Contents/Applications"
- "/PackageMaker.app/Contents/MacOS");
- paths.push_back("/Applications/Utilities"
- "/PackageMaker.app/Contents/MacOS");
- paths.push_back("/Applications"
- "/PackageMaker.app/Contents/MacOS");
- paths.push_back("/Developer/Applications/Utilities"
- "/PackageMaker.app/Contents/MacOS");
- paths.push_back("/Developer/Applications"
- "/PackageMaker.app/Contents/MacOS");
+ paths.emplace_back("/Applications/Xcode.app/Contents/Applications"
+ "/PackageMaker.app/Contents/MacOS");
+ paths.emplace_back("/Applications/Utilities"
+ "/PackageMaker.app/Contents/MacOS");
+ paths.emplace_back("/Applications"
+ "/PackageMaker.app/Contents/MacOS");
+ paths.emplace_back("/Developer/Applications/Utilities"
+ "/PackageMaker.app/Contents/MacOS");
+ paths.emplace_back("/Developer/Applications"
+ "/PackageMaker.app/Contents/MacOS");
std::string pkgPath;
const char* inst_program = this->GetOption("CPACK_INSTALLER_PROGRAM");
@@ -475,7 +473,7 @@ bool cmCPackPackageMakerGenerator::RunPackageMaker(const char* command,
cmCPackLogger(cmCPackLog::LOG_VERBOSE,
"Done running package maker" << std::endl);
if (!res || retVal) {
- cmGeneratedFileStream ofs(tmpFile.c_str());
+ cmGeneratedFileStream ofs(tmpFile);
ofs << "# Run command: " << command << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index 76b32753c..a556e0c52 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -17,9 +17,7 @@ cmCPackProductBuildGenerator::cmCPackProductBuildGenerator()
this->componentPackageMethod = ONE_PACKAGE;
}
-cmCPackProductBuildGenerator::~cmCPackProductBuildGenerator()
-{
-}
+cmCPackProductBuildGenerator::~cmCPackProductBuildGenerator() = default;
int cmCPackProductBuildGenerator::PackageFiles()
{
@@ -151,7 +149,7 @@ bool cmCPackProductBuildGenerator::RunProductBuild(const std::string& command)
this->GeneratorVerbose, cmDuration::zero());
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Done running command" << std::endl);
if (!res || retVal) {
- cmGeneratedFileStream ofs(tmpFile.c_str());
+ cmGeneratedFileStream ofs(tmpFile);
ofs << "# Run command: " << command << std::endl
<< "# Output:" << std::endl
<< output << std::endl;
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 5834829c6..33ab62bdf 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -14,13 +14,9 @@
#include "cmCPackLog.h"
#include "cmSystemTools.h"
-cmCPackRPMGenerator::cmCPackRPMGenerator()
-{
-}
+cmCPackRPMGenerator::cmCPackRPMGenerator() = default;
-cmCPackRPMGenerator::~cmCPackRPMGenerator()
-{
-}
+cmCPackRPMGenerator::~cmCPackRPMGenerator() = default;
int cmCPackRPMGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackSTGZGenerator.cxx b/Source/CPack/cmCPackSTGZGenerator.cxx
index ef0d1182c..aba15d239 100644
--- a/Source/CPack/cmCPackSTGZGenerator.cxx
+++ b/Source/CPack/cmCPackSTGZGenerator.cxx
@@ -6,19 +6,16 @@
#include <sstream>
#include <stdio.h>
#include <string>
+#include <vector>
#include "cmCPackGenerator.h"
#include "cmCPackLog.h"
#include "cmSystemTools.h"
#include "cm_sys_stat.h"
-cmCPackSTGZGenerator::cmCPackSTGZGenerator()
-{
-}
+cmCPackSTGZGenerator::cmCPackSTGZGenerator() = default;
-cmCPackSTGZGenerator::~cmCPackSTGZGenerator()
-{
-}
+cmCPackSTGZGenerator::~cmCPackSTGZGenerator() = default;
int cmCPackSTGZGenerator::InitializeInternal()
{
diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx
index eaf8186fe..6f4676ef9 100644
--- a/Source/CPack/cmCPackTGZGenerator.cxx
+++ b/Source/CPack/cmCPackTGZGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackTGZGenerator::cmCPackTGZGenerator()
{
}
-cmCPackTGZGenerator::~cmCPackTGZGenerator()
-{
-}
+cmCPackTGZGenerator::~cmCPackTGZGenerator() = default;
diff --git a/Source/CPack/cmCPackTXZGenerator.cxx b/Source/CPack/cmCPackTXZGenerator.cxx
index e55e903e9..ccbccde95 100644
--- a/Source/CPack/cmCPackTXZGenerator.cxx
+++ b/Source/CPack/cmCPackTXZGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackTXZGenerator::cmCPackTXZGenerator()
{
}
-cmCPackTXZGenerator::~cmCPackTXZGenerator()
-{
-}
+cmCPackTXZGenerator::~cmCPackTXZGenerator() = default;
diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx
index c7a3dd429..85abeb1ca 100644
--- a/Source/CPack/cmCPackTarBZip2Generator.cxx
+++ b/Source/CPack/cmCPackTarBZip2Generator.cxx
@@ -10,6 +10,4 @@ cmCPackTarBZip2Generator::cmCPackTarBZip2Generator()
{
}
-cmCPackTarBZip2Generator::~cmCPackTarBZip2Generator()
-{
-}
+cmCPackTarBZip2Generator::~cmCPackTarBZip2Generator() = default;
diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx
index 0a7cd978c..55a6de53c 100644
--- a/Source/CPack/cmCPackTarCompressGenerator.cxx
+++ b/Source/CPack/cmCPackTarCompressGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackTarCompressGenerator::cmCPackTarCompressGenerator()
{
}
-cmCPackTarCompressGenerator::~cmCPackTarCompressGenerator()
-{
-}
+cmCPackTarCompressGenerator::~cmCPackTarCompressGenerator() = default;
diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx
index 6b77c363d..f06494c44 100644
--- a/Source/CPack/cmCPackZIPGenerator.cxx
+++ b/Source/CPack/cmCPackZIPGenerator.cxx
@@ -10,6 +10,4 @@ cmCPackZIPGenerator::cmCPackZIPGenerator()
{
}
-cmCPackZIPGenerator::~cmCPackZIPGenerator()
-{
-}
+cmCPackZIPGenerator::~cmCPackZIPGenerator() = default;
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 623cdcd75..0413422b2 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -21,8 +21,10 @@
#include "cmCPackLog.h"
#include "cmDocumentation.h"
#include "cmDocumentationEntry.h"
+#include "cmDocumentationFormatter.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -88,12 +90,8 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
return 1;
}
-static void cpackProgressCallback(const char* message, float progress,
- void* clientdata)
+static void cpackProgressCallback(const char* message, float /*unused*/)
{
- (void)progress;
- (void)clientdata;
-
std::cout << "-- " << message << std::endl;
}
@@ -207,10 +205,10 @@ int main(int argc, char const* const* argv)
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack config file: " << cpackConfigFile << std::endl);
- cmake cminst(cmake::RoleScript);
+ cmake cminst(cmake::RoleScript, cmState::CPack);
cminst.SetHomeDirectory("");
cminst.SetHomeOutputDirectory("");
- cminst.SetProgressCallback(cpackProgressCallback, nullptr);
+ cminst.SetProgressCallback(cpackProgressCallback);
cminst.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator cmgg(&cminst);
cmMakefile globalMF(&cmgg, cminst.GetCurrentSnapshot());
@@ -254,7 +252,7 @@ int main(int argc, char const* const* argv)
// paths, so FIND_XXX() commands can be used in scripts
std::string systemFile =
globalMF.GetModulesFile("CMakeDetermineSystem.cmake");
- if (!globalMF.ReadListFile(systemFile.c_str())) {
+ if (!globalMF.ReadListFile(systemFile)) {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Error reading CMakeDetermineSystem.cmake" << std::endl);
return 1;
@@ -262,7 +260,7 @@ int main(int argc, char const* const* argv)
systemFile =
globalMF.GetModulesFile("CMakeSystemSpecificInformation.cmake");
- if (!globalMF.ReadListFile(systemFile.c_str())) {
+ if (!globalMF.ReadListFile(systemFile)) {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Error reading CMakeSystemSpecificInformation.cmake"
<< std::endl);
@@ -278,7 +276,7 @@ int main(int argc, char const* const* argv)
cmCPack_Log(&log, cmCPackLog::LOG_VERBOSE,
"Read CPack configuration file: " << cpackConfigFile
<< std::endl);
- if (!globalMF.ReadListFile(cpackConfigFile.c_str())) {
+ if (!globalMF.ReadListFile(cpackConfigFile)) {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Problem reading CPack config file: \""
<< cpackConfigFile << "\"" << std::endl);
@@ -368,8 +366,21 @@ int main(int argc, char const* const* argv)
cpackGenerator->SetTraceExpand(traceExpand);
} else {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
- "Cannot initialize CPack generator: " << gen
- << std::endl);
+ "Could not create CPack generator: " << gen
+ << std::endl);
+ // Print out all the valid generators
+ cmDocumentation generatorDocs;
+ std::vector<cmDocumentationEntry> v;
+ for (auto const& g : generators.GetGeneratorsList()) {
+ cmDocumentationEntry e;
+ e.Name = g.first;
+ e.Brief = g.second;
+ v.push_back(std::move(e));
+ }
+ generatorDocs.SetSection("Generators", v);
+ std::cerr << "\n";
+ generatorDocs.PrintDocumentation(cmDocumentation::ListGenerators,
+ std::cerr);
parsed = 0;
}
diff --git a/Source/CTest/cmCTestBZR.cxx b/Source/CTest/cmCTestBZR.cxx
index 365f26774..b154caf30 100644
--- a/Source/CTest/cmCTestBZR.cxx
+++ b/Source/CTest/cmCTestBZR.cxx
@@ -77,9 +77,7 @@ cmCTestBZR::cmCTestBZR(cmCTest* ct, std::ostream& log)
cmSystemTools::PutEnv("BZR_PROGRESS_BAR=none");
}
-cmCTestBZR::~cmCTestBZR()
-{
-}
+cmCTestBZR::~cmCTestBZR() = default;
class cmCTestBZR::InfoParser : public cmCTestVC::LineParser
{
diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx
index 668a3871d..2fd4c7ab3 100644
--- a/Source/CTest/cmCTestBuildAndTestHandler.cxx
+++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx
@@ -6,6 +6,7 @@
#include "cmCTestTestHandler.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmState.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
#include "cmake.h"
@@ -108,27 +109,6 @@ int cmCTestBuildAndTestHandler::RunCMake(std::string* outstring,
return 0;
}
-void CMakeMessageCallback(const char* m, const char* /*unused*/,
- bool& /*unused*/, void* s)
-{
- std::string* out = static_cast<std::string*>(s);
- *out += m;
- *out += "\n";
-}
-
-void CMakeProgressCallback(const char* msg, float /*unused*/, void* s)
-{
- std::string* out = static_cast<std::string*>(s);
- *out += msg;
- *out += "\n";
-}
-
-void CMakeOutputCallback(const char* m, size_t len, void* s)
-{
- std::string* out = static_cast<std::string*>(s);
- out->append(m, len);
-}
-
class cmCTestBuildAndTestCaptureRAII
{
cmake& CM;
@@ -137,17 +117,27 @@ public:
cmCTestBuildAndTestCaptureRAII(cmake& cm, std::string& s)
: CM(cm)
{
- cmSystemTools::SetMessageCallback(CMakeMessageCallback, &s);
- cmSystemTools::SetStdoutCallback(CMakeOutputCallback, &s);
- cmSystemTools::SetStderrCallback(CMakeOutputCallback, &s);
- this->CM.SetProgressCallback(CMakeProgressCallback, &s);
+ cmSystemTools::SetMessageCallback(
+ [&s](const char* msg, const char* /*unused*/) {
+ s += msg;
+ s += "\n";
+ });
+
+ cmSystemTools::SetStdoutCallback([&s](std::string const& m) { s += m; });
+ cmSystemTools::SetStderrCallback([&s](std::string const& m) { s += m; });
+
+ this->CM.SetProgressCallback([&s](const char* msg, float /*unused*/) {
+ s += msg;
+ s += "\n";
+ });
}
+
~cmCTestBuildAndTestCaptureRAII()
{
- this->CM.SetProgressCallback(nullptr, nullptr);
- cmSystemTools::SetStderrCallback(nullptr, nullptr);
- cmSystemTools::SetStdoutCallback(nullptr, nullptr);
- cmSystemTools::SetMessageCallback(nullptr, nullptr);
+ this->CM.SetProgressCallback(nullptr);
+ cmSystemTools::SetStderrCallback(nullptr);
+ cmSystemTools::SetStdoutCallback(nullptr);
+ cmSystemTools::SetMessageCallback(nullptr);
}
};
@@ -163,7 +153,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
return 1;
}
- cmake cm(cmake::RoleProject);
+ cmake cm(cmake::RoleProject, cmState::Project);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
std::string cmakeOutString;
@@ -231,7 +221,7 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring)
// do the build
if (this->BuildTargets.empty()) {
- this->BuildTargets.push_back("");
+ this->BuildTargets.emplace_back();
}
for (std::string const& tar : this->BuildTargets) {
cmDuration remainingTime = std::chrono::seconds(0);
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index ce27da18a..32f7496a9 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -7,6 +7,7 @@
#include "cmCTestGenericHandler.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -53,10 +54,6 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
} else {
const char* cmakeGeneratorName =
this->Makefile->GetDefinition("CTEST_CMAKE_GENERATOR");
- const char* cmakeProjectName =
- (this->Values[ctb_PROJECT_NAME] && *this->Values[ctb_PROJECT_NAME])
- ? this->Values[ctb_PROJECT_NAME]
- : this->Makefile->GetDefinition("CTEST_PROJECT_NAME");
// Build configuration is determined by: CONFIGURATION argument,
// or CTEST_BUILD_CONFIGURATION script variable, or
@@ -81,8 +78,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
? this->Values[ctb_TARGET]
: this->Makefile->GetDefinition("CTEST_BUILD_TARGET");
- if (cmakeGeneratorName && *cmakeGeneratorName && cmakeProjectName &&
- *cmakeProjectName) {
+ if (cmakeGeneratorName && *cmakeGeneratorName) {
if (!cmakeBuildConfiguration) {
cmakeBuildConfiguration = "Release";
}
@@ -100,7 +96,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
std::string e = "could not create generator named \"";
e += cmakeGeneratorName;
e += "\"";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e);
cmSystemTools::SetFatalErrorOccured();
return nullptr;
}
@@ -132,14 +128,7 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
/* clang-format off */
ostr << "has no project to build. If this is a "
"\"built with CMake\" project, verify that CTEST_CMAKE_GENERATOR "
- "and CTEST_PROJECT_NAME are set."
- "\n"
- "CTEST_PROJECT_NAME is usually set in CTestConfig.cmake. Verify "
- "that CTestConfig.cmake exists, or CTEST_PROJECT_NAME "
- "is set in the script, or PROJECT_NAME is passed as an argument "
- "to ctest_build."
- "\n"
- "Alternatively, set CTEST_BUILD_COMMAND to build the project "
+ "is set. Otherwise, set CTEST_BUILD_COMMAND to build the project "
"with a custom command line.";
/* clang-format on */
this->SetError(ostr.str());
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index a8309d94a..d934c003c 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -341,30 +341,34 @@ int cmCTestBuildHandler::ProcessHandler()
// warnings and warning exceptions.
std::vector<std::string>::size_type cc;
for (cc = 0; cmCTestErrorMatches[cc]; cc++) {
- this->CustomErrorMatches.push_back(cmCTestErrorMatches[cc]);
+ this->CustomErrorMatches.emplace_back(cmCTestErrorMatches[cc]);
}
for (cc = 0; cmCTestErrorExceptions[cc]; cc++) {
- this->CustomErrorExceptions.push_back(cmCTestErrorExceptions[cc]);
+ this->CustomErrorExceptions.emplace_back(cmCTestErrorExceptions[cc]);
}
for (cc = 0; cmCTestWarningMatches[cc]; cc++) {
- this->CustomWarningMatches.push_back(cmCTestWarningMatches[cc]);
+ this->CustomWarningMatches.emplace_back(cmCTestWarningMatches[cc]);
}
for (cc = 0; cmCTestWarningExceptions[cc]; cc++) {
- this->CustomWarningExceptions.push_back(cmCTestWarningExceptions[cc]);
+ this->CustomWarningExceptions.emplace_back(cmCTestWarningExceptions[cc]);
}
// Pre-compile regular expressions objects for all regular expressions
#define cmCTestBuildHandlerPopulateRegexVector(strings, regexes) \
- regexes.clear(); \
- cmCTestOptionalLog(this->CTest, DEBUG, \
- this << "Add " #regexes << std::endl, this->Quiet); \
- for (std::string const& s : (strings)) { \
+ do { \
+ regexes.clear(); \
cmCTestOptionalLog(this->CTest, DEBUG, \
- "Add " #strings ": " << s << std::endl, this->Quiet); \
- (regexes).push_back(s.c_str()); \
- }
+ this << "Add " #regexes << std::endl, this->Quiet); \
+ for (std::string const& s : (strings)) { \
+ cmCTestOptionalLog(this->CTest, DEBUG, \
+ "Add " #strings ": " << s << std::endl, \
+ this->Quiet); \
+ (regexes).emplace_back(s); \
+ } \
+ } while (false)
+
cmCTestBuildHandlerPopulateRegexVector(this->CustomErrorMatches,
this->ErrorMatchRegex);
cmCTestBuildHandlerPopulateRegexVector(this->CustomErrorExceptions,
@@ -503,24 +507,20 @@ public:
: FTC(ftc)
{
}
- FragmentCompare()
- : FTC(nullptr)
- {
- }
+ FragmentCompare() = default;
bool operator()(std::string const& l, std::string const& r) const
{
// Order files by modification time. Use lexicographic order
// among files with the same time.
int result;
- if (this->FTC->FileTimeCompare(l.c_str(), r.c_str(), &result) &&
- result != 0) {
+ if (this->FTC->FileTimeCompare(l, r, &result) && result != 0) {
return result < 0;
}
return l < r;
}
private:
- cmFileTimeComparison* FTC;
+ cmFileTimeComparison* FTC = nullptr;
};
void cmCTestBuildHandler::GenerateXMLLaunched(cmXMLWriter& xml)
@@ -1033,7 +1033,7 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, size_t length,
}
} else {
// Otherwise store pre-context for the next error
- this->PreContext.push_back(line);
+ this->PreContext.emplace_back(line);
if (this->PreContext.size() > this->MaxPreContext) {
this->PreContext.erase(this->PreContext.begin(),
this->PreContext.end() -
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index 4fb3273bb..6e8f73f83 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -16,9 +16,7 @@ cmCTestCVS::cmCTestCVS(cmCTest* ct, std::ostream& log)
{
}
-cmCTestCVS::~cmCTestCVS()
-{
-}
+cmCTestCVS::~cmCTestCVS() = default;
class cmCTestCVS::UpdateParser : public cmCTestVC::LineParser
{
@@ -111,8 +109,8 @@ public:
, Revisions(revs)
, Section(SectionHeader)
{
- this->SetLog(&cvs->Log, prefix),
- this->RegexRevision.compile("^revision +([^ ]*) *$");
+ this->SetLog(&cvs->Log, prefix);
+ this->RegexRevision.compile("^revision +([^ ]*) *$");
this->RegexBranches.compile("^branches: .*$");
this->RegexPerson.compile("^date: +([^;]+); +author: +([^;]+);");
}
diff --git a/Source/CTest/cmCTestConfigureHandler.cxx b/Source/CTest/cmCTestConfigureHandler.cxx
index 5967b7458..6b7601b6e 100644
--- a/Source/CTest/cmCTestConfigureHandler.cxx
+++ b/Source/CTest/cmCTestConfigureHandler.cxx
@@ -11,9 +11,7 @@
#include <ostream>
#include <string>
-cmCTestConfigureHandler::cmCTestConfigureHandler()
-{
-}
+cmCTestConfigureHandler::cmCTestConfigureHandler() = default;
void cmCTestConfigureHandler::Initialize()
{
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 1d9a5f7e0..225383ce0 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -15,7 +15,6 @@
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
#include "cmXMLWriter.h"
-#include "cmake.h"
#include "cmsys/FStream.hxx"
#include "cmsys/Glob.hxx"
@@ -56,13 +55,12 @@ public:
void SetCommand(const char* command)
{
this->CommandLineStrings.clear();
- this->CommandLineStrings.push_back(command);
- ;
+ this->CommandLineStrings.emplace_back(command);
}
void AddArgument(const char* arg)
{
if (arg) {
- this->CommandLineStrings.push_back(arg);
+ this->CommandLineStrings.emplace_back(arg);
}
}
void SetWorkingDirectory(const char* dir) { this->WorkingDirectory = dir; }
@@ -113,9 +111,7 @@ private:
cmDuration TimeOut;
};
-cmCTestCoverageHandler::cmCTestCoverageHandler()
-{
-}
+cmCTestCoverageHandler::cmCTestCoverageHandler() = default;
void cmCTestCoverageHandler::Initialize()
{
@@ -317,8 +313,7 @@ int cmCTestCoverageHandler::ProcessHandler()
// setup the regex exclude stuff
this->CustomCoverageExcludeRegex.clear();
for (std::string const& rex : this->CustomCoverageExclude) {
- this->CustomCoverageExcludeRegex.push_back(
- cmsys::RegularExpression(rex.c_str()));
+ this->CustomCoverageExcludeRegex.emplace_back(rex);
}
if (this->HandleBullseyeCoverage(&cont)) {
@@ -1006,7 +1001,7 @@ int cmCTestCoverageHandler::HandleGCovCoverage(
std::vector<std::string> basecovargs =
cmSystemTools::ParseArguments(gcovExtraFlags.c_str());
basecovargs.insert(basecovargs.begin(), gcovCommand);
- basecovargs.push_back("-o");
+ basecovargs.emplace_back("-o");
// files is a list of *.da and *.gcda files with coverage data in them.
// These are binary files that you give as input to gcov so that it will
@@ -2228,7 +2223,7 @@ int cmCTestCoverageHandler::GetLabelId(std::string const& label)
void cmCTestCoverageHandler::LoadLabels()
{
std::string fileList = this->CTest->GetBinaryDir();
- fileList += cmake::GetCMakeFilesDirectory();
+ fileList += "/CMakeFiles";
fileList += "/TargetDirectories.txt";
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
" target directory list [" << fileList << "]\n",
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 71fcafb58..210abe55b 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -31,9 +31,7 @@ cmCTestGIT::cmCTestGIT(cmCTest* ct, std::ostream& log)
this->CurrentGitVersion = 0;
}
-cmCTestGIT::~cmCTestGIT()
-{
-}
+cmCTestGIT::~cmCTestGIT() = default;
class cmCTestGIT::OneLineParser : public cmCTestVC::LineParser
{
@@ -475,15 +473,8 @@ private:
{
std::string Name;
std::string EMail;
- unsigned long Time;
- long TimeZone;
- Person()
- : Name()
- , EMail()
- , Time(0)
- , TimeZone(0)
- {
- }
+ unsigned long Time = 0;
+ long TimeZone = 0;
};
void ParsePerson(const char* str, Person& person)
@@ -618,8 +609,8 @@ bool cmCTestGIT::LoadRevisions()
git, "diff-tree", "--stdin", "--always", "-z",
"-r", "--pretty=raw", "--encoding=utf-8", nullptr
};
- this->Log << this->ComputeCommandLine(git_rev_list) << " | "
- << this->ComputeCommandLine(git_diff_tree) << "\n";
+ this->Log << cmCTestGIT::ComputeCommandLine(git_rev_list) << " | "
+ << cmCTestGIT::ComputeCommandLine(git_diff_tree) << "\n";
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_AddCommand(cp, git_rev_list);
@@ -628,7 +619,7 @@ bool cmCTestGIT::LoadRevisions()
CommitParser out(this, "dt-out> ");
OutputLogger err(this->Log, "dt-err> ");
- this->RunProcess(cp, &out, &err, cmProcessOutput::UTF8);
+ cmCTestGIT::RunProcess(cp, &out, &err, cmProcessOutput::UTF8);
// Send one extra zero-byte to terminate the last record.
out.Process("", 1);
diff --git a/Source/CTest/cmCTestGenericHandler.cxx b/Source/CTest/cmCTestGenericHandler.cxx
index dc1bba051..d3020b513 100644
--- a/Source/CTest/cmCTestGenericHandler.cxx
+++ b/Source/CTest/cmCTestGenericHandler.cxx
@@ -18,9 +18,7 @@ cmCTestGenericHandler::cmCTestGenericHandler()
this->TestLoad = 0;
}
-cmCTestGenericHandler::~cmCTestGenericHandler()
-{
-}
+cmCTestGenericHandler::~cmCTestGenericHandler() = default;
void cmCTestGenericHandler::SetOption(const std::string& op, const char* value)
{
diff --git a/Source/CTest/cmCTestGlobalVC.cxx b/Source/CTest/cmCTestGlobalVC.cxx
index d2714d90b..a2d4d2c75 100644
--- a/Source/CTest/cmCTestGlobalVC.cxx
+++ b/Source/CTest/cmCTestGlobalVC.cxx
@@ -15,9 +15,7 @@ cmCTestGlobalVC::cmCTestGlobalVC(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestGlobalVC::~cmCTestGlobalVC()
-{
-}
+cmCTestGlobalVC::~cmCTestGlobalVC() = default;
const char* cmCTestGlobalVC::LocalPath(std::string const& path)
{
diff --git a/Source/CTest/cmCTestHG.cxx b/Source/CTest/cmCTestHG.cxx
index c3c5da460..6fb99d864 100644
--- a/Source/CTest/cmCTestHG.cxx
+++ b/Source/CTest/cmCTestHG.cxx
@@ -18,9 +18,7 @@ cmCTestHG::cmCTestHG(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestHG::~cmCTestHG()
-{
-}
+cmCTestHG::~cmCTestHG() = default;
class cmCTestHG::IdentifyParser : public cmCTestVC::LineParser
{
@@ -194,7 +192,8 @@ private:
this->CData.clear();
if (name == "logentry") {
this->Rev = Revision();
- if (const char* rev = this->FindAttribute(atts, "revision")) {
+ if (const char* rev =
+ cmCTestHG::LogParser::FindAttribute(atts, "revision")) {
this->Rev.Rev = rev;
}
this->Changes.clear();
diff --git a/Source/CTest/cmCTestHandlerCommand.cxx b/Source/CTest/cmCTestHandlerCommand.cxx
index 667a8bad3..57a14efd1 100644
--- a/Source/CTest/cmCTestHandlerCommand.cxx
+++ b/Source/CTest/cmCTestHandlerCommand.cxx
@@ -5,9 +5,9 @@
#include "cmCTest.h"
#include "cmCTestGenericHandler.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
-#include "cmake.h"
#include <cstring>
#include <sstream>
@@ -206,18 +206,7 @@ bool cmCTestHandlerCommand::InitialPass(std::vector<std::string> const& args,
handler->PopulateCustomVectors(this->Makefile);
if (this->Values[ct_SUBMIT_INDEX]) {
- if (!this->CTest->GetDropSiteCDash() &&
- this->CTest->GetDartVersion() <= 1) {
- cmCTestLog(
- this->CTest, ERROR_MESSAGE,
- "Dart before version 2.0 does not support collecting submissions."
- << std::endl
- << "Please upgrade the server to Dart 2 or higher, or do not use "
- "SUBMIT_INDEX."
- << std::endl);
- } else {
- handler->SetSubmitIndex(atoi(this->Values[ct_SUBMIT_INDEX]));
- }
+ handler->SetSubmitIndex(atoi(this->Values[ct_SUBMIT_INDEX]));
}
cmWorkingDirectory workdir(
this->CTest->GetCTestConfiguration("BuildDirectory"));
@@ -300,7 +289,7 @@ bool cmCTestHandlerCommand::CheckArgumentValue(std::string const& arg)
if (this->Values[k]) {
std::ostringstream e;
e << "Called with more than one value for " << this->Arguments[k];
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
return true;
}
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 6cd1c09c6..5e66e056a 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -15,6 +15,7 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmProcessOutput.h"
+#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmSystemTools.h"
#include "cmXMLWriter.h"
@@ -145,7 +146,7 @@ void cmCTestLaunch::HandleRealArg(const char* arg)
return;
}
#endif
- this->RealArgs.push_back(arg);
+ this->RealArgs.emplace_back(arg);
}
void cmCTestLaunch::ComputeFileNames()
@@ -282,7 +283,7 @@ void cmCTestLaunch::LoadLabels()
// Labels are listed in per-target files.
std::string fname = this->OptionBuildDir;
- fname += cmake::GetCMakeFilesDirectory();
+ fname += "/CMakeFiles";
fname += "/";
fname += this->OptionTargetName;
fname += ".dir/Labels.txt";
@@ -533,9 +534,9 @@ void cmCTestLaunch::LoadScrapeRules()
// Common compiler warning formats. These are much simpler than the
// full log-scraping expressions because we do not need to extract
// file and line information.
- this->RegexWarning.push_back("(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]");
- this->RegexWarning.push_back("(^|[ :])[Rr][Ee][Mm][Aa][Rr][Kk]");
- this->RegexWarning.push_back("(^|[ :])[Nn][Oo][Tt][Ee]");
+ this->RegexWarning.emplace_back("(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]");
+ this->RegexWarning.emplace_back("(^|[ :])[Rr][Ee][Mm][Aa][Rr][Kk]");
+ this->RegexWarning.emplace_back("(^|[ :])[Nn][Oo][Tt][Ee]");
// Load custom match rules given to us by CTest.
this->LoadScrapeRules("Warning", this->RegexWarning);
@@ -610,7 +611,7 @@ int cmCTestLaunch::Main(int argc, const char* const argv[])
void cmCTestLaunch::LoadConfig()
{
- cmake cm(cmake::RoleScript);
+ cmake cm(cmake::RoleScript, cmState::CTest);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
@@ -618,7 +619,7 @@ void cmCTestLaunch::LoadConfig()
cmMakefile mf(&gg, cm.GetCurrentSnapshot());
std::string fname = this->LogDir;
fname += "CTestLaunchConfig.cmake";
- if (cmSystemTools::FileExists(fname) && mf.ReadListFile(fname.c_str())) {
+ if (cmSystemTools::FileExists(fname) && mf.ReadListFile(fname)) {
this->SourceDir = mf.GetSafeDefinition("CTEST_SOURCE_DIRECTORY");
cmSystemTools::ConvertToUnixSlashes(this->SourceDir);
}
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index 9c9532a08..8ba59d3f9 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -261,8 +261,8 @@ void cmCTestMemCheckHandler::InitializeResultsVectors()
};
this->GlobalResults.clear();
for (int i = 0; cmCTestMemCheckResultStrings[i] != nullptr; ++i) {
- this->ResultStrings.push_back(cmCTestMemCheckResultStrings[i]);
- this->ResultStringsLong.push_back(cmCTestMemCheckResultLongStrings[i]);
+ this->ResultStrings.emplace_back(cmCTestMemCheckResultStrings[i]);
+ this->ResultStringsLong.emplace_back(cmCTestMemCheckResultLongStrings[i]);
this->GlobalResults.push_back(0);
}
}
@@ -528,11 +528,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
switch (this->MemoryTesterStyle) {
case cmCTestMemCheckHandler::VALGRIND: {
if (this->MemoryTesterOptions.empty()) {
- this->MemoryTesterOptions.push_back("-q");
- this->MemoryTesterOptions.push_back("--tool=memcheck");
- this->MemoryTesterOptions.push_back("--leak-check=yes");
- this->MemoryTesterOptions.push_back("--show-reachable=yes");
- this->MemoryTesterOptions.push_back("--num-callers=50");
+ this->MemoryTesterOptions.emplace_back("-q");
+ this->MemoryTesterOptions.emplace_back("--tool=memcheck");
+ this->MemoryTesterOptions.emplace_back("--leak-check=yes");
+ this->MemoryTesterOptions.emplace_back("--show-reachable=yes");
+ this->MemoryTesterOptions.emplace_back("--num-callers=50");
}
if (!this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile")
.empty()) {
@@ -586,11 +586,11 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
std::string dpbdFile = this->CTest->GetBinaryDir() +
"/Testing/Temporary/MemoryChecker.??.DPbd";
this->BoundsCheckerDPBDFile = dpbdFile;
- this->MemoryTesterDynamicOptions.push_back("/B");
+ this->MemoryTesterDynamicOptions.emplace_back("/B");
this->MemoryTesterDynamicOptions.push_back(std::move(dpbdFile));
- this->MemoryTesterDynamicOptions.push_back("/X");
+ this->MemoryTesterDynamicOptions.emplace_back("/X");
this->MemoryTesterDynamicOptions.push_back(this->MemoryTesterOutputFile);
- this->MemoryTesterOptions.push_back("/M");
+ this->MemoryTesterOptions.emplace_back("/M");
break;
}
// these are almost the same but the env var used is different
@@ -604,8 +604,8 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
// The MemoryTesterDynamicOptions is setup with the -E env
// Then the MemoryTesterEnvironmentVariable gets the
// TSAN_OPTIONS string with the log_path in it.
- this->MemoryTesterDynamicOptions.push_back("-E");
- this->MemoryTesterDynamicOptions.push_back("env");
+ this->MemoryTesterDynamicOptions.emplace_back("-E");
+ this->MemoryTesterDynamicOptions.emplace_back("env");
std::string envVar;
std::string extraOptions;
std::string suppressionsOption;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index f0260018e..756ac6cf6 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -6,9 +6,13 @@
#include "cmCTest.h"
#include "cmCTestRunTest.h"
#include "cmCTestTestHandler.h"
+#include "cmDuration.h"
+#include "cmListFileCache.h"
#include "cmSystemTools.h"
#include "cmWorkingDirectory.h"
+#include "cm_jsoncpp_value.h"
+#include "cm_jsoncpp_writer.h"
#include "cm_uv.h"
#include "cmUVSignalHackRAII.h" // IWYU pragma: keep
@@ -20,13 +24,19 @@
#include <chrono>
#include <cstring>
#include <iomanip>
+#include <iostream>
#include <list>
#include <math.h>
#include <sstream>
#include <stack>
#include <stdlib.h>
+#include <unordered_map>
#include <utility>
+namespace cmsys {
+class RegularExpression;
+}
+
class TestComparator
{
public:
@@ -34,7 +44,6 @@ public:
: Handler(handler)
{
}
- ~TestComparator() {}
// Sorts tests in descending order of cost
bool operator()(int index1, int index2) const
@@ -60,9 +69,7 @@ cmCTestMultiProcessHandler::cmCTestMultiProcessHandler()
this->SerialTestRunning = false;
}
-cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler()
-{
-}
+cmCTestMultiProcessHandler::~cmCTestMultiProcessHandler() = default;
// Set the tests
void cmCTestMultiProcessHandler::SetTests(TestMap& tests,
@@ -528,7 +535,7 @@ void cmCTestMultiProcessHandler::UpdateCostData()
fout << f << "\n";
}
fout.close();
- cmSystemTools::RenameFile(tmpout.c_str(), fname.c_str());
+ cmSystemTools::RenameFile(tmpout, fname);
}
void cmCTestMultiProcessHandler::ReadCostData()
@@ -725,9 +732,335 @@ void cmCTestMultiProcessHandler::MarkFinished()
cmSystemTools::RemoveFile(fname);
}
+static Json::Value DumpToJsonArray(const std::set<std::string>& values)
+{
+ Json::Value jsonArray = Json::arrayValue;
+ for (auto& it : values) {
+ jsonArray.append(it);
+ }
+ return jsonArray;
+}
+
+static Json::Value DumpToJsonArray(const std::vector<std::string>& values)
+{
+ Json::Value jsonArray = Json::arrayValue;
+ for (auto& it : values) {
+ jsonArray.append(it);
+ }
+ return jsonArray;
+}
+
+static Json::Value DumpRegExToJsonArray(
+ const std::vector<std::pair<cmsys::RegularExpression, std::string>>& values)
+{
+ Json::Value jsonArray = Json::arrayValue;
+ for (auto& it : values) {
+ jsonArray.append(it.second);
+ }
+ return jsonArray;
+}
+
+static Json::Value DumpMeasurementToJsonArray(
+ const std::map<std::string, std::string>& values)
+{
+ Json::Value jsonArray = Json::arrayValue;
+ for (auto& it : values) {
+ Json::Value measurement = Json::objectValue;
+ measurement["measurement"] = it.first;
+ measurement["value"] = it.second;
+ jsonArray.append(measurement);
+ }
+ return jsonArray;
+}
+
+static Json::Value DumpTimeoutAfterMatch(
+ cmCTestTestHandler::cmCTestTestProperties& testProperties)
+{
+ Json::Value timeoutAfterMatch = Json::objectValue;
+ timeoutAfterMatch["timeout"] = testProperties.AlternateTimeout.count();
+ timeoutAfterMatch["regex"] =
+ DumpRegExToJsonArray(testProperties.TimeoutRegularExpressions);
+ return timeoutAfterMatch;
+}
+
+static Json::Value DumpCTestProperty(std::string const& name,
+ Json::Value value)
+{
+ Json::Value property = Json::objectValue;
+ property["name"] = name;
+ property["value"] = std::move(value);
+ return property;
+}
+
+static Json::Value DumpCTestProperties(
+ cmCTestTestHandler::cmCTestTestProperties& testProperties)
+{
+ Json::Value properties = Json::arrayValue;
+ if (!testProperties.AttachOnFail.empty()) {
+ properties.append(DumpCTestProperty(
+ "ATTACHED_FILES_ON_FAIL", DumpToJsonArray(testProperties.AttachOnFail)));
+ }
+ if (!testProperties.AttachedFiles.empty()) {
+ properties.append(DumpCTestProperty(
+ "ATTACHED_FILES", DumpToJsonArray(testProperties.AttachedFiles)));
+ }
+ if (testProperties.Cost != 0.0f) {
+ properties.append(
+ DumpCTestProperty("COST", static_cast<double>(testProperties.Cost)));
+ }
+ if (!testProperties.Depends.empty()) {
+ properties.append(
+ DumpCTestProperty("DEPENDS", DumpToJsonArray(testProperties.Depends)));
+ }
+ if (testProperties.Disabled) {
+ properties.append(DumpCTestProperty("DISABLED", testProperties.Disabled));
+ }
+ if (!testProperties.Environment.empty()) {
+ properties.append(DumpCTestProperty(
+ "ENVIRONMENT", DumpToJsonArray(testProperties.Environment)));
+ }
+ if (!testProperties.ErrorRegularExpressions.empty()) {
+ properties.append(DumpCTestProperty(
+ "FAIL_REGULAR_EXPRESSION",
+ DumpRegExToJsonArray(testProperties.ErrorRegularExpressions)));
+ }
+ if (!testProperties.FixturesCleanup.empty()) {
+ properties.append(DumpCTestProperty(
+ "FIXTURES_CLEANUP", DumpToJsonArray(testProperties.FixturesCleanup)));
+ }
+ if (!testProperties.FixturesRequired.empty()) {
+ properties.append(DumpCTestProperty(
+ "FIXTURES_REQUIRED", DumpToJsonArray(testProperties.FixturesRequired)));
+ }
+ if (!testProperties.FixturesSetup.empty()) {
+ properties.append(DumpCTestProperty(
+ "FIXTURES_SETUP", DumpToJsonArray(testProperties.FixturesSetup)));
+ }
+ if (!testProperties.Labels.empty()) {
+ properties.append(
+ DumpCTestProperty("LABELS", DumpToJsonArray(testProperties.Labels)));
+ }
+ if (!testProperties.Measurements.empty()) {
+ properties.append(DumpCTestProperty(
+ "MEASUREMENT", DumpMeasurementToJsonArray(testProperties.Measurements)));
+ }
+ if (!testProperties.RequiredRegularExpressions.empty()) {
+ properties.append(DumpCTestProperty(
+ "PASS_REGULAR_EXPRESSION",
+ DumpRegExToJsonArray(testProperties.RequiredRegularExpressions)));
+ }
+ if (testProperties.WantAffinity) {
+ properties.append(
+ DumpCTestProperty("PROCESSOR_AFFINITY", testProperties.WantAffinity));
+ }
+ if (testProperties.Processors != 1) {
+ properties.append(
+ DumpCTestProperty("PROCESSORS", testProperties.Processors));
+ }
+ if (!testProperties.RequiredFiles.empty()) {
+ properties["REQUIRED_FILES"] =
+ DumpToJsonArray(testProperties.RequiredFiles);
+ }
+ if (!testProperties.LockedResources.empty()) {
+ properties.append(DumpCTestProperty(
+ "RESOURCE_LOCK", DumpToJsonArray(testProperties.LockedResources)));
+ }
+ if (testProperties.RunSerial) {
+ properties.append(
+ DumpCTestProperty("RUN_SERIAL", testProperties.RunSerial));
+ }
+ if (testProperties.SkipReturnCode != -1) {
+ properties.append(
+ DumpCTestProperty("SKIP_RETURN_CODE", testProperties.SkipReturnCode));
+ }
+ if (testProperties.ExplicitTimeout) {
+ properties.append(
+ DumpCTestProperty("TIMEOUT", testProperties.Timeout.count()));
+ }
+ if (!testProperties.TimeoutRegularExpressions.empty()) {
+ properties.append(DumpCTestProperty(
+ "TIMEOUT_AFTER_MATCH", DumpTimeoutAfterMatch(testProperties)));
+ }
+ if (testProperties.WillFail) {
+ properties.append(DumpCTestProperty("WILL_FAIL", testProperties.WillFail));
+ }
+ if (!testProperties.Directory.empty()) {
+ properties.append(
+ DumpCTestProperty("WORKING_DIRECTORY", testProperties.Directory));
+ }
+ return properties;
+}
+
+class BacktraceData
+{
+ std::unordered_map<std::string, Json::ArrayIndex> CommandMap;
+ std::unordered_map<std::string, Json::ArrayIndex> FileMap;
+ std::unordered_map<cmListFileContext const*, Json::ArrayIndex> NodeMap;
+ Json::Value Commands = Json::arrayValue;
+ Json::Value Files = Json::arrayValue;
+ Json::Value Nodes = Json::arrayValue;
+
+ Json::ArrayIndex AddCommand(std::string const& command)
+ {
+ auto i = this->CommandMap.find(command);
+ if (i == this->CommandMap.end()) {
+ i = this->CommandMap.emplace(command, this->Commands.size()).first;
+ this->Commands.append(command);
+ }
+ return i->second;
+ }
+
+ Json::ArrayIndex AddFile(std::string const& file)
+ {
+ auto i = this->FileMap.find(file);
+ if (i == this->FileMap.end()) {
+ i = this->FileMap.emplace(file, this->Files.size()).first;
+ this->Files.append(file);
+ }
+ return i->second;
+ }
+
+public:
+ bool Add(cmListFileBacktrace const& bt, Json::ArrayIndex& index);
+ Json::Value Dump();
+};
+
+bool BacktraceData::Add(cmListFileBacktrace const& bt, Json::ArrayIndex& index)
+{
+ if (bt.Empty()) {
+ return false;
+ }
+ cmListFileContext const* top = &bt.Top();
+ auto found = this->NodeMap.find(top);
+ if (found != this->NodeMap.end()) {
+ index = found->second;
+ return true;
+ }
+ Json::Value entry = Json::objectValue;
+ entry["file"] = this->AddFile(top->FilePath);
+ if (top->Line) {
+ entry["line"] = static_cast<int>(top->Line);
+ }
+ if (!top->Name.empty()) {
+ entry["command"] = this->AddCommand(top->Name);
+ }
+ Json::ArrayIndex parent;
+ if (this->Add(bt.Pop(), parent)) {
+ entry["parent"] = parent;
+ }
+ index = this->NodeMap[top] = this->Nodes.size();
+ this->Nodes.append(std::move(entry)); // NOLINT(*)
+ return true;
+}
+
+Json::Value BacktraceData::Dump()
+{
+ Json::Value backtraceGraph;
+ this->CommandMap.clear();
+ this->FileMap.clear();
+ this->NodeMap.clear();
+ backtraceGraph["commands"] = std::move(this->Commands);
+ backtraceGraph["files"] = std::move(this->Files);
+ backtraceGraph["nodes"] = std::move(this->Nodes);
+ return backtraceGraph;
+}
+
+static void AddBacktrace(BacktraceData& backtraceGraph, Json::Value& object,
+ cmListFileBacktrace const& bt)
+{
+ Json::ArrayIndex backtrace;
+ if (backtraceGraph.Add(bt, backtrace)) {
+ object["backtrace"] = backtrace;
+ }
+}
+
+static Json::Value DumpCTestInfo(
+ cmCTestRunTest& testRun,
+ cmCTestTestHandler::cmCTestTestProperties& testProperties,
+ BacktraceData& backtraceGraph)
+{
+ Json::Value testInfo = Json::objectValue;
+ // test name should always be present
+ testInfo["name"] = testProperties.Name;
+ std::string const& config = testRun.GetCTest()->GetConfigType();
+ if (!config.empty()) {
+ testInfo["config"] = config;
+ }
+ std::string const& command = testRun.GetActualCommand();
+ if (!command.empty()) {
+ std::vector<std::string> commandAndArgs;
+ commandAndArgs.push_back(command);
+ const std::vector<std::string>& args = testRun.GetArguments();
+ if (!args.empty()) {
+ commandAndArgs.reserve(args.size() + 1);
+ commandAndArgs.insert(commandAndArgs.end(), args.begin(), args.end());
+ }
+ testInfo["command"] = DumpToJsonArray(commandAndArgs);
+ }
+ Json::Value properties = DumpCTestProperties(testProperties);
+ if (!properties.empty()) {
+ testInfo["properties"] = properties;
+ }
+ if (!testProperties.Backtrace.Empty()) {
+ AddBacktrace(backtraceGraph, testInfo, testProperties.Backtrace);
+ }
+ return testInfo;
+}
+
+static Json::Value DumpVersion(int major, int minor)
+{
+ Json::Value version = Json::objectValue;
+ version["major"] = major;
+ version["minor"] = minor;
+ return version;
+}
+
+void cmCTestMultiProcessHandler::PrintOutputAsJson()
+{
+ this->TestHandler->SetMaxIndex(this->FindMaxIndex());
+
+ Json::Value result = Json::objectValue;
+ result["kind"] = "ctestInfo";
+ result["version"] = DumpVersion(1, 0);
+
+ BacktraceData backtraceGraph;
+ Json::Value tests = Json::arrayValue;
+ for (auto& it : this->Properties) {
+ cmCTestTestHandler::cmCTestTestProperties& p = *it.second;
+
+ // Don't worry if this fails, we are only showing the test list, not
+ // running the tests
+ cmWorkingDirectory workdir(p.Directory);
+ cmCTestRunTest testRun(*this);
+ testRun.SetIndex(p.Index);
+ testRun.SetTestProperties(&p);
+ testRun.ComputeArguments();
+
+ // Skip tests not available in this configuration.
+ if (p.Args.size() >= 2 && p.Args[1] == "NOT_AVAILABLE") {
+ continue;
+ }
+
+ Json::Value testInfo = DumpCTestInfo(testRun, p, backtraceGraph);
+ tests.append(testInfo);
+ }
+ result["backtraceGraph"] = backtraceGraph.Dump();
+ result["tests"] = std::move(tests);
+
+ Json::StreamWriterBuilder builder;
+ builder["indentation"] = " ";
+ std::unique_ptr<Json::StreamWriter> jout(builder.newStreamWriter());
+ jout->write(result, &std::cout);
+}
+
// For ShowOnly mode
void cmCTestMultiProcessHandler::PrintTestList()
{
+ if (this->CTest->GetOutputAsJson()) {
+ PrintOutputAsJson();
+ return;
+ }
+
this->TestHandler->SetMaxIndex(this->FindMaxIndex());
int count = 0;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index 3927a8ab2..93bb880fe 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -51,6 +51,7 @@ public:
void SetParallelLevel(size_t);
void SetTestLoad(unsigned long load);
virtual void RunTests();
+ void PrintOutputAsJson();
void PrintTestList();
void PrintLabels();
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 511dbd2ec..435be97b6 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -19,9 +19,7 @@ cmCTestP4::cmCTestP4(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestP4::~cmCTestP4()
-{
-}
+cmCTestP4::~cmCTestP4() = default;
class cmCTestP4::IdentifyParser : public cmCTestVC::LineParser
{
@@ -307,20 +305,20 @@ void cmCTestP4::SetP4Options(std::vector<char const*>& CommandOptions)
{
if (P4Options.empty()) {
const char* p4 = this->CommandLineTool.c_str();
- P4Options.push_back(p4);
+ P4Options.emplace_back(p4);
// The CTEST_P4_CLIENT variable sets the P4 client used when issuing
// Perforce commands, if it's different from the default one.
std::string client = this->CTest->GetCTestConfiguration("P4Client");
if (!client.empty()) {
- P4Options.push_back("-c");
+ P4Options.emplace_back("-c");
P4Options.push_back(client);
}
// Set the message language to be English, in case the P4 admin
// has localized them
- P4Options.push_back("-L");
- P4Options.push_back("en");
+ P4Options.emplace_back("-L");
+ P4Options.emplace_back("en");
// The CTEST_P4_OPTIONS variable adds additional Perforce command line
// options before the main command
diff --git a/Source/CTest/cmCTestRunScriptCommand.cxx b/Source/CTest/cmCTestRunScriptCommand.cxx
index 238284a3f..a7e47d35c 100644
--- a/Source/CTest/cmCTestRunScriptCommand.cxx
+++ b/Source/CTest/cmCTestRunScriptCommand.cxx
@@ -39,7 +39,8 @@ bool cmCTestRunScriptCommand::InitialPass(std::vector<std::string> const& args,
++i;
} else {
int ret;
- cmCTestScriptHandler::RunScript(this->CTest, args[i].c_str(), !np, &ret);
+ cmCTestScriptHandler::RunScript(this->CTest, this->Makefile,
+ args[i].c_str(), !np, &ret);
std::ostringstream str;
str << ret;
this->Makefile->AddDefinition(returnVariable, str.str().c_str());
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 10dceca9b..918d5fa58 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -27,8 +27,6 @@ class cmCTestRunTest
public:
explicit cmCTestRunTest(cmCTestMultiProcessHandler& multiHandler);
- ~cmCTestRunTest() = default;
-
void SetNumberOfRuns(int n) { this->NumberOfRunsLeft = n; }
void SetRunUntilFailOn() { this->RunUntilFail = true; }
void SetTestProperties(cmCTestTestHandler::cmCTestTestProperties* prop)
@@ -78,6 +76,10 @@ public:
cmCTest* GetCTest() const { return this->CTest; }
+ std::string& GetActualCommand() { return this->ActualCommand; }
+
+ const std::vector<std::string>& GetArguments() { return this->Arguments; }
+
void FinalizeTest();
bool TimedOutForStopTime() const { return this->TimeoutIsForStopTime; }
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 58d9b3dcf..3bf66ca23 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -26,9 +26,7 @@ cmCTestSVN::cmCTestSVN(cmCTest* ct, std::ostream& log)
this->PriorRev = this->Unknown;
}
-cmCTestSVN::~cmCTestSVN()
-{
-}
+cmCTestSVN::~cmCTestSVN() = default;
void cmCTestSVN::CleanupImpl()
{
@@ -330,13 +328,15 @@ private:
if (name == "logentry") {
this->Rev = Revision();
this->Rev.SVNInfo = &SVNRepo;
- if (const char* rev = this->FindAttribute(atts, "revision")) {
+ if (const char* rev =
+ cmCTestSVN::LogParser::FindAttribute(atts, "revision")) {
this->Rev.Rev = rev;
}
this->Changes.clear();
} else if (name == "path") {
this->CurChange = Change();
- if (const char* action = this->FindAttribute(atts, "action")) {
+ if (const char* action =
+ cmCTestSVN::LogParser::FindAttribute(atts, "action")) {
this->CurChange.Action = action[0];
}
}
@@ -519,7 +519,7 @@ private:
} else {
local_path = path;
}
- this->SVN->Repositories.emplace_back(local_path.c_str());
+ this->SVN->Repositories.emplace_back(local_path);
}
};
@@ -530,7 +530,7 @@ bool cmCTestSVN::LoadRepositories()
}
// Info for root repository
- this->Repositories.emplace_back("");
+ this->Repositories.emplace_back();
this->RootInfo = &(this->Repositories.back());
// Run "svn status" to get the list of external repositories
diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h
index a467ede28..5c8505d49 100644
--- a/Source/CTest/cmCTestSVN.h
+++ b/Source/CTest/cmCTestSVN.h
@@ -41,7 +41,7 @@ private:
struct SVNInfo
{
- SVNInfo(const char* path)
+ SVNInfo(std::string const& path = std::string())
: LocalPath(path)
{
}
diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx
index a87473d33..33b8b4a4c 100644
--- a/Source/CTest/cmCTestScriptHandler.cxx
+++ b/Source/CTest/cmCTestScriptHandler.cxx
@@ -53,8 +53,6 @@ struct cmListFileFunction;
class cmCTestScriptFunctionBlocker : public cmFunctionBlocker
{
public:
- cmCTestScriptFunctionBlocker() {}
- ~cmCTestScriptFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus& /*status*/) override;
// virtual bool ShouldRemove(const cmListFileFunction& lff, cmMakefile &mf);
@@ -78,6 +76,7 @@ cmCTestScriptHandler::cmCTestScriptHandler()
this->EmptyBinDir = false;
this->EmptyBinDirOnce = false;
this->Makefile = nullptr;
+ this->ParentMakefile = nullptr;
this->CMake = nullptr;
this->GlobalGenerator = nullptr;
@@ -117,6 +116,7 @@ void cmCTestScriptHandler::Initialize()
delete this->Makefile;
this->Makefile = nullptr;
+ this->ParentMakefile = nullptr;
delete this->GlobalGenerator;
this->GlobalGenerator = nullptr;
@@ -135,7 +135,7 @@ cmCTestScriptHandler::~cmCTestScriptHandler()
void cmCTestScriptHandler::AddConfigurationScript(const char* script,
bool pscope)
{
- this->ConfigurationScripts.push_back(script);
+ this->ConfigurationScripts.emplace_back(script);
this->ScriptProcessScope.push_back(pscope);
}
@@ -263,15 +263,6 @@ int cmCTestScriptHandler::ExecuteScript(const std::string& total_script_arg)
return retVal;
}
-static void ctestScriptProgressCallback(const char* m, float /*unused*/,
- void* cd)
-{
- cmCTest* ctest = static_cast<cmCTest*>(cd);
- if (m && *m) {
- cmCTestLog(ctest, HANDLER_OUTPUT, "-- " << m << std::endl);
- }
-}
-
void cmCTestScriptHandler::CreateCMake()
{
// create a cmake instance to read the configuration script
@@ -280,7 +271,7 @@ void cmCTestScriptHandler::CreateCMake()
delete this->GlobalGenerator;
delete this->Makefile;
}
- this->CMake = new cmake(cmake::RoleScript);
+ this->CMake = new cmake(cmake::RoleScript, cmState::CTest);
this->CMake->SetHomeDirectory("");
this->CMake->SetHomeOutputDirectory("");
this->CMake->GetCurrentSnapshot().SetDefaultDefinitions();
@@ -292,8 +283,16 @@ void cmCTestScriptHandler::CreateCMake()
snapshot.GetDirectory().SetCurrentSource(cwd);
snapshot.GetDirectory().SetCurrentBinary(cwd);
this->Makefile = new cmMakefile(this->GlobalGenerator, snapshot);
+ if (this->ParentMakefile) {
+ this->Makefile->SetRecursionDepth(
+ this->ParentMakefile->GetRecursionDepth());
+ }
- this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
+ this->CMake->SetProgressCallback([this](const char* m, float /*unused*/) {
+ if (m && *m) {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "-- " << m << std::endl);
+ }
+ });
this->AddCTestCommand("ctest_build", new cmCTestBuildCommand);
this->AddCTestCommand("ctest_configure", new cmCTestConfigureCommand);
@@ -373,7 +372,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
ctest scripting easier. */
std::string systemFile =
this->Makefile->GetModulesFile("CTestScriptMode.cmake");
- if (!this->Makefile->ReadListFile(systemFile.c_str()) ||
+ if (!this->Makefile->ReadListFile(systemFile) ||
cmSystemTools::GetErrorOccuredFlag()) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Error in read:" << systemFile << "\n");
@@ -388,7 +387,7 @@ int cmCTestScriptHandler::ReadInScript(const std::string& total_script_arg)
}
// finally read in the script
- if (!this->Makefile->ReadListFile(script.c_str()) ||
+ if (!this->Makefile->ReadListFile(script) ||
cmSystemTools::GetErrorOccuredFlag()) {
// Reset the error flag so that it can run more than
// one script with an error when you use ctest_run_script.
@@ -450,7 +449,7 @@ int cmCTestScriptHandler::ExtractVariables()
updateVar, " specified without specifying CTEST_CVS_COMMAND.");
return 12;
}
- this->ExtraUpdates.push_back(updateVal);
+ this->ExtraUpdates.emplace_back(updateVal);
}
}
@@ -760,8 +759,8 @@ int cmCTestScriptHandler::RunConfigurationDashboard()
// put the initial cache into the bin dir
if (!this->InitialCache.empty()) {
- if (!this->WriteInitialCache(this->BinaryDir.c_str(),
- this->InitialCache.c_str())) {
+ if (!cmCTestScriptHandler::WriteInitialCache(this->BinaryDir.c_str(),
+ this->InitialCache.c_str())) {
this->RestoreBackupDirectories();
return 9;
}
@@ -891,11 +890,13 @@ void cmCTestScriptHandler::RestoreBackupDirectories()
}
}
-bool cmCTestScriptHandler::RunScript(cmCTest* ctest, const char* sname,
- bool InProcess, int* returnValue)
+bool cmCTestScriptHandler::RunScript(cmCTest* ctest, cmMakefile* mf,
+ const char* sname, bool InProcess,
+ int* returnValue)
{
cmCTestScriptHandler* sh = new cmCTestScriptHandler();
sh->SetCTestInstance(ctest);
+ sh->ParentMakefile = mf;
sh->AddConfigurationScript(sname, InProcess);
int res = sh->ProcessHandler();
if (returnValue) {
diff --git a/Source/CTest/cmCTestScriptHandler.h b/Source/CTest/cmCTestScriptHandler.h
index cf0762ec2..d93b5f8e7 100644
--- a/Source/CTest/cmCTestScriptHandler.h
+++ b/Source/CTest/cmCTestScriptHandler.h
@@ -72,8 +72,8 @@ public:
/*
* Run a script
*/
- static bool RunScript(cmCTest* ctest, const char* script, bool InProcess,
- int* returnValue);
+ static bool RunScript(cmCTest* ctest, cmMakefile* mf, const char* script,
+ bool InProcess, int* returnValue);
int RunCurrentScript();
/*
@@ -166,6 +166,7 @@ private:
std::chrono::steady_clock::time_point ScriptStartTime;
cmMakefile* Makefile;
+ cmMakefile* ParentMakefile;
cmGlobalGenerator* GlobalGenerator;
cmake* CMake;
};
diff --git a/Source/CTest/cmCTestStartCommand.cxx b/Source/CTest/cmCTestStartCommand.cxx
index 47006c10f..67ff2db05 100644
--- a/Source/CTest/cmCTestStartCommand.cxx
+++ b/Source/CTest/cmCTestStartCommand.cxx
@@ -146,7 +146,7 @@ bool cmCTestStartCommand::InitialPass(std::vector<std::string> const& args,
this->CTest->SetSuppressUpdatingCTestConfiguration(true);
int model;
if (smodel) {
- model = this->CTest->GetTestModelFromString(smodel);
+ model = cmCTest::GetTestModelFromString(smodel);
} else {
model = cmCTest::UNKNOWN;
}
diff --git a/Source/CTest/cmCTestSubmitCommand.cxx b/Source/CTest/cmCTestSubmitCommand.cxx
index 34adb4af3..00c061016 100644
--- a/Source/CTest/cmCTestSubmitCommand.cxx
+++ b/Source/CTest/cmCTestSubmitCommand.cxx
@@ -6,8 +6,8 @@
#include "cmCTestGenericHandler.h"
#include "cmCTestSubmitHandler.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include "cmake.h"
#include <sstream>
@@ -15,55 +15,28 @@ class cmExecutionStatus;
cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
{
- const char* ctestDropMethod =
- this->Makefile->GetDefinition("CTEST_DROP_METHOD");
- const char* ctestDropSite = this->Makefile->GetDefinition("CTEST_DROP_SITE");
- const char* ctestDropLocation =
- this->Makefile->GetDefinition("CTEST_DROP_LOCATION");
- const char* ctestTriggerSite =
- this->Makefile->GetDefinition("CTEST_TRIGGER_SITE");
- bool ctestDropSiteCDash = this->Makefile->IsOn("CTEST_DROP_SITE_CDASH");
- const char* ctestProjectName =
- this->Makefile->GetDefinition("CTEST_PROJECT_NAME");
- if (!ctestDropMethod) {
- ctestDropMethod = "http";
- }
+ const char* submitURL = !this->SubmitURL.empty()
+ ? this->SubmitURL.c_str()
+ : this->Makefile->GetDefinition("CTEST_SUBMIT_URL");
- if (!ctestDropSite) {
- // error: CDash requires CTEST_DROP_SITE definition
- // in CTestConfig.cmake
- }
- if (!ctestDropLocation) {
- // error: CDash requires CTEST_DROP_LOCATION definition
- // in CTestConfig.cmake
- }
- this->CTest->SetCTestConfiguration("ProjectName", ctestProjectName,
- this->Quiet);
- this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod,
- this->Quiet);
- this->CTest->SetCTestConfiguration("DropSite", ctestDropSite, this->Quiet);
- this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation,
- this->Quiet);
-
- this->CTest->SetCTestConfiguration(
- "IsCDash", ctestDropSiteCDash ? "TRUE" : "FALSE", this->Quiet);
-
- // Only propagate TriggerSite for non-CDash projects:
- //
- if (!ctestDropSiteCDash) {
- this->CTest->SetCTestConfiguration("TriggerSite", ctestTriggerSite,
- this->Quiet);
+ if (submitURL) {
+ this->CTest->SetCTestConfiguration("SubmitURL", submitURL, this->Quiet);
+ } else {
+ this->CTest->SetCTestConfigurationFromCMakeVariable(
+ this->Makefile, "DropMethod", "CTEST_DROP_METHOD", this->Quiet);
+ this->CTest->SetCTestConfigurationFromCMakeVariable(
+ this->Makefile, "DropSiteUser", "CTEST_DROP_SITE_USER", this->Quiet);
+ this->CTest->SetCTestConfigurationFromCMakeVariable(
+ this->Makefile, "DropSitePassword", "CTEST_DROP_SITE_PASSWORD",
+ this->Quiet);
+ this->CTest->SetCTestConfigurationFromCMakeVariable(
+ this->Makefile, "DropSite", "CTEST_DROP_SITE", this->Quiet);
+ this->CTest->SetCTestConfigurationFromCMakeVariable(
+ this->Makefile, "DropLocation", "CTEST_DROP_LOCATION", this->Quiet);
}
this->CTest->SetCTestConfigurationFromCMakeVariable(
this->Makefile, "CurlOptions", "CTEST_CURL_OPTIONS", this->Quiet);
- this->CTest->SetCTestConfigurationFromCMakeVariable(
- this->Makefile, "DropSiteUser", "CTEST_DROP_SITE_USER", this->Quiet);
- this->CTest->SetCTestConfigurationFromCMakeVariable(
- this->Makefile, "DropSitePassword", "CTEST_DROP_SITE_PASSWORD",
- this->Quiet);
- this->CTest->SetCTestConfigurationFromCMakeVariable(
- this->Makefile, "ScpCommand", "CTEST_SCP_COMMAND", this->Quiet);
const char* notesFilesVariable =
this->Makefile->GetDefinition("CTEST_NOTES_FILES");
@@ -203,6 +176,11 @@ bool cmCTestSubmitCommand::CheckArgumentKeyword(std::string const& arg)
return true;
}
+ if (arg == "SUBMIT_URL") {
+ this->ArgumentDoing = ArgumentDoingSubmitURL;
+ return true;
+ }
+
if (arg == "INTERNAL_TEST_CHECKSUM") {
this->InternalTest = true;
return true;
@@ -222,7 +200,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
} else {
std::ostringstream e;
e << "Part name \"" << arg << "\" is invalid.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
}
return true;
@@ -235,7 +213,7 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
std::ostringstream e;
e << "File \"" << arg << "\" does not exist. Cannot submit "
<< "a non-existent file.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
}
return true;
@@ -268,6 +246,12 @@ bool cmCTestSubmitCommand::CheckArgumentValue(std::string const& arg)
return true;
}
+ if (this->ArgumentDoing == ArgumentDoingSubmitURL) {
+ this->ArgumentDoing = ArgumentDoingNone;
+ this->SubmitURL = arg;
+ return true;
+ }
+
// Look for other arguments.
return this->Superclass::CheckArgumentValue(arg);
}
diff --git a/Source/CTest/cmCTestSubmitCommand.h b/Source/CTest/cmCTestSubmitCommand.h
index c4b84ce9f..0caccd66d 100644
--- a/Source/CTest/cmCTestSubmitCommand.h
+++ b/Source/CTest/cmCTestSubmitCommand.h
@@ -71,6 +71,7 @@ protected:
ArgumentDoingCDashUpload,
ArgumentDoingCDashUploadType,
ArgumentDoingHttpHeader,
+ ArgumentDoingSubmitURL,
ArgumentDoingLast2
};
@@ -85,6 +86,7 @@ protected:
std::string CDashUploadFile;
std::string CDashUploadType;
std::vector<std::string> HttpHeaders;
+ std::string SubmitURL;
};
#endif
diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx
index ecf309a80..87112da9e 100644
--- a/Source/CTest/cmCTestSubmitHandler.cxx
+++ b/Source/CTest/cmCTestSubmitHandler.cxx
@@ -5,13 +5,12 @@
#include "cm_curl.h"
#include "cm_jsoncpp_reader.h"
#include "cm_jsoncpp_value.h"
-#include "cmsys/Process.h"
#include <chrono>
-#include <cstring>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
+#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestCurl.h"
#include "cmCTestScriptHandler.h"
@@ -19,20 +18,11 @@
#include "cmCurl.h"
#include "cmDuration.h"
#include "cmGeneratedFileStream.h"
-#include "cmProcessOutput.h"
#include "cmState.h"
#include "cmSystemTools.h"
-#include "cmThirdParty.h"
-#include "cmWorkingDirectory.h"
#include "cmXMLParser.h"
#include "cmake.h"
-#if defined(CTEST_USE_XMLRPC)
-# include "cmVersion.h"
-# include "cm_sys_stat.h"
-# include "cm_xmlrpc.h"
-#endif
-
#define SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT 120
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
@@ -40,10 +30,6 @@ typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
class cmCTestSubmitHandler::ResponseParser : public cmXMLParser
{
public:
- ResponseParser() { this->Status = STATUS_OK; }
- ~ResponseParser() override {}
-
-public:
enum StatusType
{
STATUS_OK,
@@ -51,10 +37,11 @@ public:
STATUS_ERROR
};
- StatusType Status;
+ StatusType Status = STATUS_OK;
std::string Filename;
std::string MD5;
std::string Message;
+ std::string BuildID;
private:
std::vector<char> CurrentValue;
@@ -96,6 +83,8 @@ private:
this->MD5 = this->GetCurrentValue();
} else if (name == "message") {
this->Message = this->GetCurrentValue();
+ } else if (name == "buildId") {
+ this->BuildID = this->GetCurrentValue();
}
}
};
@@ -126,8 +115,6 @@ static size_t cmCTestSubmitHandlerCurlDebugCallback(CURL* /*unused*/,
}
cmCTestSubmitHandler::cmCTestSubmitHandler()
- : HTTPProxy()
- , FTPProxy()
{
this->Initialize();
}
@@ -139,170 +126,19 @@ void cmCTestSubmitHandler::Initialize()
p = cmCTest::Part(p + 1)) {
this->SubmitPart[p] = true;
}
- this->CDash = false;
this->HasWarnings = false;
this->HasErrors = false;
this->Superclass::Initialize();
this->HTTPProxy.clear();
this->HTTPProxyType = 0;
this->HTTPProxyAuth.clear();
- this->FTPProxy.clear();
- this->FTPProxyType = 0;
this->LogFile = nullptr;
this->Files.clear();
}
-bool cmCTestSubmitHandler::SubmitUsingFTP(const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix,
- const std::string& url)
-{
- CURL* curl;
- CURLcode res;
- FILE* ftpfile;
- char error_buffer[1024];
-
- /* In windows, this will init the winsock stuff */
- ::curl_global_init(CURL_GLOBAL_ALL);
-
- for (std::string const& file : files) {
- /* get a curl handle */
- curl = curl_easy_init();
- if (curl) {
- // Using proxy
- if (this->FTPProxyType > 0) {
- curl_easy_setopt(curl, CURLOPT_PROXY, this->FTPProxy.c_str());
- switch (this->FTPProxyType) {
- case 2:
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
- break;
- case 3:
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
- break;
- default:
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
- }
- }
-
- // enable uploading
- ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
-
- // if there is little to no activity for too long stop submitting
- ::curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 1);
- ::curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME,
- SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT);
-
- ::curl_easy_setopt(curl, CURLOPT_UPLOAD, 1);
-
- std::string local_file = file;
- if (!cmSystemTools::FileExists(local_file)) {
- local_file = localprefix + "/" + file;
- }
- std::string upload_as =
- url + "/" + remoteprefix + cmSystemTools::GetFilenameName(file);
-
- if (!cmSystemTools::FileExists(local_file)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Cannot find file: " << local_file << std::endl);
- ::curl_easy_cleanup(curl);
- ::curl_global_cleanup();
- return false;
- }
- unsigned long filelen = cmSystemTools::FileLength(local_file);
-
- ftpfile = cmsys::SystemTools::Fopen(local_file, "rb");
- *this->LogFile << "\tUpload file: " << local_file << " to " << upload_as
- << std::endl;
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Upload file: " << local_file << " to "
- << upload_as << std::endl,
- this->Quiet);
-
- ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
-
- // specify target
- ::curl_easy_setopt(curl, CURLOPT_URL, upload_as.c_str());
-
- // now specify which file to upload
- ::curl_easy_setopt(curl, CURLOPT_INFILE, ftpfile);
-
- // and give the size of the upload (optional)
- ::curl_easy_setopt(curl, CURLOPT_INFILESIZE, static_cast<long>(filelen));
-
- // and give curl the buffer for errors
- ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer);
-
- // specify handler for output
- ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
- cmCTestSubmitHandlerWriteMemoryCallback);
- ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION,
- cmCTestSubmitHandlerCurlDebugCallback);
-
- /* we pass our 'chunk' struct to the callback function */
- cmCTestSubmitHandlerVectorOfChar chunk;
- cmCTestSubmitHandlerVectorOfChar chunkDebug;
- ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk);
- ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
-
- // Now run off and do what you've been told!
- res = ::curl_easy_perform(curl);
-
- if (!chunk.empty()) {
- cmCTestOptionalLog(this->CTest, DEBUG,
- "CURL output: ["
- << cmCTestLogWrite(&*chunk.begin(), chunk.size())
- << "]" << std::endl,
- this->Quiet);
- }
- if (!chunkDebug.empty()) {
- cmCTestOptionalLog(
- this->CTest, DEBUG,
- "CURL debug output: ["
- << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
- << std::endl,
- this->Quiet);
- }
-
- fclose(ftpfile);
- if (res) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Error when uploading file: " << local_file
- << std::endl);
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Error message was: " << error_buffer << std::endl);
- *this->LogFile << " Error when uploading file: " << local_file
- << std::endl
- << " Error message was: " << error_buffer << std::endl
- << " Curl output was: ";
- // avoid dereference of empty vector
- if (!chunk.empty()) {
- *this->LogFile << cmCTestLogWrite(&*chunk.begin(), chunk.size());
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "CURL output: ["
- << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
- << std::endl);
- }
- *this->LogFile << std::endl;
- ::curl_easy_cleanup(curl);
- ::curl_global_cleanup();
- return false;
- }
- // always cleanup
- ::curl_easy_cleanup(curl);
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Uploaded: " + local_file << std::endl,
- this->Quiet);
- }
- }
- ::curl_global_cleanup();
- return true;
-}
-
-// Uploading files is simpler
-bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix,
- const std::string& url)
+bool cmCTestSubmitHandler::SubmitUsingHTTP(
+ const std::string& localprefix, const std::vector<std::string>& files,
+ const std::string& remoteprefix, const std::string& url)
{
CURL* curl;
CURLcode res;
@@ -322,7 +158,6 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
/* In windows, this will init the winsock stuff */
::curl_global_init(CURL_GLOBAL_ALL);
- std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
std::string curlopt(this->CTest->GetCTestConfiguration("CurlOptions"));
std::vector<std::string> args;
cmSystemTools::ExpandListArgument(curlopt, args);
@@ -405,26 +240,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
*this->LogFile << "\tUpload file: " << local_file << " to "
<< remote_file << std::endl;
- std::string ofile;
- for (char c : remote_file) {
- char hexCh[4] = { 0, 0, 0, 0 };
- hexCh[0] = c;
- switch (c) {
- case '+':
- case '?':
- case '/':
- case '\\':
- case '&':
- case ' ':
- case '=':
- case '%':
- sprintf(hexCh, "%%%02X", static_cast<int>(c));
- ofile.append(hexCh);
- break;
- default:
- ofile.append(hexCh);
- }
- }
+ std::string ofile = cmSystemTools::EncodeURL(remote_file);
std::string upload_as = url +
((url.find('?') == std::string::npos) ? '?' : '&') +
"FileName=" + ofile;
@@ -465,6 +281,17 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const std::string& localprefix,
cmSystemTools::ComputeFileHash(local_file, cmCryptoHash::AlgoMD5);
}
+ // Generate Done.xml right before it is submitted.
+ // The reason for this is two-fold:
+ // 1) It must be generated after some other part has been submitted
+ // so we have a buildId to refer to in its contents.
+ // 2) By generating Done.xml here its timestamp will be as late as
+ // possible. This gives us a more accurate record of how long the
+ // entire build took to complete.
+ if (file == "Done.xml") {
+ this->CTest->GenerateDoneFile();
+ }
+
if (!cmSystemTools::FileExists(local_file)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Cannot find file: " << local_file << std::endl);
@@ -646,6 +473,7 @@ void cmCTestSubmitHandler::ParseResponse(
" Submission failed: " << parser.Message << std::endl);
return;
}
+ this->CTest->SetBuildID(parser.BuildID);
}
output = cmSystemTools::UpperCase(output);
if (output.find("WARNING") != std::string::npos) {
@@ -662,392 +490,6 @@ void cmCTestSubmitHandler::ParseResponse(
}
}
-bool cmCTestSubmitHandler::TriggerUsingHTTP(const std::set<std::string>& files,
- const std::string& remoteprefix,
- const std::string& url)
-{
- CURL* curl;
- char error_buffer[1024];
-
- /* In windows, this will init the winsock stuff */
- ::curl_global_init(CURL_GLOBAL_ALL);
-
- for (std::string const& file : files) {
- /* get a curl handle */
- curl = curl_easy_init();
- if (curl) {
- // Using proxy
- if (this->HTTPProxyType > 0) {
- curl_easy_setopt(curl, CURLOPT_PROXY, this->HTTPProxy.c_str());
- switch (this->HTTPProxyType) {
- case 2:
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
- break;
- case 3:
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
- break;
- default:
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
- if (!this->HTTPProxyAuth.empty()) {
- curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD,
- this->HTTPProxyAuth.c_str());
- }
- }
- }
-
- ::curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
-
- // and give curl the buffer for errors
- ::curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, &error_buffer);
-
- // specify handler for output
- ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
- cmCTestSubmitHandlerWriteMemoryCallback);
- ::curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION,
- cmCTestSubmitHandlerCurlDebugCallback);
-
- /* we pass our 'chunk' struct to the callback function */
- cmCTestSubmitHandlerVectorOfChar chunk;
- cmCTestSubmitHandlerVectorOfChar chunkDebug;
- ::curl_easy_setopt(curl, CURLOPT_FILE, &chunk);
- ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, &chunkDebug);
-
- std::string rfile = remoteprefix + cmSystemTools::GetFilenameName(file);
- std::string ofile;
- for (char c : rfile) {
- char hexCh[4] = { 0, 0, 0, 0 };
- hexCh[0] = c;
- switch (c) {
- case '+':
- case '?':
- case '/':
- case '\\':
- case '&':
- case ' ':
- case '=':
- case '%':
- sprintf(hexCh, "%%%02X", static_cast<int>(c));
- ofile.append(hexCh);
- break;
- default:
- ofile.append(hexCh);
- }
- }
- std::string turl = url +
- ((url.find('?') == std::string::npos) ? '?' : '&') +
- "xmlfile=" + ofile;
- *this->LogFile << "Trigger url: " << turl << std::endl;
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Trigger url: " << turl << std::endl, this->Quiet);
- curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
- curl_easy_setopt(curl, CURLOPT_URL, turl.c_str());
- if (curl_easy_perform(curl)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Error when triggering: " << turl << std::endl);
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Error message was: " << error_buffer << std::endl);
- *this->LogFile << "\tTriggering failed with error: " << error_buffer
- << std::endl
- << " Error message was: " << error_buffer
- << std::endl;
- if (!chunk.empty()) {
- *this->LogFile << " Curl output was: "
- << cmCTestLogWrite(&*chunk.begin(), chunk.size())
- << std::endl;
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "CURL output: ["
- << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]"
- << std::endl);
- }
- ::curl_easy_cleanup(curl);
- ::curl_global_cleanup();
- return false;
- }
-
- if (!chunk.empty()) {
- cmCTestOptionalLog(this->CTest, DEBUG,
- "CURL output: ["
- << cmCTestLogWrite(&*chunk.begin(), chunk.size())
- << "]" << std::endl,
- this->Quiet);
- }
- if (!chunkDebug.empty()) {
- cmCTestOptionalLog(
- this->CTest, DEBUG,
- "CURL debug output: ["
- << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]"
- << std::endl,
- this->Quiet);
- }
-
- // always cleanup
- ::curl_easy_cleanup(curl);
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl,
- this->Quiet);
- }
- }
- ::curl_global_cleanup();
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Dart server triggered..." << std::endl, this->Quiet);
- return true;
-}
-
-bool cmCTestSubmitHandler::SubmitUsingSCP(const std::string& scp_command,
- const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix,
- const std::string& url)
-{
- if (scp_command.empty() || localprefix.empty() || files.empty() ||
- remoteprefix.empty() || url.empty()) {
- return false;
- }
-
- std::vector<const char*> argv;
- argv.push_back(scp_command.c_str()); // Scp command
- argv.push_back(scp_command.c_str()); // Dummy string for file
- argv.push_back(scp_command.c_str()); // Dummy string for remote url
- argv.push_back(nullptr);
-
- cmsysProcess* cp = cmsysProcess_New();
- cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1);
- // cmsysProcess_SetTimeout(cp, timeout);
-
- int problems = 0;
-
- for (std::string const& file : files) {
- int retVal;
-
- std::string lfname = localprefix;
- cmSystemTools::ConvertToUnixSlashes(lfname);
- lfname += "/" + file;
- lfname = cmSystemTools::ConvertToOutputPath(lfname);
- argv[1] = lfname.c_str();
- std::string rfname = url + "/" + remoteprefix + file;
- argv[2] = rfname.c_str();
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \""
- << argv[2] << "\"" << std::endl,
- this->Quiet);
- *this->LogFile << "Execute \"" << argv[0] << "\" \"" << argv[1] << "\" \""
- << argv[2] << "\"" << std::endl;
-
- cmsysProcess_SetCommand(cp, &*argv.begin());
- cmsysProcess_Execute(cp);
- char* data;
- int length;
- cmProcessOutput processOutput;
- std::string strdata;
-
- while (cmsysProcess_WaitForData(cp, &data, &length, nullptr)) {
- processOutput.DecodeText(data, length, strdata);
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()),
- this->Quiet);
- }
- processOutput.DecodeText(std::string(), strdata);
- if (!strdata.empty()) {
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- cmCTestLogWrite(strdata.c_str(), strdata.size()),
- this->Quiet);
- }
-
- cmsysProcess_WaitForExit(cp, nullptr);
-
- int result = cmsysProcess_GetState(cp);
-
- if (result == cmsysProcess_State_Exited) {
- retVal = cmsysProcess_GetExitValue(cp);
- if (retVal != 0) {
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- "\tSCP returned: " << retVal << std::endl,
- this->Quiet);
- *this->LogFile << "\tSCP returned: " << retVal << std::endl;
- problems++;
- }
- } else if (result == cmsysProcess_State_Exception) {
- retVal = cmsysProcess_GetExitException(cp);
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tThere was an exception: " << retVal << std::endl);
- *this->LogFile << "\tThere was an exception: " << retVal << std::endl;
- problems++;
- } else if (result == cmsysProcess_State_Expired) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tThere was a timeout" << std::endl);
- *this->LogFile << "\tThere was a timeout" << std::endl;
- problems++;
- } else if (result == cmsysProcess_State_Error) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "\tError executing SCP: " << cmsysProcess_GetErrorString(cp)
- << std::endl);
- *this->LogFile << "\tError executing SCP: "
- << cmsysProcess_GetErrorString(cp) << std::endl;
- problems++;
- }
- }
- cmsysProcess_Delete(cp);
- return problems == 0;
-}
-
-bool cmCTestSubmitHandler::SubmitUsingCP(const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix,
- const std::string& destination)
-{
- if (localprefix.empty() || files.empty() || remoteprefix.empty() ||
- destination.empty()) {
- /* clang-format off */
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Missing arguments for submit via cp:\n"
- << "\tlocalprefix: " << localprefix << "\n"
- << "\tNumber of files: " << files.size() << "\n"
- << "\tremoteprefix: " << remoteprefix << "\n"
- << "\tdestination: " << destination << std::endl);
- /* clang-format on */
- return false;
- }
-
- for (std::string const& file : files) {
- std::string lfname = localprefix;
- cmSystemTools::ConvertToUnixSlashes(lfname);
- lfname += "/" + file;
- std::string rfname = destination + "/" + remoteprefix + file;
- cmSystemTools::CopyFileAlways(lfname, rfname);
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Copy file: " << lfname << " to " << rfname
- << std::endl,
- this->Quiet);
- }
- std::string tagDoneFile = destination + "/" + remoteprefix + "DONE";
- cmSystemTools::Touch(tagDoneFile, true);
- return true;
-}
-
-#if defined(CTEST_USE_XMLRPC)
-bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
- const std::string& localprefix, const std::set<std::string>& files,
- const std::string& remoteprefix, const std::string& url)
-{
- xmlrpc_env env;
- char ctestString[] = "CTest";
- std::string ctestVersionString = cmVersion::GetCMakeVersion();
- char* ctestVersion = const_cast<char*>(ctestVersionString.c_str());
-
- std::string realURL = url + "/" + remoteprefix + "/Command/";
-
- /* Start up our XML-RPC client library. */
- xmlrpc_client_init(XMLRPC_CLIENT_NO_FLAGS, ctestString, ctestVersion);
-
- /* Initialize our error-handling environment. */
- xmlrpc_env_init(&env);
-
- /* Call the famous server at UserLand. */
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submitting to: " << realURL << " (" << remoteprefix
- << ")" << std::endl,
- this->Quiet);
- for (std::string const& file : files) {
- xmlrpc_value* result;
-
- std::string local_file = file;
- if (!cmSystemTools::FileExists(local_file)) {
- local_file = localprefix + "/" + file;
- }
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submit file: " << local_file << std::endl,
- this->Quiet);
- struct stat st;
- if (::stat(local_file.c_str(), &st)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Cannot find file: " << local_file << std::endl);
- return false;
- }
-
- // off_t can be bigger than size_t. fread takes size_t.
- // make sure the file is not too big.
- if (static_cast<off_t>(static_cast<size_t>(st.st_size)) !=
- static_cast<off_t>(st.st_size)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " File too big: " << local_file << std::endl);
- return false;
- }
- size_t fileSize = static_cast<size_t>(st.st_size);
- FILE* fp = cmsys::SystemTools::Fopen(local_file, "rb");
- if (!fp) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Cannot open file: " << local_file << std::endl);
- return false;
- }
-
- unsigned char* fileBuffer = new unsigned char[fileSize];
- if (fread(fileBuffer, 1, fileSize, fp) != fileSize) {
- delete[] fileBuffer;
- fclose(fp);
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Cannot read file: " << local_file << std::endl);
- return false;
- }
- fclose(fp);
-
- char remoteCommand[] = "Submit.put";
- char* pRealURL = const_cast<char*>(realURL.c_str());
- result =
- xmlrpc_client_call(&env, pRealURL, remoteCommand, "(6)", fileBuffer,
- static_cast<xmlrpc_int32>(fileSize));
-
- delete[] fileBuffer;
-
- if (env.fault_occurred) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Submission problem: " << env.fault_string << " ("
- << env.fault_code << ")"
- << std::endl);
- xmlrpc_env_clean(&env);
- xmlrpc_client_cleanup();
- return false;
- }
-
- /* Dispose of our result value. */
- xmlrpc_DECREF(result);
- }
-
- /* Clean up our error-handling environment. */
- xmlrpc_env_clean(&env);
-
- /* Shutdown our XML-RPC client library. */
- xmlrpc_client_cleanup();
- return true;
-}
-#else
-bool cmCTestSubmitHandler::SubmitUsingXMLRPC(
- std::string const& /*unused*/, std::set<std::string> const& /*unused*/,
- std::string const& /*unused*/, std::string const& /*unused*/)
-{
- return false;
-}
-#endif
-
-void cmCTestSubmitHandler::ConstructCDashURL(std::string& dropMethod,
- std::string& url)
-{
- dropMethod = this->CTest->GetCTestConfiguration("DropMethod");
- url = dropMethod;
- url += "://";
- if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
- url += this->CTest->GetCTestConfiguration("DropSiteUser");
- cmCTestOptionalLog(
- this->CTest, HANDLER_OUTPUT,
- this->CTest->GetCTestConfiguration("DropSiteUser").c_str(), this->Quiet);
- if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) {
- url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******", this->Quiet);
- }
- url += "@";
- }
- url += this->CTest->GetCTestConfiguration("DropSite") +
- this->CTest->GetCTestConfiguration("DropLocation");
-}
-
int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
std::string const& typeString)
{
@@ -1068,12 +510,15 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
curl.SetCurlOptions(args);
curl.SetTimeOutSeconds(SUBMIT_TIMEOUT_IN_SECONDS_DEFAULT);
curl.SetHttpHeaders(this->HttpHeaders);
- std::string dropMethod;
- std::string url;
- this->ConstructCDashURL(dropMethod, url);
- std::string::size_type pos = url.find("submit.php?");
- url = url.substr(0, pos + 10);
- if (!(dropMethod == "http" || dropMethod == "https")) {
+ std::string url = this->CTest->GetSubmitURL();
+ std::string fields;
+ std::string::size_type pos = url.find('?');
+ if (pos != std::string::npos) {
+ fields = url.substr(pos + 1);
+ url = url.substr(0, pos);
+ }
+ if (!cmHasLiteralPrefix(url, "http://") &&
+ !cmHasLiteralPrefix(url, "https://")) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
"Only http and https are supported for CDASH_UPLOAD\n");
return -1;
@@ -1120,8 +565,6 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
const char* subproject = cm->GetState()->GetGlobalProperty("SubProject");
// TODO: Encode values for a URL instead of trusting caller.
std::ostringstream str;
- str << "project="
- << curl.Escape(this->CTest->GetCTestConfiguration("ProjectName")) << "&";
if (subproject) {
str << "subproject=" << curl.Escape(subproject) << "&";
}
@@ -1139,7 +582,10 @@ int cmCTestSubmitHandler::HandleCDashUploadFile(std::string const& file,
<< "endtime=" << timeNow << "&"
<< "datafilesmd5[0]=" << md5sum << "&"
<< "type=" << curl.Escape(typeString);
- std::string fields = str.str();
+ if (!fields.empty()) {
+ fields += '&';
+ }
+ fields += str.str();
cmCTestOptionalLog(this->CTest, DEBUG,
"fields: " << fields << "\nurl:" << url
<< "\nfile: " << file << "\n",
@@ -1276,11 +722,6 @@ int cmCTestSubmitHandler::ProcessHandler()
if (cdashUploadFile && cdashUploadType) {
return this->HandleCDashUploadFile(cdashUploadFile, cdashUploadType);
}
- std::string iscdash = this->CTest->GetCTestConfiguration("IsCDash");
- // cdash does not need to trigger so just return true
- if (!iscdash.empty()) {
- this->CDash = true;
- }
const std::string& buildDirectory =
this->CTest->GetCTestConfiguration("BuildDirectory");
@@ -1318,46 +759,21 @@ int cmCTestSubmitHandler::ProcessHandler()
}
}
- if (getenv("FTP_PROXY")) {
- this->FTPProxyType = 1;
- this->FTPProxy = getenv("FTP_PROXY");
- if (getenv("FTP_PROXY_PORT")) {
- this->FTPProxy += ":";
- this->FTPProxy += getenv("FTP_PROXY_PORT");
- }
- if (getenv("FTP_PROXY_TYPE")) {
- std::string type = getenv("FTP_PROXY_TYPE");
- // HTTP/SOCKS4/SOCKS5
- if (type == "HTTP") {
- this->FTPProxyType = 1;
- } else if (type == "SOCKS4") {
- this->FTPProxyType = 2;
- } else if (type == "SOCKS5") {
- this->FTPProxyType = 3;
- }
- }
- }
-
if (!this->HTTPProxy.empty()) {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
" Use HTTP Proxy: " << this->HTTPProxy << std::endl,
this->Quiet);
}
- if (!this->FTPProxy.empty()) {
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Use FTP Proxy: " << this->FTPProxy << std::endl,
- this->Quiet);
- }
cmGeneratedFileStream ofs;
this->StartLogFile("Submit", ofs);
- cmCTest::SetOfStrings files;
+ std::vector<std::string> files;
std::string prefix = this->GetSubmitResultsPrefix();
if (!this->Files.empty()) {
// Submit the explicitly selected files:
//
- files.insert(this->Files.begin(), this->Files.end());
+ files.insert(files.end(), this->Files.begin(), this->Files.end());
}
// Add to the list of files to submit from any selected, existing parts:
@@ -1404,7 +820,21 @@ int cmCTestSubmitHandler::ProcessHandler()
// Submit files from this part.
std::vector<std::string> const& pfiles = this->CTest->GetSubmitFiles(p);
- files.insert(pfiles.begin(), pfiles.end());
+ files.insert(files.end(), pfiles.begin(), pfiles.end());
+ }
+
+ // Make sure files are unique, but preserve order.
+ {
+ // This endPos intermediate is needed to work around non-conformant C++11
+ // standard libraries that have erase(iterator,iterator) instead of
+ // erase(const_iterator,const_iterator).
+ size_t endPos = cmRemoveDuplicates(files) - files.cbegin();
+ files.erase(files.begin() + endPos, files.end());
+ }
+
+ // Submit Done.xml last
+ if (this->SubmitPart[cmCTest::PartDone]) {
+ files.emplace_back("Done.xml");
}
if (ofs) {
@@ -1415,10 +845,7 @@ int cmCTestSubmitHandler::ProcessHandler()
cnt++;
}
}
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- "Submit files (using "
- << this->CTest->GetCTestConfiguration("DropMethod")
- << ")" << std::endl,
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "Submit files\n",
this->Quiet);
const char* specificTrack = this->CTest->GetSpecificTrack();
if (specificTrack) {
@@ -1428,233 +855,32 @@ int cmCTestSubmitHandler::ProcessHandler()
}
this->SetLogFile(&ofs);
- std::string dropMethod(this->CTest->GetCTestConfiguration("DropMethod"));
-
- if (dropMethod.empty() || dropMethod == "ftp") {
- ofs << "Using drop method: FTP" << std::endl;
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Using FTP submit method" << std::endl
- << " Drop site: ftp://",
- this->Quiet);
- std::string url = "ftp://";
- url += cmCTest::MakeURLSafe(
- this->CTest->GetCTestConfiguration("DropSiteUser")) +
- ":" +
- cmCTest::MakeURLSafe(
- this->CTest->GetCTestConfiguration("DropSitePassword")) +
- "@" + this->CTest->GetCTestConfiguration("DropSite") +
- cmCTest::MakeURLSafe(this->CTest->GetCTestConfiguration("DropLocation"));
- if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
- cmCTestOptionalLog(
- this->CTest, HANDLER_OUTPUT,
- this->CTest->GetCTestConfiguration("DropSiteUser").c_str(),
- this->Quiet);
- if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) {
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******",
- this->Quiet);
- }
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "@", this->Quiet);
- }
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- this->CTest->GetCTestConfiguration("DropSite")
- << this->CTest->GetCTestConfiguration("DropLocation")
- << std::endl,
- this->Quiet);
- if (!this->SubmitUsingFTP(buildDirectory + "/Testing/" +
- this->CTest->GetCurrentTag(),
- files, prefix, url)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when submitting via FTP" << std::endl);
- ofs << " Problems when submitting via FTP" << std::endl;
- return -1;
- }
- if (!this->CDash) {
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Using HTTP trigger method"
- << std::endl
- << " Trigger site: "
- << this->CTest->GetCTestConfiguration("TriggerSite")
- << std::endl,
- this->Quiet);
- if (!this->TriggerUsingHTTP(
- files, prefix,
- this->CTest->GetCTestConfiguration("TriggerSite"))) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when triggering via HTTP" << std::endl);
- ofs << " Problems when triggering via HTTP" << std::endl;
- return -1;
- }
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submission successful" << std::endl, this->Quiet);
- ofs << " Submission successful" << std::endl;
- return 0;
- }
- } else if (dropMethod == "http" || dropMethod == "https") {
- std::string url = dropMethod;
- url += "://";
- ofs << "Using drop method: " << dropMethod << std::endl;
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Using HTTP submit method" << std::endl
- << " Drop site:" << url,
- this->Quiet);
- if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
- url += this->CTest->GetCTestConfiguration("DropSiteUser");
- cmCTestOptionalLog(
- this->CTest, HANDLER_OUTPUT,
- this->CTest->GetCTestConfiguration("DropSiteUser").c_str(),
- this->Quiet);
- if (!this->CTest->GetCTestConfiguration("DropSitePassword").empty()) {
- url += ":" + this->CTest->GetCTestConfiguration("DropSitePassword");
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, ":******",
- this->Quiet);
- }
- url += "@";
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "@", this->Quiet);
- }
- url += this->CTest->GetCTestConfiguration("DropSite") +
- this->CTest->GetCTestConfiguration("DropLocation");
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- this->CTest->GetCTestConfiguration("DropSite")
- << this->CTest->GetCTestConfiguration("DropLocation")
- << std::endl,
- this->Quiet);
- if (!this->SubmitUsingHTTP(buildDirectory + "/Testing/" +
- this->CTest->GetCurrentTag(),
- files, prefix, url)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when submitting via HTTP" << std::endl);
- ofs << " Problems when submitting via HTTP" << std::endl;
- return -1;
- }
- if (!this->CDash) {
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Using HTTP trigger method"
- << std::endl
- << " Trigger site: "
- << this->CTest->GetCTestConfiguration("TriggerSite")
- << std::endl,
- this->Quiet);
- if (!this->TriggerUsingHTTP(
- files, prefix,
- this->CTest->GetCTestConfiguration("TriggerSite"))) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when triggering via HTTP" << std::endl);
- ofs << " Problems when triggering via HTTP" << std::endl;
- return -1;
- }
- }
- if (this->HasErrors) {
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
- " Errors occurred during "
- "submission."
- << std::endl);
- ofs << " Errors occurred during submission. " << std::endl;
- } else {
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submission successful"
- << (this->HasWarnings ? ", with warnings." : "")
- << std::endl,
- this->Quiet);
- ofs << " Submission successful"
- << (this->HasWarnings ? ", with warnings." : "") << std::endl;
- }
-
- return 0;
- } else if (dropMethod == "xmlrpc") {
-#if defined(CTEST_USE_XMLRPC)
- ofs << "Using drop method: XML-RPC" << std::endl;
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Using XML-RPC submit method" << std::endl,
- this->Quiet);
- std::string url = this->CTest->GetCTestConfiguration("DropSite");
- prefix = this->CTest->GetCTestConfiguration("DropLocation");
- if (!this->SubmitUsingXMLRPC(buildDirectory + "/Testing/" +
- this->CTest->GetCurrentTag(),
- files, prefix, url)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when submitting via XML-RPC" << std::endl);
- ofs << " Problems when submitting via XML-RPC" << std::endl;
- return -1;
- }
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submission successful" << std::endl, this->Quiet);
- ofs << " Submission successful" << std::endl;
- return 0;
-#else
+ std::string url = this->CTest->GetSubmitURL();
+ cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
+ " SubmitURL: " << url << '\n', this->Quiet);
+ if (!this->SubmitUsingHTTP(buildDirectory + "/Testing/" +
+ this->CTest->GetCurrentTag(),
+ files, prefix, url)) {
cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Submission method \"xmlrpc\" not compiled into CTest!"
- << std::endl);
+ " Problems when submitting via HTTP\n");
+ ofs << " Problems when submitting via HTTP\n";
return -1;
-#endif
- } else if (dropMethod == "scp") {
- std::string url;
- if (!this->CTest->GetCTestConfiguration("DropSiteUser").empty()) {
- url += this->CTest->GetCTestConfiguration("DropSiteUser") + "@";
- }
- url += this->CTest->GetCTestConfiguration("DropSite") + ":" +
- this->CTest->GetCTestConfiguration("DropLocation");
-
- // change to the build directory so that we can uses a relative path
- // on windows since scp doesn't support "c:" a drive in the path
- cmWorkingDirectory workdir(buildDirectory);
- if (workdir.Failed()) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Failed to change directory to "
- << buildDirectory << " : "
- << std::strerror(workdir.GetLastResult()) << std::endl);
- ofs << " Failed to change directory to " << buildDirectory << " : "
- << std::strerror(workdir.GetLastResult()) << std::endl;
- return -1;
- }
-
- if (!this->SubmitUsingSCP(this->CTest->GetCTestConfiguration("ScpCommand"),
- "Testing/" + this->CTest->GetCurrentTag(), files,
- prefix, url)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when submitting via SCP" << std::endl);
- ofs << " Problems when submitting via SCP" << std::endl;
- return -1;
- }
+ }
+ if (this->HasErrors) {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ " Errors occurred during submission.\n");
+ ofs << " Errors occurred during submission.\n";
+ } else {
cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submission successful" << std::endl, this->Quiet);
- ofs << " Submission successful" << std::endl;
- return 0;
- } else if (dropMethod == "cp") {
- std::string location = this->CTest->GetCTestConfiguration("DropLocation");
-
- // change to the build directory so that we can uses a relative path
- // on windows since scp doesn't support "c:" a drive in the path
- cmWorkingDirectory workdir(buildDirectory);
- if (workdir.Failed()) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Failed to change directory to "
- << buildDirectory << " : "
- << std::strerror(workdir.GetLastResult()) << std::endl);
- ofs << " Failed to change directory to " << buildDirectory << " : "
- << std::strerror(workdir.GetLastResult()) << std::endl;
- return -1;
- }
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Change directory: " << buildDirectory << std::endl,
+ " Submission successful"
+ << (this->HasWarnings ? ", with warnings." : "")
+ << std::endl,
this->Quiet);
-
- if (!this->SubmitUsingCP("Testing/" + this->CTest->GetCurrentTag(), files,
- prefix, location)) {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Problems when submitting via CP" << std::endl);
- ofs << " Problems when submitting via cp" << std::endl;
- return -1;
- }
- cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT,
- " Submission successful" << std::endl, this->Quiet);
- ofs << " Submission successful" << std::endl;
- return 0;
+ ofs << " Submission successful"
+ << (this->HasWarnings ? ", with warnings." : "") << std::endl;
}
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- " Unknown submission method: \"" << dropMethod << "\""
- << std::endl);
- return -1;
+ return 0;
}
std::string cmCTestSubmitHandler::GetSubmitResultsPrefix()
diff --git a/Source/CTest/cmCTestSubmitHandler.h b/Source/CTest/cmCTestSubmitHandler.h
index b4d0e7772..58f4f975d 100644
--- a/Source/CTest/cmCTestSubmitHandler.h
+++ b/Source/CTest/cmCTestSubmitHandler.h
@@ -48,38 +48,16 @@ public:
this->HttpHeaders = v;
}
- void ConstructCDashURL(std::string& dropMethod, std::string& url);
-
private:
void SetLogFile(std::ostream* ost) { this->LogFile = ost; }
/**
* Submit file using various ways
*/
- bool SubmitUsingFTP(const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix, const std::string& url);
bool SubmitUsingHTTP(const std::string& localprefix,
- const std::set<std::string>& files,
+ const std::vector<std::string>& files,
const std::string& remoteprefix,
const std::string& url);
- bool SubmitUsingSCP(const std::string& scp_command,
- const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix, const std::string& url);
-
- bool SubmitUsingCP(const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix, const std::string& url);
-
- bool TriggerUsingHTTP(const std::set<std::string>& files,
- const std::string& remoteprefix,
- const std::string& url);
-
- bool SubmitUsingXMLRPC(const std::string& localprefix,
- const std::set<std::string>& files,
- const std::string& remoteprefix,
- const std::string& url);
typedef std::vector<char> cmCTestSubmitHandlerVectorOfChar;
@@ -92,11 +70,8 @@ private:
std::string HTTPProxy;
int HTTPProxyType;
std::string HTTPProxyAuth;
- std::string FTPProxy;
- int FTPProxyType;
std::ostream* LogFile;
bool SubmitPart[cmCTest::PartCount];
- bool CDash;
bool HasWarnings;
bool HasErrors;
cmCTest::SetOfStrings Files;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index c936910f8..cf2652afe 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -3,6 +3,7 @@
#include "cmCTestTestHandler.h"
#include <algorithm>
#include <chrono>
+#include <cmath>
#include <cmsys/Base64.h>
#include <cmsys/Directory.hxx>
#include <cmsys/RegularExpression.hxx>
@@ -103,7 +104,7 @@ bool cmCTestSubdirCommand::InitialPass(std::vector<std::string> const& args,
}
fname += "/";
fname += testFilename;
- readit = this->Makefile->ReadDependentFile(fname.c_str());
+ readit = this->Makefile->ReadDependentFile(fname);
}
if (!readit) {
std::string m = "Could not find include file: ";
@@ -169,7 +170,7 @@ bool cmCTestAddSubdirectoryCommand::InitialPass(
}
fname += "/";
fname += testFilename;
- readit = this->Makefile->ReadDependentFile(fname.c_str());
+ readit = this->Makefile->ReadDependentFile(fname);
}
if (!readit) {
std::string m = "Could not find include file: ";
@@ -535,11 +536,20 @@ int cmCTestTestHandler::ProcessHandler()
percent = 99;
}
+ std::string passColorCode;
+ std::string failedColorCode;
+ if (failed.empty()) {
+ passColorCode = this->CTest->GetColorCode(cmCTest::Color::GREEN);
+ } else {
+ failedColorCode = this->CTest->GetColorCode(cmCTest::Color::RED);
+ }
cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::endl
- << static_cast<int>(percent + .5f) << "% tests passed, "
- << failed.size() << " tests failed out of " << total
- << std::endl);
+ << passColorCode << std::lround(percent) << "% tests passed"
+ << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
+ << ", " << failedColorCode << failed.size() << " tests failed"
+ << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
+ << " out of " << total << std::endl);
if ((!this->CTest->GetLabelsForSubprojects().empty() &&
this->CTest->GetSubprojectSummary())) {
this->PrintLabelOrSubprojectSummary(true);
@@ -562,6 +572,8 @@ int cmCTestTestHandler::ProcessHandler()
this->StartLogFile("TestsDisabled", ofs);
const char* disabled_reason;
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ this->CTest->GetColorCode(cmCTest::Color::BLUE));
for (cmCTestTestResult const& dt : disabledTests) {
ofs << dt.TestCount << ":" << dt.Name << std::endl;
if (dt.CompletionStatus == "Disabled") {
@@ -573,6 +585,8 @@ int cmCTestTestHandler::ProcessHandler()
"\t" << std::setw(3) << dt.TestCount << " - " << dt.Name
<< " (" << disabled_reason << ")" << std::endl);
}
+ cmCTestLog(this->CTest, HANDLER_OUTPUT,
+ this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR));
}
if (!failed.empty()) {
@@ -587,10 +601,17 @@ int cmCTestTestHandler::ProcessHandler()
!cmHasLiteralPrefix(ft.CompletionStatus, "SKIP_RETURN_CODE=") &&
ft.CompletionStatus != "Disabled") {
ofs << ft.TestCount << ":" << ft.Name << std::endl;
- cmCTestLog(this->CTest, HANDLER_OUTPUT,
- "\t" << std::setw(3) << ft.TestCount << " - " << ft.Name
- << " (" << this->GetTestStatus(ft) << ")"
- << std::endl);
+ auto testColor = cmCTest::Color::RED;
+ if (this->GetTestStatus(ft) == "Not Run") {
+ testColor = cmCTest::Color::YELLOW;
+ }
+ cmCTestLog(
+ this->CTest, HANDLER_OUTPUT,
+ "\t" << this->CTest->GetColorCode(testColor) << std::setw(3)
+ << ft.TestCount << " - " << ft.Name << " ("
+ << this->GetTestStatus(ft) << ")"
+ << this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
+ << std::endl);
}
}
}
@@ -1503,7 +1524,7 @@ void cmCTestTestHandler::AddConfigurations(
}
tempPath = filepath + filename;
attempted.push_back(tempPath);
- attemptedConfigs.push_back("");
+ attemptedConfigs.emplace_back();
if (!ctest->GetConfigType().empty()) {
tempPath = filepath;
@@ -1526,32 +1547,32 @@ void cmCTestTestHandler::AddConfigurations(
tempPath += "Release/";
tempPath += filename;
attempted.push_back(tempPath);
- attemptedConfigs.push_back("Release");
+ attemptedConfigs.emplace_back("Release");
tempPath = filepath;
tempPath += "Debug/";
tempPath += filename;
attempted.push_back(tempPath);
- attemptedConfigs.push_back("Debug");
+ attemptedConfigs.emplace_back("Debug");
tempPath = filepath;
tempPath += "MinSizeRel/";
tempPath += filename;
attempted.push_back(tempPath);
- attemptedConfigs.push_back("MinSizeRel");
+ attemptedConfigs.emplace_back("MinSizeRel");
tempPath = filepath;
tempPath += "RelWithDebInfo/";
tempPath += filename;
attempted.push_back(tempPath);
- attemptedConfigs.push_back("RelWithDebInfo");
+ attemptedConfigs.emplace_back("RelWithDebInfo");
tempPath = filepath;
tempPath += "Deployment/";
tempPath += filename;
attempted.push_back(tempPath);
- attemptedConfigs.push_back("Deployment");
+ attemptedConfigs.emplace_back("Deployment");
tempPath = filepath;
tempPath += "Development/";
tempPath += filename;
attempted.push_back(tempPath);
- attemptedConfigs.push_back("Deployment");
+ attemptedConfigs.emplace_back("Deployment");
}
}
@@ -1655,7 +1676,7 @@ void cmCTestTestHandler::GetListOfTests()
}
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"Constructing a list of tests" << std::endl, this->Quiet);
- cmake cm(cmake::RoleScript);
+ cmake cm(cmake::RoleScript, cmState::CTest);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
@@ -1725,7 +1746,7 @@ void cmCTestTestHandler::UseExcludeRegExp()
this->UseExcludeRegExpFirst = !this->UseIncludeRegExpFlag;
}
-const char* cmCTestTestHandler::GetTestStatus(cmCTestTestResult const& result)
+std::string cmCTestTestHandler::GetTestStatus(cmCTestTestResult const& result)
{
static const char* statuses[] = { "Not Run", "Timeout", "SEGFAULT",
"ILLEGAL", "INTERRUPT", "NUMERICAL",
@@ -1737,7 +1758,7 @@ const char* cmCTestTestHandler::GetTestStatus(cmCTestTestResult const& result)
return "No Status";
}
if (status == cmCTestTestHandler::OTHER_FAULT) {
- return result.ExceptionStatus.c_str();
+ return result.ExceptionStatus;
}
return statuses[status];
}
@@ -2126,6 +2147,32 @@ bool cmCTestTestHandler::SetTestsProperties(
for (std::string const& t : tests) {
for (cmCTestTestProperties& rt : this->TestList) {
if (t == rt.Name) {
+ if (key == "_BACKTRACE_TRIPLES") {
+ std::vector<std::string> triples;
+ // allow empty args in the triples
+ cmSystemTools::ExpandListArgument(val, triples, true);
+
+ // Ensure we have complete triples otherwise the data is corrupt.
+ if (triples.size() % 3 == 0) {
+ cmState state;
+ rt.Backtrace = cmListFileBacktrace(state.CreateBaseSnapshot());
+
+ // the first entry represents the top of the trace so we need to
+ // reconstruct the backtrace in reverse
+ for (size_t i = triples.size(); i >= 3; i -= 3) {
+ cmListFileContext fc;
+ fc.FilePath = triples[i - 3];
+ long line = 0;
+ if (!cmSystemTools::StringToLong(triples[i - 2].c_str(),
+ &line)) {
+ line = 0;
+ }
+ fc.Line = line;
+ fc.Name = triples[i - 1];
+ rt.Backtrace = rt.Backtrace.Push(fc);
+ }
+ }
+ }
if (key == "WILL_FAIL") {
rt.WillFail = cmSystemTools::IsOn(val);
}
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index d2694a114..0b557dbcb 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -7,6 +7,7 @@
#include "cmCTestGenericHandler.h"
#include "cmDuration.h"
+#include "cmListFileCache.h"
#include "cmsys/RegularExpression.hxx"
#include <chrono>
@@ -141,6 +142,8 @@ public:
std::set<std::string> FixturesCleanup;
std::set<std::string> FixturesRequired;
std::set<std::string> RequireSuccessDepends;
+ // Private test generator properties used to track backtraces
+ cmListFileBacktrace Backtrace;
};
struct cmCTestTestResult
@@ -274,7 +277,7 @@ private:
*/
std::string FindTheExecutable(const char* exe);
- const char* GetTestStatus(cmCTestTestResult const&);
+ std::string GetTestStatus(cmCTestTestResult const&);
void ExpandTestsToRunInformation(size_t numPossibleTests);
void ExpandTestsToRunInformationForRerunFailed();
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index 57e40ce35..e3b7e9ef3 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -34,9 +34,7 @@ static const char* cmCTestUpdateHandlerUpdateToString(int type)
return cmCTestUpdateHandlerUpdateStrings[type];
}
-cmCTestUpdateHandler::cmCTestUpdateHandler()
-{
-}
+cmCTestUpdateHandler::cmCTestUpdateHandler() = default;
void cmCTestUpdateHandler::Initialize()
{
diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx
index ec78c1e87..2fe2cd347 100644
--- a/Source/CTest/cmCTestUploadCommand.cxx
+++ b/Source/CTest/cmCTestUploadCommand.cxx
@@ -9,8 +9,8 @@
#include "cmCTestGenericHandler.h"
#include "cmCTestUploadHandler.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include "cmake.h"
cmCTestGenericHandler* cmCTestUploadCommand::InitializeHandler()
{
@@ -58,7 +58,7 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
std::ostringstream e;
e << "File \"" << arg << "\" does not exist. Cannot submit "
<< "a non-existent file.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
this->ArgumentDoing = ArgumentDoingError;
return false;
}
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 21c888902..374e73ffb 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -24,9 +24,7 @@ cmCTestVC::cmCTestVC(cmCTest* ct, std::ostream& log)
this->Unknown.Rev = "Unknown";
}
-cmCTestVC::~cmCTestVC()
-{
-}
+cmCTestVC::~cmCTestVC() = default;
void cmCTestVC::SetCommandLineTool(std::string const& tool)
{
@@ -79,13 +77,13 @@ bool cmCTestVC::RunChild(char const* const* cmd, OutputParser* out,
OutputParser* err, const char* workDir,
Encoding encoding)
{
- this->Log << this->ComputeCommandLine(cmd) << "\n";
+ this->Log << cmCTestVC::ComputeCommandLine(cmd) << "\n";
cmsysProcess* cp = cmsysProcess_New();
cmsysProcess_SetCommand(cp, cmd);
workDir = workDir ? workDir : this->SourceDirectory.c_str();
cmsysProcess_SetWorkingDirectory(cp, workDir);
- this->RunProcess(cp, out, err, encoding);
+ cmCTestVC::RunProcess(cp, out, err, encoding);
int result = cmsysProcess_GetExitValue(cp);
cmsysProcess_Delete(cp);
return result == 0;
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx
index 308e6f7a3..63d6a15d8 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -20,7 +20,7 @@ public:
{
}
- virtual ~JSONParser() {}
+ virtual ~JSONParser() = default;
std::string getValue(std::string const& line, int type)
{
diff --git a/Source/CTest/cmParseCoberturaCoverage.cxx b/Source/CTest/cmParseCoberturaCoverage.cxx
index 5bb64247b..848a034c9 100644
--- a/Source/CTest/cmParseCoberturaCoverage.cxx
+++ b/Source/CTest/cmParseCoberturaCoverage.cxx
@@ -13,19 +13,12 @@ class cmParseCoberturaCoverage::XMLParser : public cmXMLParser
{
public:
XMLParser(cmCTest* ctest, cmCTestCoverageHandlerContainer& cont)
- : CTest(ctest)
+ : FilePaths{ cont.SourceDir, cont.BinaryDir }
+ , CTest(ctest)
, Coverage(cont)
{
- this->InSources = false;
- this->InSource = false;
- this->SkipThisClass = false;
- this->FilePaths.push_back(this->Coverage.SourceDir);
- this->FilePaths.push_back(this->Coverage.BinaryDir);
- this->CurFileName.clear();
}
- ~XMLParser() override {}
-
protected:
void EndElement(const std::string& name) override
{
@@ -144,9 +137,9 @@ protected:
}
private:
- bool InSources;
- bool InSource;
- bool SkipThisClass;
+ bool InSources = false;
+ bool InSource = false;
+ bool SkipThisClass = false;
std::vector<std::string> FilePaths;
typedef cmCTestCoverageHandlerContainer::SingleFileCoverageVector
FileLinesType;
diff --git a/Source/CTest/cmParseDelphiCoverage.cxx b/Source/CTest/cmParseDelphiCoverage.cxx
index cc8197951..9eda6f8f3 100644
--- a/Source/CTest/cmParseDelphiCoverage.cxx
+++ b/Source/CTest/cmParseDelphiCoverage.cxx
@@ -20,7 +20,7 @@ public:
{
}
- virtual ~HTMLParser() {}
+ virtual ~HTMLParser() = default;
bool initializeDelphiFile(
std::string const& filename,
@@ -44,7 +44,7 @@ public:
// Check that the begin is the first non-space string on the line
if ((beginPos == line.find_first_not_of(' ')) &&
beginPos != std::string::npos) {
- beginSet.push_back("begin");
+ beginSet.emplace_back("begin");
coverageVector.push_back(-1);
continue;
}
diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx
index 83dde3f75..072275372 100644
--- a/Source/CTest/cmParseGTMCoverage.cxx
+++ b/Source/CTest/cmParseGTMCoverage.cxx
@@ -1,5 +1,6 @@
#include "cmParseGTMCoverage.h"
+#include "cmAlgorithms.h"
#include "cmCTest.h"
#include "cmCTestCoverageHandler.h"
#include "cmSystemTools.h"
@@ -86,6 +87,10 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file)
}
// Find the full path to the file
bool found = this->FindMumpsFile(routine, filepath);
+ if (!found && cmHasLiteralSuffix(routine, "%")) {
+ routine.erase(0, 1);
+ found = this->FindMumpsFile(routine, filepath);
+ }
if (found) {
int lineoffset = 0;
if (this->FindFunctionInMumpsFile(filepath, function, lineoffset)) {
@@ -192,8 +197,8 @@ bool cmParseGTMCoverage::ParseMCOVLine(std::string const& line,
done = true;
}
} else {
- // all chars except ", (, and % get stored in the arg string
- if (cur != '\"' && cur != '(' && cur != '%') {
+ // all chars except " and ( get stored in the arg string
+ if (cur != '\"' && cur != '(') {
arg.append(1, line[pos]);
}
}
diff --git a/Source/CTest/cmParseJacocoCoverage.cxx b/Source/CTest/cmParseJacocoCoverage.cxx
index 31e7cd4d4..b78142a81 100644
--- a/Source/CTest/cmParseJacocoCoverage.cxx
+++ b/Source/CTest/cmParseJacocoCoverage.cxx
@@ -18,13 +18,8 @@ public:
: CTest(ctest)
, Coverage(cont)
{
- this->FilePath.clear();
- this->PackagePath.clear();
- this->PackageName.clear();
}
- ~XMLParser() override {}
-
protected:
void EndElement(const std::string& /*name*/) override {}
@@ -34,6 +29,7 @@ protected:
this->PackageName = atts[1];
this->PackagePath.clear();
} else if (name == "sourcefile") {
+ this->FilePath.clear();
std::string fileName = atts[1];
if (this->PackagePath.empty()) {
diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx
index 18412ba35..4a81ee4f7 100644
--- a/Source/CTest/cmParseMumpsCoverage.cxx
+++ b/Source/CTest/cmParseMumpsCoverage.cxx
@@ -9,6 +9,7 @@
#include <map>
#include <string>
#include <utility>
+#include <vector>
cmParseMumpsCoverage::cmParseMumpsCoverage(
cmCTestCoverageHandlerContainer& cont, cmCTest* ctest)
@@ -17,9 +18,7 @@ cmParseMumpsCoverage::cmParseMumpsCoverage(
{
}
-cmParseMumpsCoverage::~cmParseMumpsCoverage()
-{
-}
+cmParseMumpsCoverage::~cmParseMumpsCoverage() = default;
bool cmParseMumpsCoverage::ReadCoverageFile(const char* file)
{
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index c4cf046cf..70ef8dfcd 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -7,7 +7,6 @@
#include "cmCTestTestHandler.h"
#include "cmsys/Process.h"
-#include <algorithm>
#include <fcntl.h>
#include <iostream>
#include <signal.h>
@@ -15,6 +14,7 @@
#if !defined(_WIN32)
# include <unistd.h>
#endif
+#include <utility>
#define CM_PROCESS_BUF_SIZE 65536
@@ -69,9 +69,7 @@ cmProcess::cmProcess(cmCTestRunTest& runner)
this->StartTime = std::chrono::steady_clock::time_point();
}
-cmProcess::~cmProcess()
-{
-}
+cmProcess::~cmProcess() = default;
void cmProcess::SetCommand(const char* command)
{
diff --git a/Source/Checks/cm_cxx14_check.cpp b/Source/Checks/cm_cxx14_check.cpp
index 9369ba261..fff36c916 100644
--- a/Source/Checks/cm_cxx14_check.cpp
+++ b/Source/Checks/cm_cxx14_check.cpp
@@ -1,8 +1,15 @@
#include <cstdio>
+#include <iterator>
#include <memory>
int main()
{
+ int a[] = { 0, 1, 2 };
+ auto ai = std::cbegin(a);
+
+ int b[] = { 2, 1, 0 };
+ auto bi = std::cend(b);
+
std::unique_ptr<int> u(new int(0));
- return *u;
+ return *u + *ai + *(bi - 1);
}
diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp
index 4e8918454..9ea52c456 100644
--- a/Source/Checks/cm_cxx17_check.cpp
+++ b/Source/Checks/cm_cxx17_check.cpp
@@ -1,9 +1,18 @@
#include <cstdio>
+#include <iterator>
#include <memory>
#include <unordered_map>
int main()
{
+ int a[] = { 0, 1, 2 };
+ auto ai = std::cbegin(a);
+
+ int b[] = { 2, 1, 0 };
+ auto bi = std::cend(b);
+
+ auto ci = std::size(a);
+
std::unique_ptr<int> u(new int(0));
- return *u;
+ return *u + *ai + *(bi - 1) + (3 - static_cast<int>(ci));
}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 1b57fd8e6..fb68ed78c 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -22,10 +22,12 @@ function(cm_check_cxx_feature name)
# Filter out warnings caused by local configuration.
string(REGEX REPLACE "[^\n]*warning:[^\n]*directory not found for option[^\n]*" "" check_output "${check_output}")
string(REGEX REPLACE "[^\n]*warning:[^\n]*object file compiled with -mlong-branch which is no longer needed[^\n]*" "" check_output "${check_output}")
+ # Filter out other warnings unrelated to feature checks.
+ string(REGEX REPLACE "[^\n]*warning:[^\n]*sprintf\\(\\) is often misused, please use snprintf[^\n]*" "" check_output "${check_output}")
# Filter out xcodebuild warnings.
string(REGEX REPLACE "[^\n]* xcodebuild\\[[0-9]*:[0-9]*\\] warning: [^\n]*" "" check_output "${check_output}")
# If using the feature causes warnings, treat it as broken/unavailable.
- if(check_output MATCHES "[Ww]arning")
+ if(check_output MATCHES "(^|[ :])[Ww][Aa][Rr][Nn][Ii][Nn][Gg]")
set(CMake_HAVE_CXX_${FEATURE} OFF CACHE INTERNAL "TRY_COMPILE" FORCE)
endif()
if(CMake_HAVE_CXX_${FEATURE})
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx
index a3e071716..f2982a62c 100644
--- a/Source/CursesDialog/ccmake.cxx
+++ b/Source/CursesDialog/ccmake.cxx
@@ -5,7 +5,8 @@
#include "cmCursesMainForm.h"
#include "cmCursesStandardIncludes.h"
#include "cmDocumentation.h"
-#include "cmDocumentationEntry.h"
+#include "cmDocumentationEntry.h" // IWYU pragma: keep
+#include "cmState.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -64,13 +65,6 @@ void onsig(int /*unused*/)
}
}
-void CMakeMessageHandler(const char* message, const char* title,
- bool& /*unused*/, void* clientData)
-{
- cmCursesForm* self = static_cast<cmCursesForm*>(clientData);
- self->AddError(message, title);
-}
-
int main(int argc, char const* const* argv)
{
cmsys::Encoding::CommandLineArguments encoding_args =
@@ -83,19 +77,18 @@ int main(int argc, char const* const* argv)
cmDocumentation doc;
doc.addCMakeStandardDocSections();
if (doc.CheckOptions(argc, argv)) {
- cmake hcm(cmake::RoleInternal);
+ cmake hcm(cmake::RoleInternal, cmState::Unknown);
hcm.SetHomeDirectory("");
hcm.SetHomeOutputDirectory("");
hcm.AddCMakePaths();
- std::vector<cmDocumentationEntry> generators;
- hcm.GetGeneratorDocumentation(generators);
+ auto generators = hcm.GetGeneratorsDocumentation();
doc.SetName("ccmake");
doc.SetSection("Name", cmDocumentationName);
doc.SetSection("Usage", cmDocumentationUsage);
if (argc == 1) {
doc.AppendSection("Usage", cmDocumentationUsageNote);
}
- doc.SetSection("Generators", generators);
+ doc.AppendSection("Generators", generators);
doc.PrependSection("Options", cmDocumentationOptions);
return doc.PrintRequestedDocumentation(std::cout) ? 0 : 1;
}
@@ -108,7 +101,7 @@ int main(int argc, char const* const* argv)
if (strcmp(argv[j], "-debug") == 0) {
debug = true;
} else {
- args.push_back(argv[j]);
+ args.emplace_back(argv[j]);
}
}
@@ -156,7 +149,10 @@ int main(int argc, char const* const* argv)
return 1;
}
- cmSystemTools::SetMessageCallback(CMakeMessageHandler, myform);
+ cmSystemTools::SetMessageCallback(
+ [myform](const char* message, const char* title) {
+ myform->AddError(message, title);
+ });
cmCursesForm::CurrentForm = myform;
diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h
index cdb9478e1..8c9625635 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.h
+++ b/Source/CursesDialog/cmCursesBoolWidget.h
@@ -12,11 +12,12 @@ class cmCursesMainForm;
class cmCursesBoolWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesBoolWidget)
-
public:
cmCursesBoolWidget(int width, int height, int left, int top);
+ cmCursesBoolWidget(cmCursesBoolWidget const&) = delete;
+ cmCursesBoolWidget& operator=(cmCursesBoolWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h
index 54b2f1fd1..0a69d3a9b 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.h
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h
@@ -13,14 +13,17 @@ class cmake;
class cmCursesCacheEntryComposite
{
- CM_DISABLE_COPY(cmCursesCacheEntryComposite)
-
public:
cmCursesCacheEntryComposite(const std::string& key, int labelwidth,
int entrywidth);
cmCursesCacheEntryComposite(const std::string& key, cmake* cm, bool isNew,
int labelwidth, int entrywidth);
~cmCursesCacheEntryComposite();
+
+ cmCursesCacheEntryComposite(cmCursesCacheEntryComposite const&) = delete;
+ cmCursesCacheEntryComposite& operator=(cmCursesCacheEntryComposite const&) =
+ delete;
+
const char* GetValue();
friend class cmCursesMainForm;
diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h
index c509ae773..07b7288ab 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.h
+++ b/Source/CursesDialog/cmCursesDummyWidget.h
@@ -12,11 +12,12 @@ class cmCursesMainForm;
class cmCursesDummyWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesDummyWidget)
-
public:
cmCursesDummyWidget(int width, int height, int left, int top);
+ cmCursesDummyWidget(cmCursesDummyWidget const&) = delete;
+ cmCursesDummyWidget& operator=(cmCursesDummyWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesFilePathWidget.h b/Source/CursesDialog/cmCursesFilePathWidget.h
index 0a304023e..3f71259d5 100644
--- a/Source/CursesDialog/cmCursesFilePathWidget.h
+++ b/Source/CursesDialog/cmCursesFilePathWidget.h
@@ -9,10 +9,11 @@
class cmCursesFilePathWidget : public cmCursesPathWidget
{
- CM_DISABLE_COPY(cmCursesFilePathWidget)
-
public:
cmCursesFilePathWidget(int width, int height, int left, int top);
+
+ cmCursesFilePathWidget(cmCursesFilePathWidget const&) = delete;
+ cmCursesFilePathWidget& operator=(cmCursesFilePathWidget const&) = delete;
};
#endif // cmCursesFilePathWidget_h
diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h
index 249b34936..ddb67deeb 100644
--- a/Source/CursesDialog/cmCursesForm.h
+++ b/Source/CursesDialog/cmCursesForm.h
@@ -11,12 +11,13 @@
class cmCursesForm
{
- CM_DISABLE_COPY(cmCursesForm)
-
public:
cmCursesForm();
virtual ~cmCursesForm();
+ cmCursesForm(cmCursesForm const&) = delete;
+ cmCursesForm& operator=(cmCursesForm const&) = delete;
+
// Description:
// Handle user input.
virtual void HandleInput() = 0;
diff --git a/Source/CursesDialog/cmCursesLabelWidget.cxx b/Source/CursesDialog/cmCursesLabelWidget.cxx
index 1dfd4ce47..83aea5a2c 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.cxx
+++ b/Source/CursesDialog/cmCursesLabelWidget.cxx
@@ -14,9 +14,7 @@ cmCursesLabelWidget::cmCursesLabelWidget(int width, int height, int left,
this->SetValue(name);
}
-cmCursesLabelWidget::~cmCursesLabelWidget()
-{
-}
+cmCursesLabelWidget::~cmCursesLabelWidget() = default;
bool cmCursesLabelWidget::HandleInput(int& /*key*/, cmCursesMainForm* /*fm*/,
WINDOW* /*w*/)
diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h
index aab559b16..2ee9cfca8 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.h
+++ b/Source/CursesDialog/cmCursesLabelWidget.h
@@ -14,13 +14,14 @@ class cmCursesMainForm;
class cmCursesLabelWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesLabelWidget)
-
public:
cmCursesLabelWidget(int width, int height, int left, int top,
const std::string& name);
~cmCursesLabelWidget() override;
+ cmCursesLabelWidget(cmCursesLabelWidget const&) = delete;
+ cmCursesLabelWidget& operator=(cmCursesLabelWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h
index 2bcc15a20..466b4e1b0 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.h
+++ b/Source/CursesDialog/cmCursesLongMessageForm.h
@@ -13,13 +13,14 @@
class cmCursesLongMessageForm : public cmCursesForm
{
- CM_DISABLE_COPY(cmCursesLongMessageForm)
-
public:
cmCursesLongMessageForm(std::vector<std::string> const& messages,
const char* title);
~cmCursesLongMessageForm() override;
+ cmCursesLongMessageForm(cmCursesLongMessageForm const&) = delete;
+ cmCursesLongMessageForm& operator=(cmCursesLongMessageForm const&) = delete;
+
// Description:
// Handle user input.
void HandleInput() override;
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 931797a46..8ca7802f1 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -20,15 +20,16 @@
#include <algorithm>
#include <stdio.h>
#include <string.h>
+#include <utility>
inline int ctrl(int z)
{
return (z & 037);
}
-cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
+cmCursesMainForm::cmCursesMainForm(std::vector<std::string> args,
int initWidth)
- : Args(args)
+ : Args(std::move(args))
, InitialWidth(initWidth)
{
this->NumberOfPages = 0;
@@ -37,11 +38,11 @@ cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
this->AdvancedMode = false;
this->NumberOfVisibleEntries = 0;
this->OkToGenerate = false;
- this->HelpMessage.push_back(
+ this->HelpMessage.emplace_back(
"Welcome to ccmake, curses based user interface for CMake.");
- this->HelpMessage.push_back("");
- this->HelpMessage.push_back(s_ConstHelpMessage);
- this->CMakeInstance = new cmake(cmake::RoleProject);
+ this->HelpMessage.emplace_back();
+ this->HelpMessage.emplace_back(s_ConstHelpMessage);
+ this->CMakeInstance = new cmake(cmake::RoleProject, cmState::Project);
this->CMakeInstance->SetCMakeEditCommand(
cmSystemTools::GetCMakeCursesCommand());
@@ -505,12 +506,8 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
pos_form_cursor(this->Form);
}
-void cmCursesMainForm::UpdateProgress(const char* msg, float prog, void* vp)
+void cmCursesMainForm::UpdateProgress(const char* msg, float prog)
{
- cmCursesMainForm* cm = static_cast<cmCursesMainForm*>(vp);
- if (!cm) {
- return;
- }
char tmp[1024];
const char* cmsg = tmp;
if (prog >= 0) {
@@ -518,8 +515,8 @@ void cmCursesMainForm::UpdateProgress(const char* msg, float prog, void* vp)
} else {
cmsg = msg;
}
- cm->UpdateStatusBar(cmsg);
- cm->PrintKeys(1);
+ this->UpdateStatusBar(cmsg);
+ this->PrintKeys(1);
curses_move(1, 1);
touchwin(stdscr);
refresh();
@@ -535,8 +532,8 @@ int cmCursesMainForm::Configure(int noconfigure)
this->PrintKeys(1);
touchwin(stdscr);
refresh();
- this->CMakeInstance->SetProgressCallback(cmCursesMainForm::UpdateProgress,
- this);
+ this->CMakeInstance->SetProgressCallback(
+ [this](const char* msg, float prog) { this->UpdateProgress(msg, prog); });
// always save the current gui values to disk
this->FillCacheManagerFromUI();
@@ -559,7 +556,7 @@ int cmCursesMainForm::Configure(int noconfigure)
} else {
retVal = this->CMakeInstance->Configure();
}
- this->CMakeInstance->SetProgressCallback(nullptr, nullptr);
+ this->CMakeInstance->SetProgressCallback(nullptr);
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
@@ -605,8 +602,8 @@ int cmCursesMainForm::Generate()
this->PrintKeys(1);
touchwin(stdscr);
refresh();
- this->CMakeInstance->SetProgressCallback(cmCursesMainForm::UpdateProgress,
- this);
+ this->CMakeInstance->SetProgressCallback(
+ [this](const char* msg, float prog) { this->UpdateProgress(msg, prog); });
// Get rid of previous errors
this->Errors = std::vector<std::string>();
@@ -614,7 +611,7 @@ int cmCursesMainForm::Generate()
// run the generate process
int retVal = this->CMakeInstance->Generate();
- this->CMakeInstance->SetProgressCallback(nullptr, nullptr);
+ this->CMakeInstance->SetProgressCallback(nullptr);
keypad(stdscr, true); /* Use key symbols as KEY_DOWN */
if (retVal != 0 || !this->Errors.empty()) {
@@ -652,7 +649,7 @@ int cmCursesMainForm::Generate()
void cmCursesMainForm::AddError(const char* message, const char* /*unused*/)
{
- this->Errors.push_back(message);
+ this->Errors.emplace_back(message);
}
void cmCursesMainForm::RemoveEntry(const char* value)
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 2c006cfb8..cc6482fd3 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -23,12 +23,13 @@ class cmake;
*/
class cmCursesMainForm : public cmCursesForm
{
- CM_DISABLE_COPY(cmCursesMainForm)
-
public:
- cmCursesMainForm(std::vector<std::string> const& args, int initwidth);
+ cmCursesMainForm(std::vector<std::string> args, int initwidth);
~cmCursesMainForm() override;
+ cmCursesMainForm(cmCursesMainForm const&) = delete;
+ cmCursesMainForm& operator=(cmCursesMainForm const&) = delete;
+
/**
* Set the widgets which represent the cache entries.
*/
@@ -101,8 +102,7 @@ public:
/**
* Progress callback
*/
- static void UpdateProgressOld(const char* msg, float prog, void*);
- static void UpdateProgress(const char* msg, float prog, void*);
+ void UpdateProgress(const char* msg, float prog);
protected:
// Copy the cache values from the user interface to the actual
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h
index 3e50e2d4c..0128d6a42 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.h
+++ b/Source/CursesDialog/cmCursesOptionsWidget.h
@@ -15,11 +15,12 @@ class cmCursesMainForm;
class cmCursesOptionsWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesOptionsWidget)
-
public:
cmCursesOptionsWidget(int width, int height, int left, int top);
+ cmCursesOptionsWidget(cmCursesOptionsWidget const&) = delete;
+ cmCursesOptionsWidget& operator=(cmCursesOptionsWidget const&) = delete;
+
// Description:
// Handle user input. Called by the container of this widget
// when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesPathWidget.h b/Source/CursesDialog/cmCursesPathWidget.h
index bfa0ea343..1eace03a6 100644
--- a/Source/CursesDialog/cmCursesPathWidget.h
+++ b/Source/CursesDialog/cmCursesPathWidget.h
@@ -14,11 +14,12 @@ class cmCursesMainForm;
class cmCursesPathWidget : public cmCursesStringWidget
{
- CM_DISABLE_COPY(cmCursesPathWidget)
-
public:
cmCursesPathWidget(int width, int height, int left, int top);
+ cmCursesPathWidget(cmCursesPathWidget const&) = delete;
+ cmCursesPathWidget& operator=(cmCursesPathWidget const&) = delete;
+
/**
* This method is called when different keys are pressed. The
* subclass can have a special implementation handler for this.
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index 90310f612..021515ba3 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -20,11 +20,12 @@ class cmCursesMainForm;
class cmCursesStringWidget : public cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesStringWidget)
-
public:
cmCursesStringWidget(int width, int height, int left, int top);
+ cmCursesStringWidget(cmCursesStringWidget const&) = delete;
+ cmCursesStringWidget& operator=(cmCursesStringWidget const&) = delete;
+
/**
* Handle user input. Called by the container of this widget
* when this widget has focus. Returns true if the input was
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index a44c5e6b6..f761f6d8a 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -14,12 +14,13 @@ class cmCursesMainForm;
class cmCursesWidget
{
- CM_DISABLE_COPY(cmCursesWidget)
-
public:
cmCursesWidget(int width, int height, int left, int top);
virtual ~cmCursesWidget();
+ cmCursesWidget(cmCursesWidget const&) = delete;
+ cmCursesWidget& operator=(cmCursesWidget const&) = delete;
+
/**
* Handle user input. Called by the container of this widget
* when this widget has focus. Returns true if the input was
diff --git a/Source/LexerParser/cmCommandArgumentLexer.cxx b/Source/LexerParser/cmCommandArgumentLexer.cxx
index 6b4fc85f2..58799123f 100644
--- a/Source/LexerParser/cmCommandArgumentLexer.cxx
+++ b/Source/LexerParser/cmCommandArgumentLexer.cxx
@@ -664,12 +664,14 @@ Modify cmCommandArgumentLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmCommandArgumentParserHelper.h"
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = yyextra->LexInput(buf, max_size); }
+ do { result = yyextra->LexInput(buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmCommandArgumentParserTokens.h"
@@ -2246,3 +2248,5 @@ void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
BEGIN(ESCAPES);
}
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmCommandArgumentLexer.in.l b/Source/LexerParser/cmCommandArgumentLexer.in.l
index 5927b9ed3..010d54bf5 100644
--- a/Source/LexerParser/cmCommandArgumentLexer.in.l
+++ b/Source/LexerParser/cmCommandArgumentLexer.in.l
@@ -18,12 +18,14 @@ Modify cmCommandArgumentLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmCommandArgumentParserHelper.h"
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = yyextra->LexInput(buf, max_size); }
+ do { result = yyextra->LexInput(buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmCommandArgumentParserTokens.h"
@@ -145,3 +147,5 @@ void cmCommandArgument_SetupEscapes(yyscan_t yyscanner, bool noEscapes)
BEGIN(ESCAPES);
}
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmDependsJavaLexer.cxx b/Source/LexerParser/cmDependsJavaLexer.cxx
index 36cac61f9..d703e3c95 100644
--- a/Source/LexerParser/cmDependsJavaLexer.cxx
+++ b/Source/LexerParser/cmDependsJavaLexer.cxx
@@ -860,6 +860,8 @@ Modify cmDependsJavaLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include <iostream>
#include "cmDependsJavaParserHelper.h"
@@ -867,7 +869,7 @@ Modify cmDependsJavaLexer.cxx:
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = yyextra->LexInput(buf, max_size); }
+ do { result = yyextra->LexInput(buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmDependsJavaParserTokens.h"
@@ -2811,3 +2813,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
}
#define YYTABLES_NAME "yytables"
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmDependsJavaLexer.in.l b/Source/LexerParser/cmDependsJavaLexer.in.l
index 01a0fa302..3dd3c224a 100644
--- a/Source/LexerParser/cmDependsJavaLexer.in.l
+++ b/Source/LexerParser/cmDependsJavaLexer.in.l
@@ -18,6 +18,8 @@ Modify cmDependsJavaLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include <iostream>
#include "cmDependsJavaParserHelper.h"
@@ -25,7 +27,7 @@ Modify cmDependsJavaLexer.cxx:
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = yyextra->LexInput(buf, max_size); }
+ do { result = yyextra->LexInput(buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmDependsJavaParserTokens.h"
@@ -173,3 +175,7 @@ null { PRIMITIVE; return jp_NULLLITERAL; }
}
%%
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmDependsJavaParser.cxx b/Source/LexerParser/cmDependsJavaParser.cxx
index 5400a10e7..e83afa9ea 100644
--- a/Source/LexerParser/cmDependsJavaParser.cxx
+++ b/Source/LexerParser/cmDependsJavaParser.cxx
@@ -107,7 +107,7 @@ static void cmDependsJava_yyerror(yyscan_t yyscanner, const char* message);
#define YYMAXDEPTH 1000000
-#define jpCheckEmpty(cnt) yyGetParser->CheckEmpty(__LINE__, cnt, yyvsp);
+#define jpCheckEmpty(cnt) yyGetParser->CheckEmpty(__LINE__, cnt, yyvsp)
#define jpElementStart(cnt) yyGetParser->PrepareElement(&yyval)
#define jpStoreClass(str) yyGetParser->AddClassFound(str); yyGetParser->DeallocateParserType(&(str))
/* Disable some warnings in the generated code. */
diff --git a/Source/LexerParser/cmDependsJavaParser.y b/Source/LexerParser/cmDependsJavaParser.y
index a4e9c5d17..d15cffc56 100644
--- a/Source/LexerParser/cmDependsJavaParser.y
+++ b/Source/LexerParser/cmDependsJavaParser.y
@@ -36,7 +36,7 @@ static void cmDependsJava_yyerror(yyscan_t yyscanner, const char* message);
#define YYMAXDEPTH 1000000
-#define jpCheckEmpty(cnt) yyGetParser->CheckEmpty(__LINE__, cnt, yyvsp);
+#define jpCheckEmpty(cnt) yyGetParser->CheckEmpty(__LINE__, cnt, yyvsp)
#define jpElementStart(cnt) yyGetParser->PrepareElement(&yyval)
#define jpStoreClass(str) yyGetParser->AddClassFound(str); yyGetParser->DeallocateParserType(&(str))
/* Disable some warnings in the generated code. */
diff --git a/Source/LexerParser/cmExprLexer.cxx b/Source/LexerParser/cmExprLexer.cxx
index cb246873e..72e59b689 100644
--- a/Source/LexerParser/cmExprLexer.cxx
+++ b/Source/LexerParser/cmExprLexer.cxx
@@ -664,12 +664,14 @@ Modify cmExprLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmExprParserHelper.h"
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = yyextra->LexInput(buf, max_size); }
+ do { result = yyextra->LexInput(buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmExprParserTokens.h"
@@ -2223,3 +2225,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
}
#define YYTABLES_NAME "yytables"
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmExprLexer.in.l b/Source/LexerParser/cmExprLexer.in.l
index 2197c2ae5..f8a422431 100644
--- a/Source/LexerParser/cmExprLexer.in.l
+++ b/Source/LexerParser/cmExprLexer.in.l
@@ -18,12 +18,14 @@ Modify cmExprLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#include "cmExprParserHelper.h"
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = yyextra->LexInput(buf, max_size); }
+ do { result = yyextra->LexInput(buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmExprParserTokens.h"
@@ -61,3 +63,7 @@ Modify cmExprLexer.cxx:
. { yyextra->UnexpectedChar(yytext[0]); }
%%
+
+/*--------------------------------------------------------------------------*/
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmFortranLexer.cxx b/Source/LexerParser/cmFortranLexer.cxx
index 82048df1d..bcda77c30 100644
--- a/Source/LexerParser/cmFortranLexer.cxx
+++ b/Source/LexerParser/cmFortranLexer.cxx
@@ -838,6 +838,8 @@ Modify cmFortranLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#undef YY_NO_UNPUT
#define cmFortranLexer_cxx
@@ -846,7 +848,7 @@ Modify cmFortranLexer.cxx:
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = cmFortranParser_Input(yyextra, buf, max_size); }
+ do { result = cmFortranParser_Input(yyextra, buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmFortranParserTokens.h"
@@ -2610,3 +2612,5 @@ YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return YY_CURRENT_BUFFER;
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmFortranLexer.in.l b/Source/LexerParser/cmFortranLexer.in.l
index b7e837be0..3d38a7dad 100644
--- a/Source/LexerParser/cmFortranLexer.in.l
+++ b/Source/LexerParser/cmFortranLexer.in.l
@@ -27,6 +27,8 @@ Modify cmFortranLexer.cxx:
/* IWYU pragma: no_forward_declare yyguts_t */
+#ifndef __clang_analyzer__ /* Suppress clang scan-build warnings */
+
#undef YY_NO_UNPUT
#define cmFortranLexer_cxx
@@ -35,7 +37,7 @@ Modify cmFortranLexer.cxx:
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = cmFortranParser_Input(yyextra, buf, max_size); }
+ do { result = cmFortranParser_Input(yyextra, buf, max_size); } while (0)
/* Include the set of tokens from the parser. */
#include "cmFortranParserTokens.h"
@@ -183,3 +185,5 @@ YY_BUFFER_STATE cmFortranLexer_GetCurrentBuffer(yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return YY_CURRENT_BUFFER;
}
+
+#endif /* __clang_analyzer__ */
diff --git a/Source/LexerParser/cmListFileLexer.c b/Source/LexerParser/cmListFileLexer.c
index eb373373f..15dcda04a 100644
--- a/Source/LexerParser/cmListFileLexer.c
+++ b/Source/LexerParser/cmListFileLexer.c
@@ -766,7 +766,7 @@ Modify cmListFileLexer.c:
/* IWYU pragma: no_forward_declare yyguts_t */
-#ifdef WIN32
+#ifdef _WIN32
#include "cmsys/Encoding.h"
#endif
@@ -805,7 +805,7 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = cmListFileLexerInput(cmListFileLexer_yyget_extra(yyscanner), buf, max_size); }
+ do { result = cmListFileLexerInput(cmListFileLexer_yyget_extra(yyscanner), buf, max_size); } while (0)
/*--------------------------------------------------------------------------*/
diff --git a/Source/LexerParser/cmListFileLexer.in.l b/Source/LexerParser/cmListFileLexer.in.l
index 23c7e4915..fdf14d2d3 100644
--- a/Source/LexerParser/cmListFileLexer.in.l
+++ b/Source/LexerParser/cmListFileLexer.in.l
@@ -18,7 +18,7 @@ Modify cmListFileLexer.c:
/* IWYU pragma: no_forward_declare yyguts_t */
-#ifdef WIN32
+#ifdef _WIN32
#include "cmsys/Encoding.h"
#endif
@@ -57,7 +57,7 @@ static void cmListFileLexerDestroy(cmListFileLexer* lexer);
/* Replace the lexer input function. */
#undef YY_INPUT
#define YY_INPUT(buf, result, max_size) \
- { result = cmListFileLexerInput(cmListFileLexer_yyget_extra(yyscanner), buf, max_size); }
+ do { result = cmListFileLexerInput(cmListFileLexer_yyget_extra(yyscanner), buf, max_size); } while (0)
/*--------------------------------------------------------------------------*/
%}
diff --git a/Source/QtDialog/AddCacheEntry.cxx b/Source/QtDialog/AddCacheEntry.cxx
index 6284ac946..f5e0777bf 100644
--- a/Source/QtDialog/AddCacheEntry.cxx
+++ b/Source/QtDialog/AddCacheEntry.cxx
@@ -21,8 +21,8 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames,
, VarTypes(varTypes)
{
this->setupUi(this);
- for (int i = 0; i < NumTypes; i++) {
- this->Type->addItem(TypeStrings[i]);
+ for (auto const& elem : TypeStrings) {
+ this->Type->addItem(elem);
}
QWidget* cb = new QCheckBox();
QWidget* path = new QCMakePathEditor();
@@ -32,12 +32,12 @@ AddCacheEntry::AddCacheEntry(QWidget* p, const QStringList& varNames,
this->StackedWidget->addWidget(path);
this->StackedWidget->addWidget(filepath);
this->StackedWidget->addWidget(string);
- this->setTabOrder(this->Name, this->Type);
- this->setTabOrder(this->Type, cb);
- this->setTabOrder(cb, path);
- this->setTabOrder(path, filepath);
- this->setTabOrder(filepath, string);
- this->setTabOrder(string, this->Description);
+ AddCacheEntry::setTabOrder(this->Name, this->Type);
+ AddCacheEntry::setTabOrder(this->Type, cb);
+ AddCacheEntry::setTabOrder(cb, path);
+ AddCacheEntry::setTabOrder(path, filepath);
+ AddCacheEntry::setTabOrder(filepath, string);
+ AddCacheEntry::setTabOrder(string, this->Description);
QCompleter* completer = new QCompleter(this->VarNames, this);
this->Name->setCompleter(completer);
connect(completer, SIGNAL(activated(const QString&)), this,
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 330b74729..9ce032384 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -19,9 +19,20 @@ if (Qt5Widgets_FOUND)
macro(qt4_add_resources)
qt5_add_resources(${ARGN})
endmacro()
+
set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
set(QT_QTMAIN_LIBRARY ${Qt5Core_QTMAIN_LIBRARIES})
+ # Try to find the package WinExtras for the task bar progress
+ if(WIN32)
+ find_package(Qt5WinExtras QUIET)
+ if (Qt5WinExtras_FOUND)
+ include_directories(${Qt5WinExtras_INCLUDE_DIRS})
+ add_definitions(-DQT_WINEXTRAS)
+ list(APPEND CMake_QT_LIBRARIES ${Qt5WinExtras_LIBRARIES})
+ endif()
+ endif()
+
# Remove this when the minimum version of Qt is 4.6.
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx
index 7b980a01f..cd30ad547 100644
--- a/Source/QtDialog/CMakeSetup.cxx
+++ b/Source/QtDialog/CMakeSetup.cxx
@@ -30,7 +30,8 @@ static const char* cmDocumentationUsage[][2] = {
{ nullptr,
" cmake-gui [options]\n"
" cmake-gui [options] <path-to-source>\n"
- " cmake-gui [options] <path-to-existing-build>" },
+ " cmake-gui [options] <path-to-existing-build>\n"
+ " cmake-gui [options] -S <path-to-source> -B <path-to-build>\n" },
{ nullptr, nullptr }
};
@@ -64,13 +65,12 @@ int main(int argc, char** argv)
doc.addCMakeStandardDocSections();
if (argc2 > 1 && doc.CheckOptions(argc2, argv2)) {
// Construct and print requested documentation.
- cmake hcm(cmake::RoleInternal);
+ cmake hcm(cmake::RoleInternal, cmState::Unknown);
hcm.SetHomeDirectory("");
hcm.SetHomeOutputDirectory("");
hcm.AddCMakePaths();
- std::vector<cmDocumentationEntry> generators;
- hcm.GetGeneratorDocumentation(generators);
+ auto generators = hcm.GetGeneratorsDocumentation();
doc.SetName("cmake");
doc.SetSection("Name", cmDocumentationName);
doc.SetSection("Usage", cmDocumentationUsage);
@@ -130,36 +130,66 @@ int main(int argc, char** argv)
QTranslator translator;
QString transfile = QString("cmake_%1").arg(QLocale::system().name());
translator.load(transfile, translationsDir.path());
- app.installTranslator(&translator);
+ QApplication::installTranslator(&translator);
// app setup
- app.setApplicationName("CMakeSetup");
- app.setOrganizationName("Kitware");
+ QApplication::setApplicationName("CMakeSetup");
+ QApplication::setOrganizationName("Kitware");
QIcon appIcon;
appIcon.addFile(":/Icons/CMakeSetup32.png");
appIcon.addFile(":/Icons/CMakeSetup128.png");
- app.setWindowIcon(appIcon);
+ QApplication::setWindowIcon(appIcon);
CMakeSetupDialog dialog;
dialog.show();
- cmsys::CommandLineArguments arg;
- arg.Initialize(argc2, argv2);
+ QStringList args = QApplication::arguments();
std::string binaryDirectory;
std::string sourceDirectory;
- typedef cmsys::CommandLineArguments argT;
- arg.AddArgument("-B", argT::CONCAT_ARGUMENT, &binaryDirectory,
- "Binary Directory");
- arg.AddArgument("-S", argT::CONCAT_ARGUMENT, &sourceDirectory,
- "Source Directory");
- // do not complain about unknown options
- arg.StoreUnusedArguments(true);
- arg.Parse();
+ for (int i = 1; i < args.size(); ++i) {
+ const QString& arg = args[i];
+ if (arg.startsWith("-S")) {
+ QString path = arg.mid(2);
+ if (path.isEmpty()) {
+ ++i;
+ if (i >= args.size()) {
+ std::cerr << "No source directory specified for -S" << std::endl;
+ return 1;
+ }
+ path = args[i];
+ if (path[0] == '-') {
+ std::cerr << "No source directory specified for -S" << std::endl;
+ return 1;
+ }
+ }
+
+ sourceDirectory =
+ cmSystemTools::CollapseFullPath(path.toLocal8Bit().data());
+ cmSystemTools::ConvertToUnixSlashes(sourceDirectory);
+ } else if (arg.startsWith("-B")) {
+ QString path = arg.mid(2);
+ if (path.isEmpty()) {
+ ++i;
+ if (i >= args.size()) {
+ std::cerr << "No build directory specified for -B" << std::endl;
+ return 1;
+ }
+ path = args[i];
+ if (path[0] == '-') {
+ std::cerr << "No build directory specified for -B" << std::endl;
+ return 1;
+ }
+ }
+
+ binaryDirectory =
+ cmSystemTools::CollapseFullPath(path.toLocal8Bit().data());
+ cmSystemTools::ConvertToUnixSlashes(binaryDirectory);
+ }
+ }
if (!sourceDirectory.empty() && !binaryDirectory.empty()) {
dialog.setSourceDirectory(QString::fromLocal8Bit(sourceDirectory.c_str()));
dialog.setBinaryDirectory(QString::fromLocal8Bit(binaryDirectory.c_str()));
} else {
- QStringList args = app.arguments();
if (args.count() == 2) {
std::string filePath =
cmSystemTools::CollapseFullPath(args[1].toLocal8Bit().data());
@@ -189,7 +219,7 @@ int main(int argc, char** argv)
}
}
- return app.exec();
+ return QApplication::exec();
}
#if defined(Q_OS_MAC)
@@ -216,12 +246,11 @@ static bool cmOSXInstall(std::string const& dir, std::string const& tool)
if (symlink(tool.c_str(), link.c_str()) == 0) {
std::cerr << "Linked: '" << link << "' -> '" << tool << "'\n";
return true;
- } else {
- int err = errno;
- std::cerr << "Failed: '" << link << "' -> '" << tool
- << "': " << strerror(err) << "\n";
- return false;
}
+ int err = errno;
+ std::cerr << "Failed: '" << link << "' -> '" << tool
+ << "': " << strerror(err) << "\n";
+ return false;
}
static int cmOSXInstall(std::string dir)
{
diff --git a/Source/QtDialog/CMakeSetup128.png b/Source/QtDialog/CMakeSetup128.png
index 728ef0269..32984e104 100644
--- a/Source/QtDialog/CMakeSetup128.png
+++ b/Source/QtDialog/CMakeSetup128.png
Binary files differ
diff --git a/Source/QtDialog/CMakeSetup32.png b/Source/QtDialog/CMakeSetup32.png
index 1c36b31d0..78df82f15 100644
--- a/Source/QtDialog/CMakeSetup32.png
+++ b/Source/QtDialog/CMakeSetup32.png
Binary files differ
diff --git a/Source/QtDialog/CMakeSetup64.png b/Source/QtDialog/CMakeSetup64.png
index 44eb17173..5c2dbf552 100644
--- a/Source/QtDialog/CMakeSetup64.png
+++ b/Source/QtDialog/CMakeSetup64.png
Binary files differ
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index 3761bd363..72cce9f50 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -21,6 +21,11 @@
#include <QToolButton>
#include <QUrl>
+#ifdef QT_WINEXTRAS
+# include <QWinTaskbarButton>
+# include <QWinTaskbarProgress>
+#endif
+
#include "AddCacheEntry.h"
#include "FirstConfigure.h"
#include "QCMake.h"
@@ -294,6 +299,12 @@ void CMakeSetupDialog::initialize()
} else {
this->onBinaryDirectoryChanged(this->BinaryDirectory->lineEdit()->text());
}
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton = new QWinTaskbarButton(this);
+ this->TaskbarButton->setWindow(this->windowHandle());
+ this->TaskbarButton->setOverlayIcon(QIcon(":/loading.png"));
+#endif
}
CMakeSetupDialog::~CMakeSetupDialog()
@@ -381,6 +392,10 @@ void CMakeSetupDialog::doConfigure()
this->CacheValues->scrollToTop();
}
this->ProgressBar->reset();
+
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
}
bool CMakeSetupDialog::doConfigureInternal()
@@ -495,6 +510,9 @@ void CMakeSetupDialog::doGenerate()
this->enterState(ReadyConfigure);
this->ProgressBar->reset();
+#ifdef QT_WINEXTRAS
+ this->TaskbarButton->progress()->reset();
+#endif
this->ConfigureNeeded = true;
}
@@ -674,6 +692,12 @@ void CMakeSetupDialog::showProgress(const QString& /*msg*/, float percent)
{
percent = (percent * ProgressFactor) + ProgressOffset;
this->ProgressBar->setValue(qRound(percent * 100));
+
+#ifdef QT_WINEXTRAS
+ QWinTaskbarProgress* progress = this->TaskbarButton->progress();
+ progress->setVisible(true);
+ progress->setValue(qRound(percent * 100));
+#endif
}
void CMakeSetupDialog::error(const QString& msg)
@@ -727,6 +751,7 @@ bool CMakeSetupDialog::setupFirstConfigure()
if (dialog.exec() == QDialog::Accepted) {
dialog.saveToSettings();
this->CMakeThread->cmakeInstance()->setGenerator(dialog.getGenerator());
+ this->CMakeThread->cmakeInstance()->setPlatform(dialog.getPlatform());
this->CMakeThread->cmakeInstance()->setToolset(dialog.getToolset());
QCMakeCacheModel* m = this->CacheValues->cacheModel();
diff --git a/Source/QtDialog/CMakeSetupDialog.h b/Source/QtDialog/CMakeSetupDialog.h
index 1cce35c0b..39c1053cb 100644
--- a/Source/QtDialog/CMakeSetupDialog.h
+++ b/Source/QtDialog/CMakeSetupDialog.h
@@ -15,6 +15,10 @@ class CMakeCacheModel;
class QProgressBar;
class QToolButton;
+#ifdef QT_WINEXTRAS
+class QWinTaskbarButton;
+#endif
+
/// Qt user interface for CMake
class CMakeSetupDialog
: public QMainWindow
@@ -118,6 +122,10 @@ protected:
QEventLoop LocalLoop;
+#ifdef QT_WINEXTRAS
+ QWinTaskbarButton* TaskbarButton;
+#endif
+
float ProgressOffset;
float ProgressFactor;
};
diff --git a/Source/QtDialog/Delete16.png b/Source/QtDialog/Delete16.png
index 16989fee1..9d2f2b7ec 100644
--- a/Source/QtDialog/Delete16.png
+++ b/Source/QtDialog/Delete16.png
Binary files differ
diff --git a/Source/QtDialog/FirstConfigure.cxx b/Source/QtDialog/FirstConfigure.cxx
index 88ce7cb8a..f28e1a821 100644
--- a/Source/QtDialog/FirstConfigure.cxx
+++ b/Source/QtDialog/FirstConfigure.cxx
@@ -16,8 +16,12 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p)
this->GeneratorOptions = new QComboBox(this);
l->addWidget(this->GeneratorOptions);
+ // Add the generator platform
+ this->PlatformFrame = CreatePlatformWidgets();
+ l->addWidget(PlatformFrame);
+
// Add the ability to specify toolset (-T parameter)
- ToolsetFrame = CreateToolsetWidgets();
+ this->ToolsetFrame = CreateToolsetWidgets();
l->addWidget(ToolsetFrame);
l->addSpacing(6);
@@ -45,7 +49,7 @@ StartCompilerSetup::StartCompilerSetup(QWidget* p)
SLOT(onSelectionChanged(bool)));
QObject::connect(this->CompilerSetupOptions[3], SIGNAL(toggled(bool)), this,
SLOT(onSelectionChanged(bool)));
- QObject::connect(GeneratorOptions,
+ QObject::connect(this->GeneratorOptions,
SIGNAL(currentIndexChanged(QString const&)), this,
SLOT(onGeneratorChanged(QString const&)));
}
@@ -65,10 +69,25 @@ QFrame* StartCompilerSetup::CreateToolsetWidgets()
return frame;
}
-StartCompilerSetup::~StartCompilerSetup()
+QFrame* StartCompilerSetup::CreatePlatformWidgets()
{
+ QFrame* frame = new QFrame(this);
+ QVBoxLayout* l = new QVBoxLayout(frame);
+ l->setContentsMargins(0, 0, 0, 0);
+
+ this->PlatformLabel = new QLabel(tr("Optional platform for generator"));
+ l->addWidget(this->PlatformLabel);
+
+ this->PlatformOptions = new QComboBox(frame);
+ this->PlatformOptions->setEditable(true);
+
+ l->addWidget(this->PlatformOptions);
+
+ return frame;
}
+StartCompilerSetup::~StartCompilerSetup() = default;
+
void StartCompilerSetup::setGenerators(
std::vector<cmake::GeneratorInfo> const& gens)
{
@@ -80,6 +99,26 @@ void StartCompilerSetup::setGenerators(
for (it = gens.begin(); it != gens.end(); ++it) {
generator_list.append(QString::fromLocal8Bit(it->name.c_str()));
+ if (it->supportsPlatform) {
+ this->GeneratorsSupportingPlatform.append(
+ QString::fromLocal8Bit(it->name.c_str()));
+
+ this
+ ->GeneratorDefaultPlatform[QString::fromLocal8Bit(it->name.c_str())] =
+ QString::fromLocal8Bit(it->defaultPlatform.c_str());
+
+ std::vector<std::string>::const_iterator platformIt =
+ it->supportedPlatforms.cbegin();
+ while (platformIt != it->supportedPlatforms.cend()) {
+
+ this->GeneratorSupportedPlatforms.insert(
+ QString::fromLocal8Bit(it->name.c_str()),
+ QString::fromLocal8Bit((*platformIt).c_str()));
+
+ platformIt++;
+ }
+ }
+
if (it->supportsToolset) {
this->GeneratorsSupportingToolset.append(
QString::fromLocal8Bit(it->name.c_str()));
@@ -102,6 +141,11 @@ QString StartCompilerSetup::getGenerator() const
return this->GeneratorOptions->currentText();
};
+QString StartCompilerSetup::getPlatform() const
+{
+ return this->PlatformOptions->currentText();
+};
+
QString StartCompilerSetup::getToolset() const
{
return this->Toolset->text();
@@ -136,6 +180,31 @@ void StartCompilerSetup::onSelectionChanged(bool on)
void StartCompilerSetup::onGeneratorChanged(QString const& name)
{
+ // Display the generator platform for the generators supporting it
+ if (GeneratorsSupportingPlatform.contains(name)) {
+
+ // Change the label title to include the default platform
+ std::string label = "Optional platform for generator";
+ label += "(if empty, generator uses: ";
+ label += this->GeneratorDefaultPlatform[name].toStdString();
+ label += ")";
+ this->PlatformLabel->setText(tr(label.c_str()));
+
+ // Regenerate the list of supported platform
+ this->PlatformOptions->clear();
+ QStringList platform_list;
+ platform_list.append("");
+
+ QList<QString> platforms = this->GeneratorSupportedPlatforms.values(name);
+ platform_list.append(platforms);
+
+ this->PlatformOptions->addItems(platform_list);
+ PlatformFrame->show();
+ } else {
+ PlatformFrame->hide();
+ }
+
+ // Display the toolset box for the generators supporting it
if (GeneratorsSupportingToolset.contains(name)) {
ToolsetFrame->show();
} else {
@@ -166,9 +235,7 @@ NativeCompilerSetup::NativeCompilerSetup(QWidget* p)
this->setupUi(c);
}
-NativeCompilerSetup::~NativeCompilerSetup()
-{
-}
+NativeCompilerSetup::~NativeCompilerSetup() = default;
QString NativeCompilerSetup::getCCompiler() const
{
@@ -230,9 +297,7 @@ CrossCompilerSetup::CrossCompilerSetup(QWidget* p)
this->registerField("systemName*", this->systemName);
}
-CrossCompilerSetup::~CrossCompilerSetup()
-{
-}
+CrossCompilerSetup::~CrossCompilerSetup() = default;
QString CrossCompilerSetup::getCCompiler() const
{
@@ -343,9 +408,7 @@ ToolchainCompilerSetup::ToolchainCompilerSetup(QWidget* p)
l->addWidget(this->ToolchainFile);
}
-ToolchainCompilerSetup::~ToolchainCompilerSetup()
-{
-}
+ToolchainCompilerSetup::~ToolchainCompilerSetup() = default;
QString ToolchainCompilerSetup::toolchainFile() const
{
@@ -375,9 +438,7 @@ FirstConfigure::FirstConfigure()
this->setPage(ToolchainSetup, this->mToolchainCompilerSetupPage);
}
-FirstConfigure::~FirstConfigure()
-{
-}
+FirstConfigure::~FirstConfigure() = default;
void FirstConfigure::setGenerators(
std::vector<cmake::GeneratorInfo> const& gens)
@@ -390,6 +451,11 @@ QString FirstConfigure::getGenerator() const
return this->mStartCompilerSetupPage->getGenerator();
}
+QString FirstConfigure::getPlatform() const
+{
+ return this->mStartCompilerSetupPage->getPlatform();
+}
+
QString FirstConfigure::getToolset() const
{
return this->mStartCompilerSetupPage->getToolset();
diff --git a/Source/QtDialog/FirstConfigure.h b/Source/QtDialog/FirstConfigure.h
index abfa03fd8..d1db5bff6 100644
--- a/Source/QtDialog/FirstConfigure.h
+++ b/Source/QtDialog/FirstConfigure.h
@@ -35,6 +35,7 @@ public:
void setCurrentGenerator(const QString& gen);
QString getGenerator() const;
QString getToolset() const;
+ QString getPlatform() const;
bool defaultSetup() const;
bool compilerSetup() const;
@@ -56,10 +57,17 @@ protected:
QFrame* ToolsetFrame;
QLineEdit* Toolset;
QLabel* ToolsetLabel;
+ QFrame* PlatformFrame;
+ QComboBox* PlatformOptions;
+ QLabel* PlatformLabel;
QStringList GeneratorsSupportingToolset;
+ QStringList GeneratorsSupportingPlatform;
+ QMultiMap<QString, QString> GeneratorSupportedPlatforms;
+ QMap<QString, QString> GeneratorDefaultPlatform;
private:
QFrame* CreateToolsetWidgets();
+ QFrame* CreatePlatformWidgets();
};
//! the page that gives basic options for native compilers
@@ -159,6 +167,7 @@ public:
void setGenerators(std::vector<cmake::GeneratorInfo> const& gens);
QString getGenerator() const;
+ QString getPlatform() const;
QString getToolset() const;
bool defaultSetup() const;
diff --git a/Source/QtDialog/Plus16.png b/Source/QtDialog/Plus16.png
index 552f6f004..1c33bc763 100644
--- a/Source/QtDialog/Plus16.png
+++ b/Source/QtDialog/Plus16.png
Binary files differ
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 0133b88b3..a073c3064 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -23,19 +23,30 @@ QCMake::QCMake(QObject* p)
cmSystemTools::DisableRunCommandOutput();
cmSystemTools::SetRunCommandHideConsole(true);
- cmSystemTools::SetMessageCallback(QCMake::messageCallback, this);
- cmSystemTools::SetStdoutCallback(QCMake::stdoutCallback, this);
- cmSystemTools::SetStderrCallback(QCMake::stderrCallback, this);
- this->CMakeInstance = new cmake(cmake::RoleProject);
+ cmSystemTools::SetMessageCallback(
+ [this](const char* msg, const char* title) {
+ this->messageCallback(msg, title);
+ });
+ cmSystemTools::SetStdoutCallback(
+ [this](std::string const& msg) { this->stdoutCallback(msg); });
+ cmSystemTools::SetStderrCallback(
+ [this](std::string const& msg) { this->stderrCallback(msg); });
+
+ this->CMakeInstance = new cmake(cmake::RoleProject, cmState::Project);
this->CMakeInstance->SetCMakeEditCommand(
cmSystemTools::GetCMakeGUICommand());
- this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
+ this->CMakeInstance->SetProgressCallback(
+ [this](const char* msg, float percent) {
+ this->progressCallback(msg, percent);
+ });
- cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);
+ cmSystemTools::SetInterruptCallback(
+ [this] { return this->interruptCallback(); });
std::vector<cmake::GeneratorInfo> generators;
- this->CMakeInstance->GetRegisteredGenerators(generators);
+ this->CMakeInstance->GetRegisteredGenerators(
+ generators, /*includeNamesWithPlatform=*/false);
std::vector<cmake::GeneratorInfo>::const_iterator it;
for (it = generators.begin(); it != generators.end(); ++it) {
@@ -74,6 +85,7 @@ void QCMake::setBinaryDirectory(const QString& _dir)
cmState* state = this->CMakeInstance->GetState();
this->setGenerator(QString());
this->setToolset(QString());
+ this->setPlatform(QString());
if (!this->CMakeInstance->LoadCache(
this->BinaryDirectory.toLocal8Bit().data())) {
QDir testDir(this->BinaryDirectory);
@@ -102,6 +114,12 @@ void QCMake::setBinaryDirectory(const QString& _dir)
this->setGenerator(QString::fromLocal8Bit(curGen.c_str()));
}
+ const char* platform =
+ state->GetCacheEntryValue("CMAKE_GENERATOR_PLATFORM");
+ if (platform) {
+ this->setPlatform(QString::fromLocal8Bit(platform));
+ }
+
const char* toolset = state->GetCacheEntryValue("CMAKE_GENERATOR_TOOLSET");
if (toolset) {
this->setToolset(QString::fromLocal8Bit(toolset));
@@ -119,6 +137,14 @@ void QCMake::setGenerator(const QString& gen)
}
}
+void QCMake::setPlatform(const QString& platform)
+{
+ if (this->Platform != platform) {
+ this->Platform = platform;
+ emit this->platformChanged(this->Platform);
+ }
+}
+
void QCMake::setToolset(const QString& toolset)
{
if (this->Toolset != toolset) {
@@ -140,7 +166,8 @@ void QCMake::configure()
this->CMakeInstance->SetGlobalGenerator(
this->CMakeInstance->CreateGlobalGenerator(
this->Generator.toLocal8Bit().data()));
- this->CMakeInstance->SetGeneratorPlatform("");
+ this->CMakeInstance->SetGeneratorPlatform(
+ this->Platform.toLocal8Bit().data());
this->CMakeInstance->SetGeneratorToolset(this->Toolset.toLocal8Bit().data());
this->CMakeInstance->LoadCache();
this->CMakeInstance->SetWarnUninitialized(this->WarnUninitializedMode);
@@ -313,46 +340,40 @@ void QCMake::interrupt()
this->InterruptFlag.ref();
}
-bool QCMake::interruptCallback(void* cd)
+bool QCMake::interruptCallback()
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- return self->InterruptFlag;
+ return this->InterruptFlag;
#else
- return self->InterruptFlag.load();
+ return this->InterruptFlag.load();
#endif
}
-void QCMake::progressCallback(const char* msg, float percent, void* cd)
+void QCMake::progressCallback(const char* msg, float percent)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
if (percent >= 0) {
- emit self->progressChanged(QString::fromLocal8Bit(msg), percent);
+ emit this->progressChanged(QString::fromLocal8Bit(msg), percent);
} else {
- emit self->outputMessage(QString::fromLocal8Bit(msg));
+ emit this->outputMessage(QString::fromLocal8Bit(msg));
}
QCoreApplication::processEvents();
}
-void QCMake::messageCallback(const char* msg, const char* /*title*/,
- bool& /*stop*/, void* cd)
+void QCMake::messageCallback(const char* msg, const char* /*title*/)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
- emit self->errorMessage(QString::fromLocal8Bit(msg));
+ emit this->errorMessage(QString::fromLocal8Bit(msg));
QCoreApplication::processEvents();
}
-void QCMake::stdoutCallback(const char* msg, size_t len, void* cd)
+void QCMake::stdoutCallback(std::string const& msg)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
- emit self->outputMessage(QString::fromLocal8Bit(msg, int(len)));
+ emit this->outputMessage(QString::fromStdString(msg));
QCoreApplication::processEvents();
}
-void QCMake::stderrCallback(const char* msg, size_t len, void* cd)
+void QCMake::stderrCallback(std::string const& msg)
{
- QCMake* self = reinterpret_cast<QCMake*>(cd);
- emit self->outputMessage(QString::fromLocal8Bit(msg, int(len)));
+ emit this->outputMessage(QString::fromStdString(msg));
QCoreApplication::processEvents();
}
diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h
index 4b3920aaf..ef4d2a1a1 100644
--- a/Source/QtDialog/QCMake.h
+++ b/Source/QtDialog/QCMake.h
@@ -75,6 +75,8 @@ public slots:
/// set the desired generator to use
void setGenerator(const QString& generator);
/// set the desired generator to use
+ void setPlatform(const QString& platform);
+ /// set the desired generator to use
void setToolset(const QString& toolset);
/// do the configure step
void configure();
@@ -155,6 +157,8 @@ signals:
void debugOutputChanged(bool);
/// signal when the toolset changes
void toolsetChanged(const QString& toolset);
+ /// signal when the platform changes
+ void platformChanged(const QString& platform);
/// signal when open is done
void openDone(bool successful);
/// signal when open is done
@@ -163,18 +167,19 @@ signals:
protected:
cmake* CMakeInstance;
- static bool interruptCallback(void*);
- static void progressCallback(const char* msg, float percent, void* cd);
- static void messageCallback(const char* msg, const char* title, bool&,
- void* cd);
- static void stdoutCallback(const char* msg, size_t len, void* cd);
- static void stderrCallback(const char* msg, size_t len, void* cd);
+ bool interruptCallback();
+ void progressCallback(const char* msg, float percent);
+ void messageCallback(const char* msg, const char* title);
+ void stdoutCallback(std::string const& msg);
+ void stderrCallback(std::string const& msg);
+
bool WarnUninitializedMode;
bool WarnUnusedMode;
bool WarnUnusedAllMode;
QString SourceDirectory;
QString BinaryDirectory;
QString Generator;
+ QString Platform;
QString Toolset;
std::vector<cmake::GeneratorInfo> AvailableGenerators;
QString CMakeExecutable;
diff --git a/Source/QtDialog/QCMakeCacheView.cxx b/Source/QtDialog/QCMakeCacheView.cxx
index 7d3aa57e6..78a271024 100644
--- a/Source/QtDialog/QCMakeCacheView.cxx
+++ b/Source/QtDialog/QCMakeCacheView.cxx
@@ -186,9 +186,7 @@ QCMakeCacheModel::QCMakeCacheModel(QObject* p)
this->setHorizontalHeaderLabels(labels);
}
-QCMakeCacheModel::~QCMakeCacheModel()
-{
-}
+QCMakeCacheModel::~QCMakeCacheModel() = default;
static uint qHash(const QCMakeProperty& p)
{
@@ -248,9 +246,9 @@ void QCMakeCacheModel::setProperties(const QCMakePropertyList& props)
}
} else if (this->View == GroupView) {
QMap<QString, QCMakePropertyList> newPropsTree;
- this->breakProperties(newProps, newPropsTree);
+ QCMakeCacheModel::breakProperties(newProps, newPropsTree);
QMap<QString, QCMakePropertyList> newPropsTree2;
- this->breakProperties(newProps2, newPropsTree2);
+ QCMakeCacheModel::breakProperties(newProps2, newPropsTree2);
QStandardItem* root = this->invisibleRootItem();
diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx
index b544b8613..eab418fe7 100644
--- a/Source/QtDialog/QCMakeWidgets.cxx
+++ b/Source/QtDialog/QCMakeWidgets.cxx
@@ -7,10 +7,11 @@
#include <QFileInfo>
#include <QResizeEvent>
#include <QToolButton>
+#include <utility>
-QCMakeFileEditor::QCMakeFileEditor(QWidget* p, const QString& var)
+QCMakeFileEditor::QCMakeFileEditor(QWidget* p, QString var)
: QLineEdit(p)
- , Variable(var)
+ , Variable(std::move(var))
{
this->ToolButton = new QToolButton(this);
this->ToolButton->setText("...");
diff --git a/Source/QtDialog/QCMakeWidgets.h b/Source/QtDialog/QCMakeWidgets.h
index e63c19753..5d2368eab 100644
--- a/Source/QtDialog/QCMakeWidgets.h
+++ b/Source/QtDialog/QCMakeWidgets.h
@@ -18,7 +18,7 @@ class QCMakeFileEditor : public QLineEdit
{
Q_OBJECT
public:
- QCMakeFileEditor(QWidget* p, const QString& var);
+ QCMakeFileEditor(QWidget* p, QString var);
protected slots:
virtual void chooseFile() = 0;
signals:
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 53f5593e4..a840f17c1 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -10,11 +10,11 @@
#include "cmCustomCommandLines.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -361,7 +361,7 @@ bool cmAddCustomCommandCommand::InitialPass(
} else {
bool issueMessage = true;
std::ostringstream e;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0050)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0050) << "\n";
@@ -372,7 +372,7 @@ bool cmAddCustomCommandCommand::InitialPass(
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
break;
}
@@ -380,7 +380,7 @@ bool cmAddCustomCommandCommand::InitialPass(
e << "The SOURCE signatures of add_custom_command are no longer "
"supported.";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
diff --git a/Source/cmAddCustomTargetCommand.cxx b/Source/cmAddCustomTargetCommand.cxx
index ddd9b7082..8240d3ef2 100644
--- a/Source/cmAddCustomTargetCommand.cxx
+++ b/Source/cmAddCustomTargetCommand.cxx
@@ -9,10 +9,10 @@
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -183,19 +183,19 @@ bool cmAddCustomTargetCommand::InitialPass(
if (commandLines.empty() && !byproducts.empty()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"BYPRODUCTS may not be specified without any COMMAND");
return true;
}
if (commandLines.empty() && uses_terminal) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"USES_TERMINAL may not be specified without any COMMAND");
return true;
}
if (commandLines.empty() && command_expand_lists) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"COMMAND_EXPAND_LISTS may not be specified without any COMMAND");
return true;
}
diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx
index a73b57e82..021bd2951 100644
--- a/Source/cmAddDependenciesCommand.cxx
+++ b/Source/cmAddDependenciesCommand.cxx
@@ -5,8 +5,8 @@
#include <sstream>
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -24,7 +24,7 @@ bool cmAddDependenciesCommand::InitialPass(
std::ostringstream e;
e << "Cannot add target-level dependencies to alias target \""
<< target_name << "\".\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
if (cmTarget* target = this->Makefile->FindTargetToUse(target_name)) {
std::vector<std::string>::const_iterator s = args.begin();
@@ -40,7 +40,7 @@ bool cmAddDependenciesCommand::InitialPass(
<< "by the add_executable, add_library, or add_custom_target commands. "
<< "If you want to add file-level dependencies see the DEPENDS option "
<< "of the add_custom_target and add_custom_command commands.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
return true;
diff --git a/Source/cmAddLibraryCommand.cxx b/Source/cmAddLibraryCommand.cxx
index fae806324..514933303 100644
--- a/Source/cmAddLibraryCommand.cxx
+++ b/Source/cmAddLibraryCommand.cxx
@@ -7,11 +7,11 @@
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -259,7 +259,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
<< (type == cmStateEnums::SHARED_LIBRARY ? "SHARED" : "MODULE")
<< " option but the target platform does not support dynamic linking. "
"Building a STATIC library instead. This may lead to problems.";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
type = cmStateEnums::STATIC_LIBRARY;
}
@@ -275,7 +275,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
if (!this->Makefile->GetGlobalGenerator()->HasKnownObjectFileLocation(
&reason)) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The OBJECT library type may not be used for IMPORTED libraries" +
reason + ".");
return true;
@@ -307,7 +307,7 @@ bool cmAddLibraryCommand::InitialPass(std::vector<std::string> const& args,
// A non-imported target may not have UNKNOWN type.
if (type == cmStateEnums::UNKNOWN_LIBRARY) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The UNKNOWN library type may be used only for IMPORTED libraries.");
return true;
}
diff --git a/Source/cmAddSubDirectoryCommand.cxx b/Source/cmAddSubDirectoryCommand.cxx
index 75bd6fba4..75e5aa43f 100644
--- a/Source/cmAddSubDirectoryCommand.cxx
+++ b/Source/cmAddSubDirectoryCommand.cxx
@@ -20,7 +20,7 @@ bool cmAddSubDirectoryCommand::InitialPass(
}
// store the binpath
- std::string const& srcArg = args[0];
+ std::string const& srcArg = args.front();
std::string binArg;
bool excludeFromAll = false;
@@ -84,10 +84,10 @@ bool cmAddSubDirectoryCommand::InitialPass(
const std::string& bin = this->Makefile->GetCurrentBinaryDirectory();
size_t srcLen = src.length();
size_t binLen = bin.length();
- if (srcLen > 0 && src[srcLen - 1] == '/') {
+ if (srcLen > 0 && src.back() == '/') {
--srcLen;
}
- if (binLen > 0 && bin[binLen - 1] == '/') {
+ if (binLen > 0 && bin.back() == '/') {
--binLen;
}
binPath = bin.substr(0, binLen) + srcPath.substr(srcLen);
diff --git a/Source/cmAlgorithms.h b/Source/cmAlgorithms.h
index bbd3e8ea4..d38b0d125 100644
--- a/Source/cmAlgorithms.h
+++ b/Source/cmAlgorithms.h
@@ -61,8 +61,8 @@ struct cmStrCmp
: m_test(test)
{
}
- cmStrCmp(const std::string& test)
- : m_test(test)
+ cmStrCmp(std::string test)
+ : m_test(std::move(test))
{
}
@@ -336,6 +336,14 @@ std::reverse_iterator<Iter> cmMakeReverseIterator(Iter it)
return std::reverse_iterator<Iter>(it);
}
+inline bool cmHasPrefix(std::string const& str, std::string const& prefix)
+{
+ if (str.size() < prefix.size()) {
+ return false;
+ }
+ return str.compare(0, prefix.size(), prefix) == 0;
+}
+
inline bool cmHasSuffix(const std::string& str, const std::string& suffix)
{
if (str.size() < suffix.size()) {
@@ -396,6 +404,12 @@ constexpr
#endif
+template <typename T>
+int isize(const T& t)
+{
+ return static_cast<int>(cm::size(t));
+}
+
#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
using std::cbegin;
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 60317818b..6e5109aa1 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -135,7 +135,7 @@ cmArchiveWrite::cmArchiveWrite(std::ostream& os, Compress c,
return;
}
break;
- };
+ }
#if !defined(_WIN32) || defined(__CYGWIN__)
if (archive_read_disk_set_standard_lookup(this->Disk) != ARCHIVE_OK) {
this->Error = "archive_read_disk_set_standard_lookup: ";
@@ -178,7 +178,7 @@ bool cmArchiveWrite::Add(std::string path, size_t skip, const char* prefix,
bool recursive)
{
if (this->Okay()) {
- if (!path.empty() && path[path.size() - 1] == '/') {
+ if (!path.empty() && path.back() == '/') {
path.erase(path.size() - 1);
}
this->AddPath(path.c_str(), skip, prefix, recursive);
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index 6c678acbe..6ecdd630c 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -40,9 +40,6 @@ private:
*/
class cmArchiveWrite
{
- typedef void (cmArchiveWrite::*safe_bool)();
- void safe_bool_true() {}
-
public:
/** Compression type. */
enum Compress
@@ -73,10 +70,7 @@ public:
bool recursive = true);
/** Returns true if there has been no error. */
- operator safe_bool() const
- {
- return this->Okay() ? &cmArchiveWrite::safe_bool_true : nullptr;
- }
+ explicit operator bool() const { return this->Okay(); }
/** Returns true if there has been an error. */
bool operator!() const { return !this->Okay(); }
diff --git a/Source/cmAuxSourceDirectoryCommand.cxx b/Source/cmAuxSourceDirectoryCommand.cxx
index 1f9f5802a..106e7a79a 100644
--- a/Source/cmAuxSourceDirectoryCommand.cxx
+++ b/Source/cmAuxSourceDirectoryCommand.cxx
@@ -5,6 +5,7 @@
#include "cmsys/Directory.hxx"
#include <algorithm>
#include <stddef.h>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmMakefile.h"
diff --git a/Source/cmBase32.cxx b/Source/cmBase32.cxx
index 1dac212c2..80ada4766 100644
--- a/Source/cmBase32.cxx
+++ b/Source/cmBase32.cxx
@@ -34,13 +34,9 @@ void Base32Encode5(const unsigned char src[5], char dst[8])
// -- Class methods
-cmBase32Encoder::cmBase32Encoder()
-{
-}
+cmBase32Encoder::cmBase32Encoder() = default;
-cmBase32Encoder::~cmBase32Encoder()
-{
-}
+cmBase32Encoder::~cmBase32Encoder() = default;
std::string cmBase32Encoder::encodeString(const unsigned char* input,
size_t len, bool padding)
diff --git a/Source/cmBreakCommand.cxx b/Source/cmBreakCommand.cxx
index 3772c6fb6..d07898fd6 100644
--- a/Source/cmBreakCommand.cxx
+++ b/Source/cmBreakCommand.cxx
@@ -6,8 +6,8 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
-#include "cmake.h"
// cmBreakCommand
bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
@@ -16,7 +16,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
if (!this->Makefile->IsLoopBlock()) {
bool issueMessage = true;
std::ostringstream e;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n";
@@ -27,7 +27,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
break;
}
@@ -35,7 +35,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
e << "A BREAK command was found outside of a proper "
"FOREACH or WHILE loop scope.";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
@@ -46,7 +46,7 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
if (!args.empty()) {
bool issueMessage = true;
std::ostringstream e;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0055)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0055) << "\n";
@@ -57,14 +57,14 @@ bool cmBreakCommand::InitialPass(std::vector<std::string> const& args,
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
break;
}
if (issueMessage) {
e << "The BREAK command does not accept any arguments.";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index fd876004b..428a0b224 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -6,9 +6,9 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -84,7 +84,7 @@ bool cmBuildCommand::MainSignature(std::vector<std::string> const& args)
if (!project_name.empty()) {
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
"Ignoring PROJECT_NAME option because it has no effect.");
}
diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h
index ec81cb9f2..93032c12e 100644
--- a/Source/cmCLocaleEnvironmentScope.h
+++ b/Source/cmCLocaleEnvironmentScope.h
@@ -10,12 +10,14 @@
class cmCLocaleEnvironmentScope
{
- CM_DISABLE_COPY(cmCLocaleEnvironmentScope)
-
public:
cmCLocaleEnvironmentScope();
~cmCLocaleEnvironmentScope();
+ cmCLocaleEnvironmentScope(cmCLocaleEnvironmentScope const&) = delete;
+ cmCLocaleEnvironmentScope& operator=(cmCLocaleEnvironmentScope const&) =
+ delete;
+
private:
std::string GetEnv(std::string const& key);
void SetEnv(std::string const& key, std::string const& value);
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 882294264..54f08bbcd 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -10,7 +10,7 @@
#if defined(_WIN32)
# include "cmAlgorithms.h"
# include "cmGlobalGenerator.h"
-# include "cmGlobalVisualStudio15Generator.h"
+# include "cmGlobalVisualStudioVersionedGenerator.h"
# include "cmSystemTools.h"
# include "cmVSSetupHelper.h"
# define HAVE_VS_SETUP_HELPER
@@ -133,15 +133,31 @@ bool cmCMakeHostSystemInformationCommand::GetValue(
// If generating for the VS 15 IDE, use the same instance.
cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
if (cmHasLiteralPrefix(gg->GetName(), "Visual Studio 15 ")) {
- cmGlobalVisualStudio15Generator* vs15gen =
- static_cast<cmGlobalVisualStudio15Generator*>(gg);
+ cmGlobalVisualStudioVersionedGenerator* vs15gen =
+ static_cast<cmGlobalVisualStudioVersionedGenerator*>(gg);
if (vs15gen->GetVSInstance(value)) {
return true;
}
}
// Otherwise, find a VS 15 instance ourselves.
- cmVSSetupAPIHelper vsSetupAPIHelper;
+ cmVSSetupAPIHelper vsSetupAPIHelper(15);
+ if (vsSetupAPIHelper.GetVSInstanceInfo(value)) {
+ cmSystemTools::ConvertToUnixSlashes(value);
+ }
+ } else if (key == "VS_16_DIR") {
+ // If generating for the VS 16 IDE, use the same instance.
+ cmGlobalGenerator* gg = this->Makefile->GetGlobalGenerator();
+ if (cmHasLiteralPrefix(gg->GetName(), "Visual Studio 16 ")) {
+ cmGlobalVisualStudioVersionedGenerator* vs16gen =
+ static_cast<cmGlobalVisualStudioVersionedGenerator*>(gg);
+ if (vs16gen->GetVSInstance(value)) {
+ return true;
+ }
+ }
+
+ // Otherwise, find a VS 16 instance ourselves.
+ cmVSSetupAPIHelper vsSetupAPIHelper(16);
if (vsSetupAPIHelper.GetVSInstanceInfo(value)) {
cmSystemTools::ConvertToUnixSlashes(value);
}
diff --git a/Source/cmCMakeMinimumRequired.cxx b/Source/cmCMakeMinimumRequired.cxx
index 2b51976b9..4218d810b 100644
--- a/Source/cmCMakeMinimumRequired.cxx
+++ b/Source/cmCMakeMinimumRequired.cxx
@@ -6,9 +6,9 @@
#include <stdio.h>
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -96,7 +96,7 @@ bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args,
e << "CMake " << version_min
<< " or higher is required. You are running version "
<< cmVersion::GetCMakeVersion();
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return true;
}
@@ -108,7 +108,7 @@ bool cmCMakeMinimumRequired::InitialPass(std::vector<std::string> const& args,
if (required_major < 2 || (required_major == 2 && required_minor < 4)) {
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
"Compatibility with CMake < 2.4 is not supported by CMake >= 3.0.");
this->Makefile->SetPolicyVersion("2.4", version_max);
} else {
diff --git a/Source/cmCMakePolicyCommand.cxx b/Source/cmCMakePolicyCommand.cxx
index adf9ef80e..ac30e1a39 100644
--- a/Source/cmCMakePolicyCommand.cxx
+++ b/Source/cmCMakePolicyCommand.cxx
@@ -5,10 +5,10 @@
#include <sstream>
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmState.h"
#include "cmStateTypes.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -46,6 +46,9 @@ bool cmCMakePolicyCommand::InitialPass(std::vector<std::string> const& args,
if (args[0] == "VERSION") {
return this->HandleVersionMode(args);
}
+ if (args[0] == "GET_WARNING") {
+ return this->HandleGetWarningMode(args);
+ }
std::ostringstream e;
e << "given unknown first argument \"" << args[0] << "\"";
@@ -143,7 +146,7 @@ bool cmCMakePolicyCommand::HandleGetMode(std::vector<std::string> const& args)
<< "The call to cmake_policy(GET " << id << " ...) at which this "
<< "error appears requests the policy, and this version of CMake "
<< "requires that the policy be set to NEW before it is checked.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
}
@@ -181,3 +184,33 @@ bool cmCMakePolicyCommand::HandleVersionMode(
this->Makefile->SetPolicyVersion(version_min, version_max);
return true;
}
+
+bool cmCMakePolicyCommand::HandleGetWarningMode(
+ std::vector<std::string> const& args)
+{
+ if (args.size() != 3) {
+ this->SetError(
+ "GET_WARNING must be given exactly 2 additional arguments.");
+ return false;
+ }
+
+ // Get arguments.
+ std::string const& id = args[1];
+ std::string const& var = args[2];
+
+ // Lookup the policy number.
+ cmPolicies::PolicyID pid;
+ if (!cmPolicies::GetPolicyID(id.c_str(), pid)) {
+ std::ostringstream e;
+ e << "GET_WARNING given policy \"" << id
+ << "\" which is not known to this version of CMake.";
+ this->SetError(e.str());
+ return false;
+ }
+
+ // Lookup the policy warning.
+ this->Makefile->AddDefinition(var,
+ cmPolicies::GetPolicyWarning(pid).c_str());
+
+ return true;
+}
diff --git a/Source/cmCMakePolicyCommand.h b/Source/cmCMakePolicyCommand.h
index b18576c67..cca140617 100644
--- a/Source/cmCMakePolicyCommand.h
+++ b/Source/cmCMakePolicyCommand.h
@@ -37,6 +37,7 @@ private:
bool HandleSetMode(std::vector<std::string> const& args);
bool HandleGetMode(std::vector<std::string> const& args);
bool HandleVersionMode(std::vector<std::string> const& args);
+ bool HandleGetWarningMode(std::vector<std::string> const& args);
};
#endif
diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h
index e580e044b..ad943c588 100644
--- a/Source/cmCPackPropertiesGenerator.h
+++ b/Source/cmCPackPropertiesGenerator.h
@@ -20,13 +20,15 @@ class cmLocalGenerator;
*/
class cmCPackPropertiesGenerator : public cmScriptGenerator
{
- CM_DISABLE_COPY(cmCPackPropertiesGenerator)
-
public:
cmCPackPropertiesGenerator(cmLocalGenerator* lg,
cmInstalledFile const& installedFile,
std::vector<std::string> const& configurations);
+ cmCPackPropertiesGenerator(cmCPackPropertiesGenerator const&) = delete;
+ cmCPackPropertiesGenerator& operator=(cmCPackPropertiesGenerator const&) =
+ delete;
+
protected:
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
Indent indent) override;
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 22ae34033..c0088ac5d 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -181,7 +181,7 @@ void CCONV cmAddExecutable(void* arg, const char* exename, int numSrcs,
std::vector<std::string> srcs2;
int i;
for (i = 0; i < numSrcs; ++i) {
- srcs2.push_back(srcs[i]);
+ srcs2.emplace_back(srcs[i]);
}
cmTarget* tg = mf->AddExecutable(exename, srcs2);
if (win32) {
@@ -347,7 +347,7 @@ static void addLinkLibrary(cmMakefile* mf, std::string const& target,
std::ostringstream e;
e << "Attempt to add link library \"" << lib << "\" to target \"" << target
<< "\" which is not built in this directory.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -362,7 +362,7 @@ static void addLinkLibrary(cmMakefile* mf, std::string const& target,
<< " may not be linked into another target. "
<< "One may link only to STATIC or SHARED libraries, or "
<< "to executables with the ENABLE_EXPORTS property set.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
t->AddLinkLibrary(*mf, lib, llt);
@@ -393,7 +393,7 @@ void CCONV cmAddLibrary(void* arg, const char* libname, int shared,
std::vector<std::string> srcs2;
int i;
for (i = 0; i < numSrcs; ++i) {
- srcs2.push_back(srcs[i]);
+ srcs2.emplace_back(srcs[i]);
}
mf->AddLibrary(
libname,
@@ -407,7 +407,7 @@ char CCONV* cmExpandVariablesInString(void* arg, const char* source,
cmMakefile* mf = static_cast<cmMakefile*>(arg);
std::string barf = source;
std::string const& result =
- mf->ExpandVariablesInString(barf, escapeQuotes, atOnly);
+ mf->ExpandVariablesInString(barf, escapeQuotes != 0, atOnly != 0);
return strdup(result.c_str());
}
@@ -419,8 +419,7 @@ int CCONV cmExecuteCommand(void* arg, const char* name, int numArgs,
lff.Name = name;
for (int i = 0; i < numArgs; ++i) {
// Assume all arguments are quoted.
- lff.Arguments.push_back(
- cmListFileArgument(args[i], cmListFileArgument::Quoted, 0));
+ lff.Arguments.emplace_back(args[i], cmListFileArgument::Quoted, 0);
}
cmExecutionStatus status;
return mf->ExecuteCommand(lff, status);
@@ -436,7 +435,7 @@ void CCONV cmExpandSourceListArguments(void* arg, int numArgs,
std::vector<std::string> result;
int i;
for (i = 0; i < numArgs; ++i) {
- result.push_back(args[i]);
+ result.emplace_back(args[i]);
}
int resargc = static_cast<int>(result.size());
char** resargv = nullptr;
@@ -475,11 +474,7 @@ int CCONV cmGetTotalArgumentSize(int argc, char** argv)
// API for source files.
struct cmCPluginAPISourceFile
{
- cmCPluginAPISourceFile()
- : RealSourceFile(nullptr)
- {
- }
- cmSourceFile* RealSourceFile;
+ cmSourceFile* RealSourceFile = nullptr;
std::string SourceName;
std::string SourceExtension;
std::string FullPath;
@@ -630,7 +625,7 @@ void CCONV cmSourceFileAddDepend(void* arg, const char* depend)
if (cmSourceFile* rsf = sf->RealSourceFile) {
rsf->AddDepend(depend);
} else {
- sf->Depends.push_back(depend);
+ sf->Depends.emplace_back(depend);
}
}
@@ -650,10 +645,10 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir,
std::vector<std::string> headerExts;
int i;
for (i = 0; i < numSourceExtensions; ++i) {
- sourceExts.push_back(sourceExtensions[i]);
+ sourceExts.emplace_back(sourceExtensions[i]);
}
for (i = 0; i < numHeaderExtensions; ++i) {
- headerExts.push_back(headerExtensions[i]);
+ headerExts.emplace_back(headerExtensions[i]);
}
// Save the original name given.
@@ -724,7 +719,7 @@ void CCONV cmSourceFileSetName(void* arg, const char* name, const char* dir,
ext != headerExts.end(); ++ext) {
e << " ." << *ext;
}
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
}
void CCONV cmSourceFileSetName2(void* arg, const char* name, const char* dir,
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 908eea145..989c7ee45 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -278,6 +278,8 @@ cmCTest::cmCTest()
this->ExtraVerbose = false;
this->ProduceXML = false;
this->ShowOnly = false;
+ this->OutputAsJson = false;
+ this->OutputAsJsonVersion = 1;
this->RunConfigurationScript = false;
this->UseHTTP10 = false;
this->PrintLabels = false;
@@ -292,9 +294,9 @@ cmCTest::cmCTest()
this->OutputLogFile = nullptr;
this->OutputLogFileLastTag = -1;
this->SuppressUpdatingCTestConfiguration = false;
- this->DartVersion = 1;
- this->DropSiteCDash = false;
+ this->BuildID = "";
this->OutputTestOutputOnTestFailure = false;
+ this->OutputColorCode = cmCTest::ColoredOutputSupportedByConsole();
this->RepeatTests = 1; // default to run each test once
this->RepeatUntilFail = false;
@@ -320,6 +322,7 @@ cmCTest::cmCTest()
this->Parts[PartNotes].SetName("Notes");
this->Parts[PartExtraFiles].SetName("ExtraFiles");
this->Parts[PartUpload].SetName("Upload");
+ this->Parts[PartDone].SetName("Done");
// Fill the part name-to-id map.
for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
@@ -426,7 +429,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
}
}
- cmake cm(cmake::RoleScript);
+ cmake cm(cmake::RoleScript, cmState::CTest);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
@@ -610,8 +613,7 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
{
std::string src_dir = this->GetCTestConfiguration("SourceDirectory");
std::string bld_dir = this->GetCTestConfiguration("BuildDirectory");
- this->DartVersion = 1;
- this->DropSiteCDash = false;
+ this->BuildID = "";
for (Part p = PartStart; p != PartCount; p = Part(p + 1)) {
this->Parts[p].SubmitFiles.clear();
}
@@ -638,23 +640,13 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
" Reading ctest configuration file: " << fname
<< std::endl,
command->ShouldBeQuiet());
- bool readit = mf->ReadDependentFile(fname.c_str());
+ bool readit = mf->ReadDependentFile(fname);
if (!readit) {
std::string m = "Could not find include file: ";
m += fname;
command->SetError(m);
return false;
}
- } else {
- cmCTestOptionalLog(this, WARNING,
- "Cannot locate CTest configuration: in BuildDirectory: "
- << bld_dir_fname << std::endl,
- command->ShouldBeQuiet());
- cmCTestOptionalLog(
- this, WARNING,
- "Cannot locate CTest configuration: in SourceDirectory: "
- << src_dir_fname << std::endl,
- command->ShouldBeQuiet());
}
this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime",
@@ -664,18 +656,6 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command)
command->ShouldBeQuiet());
this->SetCTestConfigurationFromCMakeVariable(
mf, "BuildName", "CTEST_BUILD_NAME", command->ShouldBeQuiet());
- const char* dartVersion = mf->GetDefinition("CTEST_DART_SERVER_VERSION");
- if (dartVersion) {
- this->DartVersion = atoi(dartVersion);
- if (this->DartVersion < 0) {
- cmCTestLog(this, ERROR_MESSAGE,
- "Invalid Dart server version: "
- << dartVersion << ". Please specify the version number."
- << std::endl);
- return false;
- }
- }
- this->DropSiteCDash = mf->IsOn("CTEST_DROP_SITE_CDASH");
if (!this->Initialize(bld_dir.c_str(), command)) {
return false;
@@ -724,7 +704,7 @@ bool cmCTest::UpdateCTestConfiguration()
if (line.empty()) {
continue;
}
- while (fin && (line[line.size() - 1] == '\\')) {
+ while (fin && (line.back() == '\\')) {
line = line.substr(0, line.size() - 1);
buffer[0] = 0;
fin.getline(buffer, 1023);
@@ -1196,12 +1176,12 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
if (strcmp(i, "--build-generator") == 0 &&
timeout != cmCTest::MaxDuration() &&
timeout > cmDuration::zero()) {
- args.push_back("--test-timeout");
+ args.emplace_back("--test-timeout");
std::ostringstream msg;
msg << cmDurationTo<unsigned int>(timeout);
args.push_back(msg.str());
}
- args.push_back(i);
+ args.emplace_back(i);
}
}
if (log) {
@@ -1565,6 +1545,24 @@ int cmCTest::GenerateNotesFile(const char* cfiles)
return this->GenerateNotesFile(files);
}
+int cmCTest::GenerateDoneFile()
+{
+ cmGeneratedFileStream ofs;
+ if (!this->OpenOutputFile(this->CurrentTag, "Done.xml", ofs)) {
+ cmCTestLog(this, ERROR_MESSAGE, "Cannot open done file" << std::endl);
+ return 1;
+ }
+ cmXMLWriter xml(ofs);
+ xml.StartDocument();
+ xml.StartElement("Done");
+ xml.Element("buildId", this->BuildID);
+ xml.Element("time", std::chrono::system_clock::now());
+ xml.EndElement(); // Done
+ xml.EndDocument();
+
+ return 0;
+}
+
std::string cmCTest::Base64GzipEncodeFile(std::string const& file)
{
std::string tarFile = file + "_temp.tar.gz";
@@ -1934,6 +1932,23 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
if (this->CheckArgument(arg, "-N", "--show-only")) {
this->ShowOnly = true;
}
+ if (cmSystemTools::StringStartsWith(arg.c_str(), "--show-only=")) {
+ this->ShowOnly = true;
+
+ // Check if a specific format is requested. Defaults to human readable
+ // text.
+ std::string argWithFormat = "--show-only=";
+ std::string format = arg.substr(argWithFormat.length());
+ if (format == "json-v1") {
+ // Force quiet mode so the only output is the json object model.
+ this->Quiet = true;
+ this->OutputAsJson = true;
+ this->OutputAsJsonVersion = 1;
+ } else if (format != "human") {
+ errormsg = "'--show-only=' given unknown value '" + format + "'";
+ return false;
+ }
+ }
if (this->CheckArgument(arg, "-O", "--output-log") && i < args.size() - 1) {
i++;
@@ -2054,7 +2069,18 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
return true;
}
-bool cmCTest::ProgressOutputSupportedByConsole() const
+#if !defined(_WIN32)
+bool cmCTest::ConsoleIsNotDumb()
+{
+ std::string term_env_variable;
+ if (cmSystemTools::GetEnv("TERM", term_env_variable)) {
+ return isatty(1) && term_env_variable != "dumb";
+ }
+ return false;
+}
+#endif
+
+bool cmCTest::ProgressOutputSupportedByConsole()
{
#if defined(_WIN32)
// On Windows we need a console buffer.
@@ -2063,12 +2089,19 @@ bool cmCTest::ProgressOutputSupportedByConsole() const
return GetConsoleScreenBufferInfo(console, &csbi);
#else
// On UNIX we need a non-dumb tty.
- std::string term_env_variable;
- if (cmSystemTools::GetEnv("TERM", term_env_variable)) {
- return isatty(1) && term_env_variable != "dumb";
- }
+ return ConsoleIsNotDumb();
#endif
+}
+
+bool cmCTest::ColoredOutputSupportedByConsole()
+{
+#if defined(_WIN32)
+ // Not supported on Windows
return false;
+#else
+ // On UNIX we need a non-dumb tty.
+ return ConsoleIsNotDumb();
+#endif
}
// handle the -S -SR and -SP arguments
@@ -2140,7 +2173,7 @@ int cmCTest::Run(std::vector<std::string>& args, std::string* output)
// handle the simple commandline arguments
std::string errormsg;
if (!this->HandleCommandLineArguments(i, args, errormsg)) {
- cmSystemTools::Error(errormsg.c_str());
+ cmSystemTools::Error(errormsg);
return 1;
}
@@ -2439,8 +2472,7 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
bool erroroc = cmSystemTools::GetErrorOccuredFlag();
cmSystemTools::ResetErrorOccuredFlag();
- if (!mf->ReadListFile(fname.c_str()) ||
- cmSystemTools::GetErrorOccuredFlag()) {
+ if (!mf->ReadListFile(fname) || cmSystemTools::GetErrorOccuredFlag()) {
cmCTestLog(this, ERROR_MESSAGE,
"Problem reading custom configuration: " << fname
<< std::endl);
@@ -2459,15 +2491,13 @@ int cmCTest::ReadCustomConfigurationFileTree(const char* dir, cmMakefile* mf)
gl.RecurseOn();
gl.FindFiles(rexpr);
std::vector<std::string>& files = gl.GetFiles();
- std::vector<std::string>::iterator fileIt;
- for (fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
+ for (const std::string& file : files) {
cmCTestLog(this, DEBUG,
- "* Read custom CTest configuration file: " << *fileIt
+ "* Read custom CTest configuration file: " << file
<< std::endl);
- if (!mf->ReadListFile(fileIt->c_str()) ||
- cmSystemTools::GetErrorOccuredFlag()) {
+ if (!mf->ReadListFile(file) || cmSystemTools::GetErrorOccuredFlag()) {
cmCTestLog(this, ERROR_MESSAGE,
- "Problem reading custom configuration: " << *fileIt
+ "Problem reading custom configuration: " << file
<< std::endl);
}
}
@@ -2554,7 +2584,7 @@ std::string cmCTest::GetShortPathToFile(const char* cfname)
cmSystemTools::ConvertToUnixSlashes(*res);
path = "./" + *res;
- if (path[path.size() - 1] == '/') {
+ if (path.back() == '/') {
path = path.substr(0, path.size() - 1);
}
}
@@ -2596,6 +2626,32 @@ void cmCTest::SetCTestConfiguration(const char* name, const char* value,
this->CTestConfiguration[name] = value;
}
+std::string cmCTest::GetSubmitURL()
+{
+ std::string url = this->GetCTestConfiguration("SubmitURL");
+ if (url.empty()) {
+ std::string method = this->GetCTestConfiguration("DropMethod");
+ std::string user = this->GetCTestConfiguration("DropSiteUser");
+ std::string password = this->GetCTestConfiguration("DropSitePassword");
+ std::string site = this->GetCTestConfiguration("DropSite");
+ std::string location = this->GetCTestConfiguration("DropLocation");
+
+ url = method.empty() ? "http" : method;
+ url += "://";
+ if (!user.empty()) {
+ url += user;
+ if (!password.empty()) {
+ url += ':';
+ url += password;
+ }
+ url += '@';
+ }
+ url += site;
+ url += location;
+ }
+ return url;
+}
+
std::string cmCTest::GetCurrentTag()
{
return this->CurrentTag;
@@ -2616,6 +2672,16 @@ bool cmCTest::GetShowOnly()
return this->ShowOnly;
}
+bool cmCTest::GetOutputAsJson()
+{
+ return this->OutputAsJson;
+}
+
+int cmCTest::GetOutputAsJsonVersion()
+{
+ return this->OutputAsJsonVersion;
+}
+
int cmCTest::GetMaxTestNameWidth() const
{
return this->MaxTestNameWidth;
@@ -2650,7 +2716,7 @@ void cmCTest::SetSpecificTrack(const char* track)
void cmCTest::AddSubmitFile(Part part, const char* name)
{
- this->Parts[part].SubmitFiles.push_back(name);
+ this->Parts[part].SubmitFiles.emplace_back(name);
}
void cmCTest::AddCTestConfigurationOverwrite(const std::string& overStr)
@@ -2741,13 +2807,13 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
if ((res == cmsysProcess_Pipe_STDOUT || res == cmsysProcess_Pipe_STDERR) &&
this->ExtraVerbose) {
processOutput.DecodeText(data, length, strdata);
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
}
}
if (this->ExtraVerbose) {
processOutput.DecodeText(std::string(), strdata);
if (!strdata.empty()) {
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
}
}
@@ -2813,9 +2879,11 @@ static const char* cmCTestStringLogType[] = { "DEBUG",
nullptr };
#define cmCTestLogOutputFileLine(stream) \
- if (this->ShowLineNumbers) { \
- (stream) << std::endl << file << ":" << line << " "; \
- }
+ do { \
+ if (this->ShowLineNumbers) { \
+ (stream) << std::endl << file << ":" << line << " "; \
+ } \
+ } while (false)
void cmCTest::InitStreams()
{
@@ -2937,6 +3005,20 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg,
}
}
+std::string cmCTest::GetColorCode(Color color) const
+{
+ if (this->OutputColorCode) {
+#if defined(_WIN32)
+ // Not supported on Windows
+ static_cast<void>(color);
+#else
+ return "\033[0;" + std::to_string(static_cast<int>(color)) + "m";
+#endif
+ }
+
+ return "";
+}
+
cmDuration cmCTest::GetRemainingTimeAllowed()
{
if (!this->GetHandler("script")) {
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 345b538e7..92a02c316 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -50,27 +50,23 @@ public:
PartNotes,
PartExtraFiles,
PartUpload,
+ PartDone,
PartCount // Update names in constructor when adding a part
};
/** Representation of one part. */
struct PartInfo
{
- PartInfo()
- : Enabled(false)
- {
- }
-
void SetName(const std::string& name) { this->Name = name; }
const std::string& GetName() const { return this->Name; }
void Enable() { this->Enabled = true; }
- operator bool() const { return this->Enabled; }
+ explicit operator bool() const { return this->Enabled; }
std::vector<std::string> SubmitFiles;
private:
- bool Enabled;
+ bool Enabled = false;
std::string Name;
};
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -178,6 +174,8 @@ public:
bool suppress = false);
void EmptyCTestConfiguration();
+ std::string GetSubmitURL();
+
/**
* constructor and destructor
*/
@@ -217,6 +215,10 @@ public:
/** Should we only show what we would do? */
bool GetShowOnly();
+ bool GetOutputAsJson();
+
+ int GetOutputAsJsonVersion();
+
bool ShouldUseHTTP10() { return this->UseHTTP10; }
bool ShouldPrintLabels() { return this->PrintLabels; }
@@ -373,6 +375,9 @@ public:
/** Create XML file that contains all the notes specified */
int GenerateNotesFile(const VectorOfStrings& files);
+ /** Create XML file to indicate that build is complete */
+ int GenerateDoneFile();
+
/** Submit extra files to the server */
bool SubmitExtraFiles(const char* files);
bool SubmitExtraFiles(const VectorOfStrings& files);
@@ -401,9 +406,22 @@ public:
void Log(int logType, const char* file, int line, const char* msg,
bool suppress = false);
- /** Get the version of dart server */
- int GetDartVersion() { return this->DartVersion; }
- int GetDropSiteCDash() { return this->DropSiteCDash; }
+ /** Color values */
+ enum class Color
+ {
+ CLEAR_COLOR = 0,
+ RED = 31,
+ GREEN = 32,
+ YELLOW = 33,
+ BLUE = 34
+ };
+
+ /** Get color code characters for a specific color */
+ std::string GetColorCode(Color color) const;
+
+ /** The Build ID is assigned by CDash */
+ void SetBuildID(const std::string& id) { this->BuildID = id; }
+ std::string GetBuildID() { return this->BuildID; }
/** Add file to be submitted */
void AddSubmitFile(Part part, const char* name);
@@ -493,6 +511,8 @@ private:
t_TestingHandlers TestingHandlers;
bool ShowOnly;
+ bool OutputAsJson;
+ int OutputAsJsonVersion;
/** Map of configuration properties */
typedef std::map<std::string, std::string> CTestConfigurationMap;
@@ -567,8 +587,16 @@ private:
bool HandleCommandLineArguments(size_t& i, std::vector<std::string>& args,
std::string& errormsg);
+#if !defined(_WIN32)
+ /** returns true iff the console supports progress output */
+ static bool ConsoleIsNotDumb();
+#endif
+
/** returns true iff the console supports progress output */
- bool ProgressOutputSupportedByConsole() const;
+ static bool ProgressOutputSupportedByConsole();
+
+ /** returns true iff the console supports colored output */
+ static bool ColoredOutputSupportedByConsole();
/** handle the -S -SP and -SR arguments */
void HandleScriptArguments(size_t& i, std::vector<std::string>& args,
@@ -604,8 +632,7 @@ private:
bool ShowLineNumbers;
bool Quiet;
- int DartVersion;
- bool DropSiteCDash;
+ std::string BuildID;
std::vector<std::string> InitialCommandLineArguments;
@@ -615,6 +642,7 @@ private:
int OutputLogFileLastTag;
bool OutputTestOutputOnTestFailure;
+ bool OutputColorCode;
std::map<std::string, std::string> Definitions;
};
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index b391dc44b..2728f0f9a 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -11,11 +11,11 @@
#include <string>
#include "cmGeneratedFileStream.h"
+#include "cmMessageType.h"
#include "cmMessenger.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
-#include "cmake.h"
cmCacheManager::cmCacheManager()
{
@@ -26,7 +26,7 @@ cmCacheManager::cmCacheManager()
void cmCacheManager::CleanCMakeFiles(const std::string& path)
{
std::string glob = path;
- glob += cmake::GetCMakeFilesDirectory();
+ glob += "/CMakeFiles";
glob += "/*.cmake";
cmsys::Glob globIt;
globIt.FindFiles(glob);
@@ -122,7 +122,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
std::ostringstream error;
error << "Parse error in cache file " << cacheFile;
error << " on line " << lineno << ". Offending entry: " << realbuffer;
- cmSystemTools::Error(error.str().c_str());
+ cmSystemTools::Error(error.str());
}
}
this->CacheMajorVersion = 0;
@@ -170,7 +170,7 @@ bool cmCacheManager::LoadCache(const std::string& path, bool internal,
<< " where CMakeCache.txt was created. This may result "
"in binaries being created in the wrong place. If you "
"are not sure, reedit the CMakeCache.txt";
- cmSystemTools::Error(message.str().c_str());
+ cmSystemTools::Error(message.str());
}
}
return true;
@@ -188,7 +188,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
}
const char* end = entryKey.c_str() + entryKey.size();
- for (const char** p = this->PersistentProperties; *p; ++p) {
+ for (const char** p = cmCacheManager::PersistentProperties; *p; ++p) {
std::string::size_type plen = strlen(*p) + 1;
if (entryKey.size() > plen && *(end - plen) == '-' &&
strcmp(end - plen + 1, *p) == 0) {
@@ -212,7 +212,7 @@ bool cmCacheManager::ReadPropertyEntry(std::string const& entryKey,
void cmCacheManager::WritePropertyEntries(std::ostream& os, CacheIterator i,
cmMessenger* messenger)
{
- for (const char** p = this->PersistentProperties; *p; ++p) {
+ for (const char** p = cmCacheManager::PersistentProperties; *p; ++p) {
if (const char* value = i.GetProperty(*p)) {
std::string helpstring = *p;
helpstring += " property for variable: ";
@@ -222,9 +222,9 @@ void cmCacheManager::WritePropertyEntries(std::ostream& os, CacheIterator i,
std::string key = i.GetName();
key += "-";
key += *p;
- this->OutputKey(os, key);
+ cmCacheManager::OutputKey(os, key);
os << ":INTERNAL=";
- this->OutputValue(os, value);
+ cmCacheManager::OutputValue(os, value);
os << "\n";
cmCacheManager::OutputNewlineTruncationWarning(os, key, value,
messenger);
@@ -319,9 +319,9 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
} else {
cmCacheManager::OutputHelpString(fout, "Missing description");
}
- this->OutputKey(fout, i.first);
+ cmCacheManager::OutputKey(fout, i.first);
fout << ":" << cmState::CacheEntryTypeToString(t) << "=";
- this->OutputValue(fout, ce.Value);
+ cmCacheManager::OutputValue(fout, ce.Value);
fout << "\n";
cmCacheManager::OutputNewlineTruncationWarning(fout, i.first, ce.Value,
messenger);
@@ -346,11 +346,11 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
if (t == cmStateEnums::INTERNAL) {
// Format is key:type=value
if (const char* help = i.GetProperty("HELPSTRING")) {
- this->OutputHelpString(fout, help);
+ cmCacheManager::OutputHelpString(fout, help);
}
- this->OutputKey(fout, i.GetName());
+ cmCacheManager::OutputKey(fout, i.GetName());
fout << ":" << cmState::CacheEntryTypeToString(t) << "=";
- this->OutputValue(fout, i.GetValue());
+ cmCacheManager::OutputValue(fout, i.GetValue());
fout << "\n";
cmCacheManager::OutputNewlineTruncationWarning(fout, i.GetName(),
i.GetValue(), messenger);
@@ -359,7 +359,7 @@ bool cmCacheManager::SaveCache(const std::string& path, cmMessenger* messenger)
fout << "\n";
fout.Close();
std::string checkCacheFile = path;
- checkCacheFile += cmake::GetCMakeFilesDirectory();
+ checkCacheFile += "/CMakeFiles";
cmSystemTools::MakeDirectory(checkCacheFile);
checkCacheFile += "/cmake.check_cache";
cmsys::ofstream checkCache(checkCacheFile.c_str());
@@ -383,7 +383,7 @@ bool cmCacheManager::DeleteCache(const std::string& path)
cmSystemTools::RemoveFile(cacheFile);
// now remove the files in the CMakeFiles directory
// this cleans up language cache files
- cmakeFiles += cmake::GetCMakeFilesDirectory();
+ cmakeFiles += "/CMakeFiles";
if (cmSystemTools::FileIsDirectory(cmakeFiles)) {
cmSystemTools::RemoveADirectory(cmakeFiles);
}
@@ -415,8 +415,7 @@ void cmCacheManager::OutputValueNoNewlines(std::ostream& fout,
std::string const& value)
{
// if value has trailing space or tab, enclose it in single quotes
- if (!value.empty() &&
- (value[value.size() - 1] == ' ' || value[value.size() - 1] == '\t')) {
+ if (!value.empty() && (value.back() == ' ' || value.back() == '\t')) {
fout << '\'' << value << '\'';
} else {
fout << value;
@@ -479,7 +478,7 @@ void cmCacheManager::OutputNewlineTruncationWarning(std::ostream& fout,
std::string message = "Value of ";
message += key;
message += " contained a newline; truncating";
- messenger->IssueMessage(cmake::WARNING, message);
+ messenger->IssueMessage(MessageType::WARNING, message);
}
std::string comment = "WARNING: Value of ";
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index a269271b8..0c70ed27f 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -34,20 +34,14 @@ private:
struct CacheEntry
{
std::string Value;
- cmStateEnums::CacheEntryType Type;
+ cmStateEnums::CacheEntryType Type = cmStateEnums::UNINITIALIZED;
cmPropertyMap Properties;
std::vector<std::string> GetPropertyList() const;
const char* GetProperty(const std::string&) const;
void SetProperty(const std::string& property, const char* value);
void AppendProperty(const std::string& property, const char* value,
bool asString = false);
- bool Initialized;
- CacheEntry()
- : Value("")
- , Type(cmStateEnums::UNINITIALIZED)
- , Initialized(false)
- {
- }
+ bool Initialized = false;
};
public:
diff --git a/Source/cmCallVisualStudioMacro.cxx b/Source/cmCallVisualStudioMacro.cxx
index ecfcfb965..ee5feee76 100644
--- a/Source/cmCallVisualStudioMacro.cxx
+++ b/Source/cmCallVisualStudioMacro.cxx
@@ -46,7 +46,7 @@ static bool LogErrorsAsMessages;
<< std::endl; \
_hresult_oss.flags(std::ios::dec); \
_hresult_oss << __FILE__ << "(" << __LINE__ << ")"; \
- cmSystemTools::Message(_hresult_oss.str().c_str()); \
+ cmSystemTools::Message(_hresult_oss.str()); \
} \
}
@@ -446,7 +446,7 @@ int cmCallVisualStudioMacro::CallMacro(const std::string& slnFile,
if (err && LogErrorsAsMessages) {
std::ostringstream oss;
oss << "cmCallVisualStudioMacro::CallMacro failed, err = " << err;
- cmSystemTools::Message(oss.str().c_str());
+ cmSystemTools::Message(oss.str());
}
return 0;
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index 2cc0b88ec..9ccd773f6 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -24,21 +24,19 @@ struct cmListFileArgument;
*/
class cmCommand
{
- CM_DISABLE_COPY(cmCommand)
-
public:
/**
* Construct the command. By default it has no makefile.
*/
- cmCommand()
- : Makefile(nullptr)
- {
- }
+ cmCommand() = default;
/**
* Need virtual destructor to destroy real command type.
*/
- virtual ~cmCommand() {}
+ virtual ~cmCommand() = default;
+
+ cmCommand(cmCommand const&) = delete;
+ cmCommand& operator=(cmCommand const&) = delete;
/**
* Specify the makefile.
@@ -90,7 +88,7 @@ public:
void SetError(const std::string& e);
protected:
- cmMakefile* Makefile;
+ cmMakefile* Makefile = nullptr;
private:
std::string Error;
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 2b4ceaa3e..ca2996741 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -6,7 +6,6 @@
#include "cmMakefile.h"
#include "cmState.h"
#include "cmSystemTools.h"
-#include "cmake.h"
#include <iostream>
#include <sstream>
@@ -16,8 +15,6 @@ int cmCommandArgument_yyparse(yyscan_t yyscanner);
//
cmCommandArgumentParserHelper::cmCommandArgumentParserHelper()
{
- this->WarnUninitialized = false;
- this->CheckSystemVars = false;
this->FileLine = -1;
this->FileName = nullptr;
this->RemoveEmpty = true;
@@ -95,23 +92,11 @@ const char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
return this->AddString(ostr.str());
}
const char* value = this->Makefile->GetDefinition(var);
- if (!value && !this->RemoveEmpty) {
- // check to see if we need to print a warning
- // if strict mode is on and the variable has
- // not been "cleared"/initialized with a set(foo ) call
- if (this->WarnUninitialized && !this->Makefile->VariableInitialized(var)) {
- if (this->CheckSystemVars ||
- (this->FileName &&
- (cmSystemTools::IsSubDirectory(
- this->FileName, this->Makefile->GetHomeDirectory()) ||
- cmSystemTools::IsSubDirectory(
- this->FileName, this->Makefile->GetHomeOutputDirectory())))) {
- std::ostringstream msg;
- msg << "uninitialized variable \'" << var << "\'";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
- }
+ if (!value) {
+ this->Makefile->MaybeWarnUninitialized(var, this->FileName);
+ if (!this->RemoveEmpty) {
+ return nullptr;
}
- return nullptr;
}
if (this->EscapeQuotes && value) {
return this->AddString(cmSystemTools::EscapeQuotes(value));
@@ -286,8 +271,6 @@ void cmCommandArgumentParserHelper::Error(const char* str)
void cmCommandArgumentParserHelper::SetMakefile(const cmMakefile* mf)
{
this->Makefile = mf;
- this->WarnUninitialized = mf->GetCMakeInstance()->GetWarnUninitialized();
- this->CheckSystemVars = mf->GetCMakeInstance()->GetCheckSystemVars();
}
void cmCommandArgumentParserHelper::SetResult(const char* value)
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index 098c00064..25e689224 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -12,8 +12,6 @@ class cmMakefile;
class cmCommandArgumentParserHelper
{
- CM_DISABLE_COPY(cmCommandArgumentParserHelper)
-
public:
struct ParserType
{
@@ -23,6 +21,10 @@ public:
cmCommandArgumentParserHelper();
~cmCommandArgumentParserHelper();
+ cmCommandArgumentParserHelper(cmCommandArgumentParserHelper const&) = delete;
+ cmCommandArgumentParserHelper& operator=(
+ cmCommandArgumentParserHelper const&) = delete;
+
int ParseString(const char* str, int verb);
// For the lexer:
@@ -75,8 +77,6 @@ private:
long FileLine;
int CurrentLine;
int Verbose;
- bool WarnUninitialized;
- bool CheckSystemVars;
bool EscapeQuotes;
bool NoEscapeMode;
bool ReplaceAtSyntax;
diff --git a/Source/cmCommandArgumentsHelper.h b/Source/cmCommandArgumentsHelper.h
index c68e64c10..dc934bed6 100644
--- a/Source/cmCommandArgumentsHelper.h
+++ b/Source/cmCommandArgumentsHelper.h
@@ -39,7 +39,7 @@ class cmCommandArgument
public:
cmCommandArgument(cmCommandArgumentsHelper* args, const char* key,
cmCommandArgumentGroup* group = nullptr);
- virtual ~cmCommandArgument() {}
+ virtual ~cmCommandArgument() = default;
/// this argument may follow after arg. 0 means it comes first.
void Follows(const cmCommandArgument* arg);
@@ -103,7 +103,6 @@ private:
std::vector<std::string> Vector;
unsigned int DataStart;
const char* Ignore;
- cmCAStringVector();
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
};
@@ -125,7 +124,6 @@ private:
unsigned int DataStart;
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
- cmCAString();
};
/** cmCAEnabler is to be used for options which are off by default and can be
@@ -143,7 +141,6 @@ private:
bool Enabled;
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
- cmCAEnabler();
};
/** cmCADisable is to be used for options which are on by default and can be
@@ -161,7 +158,6 @@ private:
bool Enabled;
bool DoConsume(const std::string& arg, unsigned int index) override;
void DoReset() override;
- cmCADisabler();
};
/** Group of arguments, needed for ordering. E.g. WIN32, EXCLUDE_FROM_ALL and
@@ -172,8 +168,6 @@ class cmCommandArgumentGroup
friend class cmCommandArgument;
public:
- cmCommandArgumentGroup() {}
-
/// All members of this group may follow the given argument
void Follows(const cmCommandArgument* arg);
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index a1df27107..66250f329 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -29,9 +29,7 @@ cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
{
}
-cmCommonTargetGenerator::~cmCommonTargetGenerator()
-{
-}
+cmCommonTargetGenerator::~cmCommonTargetGenerator() = default;
std::string const& cmCommonTargetGenerator::GetConfigName() const
{
@@ -198,7 +196,7 @@ std::string cmCommonTargetGenerator::GetManifests()
manifests.reserve(manifest_srcs.size());
for (cmSourceFile const* manifest_src : manifest_srcs) {
manifests.push_back(this->LocalCommonGenerator->ConvertToOutputFormat(
- this->LocalCommonGenerator->ConvertToRelativePath(
+ this->LocalCommonGenerator->MaybeConvertToRelativePath(
this->LocalCommonGenerator->GetWorkingDirectory(),
manifest_src->GetFullPath()),
cmOutputConverter::SHELL));
diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx
index a7dc1ca03..113463f63 100644
--- a/Source/cmComputeComponentGraph.cxx
+++ b/Source/cmComputeComponentGraph.cxx
@@ -18,9 +18,7 @@ cmComputeComponentGraph::cmComputeComponentGraph(Graph const& input)
this->TransferEdges();
}
-cmComputeComponentGraph::~cmComputeComponentGraph()
-{
-}
+cmComputeComponentGraph::~cmComputeComponentGraph() = default;
void cmComputeComponentGraph::Tarjan()
{
@@ -125,8 +123,8 @@ void cmComputeComponentGraph::TransferEdges()
if (i_component != j_component) {
// We do not attempt to combine duplicate edges, but instead
// store the inter-component edges with suitable multiplicity.
- this->ComponentGraph[i_component].emplace_back(j_component,
- ni.IsStrong());
+ this->ComponentGraph[i_component].emplace_back(
+ j_component, ni.IsStrong(), ni.GetBacktrace());
}
}
}
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index aa17de6e4..4717cf6b5 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -6,6 +6,7 @@
#include "cmComputeComponentGraph.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmStateTypes.h"
@@ -419,7 +420,8 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
// This shared library dependency must follow the item that listed
// it.
- this->EntryConstraintGraph[dep.DependerIndex].push_back(index);
+ this->EntryConstraintGraph[dep.DependerIndex].emplace_back(
+ index, true, cmListFileBacktrace());
// Target items may have their own dependencies.
if (entry.Target) {
@@ -522,7 +524,8 @@ void cmComputeLinkDepends::AddLinkEntries(int depender_index,
// The dependee must come after the depender.
if (depender_index >= 0) {
- this->EntryConstraintGraph[depender_index].push_back(dependee_index);
+ this->EntryConstraintGraph[depender_index].emplace_back(
+ dependee_index, false, cmListFileBacktrace());
} else {
// This is a direct dependency of the target being linked.
this->OriginalEntries.push_back(dependee_index);
@@ -565,7 +568,7 @@ cmLinkItem cmComputeLinkDepends::ResolveLinkItem(int depender_index,
from = depender;
}
}
- return from->ResolveLinkItem(name);
+ return from->ResolveLinkItem(name, cmListFileBacktrace());
}
void cmComputeLinkDepends::InferDependencies()
@@ -594,7 +597,10 @@ void cmComputeLinkDepends::InferDependencies()
// Add the inferred dependencies to the graph.
cmGraphEdgeList& edges = this->EntryConstraintGraph[depender_index];
- edges.insert(edges.end(), common.begin(), common.end());
+ edges.reserve(edges.size() + common.size());
+ for (auto const& c : common) {
+ edges.emplace_back(c, true, cmListFileBacktrace());
+ }
}
}
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 66fb1e652..252f8748c 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -35,23 +35,9 @@ public:
struct LinkEntry
{
std::string Item;
- cmGeneratorTarget const* Target;
- bool IsSharedDep;
- bool IsFlag;
- LinkEntry()
- : Item()
- , Target(nullptr)
- , IsSharedDep(false)
- , IsFlag(false)
- {
- }
- LinkEntry(LinkEntry const& r)
- : Item(r.Item)
- , Target(r.Target)
- , IsSharedDep(r.IsSharedDep)
- , IsFlag(r.IsFlag)
- {
- }
+ cmGeneratorTarget const* Target = nullptr;
+ bool IsSharedDep = false;
+ bool IsFlag = false;
};
typedef std::vector<LinkEntry> EntryVector;
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 0e48ca86d..3d61665fd 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -8,6 +8,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOrderDirectories.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
@@ -30,7 +31,7 @@ Notes about linking on various platforms:
------------------------------------------------------------------------------
-Linux, FreeBSD, macOS, IRIX, Sun, Windows:
+Linux, FreeBSD, macOS, Sun, Windows:
Linking to libraries using the full path works fine.
@@ -421,7 +422,8 @@ std::string cmComputeLinkInformation::GetRPathLinkString() const
return "";
}
- // Construct the linker runtime search path.
+ // Construct the linker runtime search path. These MUST NOT contain tokens
+ // such as $ORIGIN, see https://sourceware.org/bugzilla/show_bug.cgi?id=16936
return cmJoin(this->OrderDependentRPath->GetOrderedDirectories(), ":");
}
@@ -521,7 +523,7 @@ bool cmComputeLinkInformation::Compute()
"name."
;
/* clang-format on */
- this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+ this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
@@ -882,12 +884,12 @@ void cmComputeLinkInformation::AddLinkExtension(const char* e, LinkType type)
{
if (e && *e) {
if (type == LinkStatic) {
- this->StaticLinkExtensions.push_back(e);
+ this->StaticLinkExtensions.emplace_back(e);
}
if (type == LinkShared) {
- this->SharedLinkExtensions.push_back(e);
+ this->SharedLinkExtensions.emplace_back(e);
}
- this->LinkExtensions.push_back(e);
+ this->LinkExtensions.emplace_back(e);
}
}
@@ -1235,7 +1237,7 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
std::ostringstream e;
e << "Could not parse framework path \"" << item << "\" "
<< "linked by target " << this->Target->GetName() << ".";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return;
}
@@ -1280,7 +1282,7 @@ void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
<< "\" requests linking to directory \"" << item << "\". "
<< "Targets may link only to libraries. "
<< "CMake is dropping the item.";
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
}
void cmComputeLinkInformation::ComputeFrameworkInfo()
@@ -1381,7 +1383,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
<< " " << item << "\n"
<< "which is a full-path but not a valid library file name.";
/* clang-format on */
- this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+ this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
}
@@ -1400,7 +1402,7 @@ void cmComputeLinkInformation::HandleBadFullItem(std::string const& item,
<< " " << item << "\n"
<< "which is a full-path but not a valid library file name.";
/* clang-format on */
- this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->CMakeInstance->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Target->GetBacktrace());
} break;
}
@@ -1423,7 +1425,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
"CMP0003-WARNING-GIVEN", "1");
std::ostringstream w;
this->PrintLinkPolicyDiagnosis(w);
- this->CMakeInstance->IssueMessage(cmake::AUTHOR_WARNING, w.str(),
+ this->CMakeInstance->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
this->Target->GetBacktrace());
}
case cmPolicies::OLD:
@@ -1438,7 +1440,7 @@ bool cmComputeLinkInformation::FinishLinkerSearchDirectories()
std::ostringstream e;
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0003) << "\n";
this->PrintLinkPolicyDiagnosis(e);
- this->CMakeInstance->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->CMakeInstance->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Target->GetBacktrace());
return false;
}
@@ -1702,6 +1704,14 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
!this->Makefile->IsOn("CMAKE_SKIP_INSTALL_RPATH") &&
this->Target->GetPropertyAsBool("INSTALL_RPATH_USE_LINK_PATH");
+ // Select whether to use $ORIGIN in RPATHs for artifacts in the build tree.
+ std::string const& originToken = this->Makefile->GetSafeDefinition(
+ "CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN");
+ std::string targetOutputDir = this->Target->GetDirectory(this->Config);
+ bool use_relative_build_rpath =
+ this->Target->GetPropertyAsBool("BUILD_RPATH_USE_ORIGIN") &&
+ !originToken.empty() && !targetOutputDir.empty();
+
// Construct the RPATH.
std::set<std::string> emitted;
if (use_install_rpath) {
@@ -1711,6 +1721,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
if (use_build_rpath) {
// Add directories explicitly specified by user
if (const char* build_rpath = this->Target->GetProperty("BUILD_RPATH")) {
+ // This will not resolve entries to use $ORIGIN, the user is expected to
+ // do that if necessary.
cmCLI_ExpandListUnique(build_rpath, runtimeDirs, emitted);
}
}
@@ -1728,6 +1740,8 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
this->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
cmSystemTools::ConvertToUnixSlashes(rootPath);
std::vector<std::string> const& rdirs = this->GetRuntimeSearchPath();
+ std::string const& topBinaryDir =
+ this->CMakeInstance->GetHomeOutputDirectory();
for (std::string const& ri : rdirs) {
// Put this directory in the rpath if using build-tree rpath
// support or if using the link path as an rpath.
@@ -1741,6 +1755,18 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
d += "/";
d += suffix;
cmSystemTools::ConvertToUnixSlashes(d);
+ } else if (use_relative_build_rpath) {
+ // If expansion of the $ORIGIN token is supported and permitted per
+ // policy, use relative paths in the RPATH.
+ if (cmSystemTools::ComparePath(d, topBinaryDir) ||
+ cmSystemTools::IsSubDirectory(d, topBinaryDir)) {
+ d = cmSystemTools::RelativePath(targetOutputDir, d);
+ if (!d.empty()) {
+ d = originToken + "/" + d;
+ } else {
+ d = originToken;
+ }
+ }
}
if (emitted.insert(d).second) {
runtimeDirs.push_back(std::move(d));
@@ -1749,8 +1775,6 @@ void cmComputeLinkInformation::GetRPath(std::vector<std::string>& runtimeDirs,
// Do not add any path inside the source or build tree.
std::string const& topSourceDir =
this->CMakeInstance->GetHomeDirectory();
- std::string const& topBinaryDir =
- this->CMakeInstance->GetHomeOutputDirectory();
if (!cmSystemTools::ComparePath(ri, topSourceDir) &&
!cmSystemTools::ComparePath(ri, topBinaryDir) &&
!cmSystemTools::IsSubDirectory(ri, topSourceDir) &&
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index e00d230a3..863639c6a 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -9,6 +9,7 @@
#include <iosfwd>
#include <set>
#include <string>
+#include <utility>
#include <vector>
class cmGeneratorTarget;
@@ -30,22 +31,16 @@ public:
struct Item
{
- Item()
- : Value()
- , IsPath(true)
- , Target(nullptr)
- {
- }
- Item(std::string const& v, bool p,
- cmGeneratorTarget const* target = nullptr)
- : Value(v)
+ Item() = default;
+ Item(std::string v, bool p, cmGeneratorTarget const* target = nullptr)
+ : Value(std::move(v))
, IsPath(p)
, Target(target)
{
}
std::string Value;
- bool IsPath;
- cmGeneratorTarget const* Target;
+ bool IsPath = true;
+ cmGeneratorTarget const* Target = nullptr;
};
typedef std::vector<Item> ItemVector;
ItemVector const& GetItems() const;
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 268e74970..9b7b02f53 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -6,8 +6,10 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmLinkItem.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmState.h"
@@ -22,8 +24,6 @@
#include <stdio.h>
#include <utility>
-class cmListFileBacktrace;
-
/*
This class is meant to analyze inter-target dependencies globally
@@ -103,9 +103,7 @@ cmComputeTargetDepends::cmComputeTargetDepends(cmGlobalGenerator* gg)
cm->GetState()->GetGlobalPropertyAsBool("GLOBAL_DEPENDS_NO_CYCLES");
}
-cmComputeTargetDepends::~cmComputeTargetDepends()
-{
-}
+cmComputeTargetDepends::~cmComputeTargetDepends() = default;
bool cmComputeTargetDepends::Compute()
{
@@ -152,6 +150,7 @@ void cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t,
cmGeneratorTarget const* dep = this->Targets[ni];
cmTargetDependSet::iterator di = deps.insert(dep).first;
di->SetType(ni.IsStrong());
+ di->SetBacktrace(ni.GetBacktrace());
}
}
@@ -208,7 +207,8 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
for (cmSourceFile const* o : objectFiles) {
std::string const& objLib = o->GetObjectLibrary();
if (!objLib.empty()) {
- cmLinkItem const& objItem = depender->ResolveLinkItem(objLib);
+ cmLinkItem const& objItem =
+ depender->ResolveLinkItem(objLib, cmListFileBacktrace());
if (emitted.insert(objItem).second) {
if (depender->GetType() != cmStateEnums::EXECUTABLE &&
depender->GetType() != cmStateEnums::STATIC_LIBRARY &&
@@ -216,7 +216,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
depender->GetType() != cmStateEnums::MODULE_LIBRARY &&
depender->GetType() != cmStateEnums::OBJECT_LIBRARY) {
this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"Only executables and libraries may reference target objects.",
depender->GetBacktrace());
return;
@@ -230,7 +230,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
cmLinkImplementation const* impl = depender->GetLinkImplementation(it);
// A target should not depend on itself.
- emitted.insert(cmLinkItem(depender));
+ emitted.insert(cmLinkItem(depender, cmListFileBacktrace()));
for (cmLinkImplItem const& lib : impl->Libraries) {
// Don't emit the same library twice for this target.
if (emitted.insert(lib).second) {
@@ -246,7 +246,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
std::set<cmLinkItem> const& tutils = depender->GetUtilityItems();
std::set<cmLinkItem> emitted;
// A target should not depend on itself.
- emitted.insert(cmLinkItem(depender));
+ emitted.insert(cmLinkItem(depender, cmListFileBacktrace()));
for (cmLinkItem const& litem : tutils) {
// Don't emit the same utility twice for this target.
if (emitted.insert(litem).second) {
@@ -258,7 +258,8 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index)
void cmComputeTargetDepends::AddInterfaceDepends(
int depender_index, const cmGeneratorTarget* dependee,
- const std::string& config, std::set<cmLinkItem>& emitted)
+ cmListFileBacktrace const& dependee_backtrace, const std::string& config,
+ std::set<cmLinkItem>& emitted)
{
cmGeneratorTarget const* depender = this->Targets[depender_index];
if (cmLinkInterface const* iface =
@@ -266,8 +267,13 @@ void cmComputeTargetDepends::AddInterfaceDepends(
for (cmLinkItem const& lib : iface->Libraries) {
// Don't emit the same library twice for this target.
if (emitted.insert(lib).second) {
- this->AddTargetDepend(depender_index, lib, true);
- this->AddInterfaceDepends(depender_index, lib, config, emitted);
+ // Inject the backtrace of the original link dependency whose
+ // link interface we are adding. This indicates the line of
+ // code in the project that caused this dependency to be added.
+ cmLinkItem libBT = lib;
+ libBT.Backtrace = dependee_backtrace;
+ this->AddTargetDepend(depender_index, libBT, true);
+ this->AddInterfaceDepends(depender_index, libBT, config, emitted);
}
}
}
@@ -289,8 +295,9 @@ void cmComputeTargetDepends::AddInterfaceDepends(
if (dependee) {
// A target should not depend on itself.
- emitted.insert(cmLinkItem(depender));
- this->AddInterfaceDepends(depender_index, dependee, config, emitted);
+ emitted.insert(cmLinkItem(depender, cmListFileBacktrace()));
+ this->AddInterfaceDepends(depender_index, dependee,
+ dependee_name.Backtrace, config, emitted);
}
}
@@ -306,7 +313,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
if (!dependee && !linking &&
(depender->GetType() != cmStateEnums::GLOBAL_TARGET)) {
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
bool issueMessage = false;
std::ostringstream e;
switch (depender->GetPolicyStatusCMP0046()) {
@@ -319,7 +326,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
issueMessage = true;
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (issueMessage) {
cmake* cm = this->GlobalGenerator->GetCMakeInstance();
@@ -327,13 +334,7 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
e << "The dependency target \"" << dependee_name << "\" of target \""
<< depender->GetName() << "\" does not exist.";
- cmListFileBacktrace const* backtrace =
- depender->GetUtilityBacktrace(dependee_name.AsStr());
- if (backtrace) {
- cm->IssueMessage(messageType, e.str(), *backtrace);
- } else {
- cm->IssueMessage(messageType, e.str());
- }
+ cm->IssueMessage(messageType, e.str(), dependee_name.Backtrace);
}
}
@@ -346,13 +347,14 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
}
if (dependee) {
- this->AddTargetDepend(depender_index, dependee, linking);
+ this->AddTargetDepend(depender_index, dependee, dependee_name.Backtrace,
+ linking);
}
}
-void cmComputeTargetDepends::AddTargetDepend(int depender_index,
- const cmGeneratorTarget* dependee,
- bool linking)
+void cmComputeTargetDepends::AddTargetDepend(
+ int depender_index, cmGeneratorTarget const* dependee,
+ cmListFileBacktrace const& dependee_backtrace, bool linking)
{
if (dependee->IsImported() ||
dependee->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
@@ -361,7 +363,8 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
std::set<cmLinkItem> const& utils = dependee->GetUtilityItems();
for (cmLinkItem const& i : utils) {
if (cmGeneratorTarget const* transitive_dependee = i.Target) {
- this->AddTargetDepend(depender_index, transitive_dependee, false);
+ this->AddTargetDepend(depender_index, transitive_dependee, i.Backtrace,
+ false);
}
}
} else {
@@ -373,7 +376,8 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index,
int dependee_index = tii->second;
// Add this entry to the dependency graph.
- this->InitialGraph[depender_index].emplace_back(dependee_index, !linking);
+ this->InitialGraph[depender_index].emplace_back(dependee_index, !linking,
+ dependee_backtrace);
}
}
@@ -489,7 +493,7 @@ void cmComputeTargetDepends::ComplainAboutBadComponent(
e << "At least one of these targets is not a STATIC_LIBRARY. "
<< "Cyclic dependencies are allowed only among static libraries.";
}
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
}
bool cmComputeTargetDepends::IntraComponent(std::vector<int> const& cmap,
@@ -507,7 +511,7 @@ bool cmComputeTargetDepends::IntraComponent(std::vector<int> const& cmap,
for (cmGraphEdge const& edge : el) {
int j = edge;
if (cmap[j] == c && edge.IsStrong()) {
- this->FinalGraph[i].emplace_back(j, true);
+ this->FinalGraph[i].emplace_back(j, true, edge.GetBacktrace());
if (!this->IntraComponent(cmap, c, j, head, emitted, visited)) {
return false;
}
@@ -516,7 +520,7 @@ bool cmComputeTargetDepends::IntraComponent(std::vector<int> const& cmap,
// Prepend to a linear linked-list of intra-component edges.
if (*head >= 0) {
- this->FinalGraph[i].emplace_back(*head, false);
+ this->FinalGraph[i].emplace_back(*head, false, cmListFileBacktrace());
} else {
this->ComponentTail[c] = i;
}
@@ -567,7 +571,7 @@ bool cmComputeTargetDepends::ComputeFinalDepends(
int dependee_component = ni;
int dependee_component_head = this->ComponentHead[dependee_component];
this->FinalGraph[depender_component_tail].emplace_back(
- dependee_component_head, ni.IsStrong());
+ dependee_component_head, ni.IsStrong(), ni.GetBacktrace());
}
}
return true;
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index 3046e8af9..3840bd752 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmGraphAdjacencyList.h"
+#include "cmListFileCache.h"
#include <map>
#include <set>
@@ -47,6 +48,7 @@ private:
void AddTargetDepend(int depender_index, cmLinkItem const& dependee_name,
bool linking);
void AddTargetDepend(int depender_index, cmGeneratorTarget const* dependee,
+ cmListFileBacktrace const& dependee_backtrace,
bool linking);
bool ComputeFinalDepends(cmComputeComponentGraph const& ccg);
void AddInterfaceDepends(int depender_index, cmLinkItem const& dependee_name,
@@ -54,6 +56,7 @@ private:
std::set<cmLinkItem>& emitted);
void AddInterfaceDepends(int depender_index,
cmGeneratorTarget const* dependee,
+ cmListFileBacktrace const& dependee_backtrace,
const std::string& config,
std::set<cmLinkItem>& emitted);
cmGlobalGenerator* GlobalGenerator;
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 172ef9247..94ea529ea 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -8,11 +8,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmSystemTools.h"
+#include "cmake.h"
class cmCommand;
class cmTest;
@@ -51,11 +54,11 @@ static std::string const keyVERSION_LESS = "VERSION_LESS";
static std::string const keyVERSION_LESS_EQUAL = "VERSION_LESS_EQUAL";
cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
- const cmListFileContext& context,
- const cmListFileBacktrace& bt)
+ cmListFileContext context,
+ cmListFileBacktrace bt)
: Makefile(makefile)
- , ExecutionContext(context)
- , Backtrace(bt)
+ , ExecutionContext(std::move(context))
+ , Backtrace(std::move(bt))
, Policy12Status(makefile.GetPolicyStatus(cmPolicies::CMP0012))
, Policy54Status(makefile.GetPolicyStatus(cmPolicies::CMP0054))
, Policy57Status(makefile.GetPolicyStatus(cmPolicies::CMP0057))
@@ -81,7 +84,7 @@ cmConditionEvaluator::cmConditionEvaluator(cmMakefile& makefile,
bool cmConditionEvaluator::IsTrue(
const std::vector<cmExpandedCommandArgument>& args, std::string& errorString,
- cmake::MessageType& status)
+ MessageType& status)
{
errorString.clear();
@@ -123,7 +126,7 @@ bool cmConditionEvaluator::IsTrue(
// now at the end there should only be one argument left
if (newArgs.size() != 1) {
errorString = "Unknown arguments specified";
- status = cmake::FATAL_ERROR;
+ status = MessageType::FATAL_ERROR;
return false;
}
@@ -155,7 +158,7 @@ const char* cmConditionEvaluator::GetDefinitionIfUnquoted(
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.GetCMakeInstance()->IssueMessage(
- cmake::AUTHOR_WARNING, e.str(), this->Backtrace);
+ MessageType::AUTHOR_WARNING, e.str(), this->Backtrace);
}
}
@@ -199,7 +202,7 @@ bool cmConditionEvaluator::IsKeyword(std::string const& keyword,
"Since the policy is not set the OLD behavior will be used.";
this->Makefile.GetCMakeInstance()->IssueMessage(
- cmake::AUTHOR_WARNING, e.str(), this->Backtrace);
+ MessageType::AUTHOR_WARNING, e.str(), this->Backtrace);
}
}
@@ -269,7 +272,7 @@ bool cmConditionEvaluator::GetBooleanValueOld(
// returns the resulting boolean value
bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
cmExpandedCommandArgument& newArg, std::string& errorString,
- cmake::MessageType& status, bool oneArg) const
+ MessageType& status, bool oneArg) const
{
// Use the policy if it is set.
if (this->Policy12Status == cmPolicies::NEW) {
@@ -288,7 +291,7 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
errorString = "An argument named \"" + newArg.GetValue() +
"\" appears in a conditional statement. " +
cmPolicies::GetPolicyWarning(cmPolicies::CMP0012);
- status = cmake::AUTHOR_WARNING;
+ status = MessageType::AUTHOR_WARNING;
CM_FALLTHROUGH;
case cmPolicies::OLD:
return oldResult;
@@ -297,7 +300,7 @@ bool cmConditionEvaluator::GetBooleanValueWithAutoDereference(
errorString = "An argument named \"" + newArg.GetValue() +
"\" appears in a conditional statement. " +
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0012);
- status = cmake::FATAL_ERROR;
+ status = MessageType::FATAL_ERROR;
}
case cmPolicies::NEW:
break;
@@ -362,7 +365,7 @@ void cmConditionEvaluator::HandleBinaryOp(bool value, int& reducible,
// level 0 processes parenthetical expressions
bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
std::string& errorString,
- cmake::MessageType& status)
+ MessageType& status)
{
int reducible;
do {
@@ -386,7 +389,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
}
if (depth) {
errorString = "mismatched parenthesis in condition";
- status = cmake::FATAL_ERROR;
+ status = MessageType::FATAL_ERROR;
return false;
}
// store the reduced args in this vector
@@ -419,7 +422,7 @@ bool cmConditionEvaluator::HandleLevel0(cmArgumentList& newArgs,
//=========================================================================
// level one handles most predicates except for NOT
bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
- cmake::MessageType&)
+ MessageType&)
{
int reducible;
do {
@@ -485,7 +488,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
- this->Makefile.IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->Makefile.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
// is a variable defined
if (this->IsKeyword(keyDEFINED, *arg) && argP1 != newArgs.end()) {
@@ -495,6 +498,12 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
argP1->GetValue().operator[](argP1len - 1) == '}') {
std::string env = argP1->GetValue().substr(4, argP1len - 5);
bdef = cmSystemTools::HasEnv(env);
+ } else if (argP1len > 6 &&
+ argP1->GetValue().substr(0, 6) == "CACHE{" &&
+ argP1->GetValue().operator[](argP1len - 1) == '}') {
+ std::string cache = argP1->GetValue().substr(6, argP1len - 7);
+ bdef =
+ this->Makefile.GetState()->GetCacheEntryValue(cache) != nullptr;
} else {
bdef = this->Makefile.IsDefinitionSet(argP1->GetValue());
}
@@ -510,7 +519,7 @@ bool cmConditionEvaluator::HandleLevel1(cmArgumentList& newArgs, std::string&,
// level two handles most binary operations except for AND OR
bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
std::string& errorString,
- cmake::MessageType& status)
+ MessageType& status)
{
int reducible;
std::string def_buf;
@@ -541,7 +550,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
std::ostringstream error;
error << "Regular expression \"" << rex << "\" cannot compile";
errorString = error.str();
- status = cmake::FATAL_ERROR;
+ status = MessageType::FATAL_ERROR;
return false;
}
if (regEntry.find(def)) {
@@ -676,7 +685,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
"when the policy is set to NEW. "
"Since the policy is not set the OLD behavior will be used.";
- this->Makefile.IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->Makefile.IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
}
@@ -690,7 +699,7 @@ bool cmConditionEvaluator::HandleLevel2(cmArgumentList& newArgs,
// level 3 handles NOT
bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
std::string& errorString,
- cmake::MessageType& status)
+ MessageType& status)
{
int reducible;
do {
@@ -716,7 +725,7 @@ bool cmConditionEvaluator::HandleLevel3(cmArgumentList& newArgs,
// level 4 handles AND OR
bool cmConditionEvaluator::HandleLevel4(cmArgumentList& newArgs,
std::string& errorString,
- cmake::MessageType& status)
+ MessageType& status)
{
int reducible;
bool lhs;
diff --git a/Source/cmConditionEvaluator.h b/Source/cmConditionEvaluator.h
index 50f4edc4f..59e1396f6 100644
--- a/Source/cmConditionEvaluator.h
+++ b/Source/cmConditionEvaluator.h
@@ -11,8 +11,8 @@
#include "cmExpandedCommandArgument.h"
#include "cmListFileCache.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
-#include "cmake.h"
class cmMakefile;
@@ -21,14 +21,14 @@ class cmConditionEvaluator
public:
typedef std::list<cmExpandedCommandArgument> cmArgumentList;
- cmConditionEvaluator(cmMakefile& makefile, cmListFileContext const& context,
- cmListFileBacktrace const& bt);
+ cmConditionEvaluator(cmMakefile& makefile, cmListFileContext context,
+ cmListFileBacktrace bt);
// this is a shared function for both If and Else to determine if the
// arguments were valid, and if so, was the response true. If there is
// an error, the errorString will be set.
bool IsTrue(const std::vector<cmExpandedCommandArgument>& args,
- std::string& errorString, cmake::MessageType& status);
+ std::string& errorString, MessageType& status);
private:
// Filter the given variable definition based on policy CMP0054.
@@ -48,7 +48,7 @@ private:
bool GetBooleanValueWithAutoDereference(cmExpandedCommandArgument& newArg,
std::string& errorString,
- cmake::MessageType& status,
+ MessageType& status,
bool oneArg = false) const;
void IncrementArguments(cmArgumentList& newArgs,
@@ -66,19 +66,18 @@ private:
cmArgumentList::iterator& argP2);
bool HandleLevel0(cmArgumentList& newArgs, std::string& errorString,
- cmake::MessageType& status);
+ MessageType& status);
- bool HandleLevel1(cmArgumentList& newArgs, std::string&,
- cmake::MessageType&);
+ bool HandleLevel1(cmArgumentList& newArgs, std::string&, MessageType&);
bool HandleLevel2(cmArgumentList& newArgs, std::string& errorString,
- cmake::MessageType& status);
+ MessageType& status);
bool HandleLevel3(cmArgumentList& newArgs, std::string& errorString,
- cmake::MessageType& status);
+ MessageType& status);
bool HandleLevel4(cmArgumentList& newArgs, std::string& errorString,
- cmake::MessageType& status);
+ MessageType& status);
cmMakefile& Makefile;
cmListFileContext ExecutionContext;
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index c80439b13..19b1cd4e3 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -20,13 +20,10 @@
#cmakedefine CMAKE_USE_ELF_PARSER
#cmakedefine CMAKE_USE_MACH_PARSER
#cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
+#define CMake_DEFAULT_RECURSION_LIMIT @CMake_DEFAULT_RECURSION_LIMIT@
#define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
#define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
#define CM_FALLTHROUGH cmsys_FALLTHROUGH
-#define CM_DISABLE_COPY(Class) \
- Class(Class const&) = delete; \
- Class& operator=(Class const&) = delete;
-
#endif
diff --git a/Source/cmConfigureFileCommand.cxx b/Source/cmConfigureFileCommand.cxx
index 305262d2d..8224a0fe3 100644
--- a/Source/cmConfigureFileCommand.cxx
+++ b/Source/cmConfigureFileCommand.cxx
@@ -5,8 +5,8 @@
#include <sstream>
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -89,7 +89,7 @@ bool cmConfigureFileCommand::InitialPass(std::vector<std::string> const& args,
if (!unknown_args.empty()) {
std::string msg = "configure_file called with unknown argument(s):\n";
msg += unknown_args;
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg);
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, msg);
}
if (!this->ConfigureFile()) {
diff --git a/Source/cmConnection.cxx b/Source/cmConnection.cxx
index 50e193668..166426bfc 100644
--- a/Source/cmConnection.cxx
+++ b/Source/cmConnection.cxx
@@ -127,9 +127,7 @@ void cmEventBasedConnection::OnDisconnect(int onerror)
}
}
-cmConnection::~cmConnection()
-{
-}
+cmConnection::~cmConnection() = default;
bool cmConnection::OnConnectionShuttingDown()
{
diff --git a/Source/cmConnection.h b/Source/cmConnection.h
index ce2d2dc2a..092b91302 100644
--- a/Source/cmConnection.h
+++ b/Source/cmConnection.h
@@ -60,10 +60,11 @@ public:
class cmConnection
{
- CM_DISABLE_COPY(cmConnection)
-
public:
- cmConnection() {}
+ cmConnection() = default;
+
+ cmConnection(cmConnection const&) = delete;
+ cmConnection& operator=(cmConnection const&) = delete;
virtual void WriteData(const std::string& data) = 0;
diff --git a/Source/cmContinueCommand.cxx b/Source/cmContinueCommand.cxx
index 2298a05c5..48f1f411b 100644
--- a/Source/cmContinueCommand.cxx
+++ b/Source/cmContinueCommand.cxx
@@ -4,15 +4,15 @@
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include "cmake.h"
// cmContinueCommand
bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
if (!this->Makefile->IsLoopBlock()) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"A CONTINUE command was found outside of a "
"proper FOREACH or WHILE loop scope.");
cmSystemTools::SetFatalErrorOccured();
@@ -22,7 +22,7 @@ bool cmContinueCommand::InitialPass(std::vector<std::string> const& args,
status.SetContinueInvoked();
if (!args.empty()) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"The CONTINUE command does not accept any "
"arguments.");
cmSystemTools::SetFatalErrorOccured();
diff --git a/Source/cmConvertMSBuildXMLToJSON.py b/Source/cmConvertMSBuildXMLToJSON.py
index 92569e744..02074ba65 100644
--- a/Source/cmConvertMSBuildXMLToJSON.py
+++ b/Source/cmConvertMSBuildXMLToJSON.py
@@ -96,7 +96,6 @@ def read_msbuild_json(path, values=[]):
return values
-
def main():
"""Script entrypoint."""
# Parse the arguments
@@ -213,6 +212,14 @@ def __find_and_remove_value(list, compare):
return found
+def __normalize_switch(switch, separator):
+ new = switch
+ if switch.startswith("/") or switch.startswith("-"):
+ new = switch[1:]
+ if new and separator:
+ new = new + separator
+ return new
+
###########################################################################################
# private xml functions
def __convert(root, tag, values, func):
@@ -257,6 +264,8 @@ def __convert_bool(node):
reverse_switch = __get_attribute(node, 'ReverseSwitch')
if reverse_switch:
+ __with_argument(node, converted)
+
converted_reverse = copy.deepcopy(converted)
converted_reverse['switch'] = reverse_switch
@@ -303,7 +312,11 @@ def __convert_node(node, default_value='', default_flags=vsflags()):
converted = {}
converted['name'] = name
- converted['switch'] = __get_attribute(node, 'Switch')
+
+ switch = __get_attribute(node, 'Switch')
+ separator = __get_attribute(node, 'Separator')
+ converted['switch'] = __normalize_switch(switch, separator)
+
converted['comment'] = __get_attribute(node, 'DisplayName')
converted['value'] = default_value
@@ -435,7 +448,7 @@ def __write_json_file(path, values):
with open(path, 'w') as f:
json.dump(sorted_values, f, indent=2, separators=(',', ': '))
-
+ f.write("\n")
###########################################################################################
# private list helpers
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx
index 0b50121ae..3892011a5 100644
--- a/Source/cmCoreTryCompile.cxx
+++ b/Source/cmCoreTryCompile.cxx
@@ -13,6 +13,7 @@
#include "cmExportTryCompileFileGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmState.h"
@@ -24,10 +25,18 @@
static std::string const kCMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN =
"CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN";
static std::string const kCMAKE_C_COMPILER_TARGET = "CMAKE_C_COMPILER_TARGET";
+static std::string const kCMAKE_C_LINK_NO_PIE_SUPPORTED =
+ "CMAKE_C_LINK_NO_PIE_SUPPORTED";
+static std::string const kCMAKE_C_LINK_PIE_SUPPORTED =
+ "CMAKE_C_LINK_PIE_SUPPORTED";
static std::string const kCMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN =
"CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN";
static std::string const kCMAKE_CXX_COMPILER_TARGET =
"CMAKE_CXX_COMPILER_TARGET";
+static std::string const kCMAKE_CXX_LINK_NO_PIE_SUPPORTED =
+ "CMAKE_CXX_LINK_NO_PIE_SUPPORTED";
+static std::string const kCMAKE_CXX_LINK_PIE_SUPPORTED =
+ "CMAKE_CXX_LINK_PIE_SUPPORTED";
static std::string const kCMAKE_ENABLE_EXPORTS = "CMAKE_ENABLE_EXPORTS";
static std::string const kCMAKE_LINK_SEARCH_END_STATIC =
"CMAKE_LINK_SEARCH_END_STATIC";
@@ -48,6 +57,12 @@ static std::string const kCMAKE_TRY_COMPILE_PLATFORM_VARIABLES =
"CMAKE_TRY_COMPILE_PLATFORM_VARIABLES";
static std::string const kCMAKE_WARN_DEPRECATED = "CMAKE_WARN_DEPRECATED";
+/* GHS Multi platform variables */
+static std::set<std::string> ghs_platform_vars{
+ "GHS_TARGET_PLATFORM", "GHS_PRIMARY_TARGET", "GHS_TOOLSET_ROOT",
+ "GHS_OS_ROOT", "GHS_OS_DIR", "GHS_BSP_NAME"
+};
+
static void writeProperty(FILE* fout, std::string const& targetName,
std::string const& prop, std::string const& value)
{
@@ -88,7 +103,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
targetType = cmStateEnums::STATIC_LIBRARY;
} else {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
std::string("Invalid value '") + tt +
"' for "
"CMAKE_TRY_COMPILE_TARGET_TYPE. Only "
@@ -108,6 +123,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
std::string targetName;
std::vector<std::string> cmakeFlags(1, "CMAKE_FLAGS"); // fake argv[0]
std::vector<std::string> compileDefs;
+ std::string cmakeInternal;
std::string outputVariable;
std::string copyFile;
std::string copyFileError;
@@ -121,6 +137,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
std::string cxxExtensions;
std::string cudaExtensions;
std::vector<std::string> targets;
+ std::vector<std::string> linkOptions;
std::string libsToLink = " ";
bool useOldLinkLibs = true;
char targetNameBuf[64];
@@ -144,6 +161,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
DoingNone,
DoingCMakeFlags,
DoingCompileDefinitions,
+ DoingLinkOptions,
DoingLinkLibraries,
DoingOutputVariable,
DoingCopyFile,
@@ -157,7 +175,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
DoingCExtensions,
DoingCxxExtensions,
DoingCudaExtensions,
- DoingSources
+ DoingSources,
+ DoingCMakeInternal
};
Doing doing = useSources ? DoingSources : DoingNone;
for (size_t i = 3; i < argv.size(); ++i) {
@@ -165,6 +184,8 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
doing = DoingCMakeFlags;
} else if (argv[i] == "COMPILE_DEFINITIONS") {
doing = DoingCompileDefinitions;
+ } else if (argv[i] == "LINK_OPTIONS") {
+ doing = DoingLinkOptions;
} else if (argv[i] == "LINK_LIBRARIES") {
doing = DoingLinkLibraries;
useOldLinkLibs = false;
@@ -204,10 +225,14 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
} else if (argv[i] == "CUDA_EXTENSIONS") {
doing = DoingCudaExtensions;
didCudaExtensions = true;
+ } else if (argv[i] == "__CMAKE_INTERNAL") {
+ doing = DoingCMakeInternal;
} else if (doing == DoingCMakeFlags) {
cmakeFlags.push_back(argv[i]);
} else if (doing == DoingCompileDefinitions) {
- compileDefs.push_back(argv[i]);
+ cmSystemTools::ExpandListArgument(argv[i], compileDefs);
+ } else if (doing == DoingLinkOptions) {
+ linkOptions.push_back(argv[i]);
} else if (doing == DoingLinkLibraries) {
libsToLink += "\"" + cmSystemTools::TrimWhitespace(argv[i]) + "\" ";
if (cmTarget* tgt = this->Makefile->FindTargetToUse(argv[i])) {
@@ -224,7 +249,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
CM_FALLTHROUGH;
default:
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"Only libraries may be used as try_compile or try_run IMPORTED "
"LINK_LIBRARIES. Got " +
std::string(tgt->GetName()) +
@@ -275,6 +300,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
doing = DoingNone;
} else if (doing == DoingSources) {
sources.push_back(argv[i]);
+ } else if (doing == DoingCMakeInternal) {
+ cmakeInternal = argv[i];
+ doing = DoingNone;
} else if (i == 3) {
this->SrcFileSignature = false;
projectName = argv[i].c_str();
@@ -283,93 +311,95 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
} else {
std::ostringstream m;
m << "try_compile given unknown argument \"" << argv[i] << "\".";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m.str());
}
}
if (didCopyFile && copyFile.empty()) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"COPY_FILE must be followed by a file path");
return -1;
}
if (didCopyFileError && copyFileError.empty()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"COPY_FILE_ERROR must be followed by a variable name");
return -1;
}
if (didCopyFileError && !didCopyFile) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR, "COPY_FILE_ERROR may be used only with COPY_FILE");
+ MessageType::FATAL_ERROR,
+ "COPY_FILE_ERROR may be used only with COPY_FILE");
return -1;
}
if (didOutputVariable && outputVariable.empty()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"OUTPUT_VARIABLE must be followed by a variable name");
return -1;
}
if (useSources && sources.empty()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"SOURCES must be followed by at least one source file");
return -1;
}
if (didCStandard && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR, "C_STANDARD allowed only in source file signature.");
+ MessageType::FATAL_ERROR,
+ "C_STANDARD allowed only in source file signature.");
return -1;
}
if (didCxxStandard && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"CXX_STANDARD allowed only in source file signature.");
return -1;
}
if (didCudaStandard && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"CUDA_STANDARD allowed only in source file signature.");
return -1;
}
if (didCStandardRequired && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"C_STANDARD_REQUIRED allowed only in source file signature.");
return -1;
}
if (didCxxStandardRequired && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"CXX_STANDARD_REQUIRED allowed only in source file signature.");
return -1;
}
if (didCudaStandardRequired && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"CUDA_STANDARD_REQUIRED allowed only in source file signature.");
return -1;
}
if (didCExtensions && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"C_EXTENSIONS allowed only in source file signature.");
return -1;
}
if (didCxxExtensions && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"CXX_EXTENSIONS allowed only in source file signature.");
return -1;
}
if (didCudaExtensions && !this->SrcFileSignature) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"CUDA_EXTENSIONS allowed only in source file signature.");
return -1;
}
@@ -377,19 +407,19 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
// compute the binary dir when TRY_COMPILE is called with a src file
// signature
if (this->SrcFileSignature) {
- this->BinaryDirectory += cmake::GetCMakeFilesDirectory();
+ this->BinaryDirectory += "/CMakeFiles";
this->BinaryDirectory += "/CMakeTmp";
} else {
// only valid for srcfile signatures
if (!compileDefs.empty()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE");
return -1;
}
if (!copyFile.empty()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"COPY_FILE specified on a srcdir type TRY_COMPILE");
return -1;
}
@@ -402,7 +432,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
std::ostringstream e;
e << "Attempt at a recursive or nested TRY_COMPILE in directory\n"
<< " " << this->BinaryDirectory << "\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return -1;
}
@@ -436,7 +466,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
gg->GetEnabledLanguages(langs);
err << cmJoin(langs, " ");
err << "\nSee project() command to enable other languages.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, err.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, err.str());
return -1;
}
}
@@ -457,7 +487,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
<< " " << outFileName << "\n"
<< cmSystemTools::GetLastSystemError();
/* clang-format on */
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return -1;
}
@@ -485,6 +515,14 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
}
fprintf(fout, "project(CMAKE_TRY_COMPILE%s)\n", projectLangs.c_str());
+ if (cmakeInternal == "ABI") {
+ // This is the ABI detection step, also used for implicit includes.
+ // Erase any include_directories() calls from the toolchain file so
+ // that we do not see them as implicit. Our ABI detection source
+ // does not include any system headers anyway.
+ fprintf(fout,
+ "set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES \"\")\n");
+ }
fprintf(fout, "set(CMAKE_VERBOSE_MAKEFILE 1)\n");
for (std::string const& li : testLangs) {
std::string langFlags = "CMAKE_" + li + "_FLAGS";
@@ -508,7 +546,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
"(e.g. CMAKE_C_FLAGS_DEBUG) in the test project."
;
/* clang-format on */
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
case cmPolicies::OLD:
// OLD behavior is to do nothing.
@@ -516,7 +554,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0066));
CM_FALLTHROUGH;
case cmPolicies::NEW: {
@@ -545,7 +583,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
"in the test project."
;
/* clang-format on */
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
case cmPolicies::OLD:
// OLD behavior is to do nothing.
@@ -553,7 +591,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0056));
CM_FALLTHROUGH;
case cmPolicies::NEW:
@@ -576,7 +614,9 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
fprintf(fout, "link_directories(${LINK_DIRECTORIES})\n");
// handle any compile flags we need to pass on
if (!compileDefs.empty()) {
- fprintf(fout, "add_definitions(%s)\n", cmJoin(compileDefs, " ").c_str());
+ // Pass using bracket arguments to preserve content.
+ fprintf(fout, "add_definitions([==[%s]==])\n",
+ cmJoin(compileDefs, "]==] [==[").c_str());
}
/* Use a random file name to avoid rapid creation and deletion
@@ -592,7 +632,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
tcfg.SetConfig(tcConfig);
if (!tcfg.GenerateImportFile()) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"could not write export file.");
fclose(fout);
return -1;
@@ -627,6 +667,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
vars.insert(varList.begin(), varList.end());
}
+ if (this->Makefile->GetPolicyStatus(cmPolicies::CMP0083) ==
+ cmPolicies::NEW) {
+ // To ensure full support of PIE, propagate cache variables
+ // driving the link options
+ vars.insert(kCMAKE_C_LINK_PIE_SUPPORTED);
+ vars.insert(kCMAKE_C_LINK_NO_PIE_SUPPORTED);
+ vars.insert(kCMAKE_CXX_LINK_PIE_SUPPORTED);
+ vars.insert(kCMAKE_CXX_LINK_NO_PIE_SUPPORTED);
+ }
+
/* for the TRY_COMPILEs we want to be able to specify the architecture.
So the user can set CMAKE_OSX_ARCHITECTURES to i386;ppc and then set
CMAKE_TRY_COMPILE_OSX_ARCHITECTURES first to i386 and then to ppc to
@@ -656,6 +706,13 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
? "NEW"
: "OLD");
+ /* Set the appropriate policy information for PIE link flags */
+ fprintf(fout, "cmake_policy(SET CMP0083 %s)\n",
+ this->Makefile->GetPolicyStatus(cmPolicies::CMP0083) ==
+ cmPolicies::NEW
+ ? "NEW"
+ : "OLD");
+
if (targetType == cmStateEnums::EXECUTABLE) {
/* Put the executable at a known location (for COPY_FILE). */
fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
@@ -703,7 +760,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0067));
case cmPolicies::NEW:
// NEW behavior is to honor the language standard variables.
@@ -765,7 +822,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
for (std::string const& vi : this->WarnCMP0067) {
w << " " << vi << "\n";
}
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
if (testC) {
@@ -807,6 +864,23 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
}
}
+ if (!linkOptions.empty()) {
+ std::vector<std::string> options;
+ options.reserve(linkOptions.size());
+ for (const auto& option : linkOptions) {
+ options.emplace_back(cmOutputConverter::EscapeForCMake(option));
+ }
+
+ if (targetType == cmStateEnums::STATIC_LIBRARY) {
+ fprintf(fout,
+ "set_property(TARGET %s PROPERTY STATIC_LIBRARY_OPTIONS %s)\n",
+ targetName.c_str(), cmJoin(options, " ").c_str());
+ } else {
+ fprintf(fout, "target_link_options(%s PRIVATE %s)\n",
+ targetName.c_str(), cmJoin(options, " ").c_str());
+ }
+ }
+
if (useOldLinkLibs) {
fprintf(fout, "target_link_libraries(%s ${LINK_LIBRARIES})\n",
targetName.c_str());
@@ -818,6 +892,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
projectName = "CMAKE_TRY_COMPILE";
}
+ if (this->Makefile->GetState()->UseGhsMultiIDE()) {
+ // Forward the GHS variables to the inner project cache.
+ for (std::string const& var : ghs_platform_vars) {
+ if (const char* val = this->Makefile->GetDefinition(var)) {
+ std::string flag = "-D" + var + "=" + val;
+ cmakeFlags.push_back(std::move(flag));
+ }
+ }
+ }
+
bool erroroc = cmSystemTools::GetErrorOccuredFlag();
cmSystemTools::ResetErrorOccuredFlag();
std::string output;
@@ -857,7 +941,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv,
emsg << this->FindErrorMessage.c_str();
}
if (copyFileError.empty()) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, emsg.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, emsg.str());
return -1;
}
copyFileErrorMessage = emsg.str();
@@ -954,12 +1038,12 @@ void cmCoreTryCompile::FindOutputFile(const std::string& targetName,
tmp += config;
searchDirs.push_back(std::move(tmp));
}
- searchDirs.push_back("/Debug");
+ searchDirs.emplace_back("/Debug");
#if defined(__APPLE__)
std::string app = "/Debug/" + targetName + ".app";
searchDirs.push_back(std::move(app));
#endif
- searchDirs.push_back("/Development");
+ searchDirs.emplace_back("/Development");
for (std::string const& sdir : searchDirs) {
std::string command = this->BinaryDirectory;
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index 1f2a1b52c..b712f09da 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -15,8 +15,6 @@
*/
class cmCryptoHash
{
- CM_DISABLE_COPY(cmCryptoHash)
-
public:
enum Algo
{
@@ -35,6 +33,9 @@ public:
cmCryptoHash(Algo algo);
~cmCryptoHash();
+ cmCryptoHash(cmCryptoHash const&) = delete;
+ cmCryptoHash& operator=(cmCryptoHash const&) = delete;
+
/// @brief Returns a new hash generator of the requested type
/// @arg algo Hash type name. Supported hash types are
/// MD5, SHA1, SHA224, SHA256, SHA384, SHA512,
diff --git a/Source/cmCurl.cxx b/Source/cmCurl.cxx
index 3360323f0..0004f666b 100644
--- a/Source/cmCurl.cxx
+++ b/Source/cmCurl.cxx
@@ -2,8 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCurl.h"
-#include "cmThirdParty.h"
-
#if !defined(CMAKE_USE_SYSTEM_CURL) && !defined(_WIN32) && \
!defined(__APPLE__) && !defined(CURL_CA_BUNDLE) && !defined(CURL_CA_PATH)
# define CMAKE_FIND_CAFILE
@@ -16,11 +14,13 @@
#endif
#define check_curl_result(result, errstr) \
- if ((result) != CURLE_OK && (result) != CURLE_NOT_BUILT_IN) { \
- e += e.empty() ? "" : "\n"; \
- e += (errstr); \
- e += ::curl_easy_strerror(result); \
- }
+ do { \
+ if ((result) != CURLE_OK && (result) != CURLE_NOT_BUILT_IN) { \
+ e += e.empty() ? "" : "\n"; \
+ e += (errstr); \
+ e += ::curl_easy_strerror(result); \
+ } \
+ } while (false)
std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile)
{
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index cfd260c23..242ceaab4 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -4,34 +4,22 @@
#include "cmMakefile.h"
-cmCustomCommand::cmCustomCommand()
- : Backtrace()
-{
- this->HaveComment = false;
- this->EscapeOldStyle = true;
- this->EscapeAllowMakeVars = false;
- this->UsesTerminal = false;
- this->CommandExpandLists = false;
-}
+#include <utility>
cmCustomCommand::cmCustomCommand(cmMakefile const* mf,
- const std::vector<std::string>& outputs,
- const std::vector<std::string>& byproducts,
- const std::vector<std::string>& depends,
- const cmCustomCommandLines& commandLines,
+ std::vector<std::string> outputs,
+ std::vector<std::string> byproducts,
+ std::vector<std::string> depends,
+ cmCustomCommandLines commandLines,
const char* comment,
const char* workingDirectory)
- : Outputs(outputs)
- , Byproducts(byproducts)
- , Depends(depends)
- , CommandLines(commandLines)
- , Backtrace()
+ : Outputs(std::move(outputs))
+ , Byproducts(std::move(byproducts))
+ , Depends(std::move(depends))
+ , CommandLines(std::move(commandLines))
, Comment(comment ? comment : "")
, WorkingDirectory(workingDirectory ? workingDirectory : "")
, HaveComment(comment != nullptr)
- , EscapeAllowMakeVars(false)
- , EscapeOldStyle(true)
- , CommandExpandLists(false)
{
if (mf) {
this->Backtrace = mf->GetBacktrace();
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index 9e82f2505..50f15a46f 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -22,16 +22,12 @@ class cmMakefile;
class cmCustomCommand
{
public:
- /** Default and copy constructors for STL containers. */
- cmCustomCommand();
-
/** Main constructor specifies all information for the command. */
- cmCustomCommand(cmMakefile const* mf,
- const std::vector<std::string>& outputs,
- const std::vector<std::string>& byproducts,
- const std::vector<std::string>& depends,
- const cmCustomCommandLines& commandLines,
- const char* comment, const char* workingDirectory);
+ cmCustomCommand(cmMakefile const* mf, std::vector<std::string> outputs,
+ std::vector<std::string> byproducts,
+ std::vector<std::string> depends,
+ cmCustomCommandLines commandLines, const char* comment,
+ const char* workingDirectory);
/** Get the output file produced by the command. */
const std::vector<std::string>& GetOutputs() const;
@@ -103,11 +99,11 @@ private:
std::string Comment;
std::string WorkingDirectory;
std::string Depfile;
- bool HaveComment;
- bool EscapeAllowMakeVars;
- bool EscapeOldStyle;
- bool UsesTerminal;
- bool CommandExpandLists;
+ bool HaveComment = false;
+ bool EscapeAllowMakeVars = false;
+ bool EscapeOldStyle = true;
+ bool UsesTerminal = false;
+ bool CommandExpandLists = false;
};
#endif
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index d1c173670..6bf99468e 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -16,10 +16,10 @@
#include <utility>
cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
- const std::string& config,
+ std::string config,
cmLocalGenerator* lg)
: CC(cc)
- , Config(config)
+ , Config(std::move(config))
, LG(lg)
, OldStyle(cc.GetEscapeOldStyle())
, MakeVars(cc.GetEscapeAllowMakeVars())
diff --git a/Source/cmCustomCommandGenerator.h b/Source/cmCustomCommandGenerator.h
index b7e2a3924..9684cffa8 100644
--- a/Source/cmCustomCommandGenerator.h
+++ b/Source/cmCustomCommandGenerator.h
@@ -29,8 +29,8 @@ class cmCustomCommandGenerator
const char* GetArgv0Location(unsigned int c) const;
public:
- cmCustomCommandGenerator(cmCustomCommand const& cc,
- const std::string& config, cmLocalGenerator* lg);
+ cmCustomCommandGenerator(cmCustomCommand const& cc, std::string config,
+ cmLocalGenerator* lg);
~cmCustomCommandGenerator();
cmCustomCommand const& GetCC() const { return this->CC; }
unsigned int GetNumberOfCommands() const;
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 4ab5be6cc..6c252bee5 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -47,26 +47,19 @@ private:
typedef std::string std_string;
public:
- Def()
- : std_string()
- , Exists(false)
- , Used(false)
- {
- }
+ Def() = default;
Def(const char* v)
: std_string(v ? v : "")
, Exists(v ? true : false)
- , Used(false)
{
}
Def(const std_string& v)
: std_string(v)
, Exists(true)
- , Used(false)
{
}
- bool Exists;
- bool Used;
+ bool Exists = false;
+ bool Used = false;
};
static Def NoDef;
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 6f1afd7bc..7d1d31624 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -13,12 +13,9 @@
#include <string.h>
#include <utility>
-cmDepends::cmDepends(cmLocalGenerator* lg, const char* targetDir)
+cmDepends::cmDepends(cmLocalGenerator* lg, std::string targetDir)
: LocalGenerator(lg)
- , Verbose(false)
- , FileComparison(nullptr)
- , TargetDirectory(targetDir)
- , MaxPath(16384)
+ , TargetDirectory(std::move(targetDir))
, Dependee(new char[MaxPath])
, Depender(new char[MaxPath])
{
@@ -68,12 +65,13 @@ bool cmDepends::Finalize(std::ostream& /*unused*/, std::ostream& /*unused*/)
return true;
}
-bool cmDepends::Check(const char* makeFile, const char* internalFile,
+bool cmDepends::Check(const std::string& makeFile,
+ const std::string& internalFile,
std::map<std::string, DependencyVector>& validDeps)
{
// Check whether dependencies must be regenerated.
bool okay = true;
- cmsys::ifstream fin(internalFile);
+ cmsys::ifstream fin(internalFile.c_str());
if (!(fin && this->CheckDependencies(fin, internalFile, validDeps))) {
// Clear all dependencies so they will be regenerated.
this->Clear(makeFile);
@@ -84,13 +82,13 @@ bool cmDepends::Check(const char* makeFile, const char* internalFile,
return okay;
}
-void cmDepends::Clear(const char* file)
+void cmDepends::Clear(const std::string& file)
{
// Print verbose output.
if (this->Verbose) {
std::ostringstream msg;
msg << "Clearing dependencies in \"" << file << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
// Write an empty dependency file.
@@ -110,7 +108,7 @@ bool cmDepends::WriteDependencies(const std::set<std::string>& /*unused*/,
}
bool cmDepends::CheckDependencies(
- std::istream& internalDepends, const char* internalDependsFileName,
+ std::istream& internalDepends, const std::string& internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps)
{
// Parse dependencies from the stream. If any dependee is missing
@@ -158,8 +156,8 @@ bool cmDepends::CheckDependencies(
// * if the depender does not exist, but the dependee is newer than the
// depends file
bool regenerate = false;
- const char* dependee = this->Dependee + 1;
- const char* depender = this->Depender;
+ const std::string dependee(this->Dependee + 1);
+ const std::string depender(this->Depender);
if (currentDependencies != nullptr) {
currentDependencies->push_back(dependee);
}
@@ -173,7 +171,7 @@ bool cmDepends::CheckDependencies(
std::ostringstream msg;
msg << "Dependee \"" << dependee << "\" does not exist for depender \""
<< depender << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
} else {
if (dependerExists) {
@@ -190,7 +188,7 @@ bool cmDepends::CheckDependencies(
std::ostringstream msg;
msg << "Dependee \"" << dependee << "\" is newer than depender \""
<< depender << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
}
} else {
@@ -209,7 +207,7 @@ bool cmDepends::CheckDependencies(
msg << "Dependee \"" << dependee
<< "\" is newer than depends file \""
<< internalDependsFileName << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
}
}
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index 4b9e05a88..20c91ca57 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -24,12 +24,13 @@ class cmLocalGenerator;
*/
class cmDepends
{
- CM_DISABLE_COPY(cmDepends)
-
public:
/** Instances need to know the build directory name and the relative
path from the build directory to the target file. */
- cmDepends(cmLocalGenerator* lg = nullptr, const char* targetDir = "");
+ cmDepends(cmLocalGenerator* lg = nullptr, std::string targetDir = "");
+
+ cmDepends(cmDepends const&) = delete;
+ cmDepends& operator=(cmDepends const&) = delete;
/** Set the local generator for the directory in which we are
scanning dependencies. This is not a full local generator; it
@@ -41,7 +42,10 @@ public:
void SetLanguage(const std::string& lang) { this->Language = lang; }
/** Set the target build directory. */
- void SetTargetDirectory(const char* dir) { this->TargetDirectory = dir; }
+ void SetTargetDirectory(const std::string& dir)
+ {
+ this->TargetDirectory = dir;
+ }
/** should this be verbose in its output */
void SetVerbose(bool verb) { this->Verbose = verb; }
@@ -61,11 +65,11 @@ public:
they must be generated Clear has already been called to wipe out
the old dependencies.
Dependencies which are still valid will be stored in validDeps. */
- bool Check(const char* makeFile, const char* internalFile,
+ bool Check(const std::string& makeFile, const std::string& internalFile,
std::map<std::string, DependencyVector>& validDeps);
/** Clear dependencies for the target file so they will be regenerated. */
- void Clear(const char* file);
+ void Clear(const std::string& file);
/** Set the file comparison object */
void SetFileComparison(cmFileTimeComparison* fc)
@@ -85,7 +89,7 @@ protected:
// Return false if dependencies must be regenerated and true
// otherwise.
virtual bool CheckDependencies(
- std::istream& internalDepends, const char* internalDependsFileName,
+ std::istream& internalDepends, const std::string& internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps);
// Finalize the dependency information for the target.
@@ -96,15 +100,15 @@ protected:
cmLocalGenerator* LocalGenerator;
// Flag for verbose output.
- bool Verbose;
- cmFileTimeComparison* FileComparison;
+ bool Verbose = false;
+ cmFileTimeComparison* FileComparison = nullptr;
std::string Language;
// The full path to the target's build directory.
std::string TargetDirectory;
- size_t MaxPath;
+ size_t MaxPath = 16384;
char* Dependee;
char* Depender;
diff --git a/Source/cmDependsC.cxx b/Source/cmDependsC.cxx
index f7dd33b37..b1630f9ae 100644
--- a/Source/cmDependsC.cxx
+++ b/Source/cmDependsC.cxx
@@ -19,13 +19,10 @@
#define INCLUDE_REGEX_COMPLAIN_MARKER "#IncludeRegexComplain: "
#define INCLUDE_REGEX_TRANSFORM_MARKER "#IncludeRegexTransform: "
-cmDependsC::cmDependsC()
- : ValidDeps(nullptr)
-{
-}
+cmDependsC::cmDependsC() = default;
cmDependsC::cmDependsC(
- cmLocalGenerator* lg, const char* targetDir, const std::string& lang,
+ cmLocalGenerator* lg, const std::string& targetDir, const std::string& lang,
const std::map<std::string, DependencyVector>* validDeps)
: cmDepends(lg, targetDir)
, ValidDeps(validDeps)
@@ -54,8 +51,8 @@ cmDependsC::cmDependsC(
}
this->IncludeRegexLine.compile(INCLUDE_REGEX_LINE);
- this->IncludeRegexScan.compile(scanRegex.c_str());
- this->IncludeRegexComplain.compile(complainRegex.c_str());
+ this->IncludeRegexScan.compile(scanRegex);
+ this->IncludeRegexComplain.compile(complainRegex);
this->IncludeRegexLineString = INCLUDE_REGEX_LINE_MARKER INCLUDE_REGEX_LINE;
this->IncludeRegexScanString = INCLUDE_REGEX_SCAN_MARKER;
this->IncludeRegexScanString += scanRegex;
@@ -101,7 +98,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// Compute a path to the object file to write to the internal depend file.
// Any existing content of the internal depend file has already been
// loaded in ValidDeps with this path as a key.
- std::string obj_i = this->LocalGenerator->ConvertToRelativePath(binDir, obj);
+ std::string obj_i =
+ this->LocalGenerator->MaybeConvertToRelativePath(binDir, obj);
if (this->ValidDeps != nullptr) {
std::map<std::string, DependencyVector>::const_iterator tmpIt =
@@ -213,7 +211,7 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
// Scan this file for new dependencies. Pass the directory
// containing the file to handle double-quote includes.
std::string dir = cmSystemTools::GetFilenamePath(fullName);
- this->Scan(fin, dir.c_str(), fullName);
+ this->Scan(fin, dir, fullName);
} else {
// Skip file with encoding we do not implement.
}
@@ -235,7 +233,8 @@ bool cmDependsC::WriteDependencies(const std::set<std::string>& sources,
for (std::string const& dep : dependencies) {
makeDepends << obj_m << ": "
<< cmSystemTools::ConvertToOutputPath(
- this->LocalGenerator->ConvertToRelativePath(binDir, dep))
+ this->LocalGenerator->MaybeConvertToRelativePath(binDir,
+ dep))
<< std::endl;
internalDepends << " " << dep << std::endl;
}
@@ -269,8 +268,7 @@ void cmDependsC::ReadCacheFile()
haveFileName = true;
int newer = 0;
cmFileTimeComparison comp;
- bool res = comp.FileTimeCompare(this->CacheFileName.c_str(),
- line.c_str(), &newer);
+ bool res = comp.FileTimeCompare(this->CacheFileName, line, &newer);
if (res && newer == 1) // cache is newer than the parsed file
{
@@ -343,7 +341,7 @@ void cmDependsC::WriteCacheFile() const
}
}
-void cmDependsC::Scan(std::istream& is, const char* directory,
+void cmDependsC::Scan(std::istream& is, const std::string& directory,
const std::string& fullName)
{
cmIncludeLines* newCacheEntry = new cmIncludeLines;
@@ -419,7 +417,7 @@ void cmDependsC::SetupTransforms()
sep = "|";
}
xform += ")[ \t]*\\(([^),]*)\\)";
- this->IncludeRegexTransform.compile(xform.c_str());
+ this->IncludeRegexTransform.compile(xform);
// Build a string that encodes all transformation rules and will
// change when rules are changed.
@@ -461,11 +459,11 @@ void cmDependsC::TransformLine(std::string& line)
// Construct the transformed line.
std::string newline = this->IncludeRegexTransform.match(1);
std::string arg = this->IncludeRegexTransform.match(4);
- for (const char* c = tri->second.c_str(); *c; ++c) {
- if (*c == '%') {
+ for (char c : tri->second) {
+ if (c == '%') {
newline += arg;
} else {
- newline += *c;
+ newline += c;
}
}
diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h
index 2f76f6275..eee5ae15c 100644
--- a/Source/cmDependsC.h
+++ b/Source/cmDependsC.h
@@ -22,19 +22,20 @@ class cmLocalGenerator;
*/
class cmDependsC : public cmDepends
{
- CM_DISABLE_COPY(cmDependsC)
-
public:
/** Checking instances need to know the build directory name and the
relative path from the build directory to the target file. */
cmDependsC();
- cmDependsC(cmLocalGenerator* lg, const char* targetDir,
+ cmDependsC(cmLocalGenerator* lg, const std::string& targetDir,
const std::string& lang,
const std::map<std::string, DependencyVector>* validDeps);
/** Virtual destructor to cleanup subclasses properly. */
~cmDependsC() override;
+ cmDependsC(cmDependsC const&) = delete;
+ cmDependsC& operator=(cmDependsC const&) = delete;
+
protected:
// Implement writing/checking methods required by superclass.
bool WriteDependencies(const std::set<std::string>& sources,
@@ -42,7 +43,7 @@ protected:
std::ostream& internalDepends) override;
// Method to scan a single file.
- void Scan(std::istream& is, const char* directory,
+ void Scan(std::istream& is, const std::string& directory,
const std::string& fullName);
// Regular expression to identify C preprocessor include directives.
@@ -75,16 +76,12 @@ public:
struct cmIncludeLines
{
- cmIncludeLines()
- : Used(false)
- {
- }
std::vector<UnscannedEntry> UnscannedEntries;
- bool Used;
+ bool Used = false;
};
protected:
- const std::map<std::string, DependencyVector>* ValidDeps;
+ const std::map<std::string, DependencyVector>* ValidDeps = nullptr;
std::set<std::string> Encountered;
std::queue<UnscannedEntry> Unscanned;
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index a04cee790..3f036a9de 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -7,7 +7,6 @@
#include <iostream>
#include <map>
#include <stdlib.h>
-#include <string.h>
#include <utility>
#include "cmAlgorithms.h"
@@ -54,7 +53,8 @@ public:
typedef std::map<std::string, cmFortranSourceInfo> ObjectInfoMap;
ObjectInfoMap ObjectInfo;
- cmFortranSourceInfo& CreateObjectInfo(const char* obj, const char* src)
+ cmFortranSourceInfo& CreateObjectInfo(const std::string& obj,
+ const std::string& src)
{
std::map<std::string, cmFortranSourceInfo>::iterator i =
this->ObjectInfo.find(obj);
@@ -68,10 +68,7 @@ public:
}
};
-cmDependsFortran::cmDependsFortran()
- : Internal(nullptr)
-{
-}
+cmDependsFortran::cmDependsFortran() = default;
cmDependsFortran::cmDependsFortran(cmLocalGenerator* lg)
: cmDepends(lg)
@@ -97,6 +94,10 @@ cmDependsFortran::cmDependsFortran(cmLocalGenerator* lg)
}
this->PPDefinitions.insert(def);
}
+
+ this->CompilerId = mf->GetSafeDefinition("CMAKE_Fortran_COMPILER_ID");
+ this->SModSep = mf->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
+ this->SModExt = mf->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
}
cmDependsFortran::~cmDependsFortran()
@@ -119,15 +120,19 @@ bool cmDependsFortran::WriteDependencies(const std::set<std::string>& sources,
return false;
}
+ cmFortranCompiler fc;
+ fc.Id = this->CompilerId;
+ fc.SModSep = this->SModSep;
+ fc.SModExt = this->SModExt;
+
bool okay = true;
for (std::string const& src : sources) {
// Get the information object for this source.
- cmFortranSourceInfo& info =
- this->Internal->CreateObjectInfo(obj.c_str(), src.c_str());
+ cmFortranSourceInfo& info = this->Internal->CreateObjectInfo(obj, src);
// Create the parser object. The constructor takes info by reference,
// so we may look into the resulting objects later.
- cmFortranParser parser(this->IncludePath, this->PPDefinitions, info);
+ cmFortranParser parser(fc, this->IncludePath, this->PPDefinitions, info);
// Push on the starting file.
cmFortranParser_FilePush(&parser, src.c_str());
@@ -154,7 +159,7 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
this->LocateModules();
// Get the directory in which stamp files will be stored.
- const char* stamp_dir = this->TargetDirectory.c_str();
+ const std::string& stamp_dir = this->TargetDirectory;
// Get the directory in which module files will be created.
cmMakefile* mf = this->LocalGenerator->GetMakefile();
@@ -168,9 +173,8 @@ bool cmDependsFortran::Finalize(std::ostream& makeDepends,
typedef cmDependsFortranInternals::ObjectInfoMap ObjectInfoMap;
ObjectInfoMap const& objInfo = this->Internal->ObjectInfo;
for (auto const& i : objInfo) {
- if (!this->WriteDependenciesReal(i.first.c_str(), i.second, mod_dir,
- stamp_dir, makeDepends,
- internalDepends)) {
+ if (!this->WriteDependenciesReal(i.first, i.second, mod_dir, stamp_dir,
+ makeDepends, internalDepends)) {
return false;
}
}
@@ -257,22 +261,22 @@ void cmDependsFortran::LocateModules()
std::string fname = targetDir + "/fortran.internal";
cmsys::ifstream fin(fname.c_str());
if (fin) {
- this->MatchRemoteModules(fin, targetDir.c_str());
+ this->MatchRemoteModules(fin, targetDir);
}
}
}
void cmDependsFortran::MatchLocalModules()
{
- const char* stampDir = this->TargetDirectory.c_str();
+ std::string const& stampDir = this->TargetDirectory;
std::set<std::string> const& provides = this->Internal->TargetProvides;
for (std::string const& i : provides) {
- this->ConsiderModule(i.c_str(), stampDir);
+ this->ConsiderModule(i, stampDir);
}
}
void cmDependsFortran::MatchRemoteModules(std::istream& fin,
- const char* stampDir)
+ const std::string& stampDir)
{
std::string line;
bool doing_provides = false;
@@ -301,7 +305,8 @@ void cmDependsFortran::MatchRemoteModules(std::istream& fin,
}
}
-void cmDependsFortran::ConsiderModule(const char* name, const char* stampDir)
+void cmDependsFortran::ConsiderModule(const std::string& name,
+ const std::string& stampDir)
{
// Locate each required module.
typedef cmDependsFortranInternals::TargetRequiresMap TargetRequiresMap;
@@ -318,17 +323,17 @@ void cmDependsFortran::ConsiderModule(const char* name, const char* stampDir)
}
}
-bool cmDependsFortran::WriteDependenciesReal(const char* obj,
+bool cmDependsFortran::WriteDependenciesReal(std::string const& obj,
cmFortranSourceInfo const& info,
std::string const& mod_dir,
- const char* stamp_dir,
+ std::string const& stamp_dir,
std::ostream& makeDepends,
std::ostream& internalDepends)
{
typedef cmDependsFortranInternals::TargetRequiresMap TargetRequiresMap;
// Get the source file for this object.
- const char* src = info.Source.c_str();
+ std::string const& src = info.Source;
// Write the include dependencies to the output stream.
std::string binDir = this->LocalGenerator->GetBinaryDirectory();
@@ -503,8 +508,7 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
cmFortranModuleAppendUpperLower(cmSystemTools::GetFilenameName(mod),
mod_upper, mod_lower);
if (cmSystemTools::FileExists(mod_upper, true)) {
- if (cmDependsFortran::ModulesDiffer(mod_upper.c_str(), stamp.c_str(),
- compilerId.c_str())) {
+ if (cmDependsFortran::ModulesDiffer(mod_upper, stamp, compilerId)) {
if (!cmSystemTools::CopyFileAlways(mod_upper, stamp)) {
std::cerr << "Error copying Fortran module from \"" << mod_upper
<< "\" to \"" << stamp << "\".\n";
@@ -514,8 +518,7 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
return true;
}
if (cmSystemTools::FileExists(mod_lower, true)) {
- if (cmDependsFortran::ModulesDiffer(mod_lower.c_str(), stamp.c_str(),
- compilerId.c_str())) {
+ if (cmDependsFortran::ModulesDiffer(mod_lower, stamp, compilerId)) {
if (!cmSystemTools::CopyFileAlways(mod_lower, stamp)) {
std::cerr << "Error copying Fortran module from \"" << mod_lower
<< "\" to \"" << stamp << "\".\n";
@@ -582,9 +585,9 @@ static bool cmFortranStreamsDiffer(std::istream& ifs1, std::istream& ifs2)
return true;
}
-bool cmDependsFortran::ModulesDiffer(const char* modFile,
- const char* stampFile,
- const char* compilerId)
+bool cmDependsFortran::ModulesDiffer(const std::string& modFile,
+ const std::string& stampFile,
+ const std::string& compilerId)
{
/*
gnu >= 4.9:
@@ -618,16 +621,17 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
* source is compiled twice
* -SunPro
*/
- if (strcmp(compilerId, "SunPro") == 0) {
+ if (compilerId == "SunPro") {
return cmSystemTools::FilesDiffer(modFile, stampFile);
}
#if defined(_WIN32) || defined(__CYGWIN__)
- cmsys::ifstream finModFile(modFile, std::ios::in | std::ios::binary);
- cmsys::ifstream finStampFile(stampFile, std::ios::in | std::ios::binary);
+ cmsys::ifstream finModFile(modFile.c_str(), std::ios::in | std::ios::binary);
+ cmsys::ifstream finStampFile(stampFile.c_str(),
+ std::ios::in | std::ios::binary);
#else
- cmsys::ifstream finModFile(modFile);
- cmsys::ifstream finStampFile(stampFile);
+ cmsys::ifstream finModFile(modFile.c_str());
+ cmsys::ifstream finStampFile(stampFile.c_str());
#endif
if (!finModFile || !finStampFile) {
// At least one of the files does not exist. The modules differ.
@@ -642,7 +646,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
* Eat the stream content until all recompile only related changes
* are left behind.
*/
- if (strcmp(compilerId, "GNU") == 0) {
+ if (compilerId == "GNU") {
// GNU Fortran 4.9 and later compress .mod files with gzip
// but also do not include a date so we can fall through to
// compare them without skipping any prefix.
@@ -665,7 +669,7 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
return true;
}
}
- } else if (strcmp(compilerId, "Intel") == 0) {
+ } else if (compilerId == "Intel") {
const char seq[2] = { '\n', '\0' };
const int seqlen = 2;
@@ -697,9 +701,9 @@ bool cmDependsFortran::ModulesDiffer(const char* modFile,
std::string cmDependsFortran::MaybeConvertToRelativePath(
std::string const& base, std::string const& path)
{
- if (!cmOutputConverter::ContainedInDirectory(
- base, path, this->LocalGenerator->GetStateSnapshot().GetDirectory())) {
+ if (!this->LocalGenerator->GetStateSnapshot().GetDirectory().ContainsBoth(
+ base, path)) {
return path;
}
- return cmOutputConverter::ForceToRelativePath(base, path);
+ return cmSystemTools::ForceToRelativePath(base, path);
}
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index bee980471..04851152e 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -21,8 +21,6 @@ class cmLocalGenerator;
*/
class cmDependsFortran : public cmDepends
{
- CM_DISABLE_COPY(cmDependsFortran)
-
public:
/** Checking instances need to know the build directory name and the
relative path from the build directory to the target file. */
@@ -37,6 +35,9 @@ public:
/** Virtual destructor to cleanup subclasses properly. */
~cmDependsFortran() override;
+ cmDependsFortran(cmDependsFortran const&) = delete;
+ cmDependsFortran& operator=(cmDependsFortran const&) = delete;
+
/** Callback from build system after a .mod file has been generated
by a Fortran90 compiler to copy the .mod file to the
corresponding stamp file. */
@@ -44,8 +45,9 @@ public:
/** Determine if a mod file and the corresponding mod.stamp file
are representing different module information. */
- static bool ModulesDiffer(const char* modFile, const char* stampFile,
- const char* compilerId);
+ static bool ModulesDiffer(const std::string& modFile,
+ const std::string& stampFile,
+ const std::string& compilerId);
protected:
// Finalize the dependency information for the target.
@@ -55,8 +57,8 @@ protected:
// Find all the modules required by the target.
void LocateModules();
void MatchLocalModules();
- void MatchRemoteModules(std::istream& fin, const char* stampDir);
- void ConsiderModule(const char* name, const char* stampDir);
+ void MatchRemoteModules(std::istream& fin, const std::string& stampDir);
+ void ConsiderModule(const std::string& name, const std::string& stampDir);
bool FindModule(std::string const& name, std::string& module);
// Implement writing/checking methods required by superclass.
@@ -65,18 +67,24 @@ protected:
std::ostream& internalDepends) override;
// Actually write the dependencies to the streams.
- bool WriteDependenciesReal(const char* obj, cmFortranSourceInfo const& info,
- std::string const& mod_dir, const char* stamp_dir,
+ bool WriteDependenciesReal(std::string const& obj,
+ cmFortranSourceInfo const& info,
+ std::string const& mod_dir,
+ std::string const& stamp_dir,
std::ostream& makeDepends,
std::ostream& internalDepends);
// The source file from which to start scanning.
std::string SourceFile;
+ std::string CompilerId;
+ std::string SModSep;
+ std::string SModExt;
+
std::set<std::string> PPDefinitions;
// Internal implementation details.
- cmDependsFortranInternals* Internal;
+ cmDependsFortranInternals* Internal = nullptr;
private:
std::string MaybeConvertToRelativePath(std::string const& base,
diff --git a/Source/cmDependsJava.cxx b/Source/cmDependsJava.cxx
index 29938ba36..2485e15fd 100644
--- a/Source/cmDependsJava.cxx
+++ b/Source/cmDependsJava.cxx
@@ -4,13 +4,9 @@
#include "cmSystemTools.h"
-cmDependsJava::cmDependsJava()
-{
-}
+cmDependsJava::cmDependsJava() = default;
-cmDependsJava::~cmDependsJava()
-{
-}
+cmDependsJava::~cmDependsJava() = default;
bool cmDependsJava::WriteDependencies(const std::set<std::string>& sources,
const std::string& /*obj*/,
@@ -27,7 +23,8 @@ bool cmDependsJava::WriteDependencies(const std::set<std::string>& sources,
}
bool cmDependsJava::CheckDependencies(
- std::istream& /*internalDepends*/, const char* /*internalDependsFileName*/,
+ std::istream& /*internalDepends*/,
+ const std::string& /*internalDependsFileName*/,
std::map<std::string, DependencyVector>& /*validDeps*/)
{
return true;
diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h
index d070840ad..109ef13d1 100644
--- a/Source/cmDependsJava.h
+++ b/Source/cmDependsJava.h
@@ -17,8 +17,6 @@
*/
class cmDependsJava : public cmDepends
{
- CM_DISABLE_COPY(cmDependsJava)
-
public:
/** Checking instances need to know the build directory name and the
relative path from the build directory to the target file. */
@@ -27,13 +25,16 @@ public:
/** Virtual destructor to cleanup subclasses properly. */
~cmDependsJava() override;
+ cmDependsJava(cmDependsJava const&) = delete;
+ cmDependsJava& operator=(cmDependsJava const&) = delete;
+
protected:
// Implement writing/checking methods required by superclass.
bool WriteDependencies(const std::set<std::string>& sources,
const std::string& file, std::ostream& makeDepends,
std::ostream& internalDepends) override;
bool CheckDependencies(
- std::istream& internalDepends, const char* internalDependsFileName,
+ std::istream& internalDepends, const std::string& internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps) override;
};
diff --git a/Source/cmDependsJavaParserHelper.cxx b/Source/cmDependsJavaParserHelper.cxx
index 02db11978..792db48a4 100644
--- a/Source/cmDependsJavaParserHelper.cxx
+++ b/Source/cmDependsJavaParserHelper.cxx
@@ -68,7 +68,7 @@ void cmDependsJavaParserHelper::AddClassFound(const char* sclass)
return;
}
}
- this->ClassesFound.push_back(sclass);
+ this->ClassesFound.emplace_back(sclass);
}
void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
@@ -78,7 +78,7 @@ void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
return;
}
}
- this->PackagesImport.push_back(sclass);
+ this->PackagesImport.emplace_back(sclass);
}
void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line,
diff --git a/Source/cmDisallowedCommand.cxx b/Source/cmDisallowedCommand.cxx
index ce1965d30..418d98c9f 100644
--- a/Source/cmDisallowedCommand.cxx
+++ b/Source/cmDisallowedCommand.cxx
@@ -3,7 +3,7 @@
#include "cmDisallowedCommand.h"
#include "cmMakefile.h"
-#include "cmake.h"
+#include "cmMessageType.h"
class cmExecutionStatus;
@@ -12,7 +12,7 @@ bool cmDisallowedCommand::InitialPass(std::vector<std::string> const& args,
{
switch (this->Makefile->GetPolicyStatus(this->Policy)) {
case cmPolicies::WARN:
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(this->Policy));
break;
case cmPolicies::OLD:
@@ -20,7 +20,7 @@ bool cmDisallowedCommand::InitialPass(std::vector<std::string> const& args,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, this->Message);
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, this->Message);
return true;
}
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 2dfba04a7..d4628fa7e 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -2,7 +2,6 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmDocumentation.h"
-#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmDocumentationSection.h"
#include "cmRST.h"
@@ -44,22 +43,24 @@ static const char* cmDocumentationStandardOptions[][2] = {
{ nullptr, nullptr }
};
-static const char* cmDocumentationGeneratorsHeader[][2] = {
+static const char* cmDocumentationCPackGeneratorsHeader[][2] = {
{ nullptr, "The following generators are available on this platform:" },
{ nullptr, nullptr }
};
+static const char* cmDocumentationCMakeGeneratorsHeader[][2] = {
+ { nullptr,
+ "The following generators are available on this platform (* marks "
+ "default):" },
+ { nullptr, nullptr }
+};
+
cmDocumentation::cmDocumentation()
{
this->addCommonStandardDocSections();
this->ShowGenerators = true;
}
-cmDocumentation::~cmDocumentation()
-{
- cmDeleteAll(this->AllSections);
-}
-
bool cmDocumentation::PrintVersion(std::ostream& os)
{
/* clang-format off */
@@ -145,10 +146,12 @@ bool cmDocumentation::PrintRequestedDocumentation(std::ostream& os)
}
#define GET_OPT_ARGUMENT(target) \
- if ((i + 1 < argc) && !this->IsOption(argv[i + 1])) { \
- (target) = argv[i + 1]; \
- i = i + 1; \
- };
+ do { \
+ if ((i + 1 < argc) && !this->IsOption(argv[i + 1])) { \
+ (target) = argv[i + 1]; \
+ i = i + 1; \
+ }; \
+ } while (false)
void cmDocumentation::WarnFormFromFilename(
cmDocumentation::RequestedHelpItem& request, bool& result)
@@ -174,20 +177,16 @@ void cmDocumentation::WarnFormFromFilename(
void cmDocumentation::addCommonStandardDocSections()
{
- cmDocumentationSection* sec;
-
- sec = new cmDocumentationSection("Options", "OPTIONS");
- sec->Append(cmDocumentationStandardOptions);
- this->AllSections["Options"] = sec;
+ cmDocumentationSection sec{ "Options" };
+ sec.Append(cmDocumentationStandardOptions);
+ this->AllSections.emplace("Options", std::move(sec));
}
void cmDocumentation::addCMakeStandardDocSections()
{
- cmDocumentationSection* sec;
-
- sec = new cmDocumentationSection("Generators", "GENERATORS");
- sec->Append(cmDocumentationGeneratorsHeader);
- this->AllSections["Generators"] = sec;
+ cmDocumentationSection sec{ "Generators" };
+ sec.Append(cmDocumentationCMakeGeneratorsHeader);
+ this->AllSections.emplace("Generators", std::move(sec));
}
void cmDocumentation::addCTestStandardDocSections()
@@ -199,11 +198,9 @@ void cmDocumentation::addCTestStandardDocSections()
void cmDocumentation::addCPackStandardDocSections()
{
- cmDocumentationSection* sec;
-
- sec = new cmDocumentationSection("Generators", "GENERATORS");
- sec->Append(cmDocumentationGeneratorsHeader);
- this->AllSections["Generators"] = sec;
+ cmDocumentationSection sec{ "Generators" };
+ sec.Append(cmDocumentationCPackGeneratorsHeader);
+ this->AllSections.emplace("Generators", std::move(sec));
}
bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
@@ -364,91 +361,59 @@ void cmDocumentation::SetName(const std::string& name)
}
void cmDocumentation::SetSection(const char* name,
- cmDocumentationSection* section)
+ cmDocumentationSection section)
{
- if (this->AllSections.find(name) != this->AllSections.end()) {
- delete this->AllSections[name];
- }
- this->AllSections[name] = section;
+ this->SectionAtName(name) = std::move(section);
}
void cmDocumentation::SetSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- sec->Append(docs);
- this->SetSection(name, sec);
+ cmDocumentationSection sec{ name };
+ sec.Append(docs);
+ this->SetSection(name, std::move(sec));
}
void cmDocumentation::SetSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- sec->Append(docs);
- this->SetSection(name, sec);
+ cmDocumentationSection sec{ name };
+ sec.Append(docs);
+ this->SetSection(name, std::move(sec));
}
void cmDocumentation::SetSections(
- std::map<std::string, cmDocumentationSection*>& sections)
+ std::map<std::string, cmDocumentationSection> sections)
{
- for (auto const& s : sections) {
- this->SetSection(s.first.c_str(), s.second);
+ for (auto& s : sections) {
+ this->SetSection(s.first.c_str(), std::move(s.second));
}
}
+cmDocumentationSection& cmDocumentation::SectionAtName(const char* name)
+{
+ return this->AllSections.emplace(name, cmDocumentationSection{ name })
+ .first->second;
+}
void cmDocumentation::PrependSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Prepend(docs);
+ this->SectionAtName(name).Prepend(docs);
}
void cmDocumentation::PrependSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Prepend(docs);
+ this->SectionAtName(name).Prepend(docs);
}
void cmDocumentation::AppendSection(const char* name, const char* docs[][2])
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Append(docs);
+ this->SectionAtName(name).Append(docs);
}
void cmDocumentation::AppendSection(const char* name,
std::vector<cmDocumentationEntry>& docs)
{
- cmDocumentationSection* sec = nullptr;
- if (this->AllSections.find(name) == this->AllSections.end()) {
- sec =
- new cmDocumentationSection(name, cmSystemTools::UpperCase(name).c_str());
- this->SetSection(name, sec);
- } else {
- sec = this->AllSections[name];
- }
- sec->Append(docs);
+ this->SectionAtName(name).Append(docs);
}
void cmDocumentation::AppendSection(const char* name,
@@ -631,11 +596,10 @@ bool cmDocumentation::PrintHelpListPolicies(std::ostream& os)
bool cmDocumentation::PrintHelpListGenerators(std::ostream& os)
{
- std::map<std::string, cmDocumentationSection*>::iterator si;
- si = this->AllSections.find("Generators");
+ const auto si = this->AllSections.find("Generators");
if (si != this->AllSections.end()) {
this->Formatter.SetIndent(" ");
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
return true;
}
@@ -661,29 +625,27 @@ bool cmDocumentation::PrintHelpListVariables(std::ostream& os)
bool cmDocumentation::PrintUsage(std::ostream& os)
{
- std::map<std::string, cmDocumentationSection*>::iterator si;
- si = this->AllSections.find("Usage");
+ const auto si = this->AllSections.find("Usage");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
return true;
}
bool cmDocumentation::PrintHelp(std::ostream& os)
{
- std::map<std::string, cmDocumentationSection*>::iterator si;
- si = this->AllSections.find("Usage");
+ auto si = this->AllSections.find("Usage");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
si = this->AllSections.find("Options");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
if (this->ShowGenerators) {
si = this->AllSections.find("Generators");
if (si != this->AllSections.end()) {
- this->Formatter.PrintSection(os, *si->second);
+ this->Formatter.PrintSection(os, si->second);
}
}
return true;
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h
index c80bed1cd..cf74b800d 100644
--- a/Source/cmDocumentation.h
+++ b/Source/cmDocumentation.h
@@ -6,13 +6,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmDocumentationFormatter.h"
+#include "cmDocumentationSection.h"
#include <iosfwd>
#include <map>
#include <string>
#include <vector>
-class cmDocumentationSection;
struct cmDocumentationEntry;
/** Class to generate documentation. */
@@ -21,8 +21,6 @@ class cmDocumentation : public cmDocumentationEnums
public:
cmDocumentation();
- ~cmDocumentation();
-
/**
* Check command line arguments for documentation options. Returns
* true if documentation options are found, and false otherwise.
@@ -52,11 +50,11 @@ public:
/** Set a section of the documentation. Typical sections include Name,
Usage, Description, Options */
- void SetSection(const char* sectionName, cmDocumentationSection* section);
+ void SetSection(const char* sectionName, cmDocumentationSection section);
void SetSection(const char* sectionName,
std::vector<cmDocumentationEntry>& docs);
void SetSection(const char* sectionName, const char* docs[][2]);
- void SetSections(std::map<std::string, cmDocumentationSection*>& sections);
+ void SetSections(std::map<std::string, cmDocumentationSection> sections);
/** Add the documentation to the beginning/end of the section */
void PrependSection(const char* sectionName, const char* docs[][2]);
@@ -110,17 +108,14 @@ private:
bool ShowGenerators;
std::string NameString;
- std::map<std::string, cmDocumentationSection*> AllSections;
+ std::map<std::string, cmDocumentationSection> AllSections;
+ cmDocumentationSection& SectionAtName(const char* name);
std::string CurrentArgument;
struct RequestedHelpItem
{
- RequestedHelpItem()
- : HelpType(None)
- {
- }
- cmDocumentationEnums::Type HelpType;
+ cmDocumentationEnums::Type HelpType = None;
std::string Filename;
std::string Argument;
};
diff --git a/Source/cmDocumentationEntry.h b/Source/cmDocumentationEntry.h
index ea43b88c3..afbca5e4b 100644
--- a/Source/cmDocumentationEntry.h
+++ b/Source/cmDocumentationEntry.h
@@ -12,7 +12,8 @@ struct cmDocumentationEntry
{
std::string Name;
std::string Brief;
- cmDocumentationEntry() {}
+ char CustomNamePrefix = ' ';
+ cmDocumentationEntry() = default;
cmDocumentationEntry(const char* doc[2])
{
if (doc[0]) {
diff --git a/Source/cmDocumentationFormatter.cxx b/Source/cmDocumentationFormatter.cxx
index 2267ef94b..3e7f9897e 100644
--- a/Source/cmDocumentationFormatter.cxx
+++ b/Source/cmDocumentationFormatter.cxx
@@ -5,20 +5,15 @@
#include "cmDocumentationEntry.h"
#include "cmDocumentationSection.h"
+#include <iomanip>
#include <ostream>
#include <string.h>
#include <string>
#include <vector>
-cmDocumentationFormatter::cmDocumentationFormatter()
- : TextWidth(77)
- , TextIndent("")
-{
-}
+cmDocumentationFormatter::cmDocumentationFormatter() = default;
-cmDocumentationFormatter::~cmDocumentationFormatter()
-{
-}
+cmDocumentationFormatter::~cmDocumentationFormatter() = default;
void cmDocumentationFormatter::PrintFormatted(std::ostream& os,
const char* text)
@@ -170,7 +165,7 @@ void cmDocumentationFormatter::PrintSection(
const std::vector<cmDocumentationEntry>& entries = section.GetEntries();
for (cmDocumentationEntry const& entry : entries) {
if (!entry.Name.empty()) {
- os << " " << entry.Name;
+ os << std::setw(2) << std::left << entry.CustomNamePrefix << entry.Name;
this->TextIndent = " ";
int align = static_cast<int>(strlen(this->TextIndent)) - 4;
for (int i = static_cast<int>(entry.Name.size()); i < align; ++i) {
diff --git a/Source/cmDocumentationFormatter.h b/Source/cmDocumentationFormatter.h
index 1f04250c9..17b63dacc 100644
--- a/Source/cmDocumentationFormatter.h
+++ b/Source/cmDocumentationFormatter.h
@@ -59,8 +59,8 @@ public:
void SetIndent(const char* indent);
private:
- int TextWidth;
- const char* TextIndent;
+ int TextWidth = 77;
+ const char* TextIndent = "";
};
#endif
diff --git a/Source/cmDocumentationSection.h b/Source/cmDocumentationSection.h
index d9e8187f8..7031b525d 100644
--- a/Source/cmDocumentationSection.h
+++ b/Source/cmDocumentationSection.h
@@ -19,7 +19,7 @@ class cmDocumentationSection
{
public:
/** Create a cmSection, with a special name for man-output mode. */
- cmDocumentationSection(const char* name, const char*)
+ explicit cmDocumentationSection(const char* name)
: Name(name)
{
}
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 7da6ff54b..0549cf916 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -24,9 +24,7 @@ private:
cmDynamicLoaderCache* cmDynamicLoaderCache::Instance = nullptr;
-cmDynamicLoaderCache::~cmDynamicLoaderCache()
-{
-}
+cmDynamicLoaderCache::~cmDynamicLoaderCache() = default;
void cmDynamicLoaderCache::CacheFile(const char* path,
cmsys::DynamicLoader::LibraryHandle p)
diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h
index 61d3b468b..4b89388e2 100644
--- a/Source/cmDynamicLoader.h
+++ b/Source/cmDynamicLoader.h
@@ -14,8 +14,6 @@
class cmDynamicLoader
{
- CM_DISABLE_COPY(cmDynamicLoader)
-
public:
// Description:
// Load a dynamic library into the current process.
@@ -28,8 +26,8 @@ public:
static void FlushCache();
protected:
- cmDynamicLoader() {}
- ~cmDynamicLoader() {}
+ cmDynamicLoader() = default;
+ ~cmDynamicLoader() = default;
};
#endif
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 0ccd68a97..27f91317f 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -684,7 +684,7 @@ cmELF::cmELF(const char* fname)
std::unique_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
// Quit now if the file could not be opened.
- if (!fin.get() || !*fin) {
+ if (!fin || !*fin) {
this->ErrorMessage = "Error opening input file.";
return;
}
diff --git a/Source/cmELF.h b/Source/cmELF.h
index 9172f3803..c8a91e4ea 100644
--- a/Source/cmELF.h
+++ b/Source/cmELF.h
@@ -32,7 +32,7 @@ public:
std::string const& GetErrorMessage() const { return this->ErrorMessage; }
/** Boolean conversion. True if the ELF file is valid. */
- operator bool() const { return this->Valid(); }
+ explicit operator bool() const { return this->Valid(); }
/** Enumeration of ELF file types. */
enum FileType
diff --git a/Source/cmExecProgramCommand.cxx b/Source/cmExecProgramCommand.cxx
index ea4cd4071..75a7786a4 100644
--- a/Source/cmExecProgramCommand.cxx
+++ b/Source/cmExecProgramCommand.cxx
@@ -217,11 +217,11 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
int p;
cmProcessOutput processOutput(encoding);
std::string strdata;
- while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) {
+ while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) {
if (p == cmsysProcess_Pipe_STDOUT || p == cmsysProcess_Pipe_STDERR) {
if (verbose) {
processOutput.DecodeText(data, length, strdata);
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
}
output.append(data, length);
}
@@ -230,7 +230,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
if (verbose) {
processOutput.DecodeText(std::string(), strdata);
if (!strdata.empty()) {
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
}
}
@@ -270,7 +270,7 @@ bool cmExecProgramCommand::RunCommand(const char* command, std::string& output,
}
msg += "\n";
if (verbose) {
- cmSystemTools::Stdout(msg.c_str());
+ cmSystemTools::Stdout(msg);
}
output += msg;
#else
diff --git a/Source/cmExecuteProcessCommand.cxx b/Source/cmExecuteProcessCommand.cxx
index 679a64814..8c67cdb4e 100644
--- a/Source/cmExecuteProcessCommand.cxx
+++ b/Source/cmExecuteProcessCommand.cxx
@@ -54,7 +54,7 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
if (args[i] == "COMMAND") {
doing_command = true;
command_index = cmds.size();
- cmds.push_back(std::vector<const char*>());
+ cmds.emplace_back();
} else if (args[i] == "OUTPUT_VARIABLE") {
doing_command = false;
if (++i < args.size()) {
@@ -244,19 +244,19 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
int p;
cmProcessOutput processOutput(encoding);
std::string strdata;
- while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) {
+ while ((p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) {
// Put the output in the right place.
if (p == cmsysProcess_Pipe_STDOUT && !output_quiet) {
if (output_variable.empty()) {
processOutput.DecodeText(data, length, strdata, 1);
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
} else {
cmExecuteProcessCommandAppend(tempOutput, data, length);
}
} else if (p == cmsysProcess_Pipe_STDERR && !error_quiet) {
if (error_variable.empty()) {
processOutput.DecodeText(data, length, strdata, 2);
- cmSystemTools::Stderr(strdata.c_str(), strdata.size());
+ cmSystemTools::Stderr(strdata);
} else {
cmExecuteProcessCommandAppend(tempError, data, length);
}
@@ -265,13 +265,13 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
if (!output_quiet && output_variable.empty()) {
processOutput.DecodeText(std::string(), strdata, 1);
if (!strdata.empty()) {
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
}
}
if (!error_quiet && error_variable.empty()) {
processOutput.DecodeText(std::string(), strdata, 2);
if (!strdata.empty()) {
- cmSystemTools::Stderr(strdata.c_str(), strdata.size());
+ cmSystemTools::Stderr(strdata);
}
}
@@ -327,15 +327,15 @@ bool cmExecuteProcessCommand::InitialPass(std::vector<std::string> const& args,
cmsysProcess_GetExitValueByIndex(cp, static_cast<int>(i));
char buf[16];
sprintf(buf, "%d", exitCode);
- res.push_back(buf);
+ res.emplace_back(buf);
} break;
case kwsysProcess_StateByIndex_Exception:
- res.push_back(cmsysProcess_GetExceptionStringByIndex(
+ res.emplace_back(cmsysProcess_GetExceptionStringByIndex(
cp, static_cast<int>(i)));
break;
case kwsysProcess_StateByIndex_Error:
default:
- res.push_back("Error getting the child return code");
+ res.emplace_back("Error getting the child return code");
break;
}
}
diff --git a/Source/cmExecutionStatus.h b/Source/cmExecutionStatus.h
index ac5fe1d72..56199dd93 100644
--- a/Source/cmExecutionStatus.h
+++ b/Source/cmExecutionStatus.h
@@ -11,14 +11,6 @@
class cmExecutionStatus
{
public:
- cmExecutionStatus()
- : ReturnInvoked(false)
- , BreakInvoked(false)
- , ContinueInvoked(false)
- , NestedError(false)
- {
- }
-
void Clear()
{
this->ReturnInvoked = false;
@@ -40,10 +32,10 @@ public:
bool GetNestedError() const { return this->NestedError; }
private:
- bool ReturnInvoked;
- bool BreakInvoked;
- bool ContinueInvoked;
- bool NestedError;
+ bool ReturnInvoked = false;
+ bool BreakInvoked = false;
+ bool ContinueInvoked = false;
+ bool NestedError = false;
};
#endif
diff --git a/Source/cmExpandedCommandArgument.cxx b/Source/cmExpandedCommandArgument.cxx
index 1c0a72175..43f648bc3 100644
--- a/Source/cmExpandedCommandArgument.cxx
+++ b/Source/cmExpandedCommandArgument.cxx
@@ -2,14 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExpandedCommandArgument.h"
-cmExpandedCommandArgument::cmExpandedCommandArgument()
- : Quoted(false)
-{
-}
+#include <utility>
+
+cmExpandedCommandArgument::cmExpandedCommandArgument() = default;
-cmExpandedCommandArgument::cmExpandedCommandArgument(std::string const& value,
+cmExpandedCommandArgument::cmExpandedCommandArgument(std::string value,
bool quoted)
- : Value(value)
+ : Value(std::move(value))
, Quoted(quoted)
{
}
diff --git a/Source/cmExpandedCommandArgument.h b/Source/cmExpandedCommandArgument.h
index 302e8dbd6..69d35debe 100644
--- a/Source/cmExpandedCommandArgument.h
+++ b/Source/cmExpandedCommandArgument.h
@@ -18,7 +18,7 @@ class cmExpandedCommandArgument
{
public:
cmExpandedCommandArgument();
- cmExpandedCommandArgument(std::string const& value, bool quoted);
+ cmExpandedCommandArgument(std::string value, bool quoted);
std::string const& GetValue() const;
@@ -33,7 +33,7 @@ public:
private:
std::string Value;
- bool Quoted;
+ bool Quoted = false;
};
#endif
diff --git a/Source/cmExportBuildAndroidMKGenerator.cxx b/Source/cmExportBuildAndroidMKGenerator.cxx
index d12ad7fd1..ced27c91c 100644
--- a/Source/cmExportBuildAndroidMKGenerator.cxx
+++ b/Source/cmExportBuildAndroidMKGenerator.cxx
@@ -11,11 +11,11 @@
#include "cmGeneratorTarget.h"
#include "cmLinkItem.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
cmExportBuildAndroidMKGenerator::cmExportBuildAndroidMKGenerator()
{
@@ -92,7 +92,7 @@ void cmExportBuildAndroidMKGenerator::GenerateInterfaceProperties(
}
w << " set to OLD for target " << target->Target->GetName() << ". "
<< "The export will only work with CMP0022 set to NEW.";
- target->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ target->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
if (!properties.empty()) {
os << "LOCAL_CPP_FEATURES := rtti exceptions\n";
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 024e64116..012355b41 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -9,6 +9,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
@@ -55,7 +56,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
std::ostringstream e;
e << "given target \"" << te->GetName() << "\" more than once.";
this->LG->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, e.str(),
+ MessageType::FATAL_ERROR, e.str(),
this->LG->GetMakefile()->GetBacktrace());
return false;
}
@@ -110,7 +111,7 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
std::string errorMessage;
if (!this->PopulateExportProperties(gte, properties, errorMessage)) {
this->LG->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, errorMessage,
+ MessageType::FATAL_ERROR, errorMessage,
this->LG->GetMakefile()->GetBacktrace());
return false;
}
@@ -328,7 +329,8 @@ void cmExportBuildFileGenerator::ComplainAboutMissingTarget(
<< "consider using the APPEND option with multiple separate calls.";
this->LG->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, e.str(), this->LG->GetMakefile()->GetBacktrace());
+ MessageType::FATAL_ERROR, e.str(),
+ this->LG->GetMakefile()->GetBacktrace());
}
std::string cmExportBuildFileGenerator::InstallNameDir(
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index f965a2993..722831a7f 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -12,10 +12,10 @@
#include "cmGeneratedFileStream.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -25,9 +25,7 @@ class cmExecutionStatus;
#endif
cmExportCommand::cmExportCommand()
- : cmCommand()
- , ArgumentGroup()
- , Targets(&Helper, "TARGETS")
+ : Targets(&Helper, "TARGETS")
, Append(&Helper, "APPEND", &ArgumentGroup)
, ExportSetName(&Helper, "EXPORT", &ArgumentGroup)
, Namespace(&Helper, "NAMESPACE", &ArgumentGroup)
@@ -281,7 +279,7 @@ void cmExportCommand::ReportRegistryError(std::string const& msg,
e << "Windows reported:\n"
<< " " << cmsys::Encoding::ToNarrow(winmsg);
}
- this->Makefile->IssueMessage(cmake::WARNING, e.str());
+ this->Makefile->IssueMessage(MessageType::WARNING, e.str());
}
void cmExportCommand::StorePackageRegistryWin(std::string const& package,
@@ -349,7 +347,7 @@ void cmExportCommand::StorePackageRegistryDir(std::string const& package,
<< " " << fname << "\n"
<< cmSystemTools::GetLastSystemError() << "\n";
/* clang-format on */
- this->Makefile->IssueMessage(cmake::WARNING, e.str());
+ this->Makefile->IssueMessage(MessageType::WARNING, e.str());
}
}
}
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index bddc3c4aa..c8f743acd 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -9,6 +9,7 @@
#include "cmLinkItem.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmProperty.h"
@@ -17,7 +18,6 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetExport.h"
-#include "cmake.h"
#include "cmsys/FStream.hxx"
#include <assert.h>
@@ -79,11 +79,11 @@ bool cmExportFileGenerator::GenerateImportFile()
ap->SetCopyIfDifferent(true);
foutPtr = std::move(ap);
}
- if (!foutPtr.get() || !*foutPtr) {
+ if (!foutPtr || !*foutPtr) {
std::string se = cmSystemTools::GetLastSystemError();
std::ostringstream e;
e << "cannot write to file \"" << this->MainImportFile << "\": " << se;
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return false;
}
std::ostream& os = *foutPtr;
@@ -214,13 +214,13 @@ static bool checkInterfaceDirs(const std::string& prepro,
if (genexPos == 0) {
continue;
}
- cmake::MessageType messageType = cmake::FATAL_ERROR;
+ MessageType messageType = MessageType::FATAL_ERROR;
std::ostringstream e;
if (genexPos != std::string::npos) {
if (prop == "INTERFACE_INCLUDE_DIRECTORIES") {
switch (target->GetPolicyStatusCMP0041()) {
case cmPolicies::WARN:
- messageType = cmake::WARNING;
+ messageType = MessageType::WARNING;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0041) << "\n";
break;
case cmPolicies::OLD:
@@ -275,8 +275,8 @@ static bool checkInterfaceDirs(const std::string& prepro,
<< (inBinary ? "build" : "source") << " tree:\n \""
<< (inBinary ? topBinaryDir : topSourceDir) << "\""
<< std::endl;
- target->GetLocalGenerator()->IssueMessage(cmake::AUTHOR_WARNING,
- s.str());
+ target->GetLocalGenerator()->IssueMessage(
+ MessageType::AUTHOR_WARNING, s.str());
CM_FALLTHROUGH;
}
case cmPolicies::OLD:
@@ -390,7 +390,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
"depend on the configuration, policy values or the link interface "
"are "
"not supported. Consider using target_include_directories instead.";
- lg->IssueMessage(cmake::FATAL_ERROR, e.str());
+ lg->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -520,7 +520,7 @@ void getCompatibleInterfaceProperties(cmGeneratorTarget* target,
e << "Exporting the target \"" << target->GetName()
<< "\" is not "
"allowed since its linker language cannot be determined";
- lg->IssueMessage(cmake::FATAL_ERROR, e.str());
+ lg->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -727,7 +727,8 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpression(
this->ReplaceInstallPrefix(input);
if (!errorString.empty()) {
- target->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, errorString);
+ target->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
+ errorString);
}
}
@@ -780,7 +781,7 @@ void cmExportFileGenerator::SetImportLinkInterface(
"but also has old-style LINK_INTERFACE_LIBRARIES properties "
"populated, but it was exported without the "
"EXPORT_LINK_INTERFACE_LIBRARIES to export the old-style properties";
- lg->IssueMessage(cmake::FATAL_ERROR, e.str());
+ lg->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index 41c6538d1..747503e6d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -42,7 +42,7 @@ class cmExportFileGenerator
{
public:
cmExportFileGenerator();
- virtual ~cmExportFileGenerator() {}
+ virtual ~cmExportFileGenerator() = default;
/** Set the full path to the export file to generate. */
void SetExportFile(const char* mainFile);
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index e44408773..f8bc0ab0b 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -4,6 +4,7 @@
#include "cmAlgorithms.h"
#include "cmExportSet.h"
+#include "cmExportSetMap.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
@@ -21,8 +22,6 @@
#include <sstream>
#include <utility>
-class cmExportSetMap;
-
cmExportInstallFileGenerator::cmExportInstallFileGenerator(
cmInstallExportGenerator* iegen)
: IEGen(iegen)
@@ -55,7 +54,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
<< "\" ...) "
<< "includes target \"" << te->Target->GetName()
<< "\" more than once in the export set.";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return false;
}
}
@@ -113,7 +112,7 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
std::string errorMessage;
if (!this->PopulateExportProperties(gt, properties, errorMessage)) {
- cmSystemTools::Error(errorMessage.c_str());
+ cmSystemTools::Error(errorMessage);
return false;
}
@@ -295,7 +294,7 @@ bool cmExportInstallFileGenerator::GenerateImportFileConfig(
std::string se = cmSystemTools::GetLastSystemError();
std::ostringstream e;
e << "cannot write to file \"" << fileName << "\": " << se;
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return false;
}
std::ostream& os = exportFileStream;
@@ -397,8 +396,8 @@ void cmExportInstallFileGenerator::SetImportLocationProperty(
prop += suffix;
// Append the installed file name.
- value += itgen->GetInstallFilename(target, config,
- cmInstallTargetGenerator::NameImplib);
+ value += cmInstallTargetGenerator::GetInstallFilename(
+ target, config, cmInstallTargetGenerator::NameImplib);
// Store the property.
properties[prop] = value;
@@ -426,12 +425,12 @@ void cmExportInstallFileGenerator::SetImportLocationProperty(
// Append the installed file name.
if (target->IsAppBundleOnApple()) {
- value += itgen->GetInstallFilename(target, config);
+ value += cmInstallTargetGenerator::GetInstallFilename(target, config);
value += ".app/Contents/MacOS/";
- value += itgen->GetInstallFilename(target, config);
+ value += cmInstallTargetGenerator::GetInstallFilename(target, config);
} else {
- value += itgen->GetInstallFilename(target, config,
- cmInstallTargetGenerator::NameReal);
+ value += cmInstallTargetGenerator::GetInstallFilename(
+ target, config, cmInstallTargetGenerator::NameReal);
}
// Store the property.
@@ -519,7 +518,7 @@ void cmExportInstallFileGenerator::ComplainAboutMissingTarget(
e << "that is not in this export set, but " << occurrences
<< " times in others.";
}
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
}
std::string cmExportInstallFileGenerator::InstallNameDir(
diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h
index 58ad617d4..0ef306f63 100644
--- a/Source/cmExportSet.h
+++ b/Source/cmExportSet.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
+#include <utility>
#include <vector>
class cmInstallExportGenerator;
@@ -17,8 +18,8 @@ class cmExportSet
{
public:
/// Construct an empty export set named \a name
- cmExportSet(const std::string& name)
- : Name(name)
+ cmExportSet(std::string name)
+ : Name(std::move(name))
{
}
/// Destructor
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx
index 8d3dad73e..80c78a38c 100644
--- a/Source/cmExprParserHelper.cxx
+++ b/Source/cmExprParserHelper.cxx
@@ -18,9 +18,7 @@ cmExprParserHelper::cmExprParserHelper()
this->Result = 0;
}
-cmExprParserHelper::~cmExprParserHelper()
-{
-}
+cmExprParserHelper::~cmExprParserHelper() = default;
int cmExprParserHelper::ParseString(const char* str, int verb)
{
diff --git a/Source/cmExternalMakefileProjectGenerator.cxx b/Source/cmExternalMakefileProjectGenerator.cxx
index fecd8216e..ac548112a 100644
--- a/Source/cmExternalMakefileProjectGenerator.cxx
+++ b/Source/cmExternalMakefileProjectGenerator.cxx
@@ -2,6 +2,8 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmExternalMakefileProjectGenerator.h"
+#include <utility>
+
class cmMakefile;
void cmExternalMakefileProjectGenerator::EnableLanguage(
@@ -32,17 +34,14 @@ bool cmExternalMakefileProjectGenerator::Open(
}
cmExternalMakefileProjectGeneratorFactory::
- cmExternalMakefileProjectGeneratorFactory(const std::string& n,
- const std::string& doc)
- : Name(n)
- , Documentation(doc)
+ cmExternalMakefileProjectGeneratorFactory(std::string n, std::string doc)
+ : Name(std::move(n))
+ , Documentation(std::move(doc))
{
}
cmExternalMakefileProjectGeneratorFactory::
- ~cmExternalMakefileProjectGeneratorFactory()
-{
-}
+ ~cmExternalMakefileProjectGeneratorFactory() = default;
std::string cmExternalMakefileProjectGeneratorFactory::GetName() const
{
diff --git a/Source/cmExternalMakefileProjectGenerator.h b/Source/cmExternalMakefileProjectGenerator.h
index d48abca78..4438f2803 100644
--- a/Source/cmExternalMakefileProjectGenerator.h
+++ b/Source/cmExternalMakefileProjectGenerator.h
@@ -26,7 +26,7 @@ class cmMakefile;
class cmExternalMakefileProjectGenerator
{
public:
- virtual ~cmExternalMakefileProjectGenerator() {}
+ virtual ~cmExternalMakefileProjectGenerator() = default;
virtual void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile*, bool optional);
@@ -70,8 +70,7 @@ protected:
class cmExternalMakefileProjectGeneratorFactory
{
public:
- cmExternalMakefileProjectGeneratorFactory(const std::string& n,
- const std::string& doc);
+ cmExternalMakefileProjectGeneratorFactory(std::string n, std::string doc);
virtual ~cmExternalMakefileProjectGeneratorFactory();
std::string GetName() const;
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 07a60de24..e408de384 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -32,10 +32,7 @@ Discussion:
http://forums.codeblocks.org/index.php/topic,6789.0.html
*/
-cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator()
- : cmExternalMakefileProjectGenerator()
-{
-}
+cmExtraCodeBlocksGenerator::cmExtraCodeBlocksGenerator() = default;
cmExternalMakefileProjectGeneratorFactory*
cmExtraCodeBlocksGenerator::GetFactory()
@@ -365,7 +362,7 @@ void cmExtraCodeBlocksGenerator::CreateNewProjectFile(
// don't add source files from UTILITY target which have the
// GENERATED property set:
if (gt->GetType() == cmStateEnums::UTILITY &&
- s->GetPropertyAsBool("GENERATED")) {
+ s->GetIsGenerated()) {
continue;
}
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx
index 28106d19d..0773edcbd 100644
--- a/Source/cmExtraCodeLiteGenerator.cxx
+++ b/Source/cmExtraCodeLiteGenerator.cxx
@@ -21,9 +21,7 @@
#include <utility>
cmExtraCodeLiteGenerator::cmExtraCodeLiteGenerator()
- : cmExternalMakefileProjectGenerator()
- , ConfigName("NoConfig")
- , CpuCount(2)
+ : ConfigName("NoConfig")
{
}
@@ -61,18 +59,17 @@ void cmExtraCodeLiteGenerator::Generate()
// and extract the information for creating the worspace
// root makefile
for (auto const& it : projectMap) {
- const cmMakefile* mf = it.second[0]->GetMakefile();
+ cmLocalGenerator* lg = it.second[0];
+ const cmMakefile* mf = lg->GetMakefile();
this->ConfigName = GetConfigurationName(mf);
- if (it.second[0]->GetCurrentBinaryDirectory() ==
- it.second[0]->GetBinaryDirectory()) {
- workspaceOutputDir = it.second[0]->GetCurrentBinaryDirectory();
- workspaceProjectName = it.second[0]->GetProjectName();
- workspaceSourcePath = it.second[0]->GetSourceDirectory();
+ if (lg->GetCurrentBinaryDirectory() == lg->GetBinaryDirectory()) {
+ workspaceOutputDir = lg->GetCurrentBinaryDirectory();
+ workspaceProjectName = lg->GetProjectName();
+ workspaceSourcePath = lg->GetSourceDirectory();
workspaceFileName = workspaceOutputDir + "/";
workspaceFileName += workspaceProjectName + ".workspace";
- this->WorkspacePath = it.second[0]->GetCurrentBinaryDirectory();
- ;
+ this->WorkspacePath = lg->GetCurrentBinaryDirectory();
break;
}
}
@@ -226,7 +223,7 @@ std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
for (cmSourceFile* s : sources) {
// check whether it is a source or a include file
// then put it accordingly into one of the two containers
- switch (cmSystemTools::GetFileFormat(s->GetExtension().c_str())) {
+ switch (cmSystemTools::GetFileFormat(s->GetExtension())) {
case cmSystemTools::C_FILE_FORMAT:
case cmSystemTools::CXX_FILE_FORMAT:
case cmSystemTools::CUDA_FILE_FORMAT:
diff --git a/Source/cmExtraCodeLiteGenerator.h b/Source/cmExtraCodeLiteGenerator.h
index 029054fdd..dea7ebc11 100644
--- a/Source/cmExtraCodeLiteGenerator.h
+++ b/Source/cmExtraCodeLiteGenerator.h
@@ -23,7 +23,7 @@ class cmExtraCodeLiteGenerator : public cmExternalMakefileProjectGenerator
protected:
std::string ConfigName;
std::string WorkspacePath;
- unsigned int CpuCount;
+ unsigned int CpuCount = 2;
protected:
std::string GetCodeLiteCompilerName(const cmMakefile* mf) const;
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 34f58adff..e05f74ba5 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -5,6 +5,7 @@
#include "cmsys/RegularExpression.hxx"
#include <algorithm>
#include <assert.h>
+#include <map>
#include <sstream>
#include <stdio.h>
#include <utility>
@@ -15,6 +16,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSourceFile.h"
#include "cmSourceGroup.h"
#include "cmState.h"
@@ -41,7 +43,6 @@ void AppendDictionary(cmXMLWriter& xml, const char* key, T const& value)
}
cmExtraEclipseCDT4Generator::cmExtraEclipseCDT4Generator()
- : cmExternalMakefileProjectGenerator()
{
this->SupportsVirtualFolders = true;
this->GenerateLinkedResources = true;
@@ -134,7 +135,7 @@ void cmExtraEclipseCDT4Generator::Generate()
if (!this->GenerateSourceProject &&
(mf->IsOn("ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT"))) {
mf->IssueMessage(
- cmake::WARNING,
+ MessageType::WARNING,
"ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT is set to TRUE, "
"but this variable is not supported anymore since CMake 2.8.7.\n"
"Enable CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT instead.");
@@ -142,7 +143,7 @@ void cmExtraEclipseCDT4Generator::Generate()
if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
this->HomeDirectory)) {
- mf->IssueMessage(cmake::WARNING,
+ mf->IssueMessage(MessageType::WARNING,
"The build directory is a subdirectory "
"of the source directory.\n"
"This is not supported well by Eclipse. It is strongly "
@@ -171,9 +172,9 @@ void cmExtraEclipseCDT4Generator::CreateSourceProjectFile()
// set up the project name: <project>-Source@<baseSourcePathName>
cmLocalGenerator* lg = this->GlobalGenerator->GetLocalGenerators()[0];
- std::string name =
- this->GenerateProjectName(lg->GetProjectName(), "Source",
- this->GetPathBasename(this->HomeDirectory));
+ std::string name = cmExtraEclipseCDT4Generator::GenerateProjectName(
+ lg->GetProjectName(), "Source",
+ cmExtraEclipseCDT4Generator::GetPathBasename(this->HomeDirectory));
const std::string filename = this->HomeDirectory + "/.project";
cmGeneratedFileStream fout(filename);
@@ -278,10 +279,11 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
xml.StartElement("projectDescription");
xml.Element("name",
- this->GenerateProjectName(
+ cmExtraEclipseCDT4Generator::GenerateProjectName(
lg->GetProjectName(),
mf->GetSafeDefinition("CMAKE_BUILD_TYPE"),
- this->GetPathBasename(this->HomeOutputDirectory)));
+ cmExtraEclipseCDT4Generator::GetPathBasename(
+ this->HomeOutputDirectory)));
xml.Element("comment", "");
xml.Element("projects", "");
@@ -302,16 +304,17 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
// set the make command
AppendDictionary(xml, "org.eclipse.cdt.make.core.enabledIncrementalBuild",
"true");
- AppendDictionary(
- xml, "org.eclipse.cdt.make.core.build.command",
- this->GetEclipsePath(mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM")));
+ AppendDictionary(xml, "org.eclipse.cdt.make.core.build.command",
+ cmExtraEclipseCDT4Generator::GetEclipsePath(
+ mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM")));
AppendDictionary(xml, "org.eclipse.cdt.make.core.contents",
"org.eclipse.cdt.make.core.activeConfigSettings");
AppendDictionary(xml, "org.eclipse.cdt.make.core.build.target.inc", "all");
AppendDictionary(xml, "org.eclipse.cdt.make.core.build.arguments",
mf->GetSafeDefinition("CMAKE_ECLIPSE_MAKE_ARGUMENTS"));
- AppendDictionary(xml, "org.eclipse.cdt.make.core.buildLocation",
- this->GetEclipsePath(this->HomeOutputDirectory));
+ AppendDictionary(
+ xml, "org.eclipse.cdt.make.core.buildLocation",
+ cmExtraEclipseCDT4Generator::GetEclipsePath(this->HomeOutputDirectory));
AppendDictionary(xml, "org.eclipse.cdt.make.core.useDefaultBuildCmd",
"false");
@@ -341,8 +344,9 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
"clean");
AppendDictionary(xml, "org.eclipse.cdt.make.core.fullBuildTarget", "all");
AppendDictionary(xml, "org.eclipse.cdt.make.core.buildArguments", "");
- AppendDictionary(xml, "org.eclipse.cdt.make.core.build.location",
- this->GetEclipsePath(this->HomeOutputDirectory));
+ AppendDictionary(
+ xml, "org.eclipse.cdt.make.core.build.location",
+ cmExtraEclipseCDT4Generator::GetEclipsePath(this->HomeOutputDirectory));
AppendDictionary(xml, "org.eclipse.cdt.make.core.autoBuildTarget", "all");
// set error parsers
@@ -379,7 +383,6 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
xml.StartElement("natures");
xml.Element("nature", "org.eclipse.cdt.make.core.makeNature");
xml.Element("nature", "org.eclipse.cdt.make.core.ScannerConfigNature");
- ;
for (std::string const& n : this->Natures) {
xml.Element("nature", n);
@@ -407,13 +410,15 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
std::string sourceLinkedResourceName = "[Source directory]";
std::string linkSourceDirectory =
- this->GetEclipsePath(lg->GetCurrentSourceDirectory());
+ cmExtraEclipseCDT4Generator::GetEclipsePath(
+ lg->GetCurrentSourceDirectory());
// .project dir can't be subdir of a linked resource dir
if (!cmSystemTools::IsSubDirectory(this->HomeOutputDirectory,
linkSourceDirectory)) {
- this->AppendLinkedResource(xml, sourceLinkedResourceName,
- this->GetEclipsePath(linkSourceDirectory),
- LinkToFolder);
+ cmExtraEclipseCDT4Generator::AppendLinkedResource(
+ xml, sourceLinkedResourceName,
+ cmExtraEclipseCDT4Generator::GetEclipsePath(linkSourceDirectory),
+ LinkToFolder);
this->SrcLinkedResources.push_back(std::move(sourceLinkedResourceName));
}
}
@@ -439,8 +444,8 @@ void cmExtraEclipseCDT4Generator::WriteGroups(
std::replace(linkName3.begin(), linkName3.end(), '\\', '/');
- this->AppendLinkedResource(xml, linkName3, "virtual:/virtual",
- VirtualFolder);
+ cmExtraEclipseCDT4Generator::AppendLinkedResource(
+ xml, linkName3, "virtual:/virtual", VirtualFolder);
std::vector<cmSourceGroup> const& children = sg.GetGroupChildren();
if (!children.empty()) {
this->WriteGroups(children, linkName, xml);
@@ -453,8 +458,9 @@ void cmExtraEclipseCDT4Generator::WriteGroups(
std::string linkName4 = linkName3;
linkName4 += "/";
linkName4 += cmSystemTools::GetFilenameName(fullPath);
- this->AppendLinkedResource(xml, linkName4,
- this->GetEclipsePath(fullPath), LinkToFile);
+ cmExtraEclipseCDT4Generator::AppendLinkedResource(
+ xml, linkName4,
+ cmExtraEclipseCDT4Generator::GetEclipsePath(fullPath), LinkToFile);
}
}
}
@@ -463,7 +469,8 @@ void cmExtraEclipseCDT4Generator::WriteGroups(
void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml)
{
std::string linkName = "[Targets]";
- this->AppendLinkedResource(xml, linkName, "virtual:/virtual", VirtualFolder);
+ cmExtraEclipseCDT4Generator::AppendLinkedResource(
+ xml, linkName, "virtual:/virtual", VirtualFolder);
for (cmLocalGenerator* lg : this->GlobalGenerator->GetLocalGenerators()) {
cmMakefile* makefile = lg->GetMakefile();
@@ -483,8 +490,8 @@ void cmExtraEclipseCDT4Generator::CreateLinksForTargets(cmXMLWriter& xml)
: "[lib] ");
linkName2 += prefix;
linkName2 += target->GetName();
- this->AppendLinkedResource(xml, linkName2, "virtual:/virtual",
- VirtualFolder);
+ cmExtraEclipseCDT4Generator::AppendLinkedResource(
+ xml, linkName2, "virtual:/virtual", VirtualFolder);
if (!this->GenerateLinkedResources) {
break; // skip generating the linked resources to the source files
}
@@ -522,21 +529,23 @@ void cmExtraEclipseCDT4Generator::CreateLinksToSubprojects(
// for each sub project create a linked resource to the source dir
// - only if it is an out-of-source build
- this->AppendLinkedResource(xml, "[Subprojects]", "virtual:/virtual",
- VirtualFolder);
+ cmExtraEclipseCDT4Generator::AppendLinkedResource(
+ xml, "[Subprojects]", "virtual:/virtual", VirtualFolder);
for (auto const& it : this->GlobalGenerator->GetProjectMap()) {
std::string linkSourceDirectory =
- this->GetEclipsePath(it.second[0]->GetCurrentSourceDirectory());
+ cmExtraEclipseCDT4Generator::GetEclipsePath(
+ it.second[0]->GetCurrentSourceDirectory());
// a linked resource must not point to a parent directory of .project or
// .project itself
if ((baseDir != linkSourceDirectory) &&
!cmSystemTools::IsSubDirectory(baseDir, linkSourceDirectory)) {
std::string linkName = "[Subprojects]/";
linkName += it.first;
- this->AppendLinkedResource(xml, linkName,
- this->GetEclipsePath(linkSourceDirectory),
- LinkToFolder);
+ cmExtraEclipseCDT4Generator::AppendLinkedResource(
+ xml, linkName,
+ cmExtraEclipseCDT4Generator::GetEclipsePath(linkSourceDirectory),
+ LinkToFolder);
// Don't add it to the srcLinkedResources, because listing multiple
// directories confuses the Eclipse indexer (#13596).
}
@@ -705,7 +714,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
xml.Attribute("path", p);
xml.EndElement();
- // exlude source directory from output search path
+ // exclude source directory from output search path
// - only if not named the same as an output directory
if (!cmSystemTools::FileIsDirectory(
std::string(this->HomeOutputDirectory + "/" + p))) {
@@ -836,6 +845,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
const std::vector<cmGeneratorTarget*>& targets =
lgen->GetGeneratorTargets();
for (cmGeneratorTarget* target : targets) {
+ if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ continue;
+ }
std::vector<std::string> includeDirs;
std::string config = mf->GetSafeDefinition("CMAKE_BUILD_TYPE");
lgen->GetIncludeDirectories(includeDirs, target, "C", config);
@@ -890,7 +902,7 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
for (cmLocalGenerator* lgen : this->GlobalGenerator->GetLocalGenerators()) {
const std::vector<cmGeneratorTarget*>& targets =
lgen->GetGeneratorTargets();
- std::string subdir = lgen->ConvertToRelativePath(
+ std::string subdir = lgen->MaybeConvertToRelativePath(
this->HomeOutputDirectory, lgen->GetCurrentBinaryDirectory());
if (subdir == ".") {
subdir.clear();
@@ -903,7 +915,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// Only add the global targets from CMAKE_BINARY_DIR,
// not from the subdirs
if (subdir.empty()) {
- this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": ");
+ cmExtraEclipseCDT4Generator::AppendTarget(xml, targetName, make,
+ makeArgs, subdir, ": ");
}
} break;
case cmStateEnums::UTILITY:
@@ -918,7 +931,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
break;
}
- this->AppendTarget(xml, targetName, make, makeArgs, subdir, ": ");
+ cmExtraEclipseCDT4Generator::AppendTarget(xml, targetName, make,
+ makeArgs, subdir, ": ");
break;
case cmStateEnums::EXECUTABLE:
case cmStateEnums::STATIC_LIBRARY:
@@ -928,10 +942,12 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
const char* prefix =
(target->GetType() == cmStateEnums::EXECUTABLE ? "[exe] "
: "[lib] ");
- this->AppendTarget(xml, targetName, make, makeArgs, subdir, prefix);
+ cmExtraEclipseCDT4Generator::AppendTarget(xml, targetName, make,
+ makeArgs, subdir, prefix);
std::string fastTarget = targetName;
fastTarget += "/fast";
- this->AppendTarget(xml, fastTarget, make, makeArgs, subdir, prefix);
+ cmExtraEclipseCDT4Generator::AppendTarget(xml, fastTarget, make,
+ makeArgs, subdir, prefix);
// Add Build and Clean targets in the virtual folder of targets:
if (this->SupportsVirtualFolders) {
@@ -942,8 +958,8 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
buildArgs += lgen->GetBinaryDirectory();
buildArgs += "\" ";
buildArgs += makeArgs;
- this->AppendTarget(xml, "Build", make, buildArgs, virtDir, "",
- targetName.c_str());
+ cmExtraEclipseCDT4Generator::AppendTarget(
+ xml, "Build", make, buildArgs, virtDir, "", targetName.c_str());
std::string cleanArgs = "-E chdir \"";
cleanArgs += lgen->GetCurrentBinaryDirectory();
@@ -953,10 +969,13 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
cmGeneratorTarget* gt = target;
cleanArgs += lgen->GetTargetDirectory(gt);
cleanArgs += "/cmake_clean.cmake\"";
- this->AppendTarget(xml, "Clean", cmSystemTools::GetCMakeCommand(),
- cleanArgs, virtDir, "", "");
+ cmExtraEclipseCDT4Generator::AppendTarget(
+ xml, "Clean", cmSystemTools::GetCMakeCommand(), cleanArgs,
+ virtDir, "", "");
}
} break;
+ case cmStateEnums::INTERFACE_LIBRARY:
+ break;
default:
break;
}
@@ -964,10 +983,12 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
// insert the all and clean targets in every subdir
if (!allTarget.empty()) {
- this->AppendTarget(xml, allTarget, make, makeArgs, subdir, ": ");
+ cmExtraEclipseCDT4Generator::AppendTarget(xml, allTarget, make, makeArgs,
+ subdir, ": ");
}
if (!cleanTarget.empty()) {
- this->AppendTarget(xml, cleanTarget, make, makeArgs, subdir, ": ");
+ cmExtraEclipseCDT4Generator::AppendTarget(xml, cleanTarget, make,
+ makeArgs, subdir, ": ");
}
// insert rules for compiling, preprocessing and assembling individual
@@ -976,19 +997,20 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
lg->GetIndividualFileTargets(objectFileTargets);
for (std::string const& f : objectFileTargets) {
const char* prefix = "[obj] ";
- if (f[f.length() - 1] == 's') {
+ if (f.back() == 's') {
prefix = "[to asm] ";
- } else if (f[f.length() - 1] == 'i') {
+ } else if (f.back() == 'i') {
prefix = "[pre] ";
}
- this->AppendTarget(xml, f, make, makeArgs, subdir, prefix);
+ cmExtraEclipseCDT4Generator::AppendTarget(xml, f, make, makeArgs, subdir,
+ prefix);
}
}
xml.EndElement(); // buildTargets
xml.EndElement(); // storageModule
- this->AppendStorageScanners(xml, *mf);
+ cmExtraEclipseCDT4Generator::AppendStorageScanners(xml, *mf);
xml.EndElement(); // cconfiguration
xml.EndElement(); // storageModule
@@ -1035,8 +1057,7 @@ std::string cmExtraEclipseCDT4Generator::GetPathBasename(
{
std::string outputBasename = path;
while (!outputBasename.empty() &&
- (outputBasename[outputBasename.size() - 1] == '/' ||
- outputBasename[outputBasename.size() - 1] == '\\')) {
+ (outputBasename.back() == '/' || outputBasename.back() == '\\')) {
outputBasename.resize(outputBasename.size() - 1);
}
std::string::size_type loc = outputBasename.find_last_of("/\\");
diff --git a/Source/cmExtraKateGenerator.cxx b/Source/cmExtraKateGenerator.cxx
index f5c4c93e4..23ba6b77f 100644
--- a/Source/cmExtraKateGenerator.cxx
+++ b/Source/cmExtraKateGenerator.cxx
@@ -16,10 +16,7 @@
#include <string.h>
#include <vector>
-cmExtraKateGenerator::cmExtraKateGenerator()
- : cmExternalMakefileProjectGenerator()
-{
-}
+cmExtraKateGenerator::cmExtraKateGenerator() = default;
cmExternalMakefileProjectGeneratorFactory* cmExtraKateGenerator::GetFactory()
{
@@ -259,7 +256,7 @@ std::string cmExtraKateGenerator::GenerateFilesString(
const std::vector<cmSourceFile*>& sources = makefile->GetSourceFiles();
for (cmSourceFile* sf : sources) {
- if (sf->GetPropertyAsBool("GENERATED")) {
+ if (sf->GetIsGenerated()) {
continue;
}
@@ -294,8 +291,7 @@ std::string cmExtraKateGenerator::GetPathBasename(
{
std::string outputBasename = path;
while (!outputBasename.empty() &&
- (outputBasename[outputBasename.size() - 1] == '/' ||
- outputBasename[outputBasename.size() - 1] == '\\')) {
+ (outputBasename.back() == '/' || outputBasename.back() == '\\')) {
outputBasename.resize(outputBasename.size() - 1);
}
std::string::size_type loc = outputBasename.find_last_of("/\\");
diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx
index c4cca072b..739a177bb 100644
--- a/Source/cmExtraSublimeTextGenerator.cxx
+++ b/Source/cmExtraSublimeTextGenerator.cxx
@@ -14,6 +14,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
@@ -55,7 +56,6 @@ cmExtraSublimeTextGenerator::GetFactory()
}
cmExtraSublimeTextGenerator::cmExtraSublimeTextGenerator()
- : cmExternalMakefileProjectGenerator()
{
this->ExcludeBuildFolder = false;
}
@@ -155,7 +155,7 @@ void cmExtraSublimeTextGenerator::CreateNewProjectFile(
e << "Could not parse Env Vars specified in "
"\"CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS\""
<< ", corrupted string " << t;
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
}
fout << "\n\t\t}";
@@ -384,13 +384,8 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines(
cmGeneratorExpressionInterpreter genexInterpreter(lg, config, target,
language);
- // Add the export symbol definition for shared library objects.
- if (const char* exportMacro = target->GetExportMacro()) {
- lg->AppendDefines(defines, exportMacro);
- }
-
// Add preprocessor definitions for this target and configuration.
- lg->AddCompileDefinitions(defines, target, config, language);
+ lg->GetTargetDefines(target, config, language, defines);
const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS");
if (const char* compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) {
lg->AppendDefines(
diff --git a/Source/cmFLTKWrapUICommand.cxx b/Source/cmFLTKWrapUICommand.cxx
index effb4460a..4b14d26d0 100644
--- a/Source/cmFLTKWrapUICommand.cxx
+++ b/Source/cmFLTKWrapUICommand.cxx
@@ -117,7 +117,7 @@ void cmFLTKWrapUICommand::FinalPass()
msg += ". The problem was found while processing the source directory: ";
msg += this->Makefile->GetCurrentSourceDirectory();
msg += ". This FLTK_WRAP_UI call will be ignored.";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
return;
}
}
diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx
new file mode 100644
index 000000000..34b6b330d
--- /dev/null
+++ b/Source/cmFileAPI.cxx
@@ -0,0 +1,800 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmFileAPI.h"
+
+#include "cmAlgorithms.h"
+#include "cmCryptoHash.h"
+#include "cmFileAPICMakeFiles.h"
+#include "cmFileAPICache.h"
+#include "cmFileAPICodemodel.h"
+#include "cmGlobalGenerator.h"
+#include "cmSystemTools.h"
+#include "cmTimestamp.h"
+#include "cmake.h"
+#include "cmsys/Directory.hxx"
+#include "cmsys/FStream.hxx"
+
+#include <algorithm>
+#include <cassert>
+#include <chrono>
+#include <ctime>
+#include <iomanip>
+#include <sstream>
+#include <utility>
+
+cmFileAPI::cmFileAPI(cmake* cm)
+ : CMakeInstance(cm)
+{
+ this->APIv1 =
+ this->CMakeInstance->GetHomeOutputDirectory() + "/.cmake/api/v1";
+
+ Json::CharReaderBuilder rbuilder;
+ rbuilder["collectComments"] = false;
+ rbuilder["failIfExtra"] = true;
+ rbuilder["rejectDupKeys"] = false;
+ rbuilder["strictRoot"] = true;
+ this->JsonReader =
+ std::unique_ptr<Json::CharReader>(rbuilder.newCharReader());
+
+ Json::StreamWriterBuilder wbuilder;
+ wbuilder["indentation"] = "\t";
+ this->JsonWriter =
+ std::unique_ptr<Json::StreamWriter>(wbuilder.newStreamWriter());
+}
+
+void cmFileAPI::ReadQueries()
+{
+ std::string const query_dir = this->APIv1 + "/query";
+ this->QueryExists = cmSystemTools::FileIsDirectory(query_dir);
+ if (!this->QueryExists) {
+ return;
+ }
+
+ // Load queries at the top level.
+ std::vector<std::string> queries = cmFileAPI::LoadDir(query_dir);
+
+ // Read the queries and save for later.
+ for (std::string& query : queries) {
+ if (cmHasLiteralPrefix(query, "client-")) {
+ this->ReadClient(query);
+ } else if (!cmFileAPI::ReadQuery(query, this->TopQuery.Known)) {
+ this->TopQuery.Unknown.push_back(std::move(query));
+ }
+ }
+}
+
+void cmFileAPI::WriteReplies()
+{
+ if (this->QueryExists) {
+ cmSystemTools::MakeDirectory(this->APIv1 + "/reply");
+ this->WriteJsonFile(this->BuildReplyIndex(), "index", ComputeSuffixTime);
+ }
+
+ this->RemoveOldReplyFiles();
+}
+
+std::vector<std::string> cmFileAPI::LoadDir(std::string const& dir)
+{
+ std::vector<std::string> files;
+ cmsys::Directory d;
+ d.Load(dir);
+ for (unsigned long i = 0; i < d.GetNumberOfFiles(); ++i) {
+ std::string f = d.GetFile(i);
+ if (f != "." && f != "..") {
+ files.push_back(std::move(f));
+ }
+ }
+ std::sort(files.begin(), files.end());
+ return files;
+}
+
+void cmFileAPI::RemoveOldReplyFiles()
+{
+ std::string const reply_dir = this->APIv1 + "/reply";
+ std::vector<std::string> files = this->LoadDir(reply_dir);
+ for (std::string const& f : files) {
+ if (this->ReplyFiles.find(f) == this->ReplyFiles.end()) {
+ std::string file = reply_dir + "/" + f;
+ cmSystemTools::RemoveFile(file);
+ }
+ }
+}
+
+bool cmFileAPI::ReadJsonFile(std::string const& file, Json::Value& value,
+ std::string& error)
+{
+ std::vector<char> content;
+
+ cmsys::ifstream fin;
+ if (!cmSystemTools::FileIsDirectory(file)) {
+ fin.open(file.c_str(), std::ios::binary);
+ }
+ auto finEnd = fin.rdbuf()->pubseekoff(0, std::ios::end);
+ if (finEnd > 0) {
+ size_t finSize = finEnd;
+ try {
+ // Allocate a buffer to read the whole file.
+ content.resize(finSize);
+
+ // Now read the file from the beginning.
+ fin.seekg(0, std::ios::beg);
+ fin.read(content.data(), finSize);
+ } catch (...) {
+ fin.setstate(std::ios::failbit);
+ }
+ }
+ fin.close();
+ if (!fin) {
+ value = Json::Value();
+ error = "failed to read from file";
+ return false;
+ }
+
+ // Parse our buffer as json.
+ if (!this->JsonReader->parse(content.data(), content.data() + content.size(),
+ &value, &error)) {
+ value = Json::Value();
+ return false;
+ }
+
+ return true;
+}
+
+std::string cmFileAPI::WriteJsonFile(
+ Json::Value const& value, std::string const& prefix,
+ std::string (*computeSuffix)(std::string const&))
+{
+ std::string fileName;
+
+ // Write the json file with a temporary name.
+ std::string const& tmpFile = this->APIv1 + "/tmp.json";
+ cmsys::ofstream ftmp(tmpFile.c_str());
+ this->JsonWriter->write(value, &ftmp);
+ ftmp << "\n";
+ ftmp.close();
+ if (!ftmp) {
+ cmSystemTools::RemoveFile(tmpFile);
+ return fileName;
+ }
+
+ // Compute the final name for the file.
+ fileName = prefix + "-" + computeSuffix(tmpFile) + ".json";
+
+ // Create the destination.
+ std::string file = this->APIv1 + "/reply";
+ cmSystemTools::MakeDirectory(file);
+ file += "/";
+ file += fileName;
+
+ // If the final name already exists then assume it has proper content.
+ // Otherwise, atomically place the reply file at its final name
+ if (cmSystemTools::FileExists(file, true) ||
+ !cmSystemTools::RenameFile(tmpFile, file)) {
+ cmSystemTools::RemoveFile(tmpFile);
+ }
+
+ // Record this among files we have just written.
+ this->ReplyFiles.insert(fileName);
+
+ return fileName;
+}
+
+Json::Value cmFileAPI::MaybeJsonFile(Json::Value in, std::string const& prefix)
+{
+ Json::Value out;
+ if (in.isObject() || in.isArray()) {
+ out = Json::objectValue;
+ out["jsonFile"] = this->WriteJsonFile(in, prefix);
+ } else {
+ out = std::move(in);
+ }
+ return out;
+}
+
+std::string cmFileAPI::ComputeSuffixHash(std::string const& file)
+{
+ cmCryptoHash hasher(cmCryptoHash::AlgoSHA3_256);
+ std::string hash = hasher.HashFile(file);
+ hash.resize(20, '0');
+ return hash;
+}
+
+std::string cmFileAPI::ComputeSuffixTime(std::string const&)
+{
+ std::chrono::milliseconds ms =
+ std::chrono::duration_cast<std::chrono::milliseconds>(
+ std::chrono::system_clock::now().time_since_epoch());
+ std::chrono::seconds s =
+ std::chrono::duration_cast<std::chrono::seconds>(ms);
+
+ std::time_t ts = s.count();
+ std::size_t tms = ms.count() % 1000;
+
+ cmTimestamp cmts;
+ std::ostringstream ss;
+ ss << cmts.CreateTimestampFromTimeT(ts, "%Y-%m-%dT%H-%M-%S", true) << '-'
+ << std::setfill('0') << std::setw(4) << tms;
+ return ss.str();
+}
+
+bool cmFileAPI::ReadQuery(std::string const& query,
+ std::vector<Object>& objects)
+{
+ // Parse the "<kind>-" syntax.
+ std::string::size_type sep_pos = query.find('-');
+ if (sep_pos == std::string::npos) {
+ return false;
+ }
+ std::string kindName = query.substr(0, sep_pos);
+ std::string verStr = query.substr(sep_pos + 1);
+ if (kindName == ObjectKindName(ObjectKind::CodeModel)) {
+ Object o;
+ o.Kind = ObjectKind::CodeModel;
+ if (verStr == "v2") {
+ o.Version = 2;
+ } else {
+ return false;
+ }
+ objects.push_back(o);
+ return true;
+ }
+ if (kindName == ObjectKindName(ObjectKind::Cache)) {
+ Object o;
+ o.Kind = ObjectKind::Cache;
+ if (verStr == "v2") {
+ o.Version = 2;
+ } else {
+ return false;
+ }
+ objects.push_back(o);
+ return true;
+ }
+ if (kindName == ObjectKindName(ObjectKind::CMakeFiles)) {
+ Object o;
+ o.Kind = ObjectKind::CMakeFiles;
+ if (verStr == "v1") {
+ o.Version = 1;
+ } else {
+ return false;
+ }
+ objects.push_back(o);
+ return true;
+ }
+ if (kindName == ObjectKindName(ObjectKind::InternalTest)) {
+ Object o;
+ o.Kind = ObjectKind::InternalTest;
+ if (verStr == "v1") {
+ o.Version = 1;
+ } else if (verStr == "v2") {
+ o.Version = 2;
+ } else {
+ return false;
+ }
+ objects.push_back(o);
+ return true;
+ }
+ return false;
+}
+
+void cmFileAPI::ReadClient(std::string const& client)
+{
+ // Load queries for the client.
+ std::string clientDir = this->APIv1 + "/query/" + client;
+ std::vector<std::string> queries = this->LoadDir(clientDir);
+
+ // Read the queries and save for later.
+ ClientQuery& clientQuery = this->ClientQueries[client];
+ for (std::string& query : queries) {
+ if (query == "query.json") {
+ clientQuery.HaveQueryJson = true;
+ this->ReadClientQuery(client, clientQuery.QueryJson);
+ } else if (!this->ReadQuery(query, clientQuery.DirQuery.Known)) {
+ clientQuery.DirQuery.Unknown.push_back(std::move(query));
+ }
+ }
+}
+
+void cmFileAPI::ReadClientQuery(std::string const& client, ClientQueryJson& q)
+{
+ // Read the query.json file.
+ std::string queryFile = this->APIv1 + "/query/" + client + "/query.json";
+ Json::Value query;
+ if (!this->ReadJsonFile(queryFile, query, q.Error)) {
+ return;
+ }
+ if (!query.isObject()) {
+ q.Error = "query root is not an object";
+ return;
+ }
+
+ Json::Value const& clientValue = query["client"];
+ if (!clientValue.isNull()) {
+ q.ClientValue = clientValue;
+ }
+ q.RequestsValue = std::move(query["requests"]);
+ q.Requests = this->BuildClientRequests(q.RequestsValue);
+}
+
+Json::Value cmFileAPI::BuildReplyIndex()
+{
+ Json::Value index(Json::objectValue);
+
+ // Report information about this version of CMake.
+ index["cmake"] = this->BuildCMake();
+
+ // Reply to all queries that we loaded.
+ Json::Value& reply = index["reply"] = this->BuildReply(this->TopQuery);
+ for (auto const& client : this->ClientQueries) {
+ std::string const& clientName = client.first;
+ ClientQuery const& clientQuery = client.second;
+ reply[clientName] = this->BuildClientReply(clientQuery);
+ }
+
+ // Move our index of generated objects into its field.
+ Json::Value& objects = index["objects"] = Json::arrayValue;
+ for (auto& entry : this->ReplyIndexObjects) {
+ objects.append(std::move(entry.second)); // NOLINT(*)
+ }
+
+ return index;
+}
+
+Json::Value cmFileAPI::BuildCMake()
+{
+ Json::Value cmake = Json::objectValue;
+ cmake["version"] = this->CMakeInstance->ReportVersionJson();
+ Json::Value& cmake_paths = cmake["paths"] = Json::objectValue;
+ cmake_paths["cmake"] = cmSystemTools::GetCMakeCommand();
+ cmake_paths["ctest"] = cmSystemTools::GetCTestCommand();
+ cmake_paths["cpack"] = cmSystemTools::GetCPackCommand();
+ cmake_paths["root"] = cmSystemTools::GetCMakeRoot();
+ cmake["generator"] = this->CMakeInstance->GetGlobalGenerator()->GetJson();
+ return cmake;
+}
+
+Json::Value cmFileAPI::BuildReply(Query const& q)
+{
+ Json::Value reply = Json::objectValue;
+ for (Object const& o : q.Known) {
+ std::string const& name = ObjectName(o);
+ reply[name] = this->AddReplyIndexObject(o);
+ }
+
+ for (std::string const& name : q.Unknown) {
+ reply[name] = cmFileAPI::BuildReplyError("unknown query file");
+ }
+ return reply;
+}
+
+Json::Value cmFileAPI::BuildReplyError(std::string const& error)
+{
+ Json::Value e = Json::objectValue;
+ e["error"] = error;
+ return e;
+}
+
+Json::Value const& cmFileAPI::AddReplyIndexObject(Object const& o)
+{
+ Json::Value& indexEntry = this->ReplyIndexObjects[o];
+ if (!indexEntry.isNull()) {
+ // The reply object has already been generated.
+ return indexEntry;
+ }
+
+ // Generate this reply object.
+ Json::Value const& object = this->BuildObject(o);
+ assert(object.isObject());
+
+ // Populate this index entry.
+ indexEntry = Json::objectValue;
+ indexEntry["kind"] = object["kind"];
+ indexEntry["version"] = object["version"];
+ indexEntry["jsonFile"] = this->WriteJsonFile(object, ObjectName(o));
+ return indexEntry;
+}
+
+const char* cmFileAPI::ObjectKindName(ObjectKind kind)
+{
+ // Keep in sync with ObjectKind enum.
+ static const char* objectKindNames[] = {
+ "codemodel", //
+ "cache", //
+ "cmakeFiles", //
+ "__test" //
+ };
+ return objectKindNames[size_t(kind)];
+}
+
+std::string cmFileAPI::ObjectName(Object const& o)
+{
+ std::string name = ObjectKindName(o.Kind);
+ name += "-v";
+ name += std::to_string(o.Version);
+ return name;
+}
+
+Json::Value cmFileAPI::BuildObject(Object const& object)
+{
+ Json::Value value;
+
+ switch (object.Kind) {
+ case ObjectKind::CodeModel:
+ value = this->BuildCodeModel(object);
+ break;
+ case ObjectKind::Cache:
+ value = this->BuildCache(object);
+ break;
+ case ObjectKind::CMakeFiles:
+ value = this->BuildCMakeFiles(object);
+ break;
+ case ObjectKind::InternalTest:
+ value = this->BuildInternalTest(object);
+ break;
+ }
+
+ return value;
+}
+
+cmFileAPI::ClientRequests cmFileAPI::BuildClientRequests(
+ Json::Value const& requests)
+{
+ ClientRequests result;
+ if (requests.isNull()) {
+ result.Error = "'requests' member missing";
+ return result;
+ }
+ if (!requests.isArray()) {
+ result.Error = "'requests' member is not an array";
+ return result;
+ }
+
+ result.reserve(requests.size());
+ for (Json::Value const& request : requests) {
+ result.emplace_back(this->BuildClientRequest(request));
+ }
+
+ return result;
+}
+
+cmFileAPI::ClientRequest cmFileAPI::BuildClientRequest(
+ Json::Value const& request)
+{
+ ClientRequest r;
+
+ if (!request.isObject()) {
+ r.Error = "request is not an object";
+ return r;
+ }
+
+ Json::Value const& kind = request["kind"];
+ if (kind.isNull()) {
+ r.Error = "'kind' member missing";
+ return r;
+ }
+ if (!kind.isString()) {
+ r.Error = "'kind' member is not a string";
+ return r;
+ }
+ std::string const& kindName = kind.asString();
+
+ if (kindName == this->ObjectKindName(ObjectKind::CodeModel)) {
+ r.Kind = ObjectKind::CodeModel;
+ } else if (kindName == this->ObjectKindName(ObjectKind::Cache)) {
+ r.Kind = ObjectKind::Cache;
+ } else if (kindName == this->ObjectKindName(ObjectKind::CMakeFiles)) {
+ r.Kind = ObjectKind::CMakeFiles;
+ } else if (kindName == this->ObjectKindName(ObjectKind::InternalTest)) {
+ r.Kind = ObjectKind::InternalTest;
+ } else {
+ r.Error = "unknown request kind '" + kindName + "'";
+ return r;
+ }
+
+ Json::Value const& version = request["version"];
+ if (version.isNull()) {
+ r.Error = "'version' member missing";
+ return r;
+ }
+ std::vector<RequestVersion> versions;
+ if (!cmFileAPI::ReadRequestVersions(version, versions, r.Error)) {
+ return r;
+ }
+
+ switch (r.Kind) {
+ case ObjectKind::CodeModel:
+ this->BuildClientRequestCodeModel(r, versions);
+ break;
+ case ObjectKind::Cache:
+ this->BuildClientRequestCache(r, versions);
+ break;
+ case ObjectKind::CMakeFiles:
+ this->BuildClientRequestCMakeFiles(r, versions);
+ break;
+ case ObjectKind::InternalTest:
+ this->BuildClientRequestInternalTest(r, versions);
+ break;
+ }
+
+ return r;
+}
+
+Json::Value cmFileAPI::BuildClientReply(ClientQuery const& q)
+{
+ Json::Value reply = this->BuildReply(q.DirQuery);
+
+ if (!q.HaveQueryJson) {
+ return reply;
+ }
+
+ Json::Value& reply_query_json = reply["query.json"];
+ ClientQueryJson const& qj = q.QueryJson;
+
+ if (!qj.Error.empty()) {
+ reply_query_json = this->BuildReplyError(qj.Error);
+ return reply;
+ }
+
+ if (!qj.ClientValue.isNull()) {
+ reply_query_json["client"] = qj.ClientValue;
+ }
+
+ if (!qj.RequestsValue.isNull()) {
+ reply_query_json["requests"] = qj.RequestsValue;
+ }
+
+ reply_query_json["responses"] = this->BuildClientReplyResponses(qj.Requests);
+
+ return reply;
+}
+
+Json::Value cmFileAPI::BuildClientReplyResponses(
+ ClientRequests const& requests)
+{
+ Json::Value responses;
+
+ if (!requests.Error.empty()) {
+ responses = this->BuildReplyError(requests.Error);
+ return responses;
+ }
+
+ responses = Json::arrayValue;
+ for (ClientRequest const& request : requests) {
+ responses.append(this->BuildClientReplyResponse(request));
+ }
+
+ return responses;
+}
+
+Json::Value cmFileAPI::BuildClientReplyResponse(ClientRequest const& request)
+{
+ Json::Value response;
+ if (!request.Error.empty()) {
+ response = this->BuildReplyError(request.Error);
+ return response;
+ }
+ response = this->AddReplyIndexObject(request);
+ return response;
+}
+
+bool cmFileAPI::ReadRequestVersions(Json::Value const& version,
+ std::vector<RequestVersion>& versions,
+ std::string& error)
+{
+ if (version.isArray()) {
+ for (Json::Value const& v : version) {
+ if (!ReadRequestVersion(v, /*inArray=*/true, versions, error)) {
+ return false;
+ }
+ }
+ } else {
+ if (!ReadRequestVersion(version, /*inArray=*/false, versions, error)) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool cmFileAPI::ReadRequestVersion(Json::Value const& version, bool inArray,
+ std::vector<RequestVersion>& result,
+ std::string& error)
+{
+ if (version.isUInt()) {
+ RequestVersion v;
+ v.Major = version.asUInt();
+ result.push_back(v);
+ return true;
+ }
+
+ if (!version.isObject()) {
+ if (inArray) {
+ error = "'version' array entry is not a non-negative integer or object";
+ } else {
+ error =
+ "'version' member is not a non-negative integer, object, or array";
+ }
+ return false;
+ }
+
+ Json::Value const& major = version["major"];
+ if (major.isNull()) {
+ error = "'version' object 'major' member missing";
+ return false;
+ }
+ if (!major.isUInt()) {
+ error = "'version' object 'major' member is not a non-negative integer";
+ return false;
+ }
+
+ RequestVersion v;
+ v.Major = major.asUInt();
+
+ Json::Value const& minor = version["minor"];
+ if (minor.isUInt()) {
+ v.Minor = minor.asUInt();
+ } else if (!minor.isNull()) {
+ error = "'version' object 'minor' member is not a non-negative integer";
+ return false;
+ }
+
+ result.push_back(v);
+
+ return true;
+}
+
+std::string cmFileAPI::NoSupportedVersion(
+ std::vector<RequestVersion> const& versions)
+{
+ std::ostringstream msg;
+ msg << "no supported version specified";
+ if (!versions.empty()) {
+ msg << " among:";
+ for (RequestVersion const& v : versions) {
+ msg << " " << v.Major << "." << v.Minor;
+ }
+ }
+ return msg.str();
+}
+
+// The "codemodel" object kind.
+
+static unsigned int const CodeModelV2Minor = 0;
+
+void cmFileAPI::BuildClientRequestCodeModel(
+ ClientRequest& r, std::vector<RequestVersion> const& versions)
+{
+ // Select a known version from those requested.
+ for (RequestVersion const& v : versions) {
+ if ((v.Major == 2 && v.Minor <= CodeModelV2Minor)) {
+ r.Version = v.Major;
+ break;
+ }
+ }
+ if (!r.Version) {
+ r.Error = NoSupportedVersion(versions);
+ }
+}
+
+Json::Value cmFileAPI::BuildCodeModel(Object const& object)
+{
+ using namespace std::placeholders;
+ Json::Value codemodel = cmFileAPICodemodelDump(*this, object.Version);
+ codemodel["kind"] = this->ObjectKindName(object.Kind);
+
+ Json::Value& version = codemodel["version"] = Json::objectValue;
+ if (object.Version == 2) {
+ version["major"] = 2;
+ version["minor"] = CodeModelV2Minor;
+ } else {
+ return codemodel; // should be unreachable
+ }
+
+ return codemodel;
+}
+
+// The "cache" object kind.
+
+static unsigned int const CacheV2Minor = 0;
+
+void cmFileAPI::BuildClientRequestCache(
+ ClientRequest& r, std::vector<RequestVersion> const& versions)
+{
+ // Select a known version from those requested.
+ for (RequestVersion const& v : versions) {
+ if ((v.Major == 2 && v.Minor <= CacheV2Minor)) {
+ r.Version = v.Major;
+ break;
+ }
+ }
+ if (!r.Version) {
+ r.Error = NoSupportedVersion(versions);
+ }
+}
+
+Json::Value cmFileAPI::BuildCache(Object const& object)
+{
+ using namespace std::placeholders;
+ Json::Value cache = cmFileAPICacheDump(*this, object.Version);
+ cache["kind"] = this->ObjectKindName(object.Kind);
+
+ Json::Value& version = cache["version"] = Json::objectValue;
+ if (object.Version == 2) {
+ version["major"] = 2;
+ version["minor"] = CacheV2Minor;
+ } else {
+ return cache; // should be unreachable
+ }
+
+ return cache;
+}
+
+// The "cmakeFiles" object kind.
+
+static unsigned int const CMakeFilesV1Minor = 0;
+
+void cmFileAPI::BuildClientRequestCMakeFiles(
+ ClientRequest& r, std::vector<RequestVersion> const& versions)
+{
+ // Select a known version from those requested.
+ for (RequestVersion const& v : versions) {
+ if ((v.Major == 1 && v.Minor <= CMakeFilesV1Minor)) {
+ r.Version = v.Major;
+ break;
+ }
+ }
+ if (!r.Version) {
+ r.Error = NoSupportedVersion(versions);
+ }
+}
+
+Json::Value cmFileAPI::BuildCMakeFiles(Object const& object)
+{
+ using namespace std::placeholders;
+ Json::Value cmakeFiles = cmFileAPICMakeFilesDump(*this, object.Version);
+ cmakeFiles["kind"] = this->ObjectKindName(object.Kind);
+
+ Json::Value& version = cmakeFiles["version"] = Json::objectValue;
+ if (object.Version == 1) {
+ version["major"] = 1;
+ version["minor"] = CMakeFilesV1Minor;
+ } else {
+ return cmakeFiles; // should be unreachable
+ }
+
+ return cmakeFiles;
+}
+
+// The "__test" object kind is for internal testing of CMake.
+
+static unsigned int const InternalTestV1Minor = 3;
+static unsigned int const InternalTestV2Minor = 0;
+
+void cmFileAPI::BuildClientRequestInternalTest(
+ ClientRequest& r, std::vector<RequestVersion> const& versions)
+{
+ // Select a known version from those requested.
+ for (RequestVersion const& v : versions) {
+ if ((v.Major == 1 && v.Minor <= InternalTestV1Minor) || //
+ (v.Major == 2 && v.Minor <= InternalTestV2Minor)) {
+ r.Version = v.Major;
+ break;
+ }
+ }
+ if (!r.Version) {
+ r.Error = NoSupportedVersion(versions);
+ }
+}
+
+Json::Value cmFileAPI::BuildInternalTest(Object const& object)
+{
+ Json::Value test = Json::objectValue;
+ test["kind"] = this->ObjectKindName(object.Kind);
+ Json::Value& version = test["version"] = Json::objectValue;
+ if (object.Version == 2) {
+ version["major"] = 2;
+ version["minor"] = InternalTestV2Minor;
+ } else {
+ version["major"] = 1;
+ version["minor"] = InternalTestV1Minor;
+ }
+ return test;
+}
diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h
new file mode 100644
index 000000000..341b072f4
--- /dev/null
+++ b/Source/cmFileAPI.h
@@ -0,0 +1,204 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmFileAPI_h
+#define cmFileAPI_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cm_jsoncpp_reader.h"
+#include "cm_jsoncpp_value.h"
+#include "cm_jsoncpp_writer.h"
+
+#include <map>
+#include <memory> // IWYU pragma: keep
+#include <string>
+#include <unordered_set>
+#include <vector>
+
+class cmake;
+
+class cmFileAPI
+{
+public:
+ cmFileAPI(cmake* cm);
+
+ /** Read fileapi queries from disk. */
+ void ReadQueries();
+
+ /** Write fileapi replies to disk. */
+ void WriteReplies();
+
+ /** Get the "cmake" instance with which this was constructed. */
+ cmake* GetCMakeInstance() const { return this->CMakeInstance; }
+
+ /** Convert a JSON object or array into an object with a single
+ "jsonFile" member specifying a file named with the given prefix
+ and holding the original object. Other JSON types are unchanged. */
+ Json::Value MaybeJsonFile(Json::Value in, std::string const& prefix);
+
+private:
+ cmake* CMakeInstance;
+
+ /** The api/v1 directory location. */
+ std::string APIv1;
+
+ /** The set of files we have just written to the reply directory. */
+ std::unordered_set<std::string> ReplyFiles;
+
+ static std::vector<std::string> LoadDir(std::string const& dir);
+ void RemoveOldReplyFiles();
+
+ // Keep in sync with ObjectKindName.
+ enum class ObjectKind
+ {
+ CodeModel,
+ Cache,
+ CMakeFiles,
+ InternalTest
+ };
+
+ /** Identify one object kind and major version. */
+ struct Object
+ {
+ ObjectKind Kind;
+ unsigned long Version = 0;
+ friend bool operator<(Object const& l, Object const& r)
+ {
+ if (l.Kind != r.Kind) {
+ return l.Kind < r.Kind;
+ }
+ return l.Version < r.Version;
+ }
+ };
+
+ /** Represent content of a query directory. */
+ struct Query
+ {
+ /** Known object kind-version pairs. */
+ std::vector<Object> Known;
+ /** Unknown object kind names. */
+ std::vector<std::string> Unknown;
+ };
+
+ /** Represent one request in a client 'query.json'. */
+ struct ClientRequest : public Object
+ {
+ /** Empty if request is valid, else the error string. */
+ std::string Error;
+ };
+
+ /** Represent the "requests" in a client 'query.json'. */
+ struct ClientRequests : public std::vector<ClientRequest>
+ {
+ /** Empty if requests field is valid, else the error string. */
+ std::string Error;
+ };
+
+ /** Represent the content of a client query.json file. */
+ struct ClientQueryJson
+ {
+ /** The error string if parsing failed, else empty. */
+ std::string Error;
+
+ /** The 'query.json' object "client" member if it exists, else null. */
+ Json::Value ClientValue;
+
+ /** The 'query.json' object "requests" member if it exists, else null. */
+ Json::Value RequestsValue;
+
+ /** Requests extracted from 'query.json'. */
+ ClientRequests Requests;
+ };
+
+ /** Represent content of a client query directory. */
+ struct ClientQuery
+ {
+ /** The content of the client query directory except 'query.json'. */
+ Query DirQuery;
+
+ /** True if 'query.json' exists. */
+ bool HaveQueryJson = false;
+
+ /** The 'query.json' content. */
+ ClientQueryJson QueryJson;
+ };
+
+ /** Whether the top-level query directory exists at all. */
+ bool QueryExists = false;
+
+ /** The content of the top-level query directory. */
+ Query TopQuery;
+
+ /** The content of each "client-$client" query directory. */
+ std::map<std::string, ClientQuery> ClientQueries;
+
+ /** Reply index object generated for object kind/version.
+ This populates the "objects" field of the reply index. */
+ std::map<Object, Json::Value> ReplyIndexObjects;
+
+ std::unique_ptr<Json::CharReader> JsonReader;
+ std::unique_ptr<Json::StreamWriter> JsonWriter;
+
+ bool ReadJsonFile(std::string const& file, Json::Value& value,
+ std::string& error);
+
+ std::string WriteJsonFile(
+ Json::Value const& value, std::string const& prefix,
+ std::string (*computeSuffix)(std::string const&) = ComputeSuffixHash);
+ static std::string ComputeSuffixHash(std::string const&);
+ static std::string ComputeSuffixTime(std::string const&);
+
+ static bool ReadQuery(std::string const& query,
+ std::vector<Object>& objects);
+ void ReadClient(std::string const& client);
+ void ReadClientQuery(std::string const& client, ClientQueryJson& q);
+
+ Json::Value BuildReplyIndex();
+ Json::Value BuildCMake();
+ Json::Value BuildReply(Query const& q);
+ static Json::Value BuildReplyError(std::string const& error);
+ Json::Value const& AddReplyIndexObject(Object const& o);
+
+ static const char* ObjectKindName(ObjectKind kind);
+ static std::string ObjectName(Object const& o);
+
+ Json::Value BuildObject(Object const& object);
+
+ ClientRequests BuildClientRequests(Json::Value const& requests);
+ ClientRequest BuildClientRequest(Json::Value const& request);
+ Json::Value BuildClientReply(ClientQuery const& q);
+ Json::Value BuildClientReplyResponses(ClientRequests const& requests);
+ Json::Value BuildClientReplyResponse(ClientRequest const& request);
+
+ struct RequestVersion
+ {
+ unsigned int Major = 0;
+ unsigned int Minor = 0;
+ };
+ static bool ReadRequestVersions(Json::Value const& version,
+ std::vector<RequestVersion>& versions,
+ std::string& error);
+ static bool ReadRequestVersion(Json::Value const& version, bool inArray,
+ std::vector<RequestVersion>& result,
+ std::string& error);
+ static std::string NoSupportedVersion(
+ std::vector<RequestVersion> const& versions);
+
+ void BuildClientRequestCodeModel(
+ ClientRequest& r, std::vector<RequestVersion> const& versions);
+ Json::Value BuildCodeModel(Object const& object);
+
+ void BuildClientRequestCache(ClientRequest& r,
+ std::vector<RequestVersion> const& versions);
+ Json::Value BuildCache(Object const& object);
+
+ void BuildClientRequestCMakeFiles(
+ ClientRequest& r, std::vector<RequestVersion> const& versions);
+ Json::Value BuildCMakeFiles(Object const& object);
+
+ void BuildClientRequestInternalTest(
+ ClientRequest& r, std::vector<RequestVersion> const& versions);
+ Json::Value BuildInternalTest(Object const& object);
+};
+
+#endif
diff --git a/Source/cmFileAPICMakeFiles.cxx b/Source/cmFileAPICMakeFiles.cxx
new file mode 100644
index 000000000..5590bc2b3
--- /dev/null
+++ b/Source/cmFileAPICMakeFiles.cxx
@@ -0,0 +1,114 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmFileAPICMakeFiles.h"
+
+#include "cmFileAPI.h"
+#include "cmGlobalGenerator.h"
+#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
+#include "cmSystemTools.h"
+#include "cmake.h"
+
+#include "cm_jsoncpp_value.h"
+
+#include <string>
+#include <vector>
+
+namespace {
+
+class CMakeFiles
+{
+ cmFileAPI& FileAPI;
+ unsigned long Version;
+ std::string CMakeModules;
+ std::string const& TopSource;
+ std::string const& TopBuild;
+ bool OutOfSource;
+
+ Json::Value DumpPaths();
+ Json::Value DumpInputs();
+ Json::Value DumpInput(std::string const& file);
+
+public:
+ CMakeFiles(cmFileAPI& fileAPI, unsigned long version);
+ Json::Value Dump();
+};
+
+CMakeFiles::CMakeFiles(cmFileAPI& fileAPI, unsigned long version)
+ : FileAPI(fileAPI)
+ , Version(version)
+ , CMakeModules(cmSystemTools::GetCMakeRoot() + "/Modules")
+ , TopSource(this->FileAPI.GetCMakeInstance()->GetHomeDirectory())
+ , TopBuild(this->FileAPI.GetCMakeInstance()->GetHomeOutputDirectory())
+ , OutOfSource(TopBuild != TopSource)
+{
+ static_cast<void>(this->Version);
+}
+
+Json::Value CMakeFiles::Dump()
+{
+ Json::Value cmakeFiles = Json::objectValue;
+ cmakeFiles["paths"] = this->DumpPaths();
+ cmakeFiles["inputs"] = DumpInputs();
+ return cmakeFiles;
+}
+
+Json::Value CMakeFiles::DumpPaths()
+{
+ Json::Value paths = Json::objectValue;
+ paths["source"] = this->TopSource;
+ paths["build"] = this->TopBuild;
+ return paths;
+}
+
+Json::Value CMakeFiles::DumpInputs()
+{
+ Json::Value inputs = Json::arrayValue;
+
+ cmGlobalGenerator* gg =
+ this->FileAPI.GetCMakeInstance()->GetGlobalGenerator();
+ for (cmLocalGenerator const* lg : gg->GetLocalGenerators()) {
+ cmMakefile const* mf = lg->GetMakefile();
+ for (std::string const& file : mf->GetListFiles()) {
+ inputs.append(this->DumpInput(file));
+ }
+ }
+
+ return inputs;
+}
+
+Json::Value CMakeFiles::DumpInput(std::string const& file)
+{
+ Json::Value input = Json::objectValue;
+
+ bool const isCMake = cmSystemTools::IsSubDirectory(file, this->CMakeModules);
+ if (isCMake) {
+ input["isCMake"] = true;
+ }
+
+ if (!cmSystemTools::IsSubDirectory(file, this->TopSource) &&
+ !cmSystemTools::IsSubDirectory(file, this->TopBuild)) {
+ input["isExternal"] = true;
+ }
+
+ if (this->OutOfSource &&
+ cmSystemTools::IsSubDirectory(file, this->TopBuild)) {
+ input["isGenerated"] = true;
+ }
+
+ std::string path = file;
+ if (!isCMake && cmSystemTools::IsSubDirectory(path, this->TopSource)) {
+ // Use a relative path within the source directory.
+ path = cmSystemTools::RelativePath(this->TopSource, path);
+ }
+ input["path"] = path;
+
+ return input;
+}
+}
+
+Json::Value cmFileAPICMakeFilesDump(cmFileAPI& fileAPI, unsigned long version)
+{
+ CMakeFiles cmakeFiles(fileAPI, version);
+ return cmakeFiles.Dump();
+}
diff --git a/Source/cmFileAPICMakeFiles.h b/Source/cmFileAPICMakeFiles.h
new file mode 100644
index 000000000..a851c32f4
--- /dev/null
+++ b/Source/cmFileAPICMakeFiles.h
@@ -0,0 +1,15 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmFileAPICMakeFiles_h
+#define cmFileAPICMakeFiles_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cm_jsoncpp_value.h"
+
+class cmFileAPI;
+
+extern Json::Value cmFileAPICMakeFilesDump(cmFileAPI& fileAPI,
+ unsigned long version);
+
+#endif
diff --git a/Source/cmFileAPICache.cxx b/Source/cmFileAPICache.cxx
new file mode 100644
index 000000000..f96bc90e5
--- /dev/null
+++ b/Source/cmFileAPICache.cxx
@@ -0,0 +1,106 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmFileAPICache.h"
+
+#include "cmFileAPI.h"
+#include "cmState.h"
+#include "cmake.h"
+
+#include "cm_jsoncpp_value.h"
+
+#include <algorithm>
+#include <string>
+#include <utility>
+#include <vector>
+
+namespace {
+
+class Cache
+{
+ cmFileAPI& FileAPI;
+ unsigned long Version;
+ cmState* State;
+
+ Json::Value DumpEntries();
+ Json::Value DumpEntry(std::string const& name);
+ Json::Value DumpEntryProperties(std::string const& name);
+ Json::Value DumpEntryProperty(std::string const& name,
+ std::string const& prop);
+
+public:
+ Cache(cmFileAPI& fileAPI, unsigned long version);
+ Json::Value Dump();
+};
+
+Cache::Cache(cmFileAPI& fileAPI, unsigned long version)
+ : FileAPI(fileAPI)
+ , Version(version)
+ , State(this->FileAPI.GetCMakeInstance()->GetState())
+{
+ static_cast<void>(this->Version);
+}
+
+Json::Value Cache::Dump()
+{
+ Json::Value cache = Json::objectValue;
+ cache["entries"] = DumpEntries();
+ return cache;
+}
+
+Json::Value Cache::DumpEntries()
+{
+ Json::Value entries = Json::arrayValue;
+
+ std::vector<std::string> names = this->State->GetCacheEntryKeys();
+ std::sort(names.begin(), names.end());
+
+ for (std::string const& name : names) {
+ entries.append(this->DumpEntry(name));
+ }
+
+ return entries;
+}
+
+Json::Value Cache::DumpEntry(std::string const& name)
+{
+ Json::Value entry = Json::objectValue;
+ entry["name"] = name;
+ entry["type"] =
+ cmState::CacheEntryTypeToString(this->State->GetCacheEntryType(name));
+ entry["value"] = this->State->GetCacheEntryValue(name);
+
+ Json::Value properties = this->DumpEntryProperties(name);
+ if (!properties.empty()) {
+ entry["properties"] = std::move(properties);
+ }
+
+ return entry;
+}
+
+Json::Value Cache::DumpEntryProperties(std::string const& name)
+{
+ Json::Value properties = Json::arrayValue;
+ std::vector<std::string> props =
+ this->State->GetCacheEntryPropertyList(name);
+ std::sort(props.begin(), props.end());
+ for (std::string const& prop : props) {
+ properties.append(this->DumpEntryProperty(name, prop));
+ }
+ return properties;
+}
+
+Json::Value Cache::DumpEntryProperty(std::string const& name,
+ std::string const& prop)
+{
+ Json::Value property = Json::objectValue;
+ property["name"] = prop;
+ property["value"] = this->State->GetCacheEntryProperty(name, prop);
+ return property;
+}
+}
+
+Json::Value cmFileAPICacheDump(cmFileAPI& fileAPI, unsigned long version)
+{
+ Cache cache(fileAPI, version);
+ return cache.Dump();
+}
diff --git a/Source/cmFileAPICache.h b/Source/cmFileAPICache.h
new file mode 100644
index 000000000..09d9e1ce9
--- /dev/null
+++ b/Source/cmFileAPICache.h
@@ -0,0 +1,15 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmFileAPICache_h
+#define cmFileAPICache_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cm_jsoncpp_value.h"
+
+class cmFileAPI;
+
+extern Json::Value cmFileAPICacheDump(cmFileAPI& fileAPI,
+ unsigned long version);
+
+#endif
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx
new file mode 100644
index 000000000..45e830318
--- /dev/null
+++ b/Source/cmFileAPICodemodel.cxx
@@ -0,0 +1,1247 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmFileAPICodemodel.h"
+
+#include "cmCryptoHash.h"
+#include "cmFileAPI.h"
+#include "cmGeneratorExpression.h"
+#include "cmGeneratorTarget.h"
+#include "cmGlobalGenerator.h"
+#include "cmInstallGenerator.h"
+#include "cmInstallSubdirectoryGenerator.h"
+#include "cmInstallTargetGenerator.h"
+#include "cmLinkLineComputer.h"
+#include "cmListFileCache.h"
+#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
+#include "cmSourceFile.h"
+#include "cmSourceGroup.h"
+#include "cmState.h"
+#include "cmStateDirectory.h"
+#include "cmStateSnapshot.h"
+#include "cmStateTypes.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
+#include "cmTargetDepend.h"
+#include "cmake.h"
+
+#include "cm_jsoncpp_value.h"
+
+#include <algorithm>
+#include <cassert>
+#include <map>
+#include <set>
+#include <string>
+#include <unordered_map>
+#include <utility>
+#include <vector>
+
+namespace {
+
+class Codemodel
+{
+ cmFileAPI& FileAPI;
+ unsigned long Version;
+
+ Json::Value DumpPaths();
+ Json::Value DumpConfigurations();
+ Json::Value DumpConfiguration(std::string const& config);
+
+public:
+ Codemodel(cmFileAPI& fileAPI, unsigned long version);
+ Json::Value Dump();
+};
+
+class CodemodelConfig
+{
+ cmFileAPI& FileAPI;
+ unsigned long Version;
+ std::string const& Config;
+ std::string TopSource;
+ std::string TopBuild;
+
+ struct Directory
+ {
+ cmStateSnapshot Snapshot;
+ cmLocalGenerator const* LocalGenerator = nullptr;
+ Json::Value TargetIndexes = Json::arrayValue;
+ Json::ArrayIndex ProjectIndex;
+ bool HasInstallRule = false;
+ };
+ std::map<cmStateSnapshot, Json::ArrayIndex, cmStateSnapshot::StrictWeakOrder>
+ DirectoryMap;
+ std::vector<Directory> Directories;
+
+ struct Project
+ {
+ cmStateSnapshot Snapshot;
+ static const Json::ArrayIndex NoParentIndex =
+ static_cast<Json::ArrayIndex>(-1);
+ Json::ArrayIndex ParentIndex = NoParentIndex;
+ Json::Value ChildIndexes = Json::arrayValue;
+ Json::Value DirectoryIndexes = Json::arrayValue;
+ Json::Value TargetIndexes = Json::arrayValue;
+ };
+ std::map<cmStateSnapshot, Json::ArrayIndex, cmStateSnapshot::StrictWeakOrder>
+ ProjectMap;
+ std::vector<Project> Projects;
+
+ void ProcessDirectories();
+
+ Json::ArrayIndex GetDirectoryIndex(cmLocalGenerator const* lg);
+ Json::ArrayIndex GetDirectoryIndex(cmStateSnapshot s);
+
+ Json::ArrayIndex AddProject(cmStateSnapshot s);
+
+ Json::Value DumpTargets();
+ Json::Value DumpTarget(cmGeneratorTarget* gt, Json::ArrayIndex ti);
+
+ Json::Value DumpDirectories();
+ Json::Value DumpDirectory(Directory& d);
+
+ Json::Value DumpProjects();
+ Json::Value DumpProject(Project& p);
+
+ Json::Value DumpMinimumCMakeVersion(cmStateSnapshot s);
+
+public:
+ CodemodelConfig(cmFileAPI& fileAPI, unsigned long version,
+ std::string const& config);
+ Json::Value Dump();
+};
+
+std::string RelativeIfUnder(std::string const& top, std::string const& in)
+{
+ std::string out;
+ if (in == top) {
+ out = ".";
+ } else if (cmSystemTools::IsSubDirectory(in, top)) {
+ out = in.substr(top.size() + 1);
+ } else {
+ out = in;
+ }
+ return out;
+}
+
+std::string TargetId(cmGeneratorTarget const* gt, std::string const& topBuild)
+{
+ cmCryptoHash hasher(cmCryptoHash::AlgoSHA3_256);
+ std::string path = RelativeIfUnder(
+ topBuild, gt->GetLocalGenerator()->GetCurrentBinaryDirectory());
+ std::string hash = hasher.HashString(path);
+ hash.resize(20, '0');
+ return gt->GetName() + CMAKE_DIRECTORY_ID_SEP + hash;
+}
+
+class BacktraceData
+{
+ std::string TopSource;
+ std::unordered_map<std::string, Json::ArrayIndex> CommandMap;
+ std::unordered_map<std::string, Json::ArrayIndex> FileMap;
+ std::unordered_map<cmListFileContext const*, Json::ArrayIndex> NodeMap;
+ Json::Value Commands = Json::arrayValue;
+ Json::Value Files = Json::arrayValue;
+ Json::Value Nodes = Json::arrayValue;
+
+ Json::ArrayIndex AddCommand(std::string const& command)
+ {
+ auto i = this->CommandMap.find(command);
+ if (i == this->CommandMap.end()) {
+ auto cmdIndex = static_cast<Json::ArrayIndex>(this->Commands.size());
+ i = this->CommandMap.emplace(command, cmdIndex).first;
+ this->Commands.append(command);
+ }
+ return i->second;
+ }
+
+ Json::ArrayIndex AddFile(std::string const& file)
+ {
+ auto i = this->FileMap.find(file);
+ if (i == this->FileMap.end()) {
+ auto fileIndex = static_cast<Json::ArrayIndex>(this->Files.size());
+ i = this->FileMap.emplace(file, fileIndex).first;
+ this->Files.append(RelativeIfUnder(this->TopSource, file));
+ }
+ return i->second;
+ }
+
+public:
+ BacktraceData(std::string topSource);
+ bool Add(cmListFileBacktrace const& bt, Json::ArrayIndex& index);
+ Json::Value Dump();
+};
+
+BacktraceData::BacktraceData(std::string topSource)
+ : TopSource(std::move(topSource))
+{
+}
+
+bool BacktraceData::Add(cmListFileBacktrace const& bt, Json::ArrayIndex& index)
+{
+ if (bt.Empty()) {
+ return false;
+ }
+ cmListFileContext const* top = &bt.Top();
+ auto found = this->NodeMap.find(top);
+ if (found != this->NodeMap.end()) {
+ index = found->second;
+ return true;
+ }
+ Json::Value entry = Json::objectValue;
+ entry["file"] = this->AddFile(top->FilePath);
+ if (top->Line) {
+ entry["line"] = static_cast<int>(top->Line);
+ }
+ if (!top->Name.empty()) {
+ entry["command"] = this->AddCommand(top->Name);
+ }
+ Json::ArrayIndex parent;
+ if (this->Add(bt.Pop(), parent)) {
+ entry["parent"] = parent;
+ }
+ index = this->NodeMap[top] = this->Nodes.size();
+ this->Nodes.append(std::move(entry)); // NOLINT(*)
+ return true;
+}
+
+Json::Value BacktraceData::Dump()
+{
+ Json::Value backtraceGraph;
+ this->CommandMap.clear();
+ this->FileMap.clear();
+ this->NodeMap.clear();
+ backtraceGraph["commands"] = std::move(this->Commands);
+ backtraceGraph["files"] = std::move(this->Files);
+ backtraceGraph["nodes"] = std::move(this->Nodes);
+ return backtraceGraph;
+}
+
+struct CompileData
+{
+ struct IncludeEntry
+ {
+ BT<std::string> Path;
+ bool IsSystem = false;
+ IncludeEntry(BT<std::string> path, bool isSystem)
+ : Path(std::move(path))
+ , IsSystem(isSystem)
+ {
+ }
+ };
+
+ void SetDefines(std::set<BT<std::string>> const& defines);
+
+ std::string Language;
+ std::string Sysroot;
+ std::vector<BT<std::string>> Flags;
+ std::vector<BT<std::string>> Defines;
+ std::vector<IncludeEntry> Includes;
+};
+
+void CompileData::SetDefines(std::set<BT<std::string>> const& defines)
+{
+ this->Defines.reserve(defines.size());
+ for (BT<std::string> const& d : defines) {
+ this->Defines.push_back(d);
+ }
+}
+
+class Target
+{
+ cmGeneratorTarget* GT;
+ std::string const& Config;
+ std::string TopSource;
+ std::string TopBuild;
+ std::vector<cmSourceGroup> SourceGroupsLocal;
+ BacktraceData Backtraces;
+
+ std::map<std::string, CompileData> CompileDataMap;
+
+ std::unordered_map<cmSourceFile const*, Json::ArrayIndex> SourceMap;
+ Json::Value Sources = Json::arrayValue;
+
+ struct SourceGroup
+ {
+ std::string Name;
+ Json::Value SourceIndexes = Json::arrayValue;
+ };
+ std::unordered_map<cmSourceGroup const*, Json::ArrayIndex> SourceGroupsMap;
+ std::vector<SourceGroup> SourceGroups;
+
+ struct CompileGroup
+ {
+ std::map<Json::Value, Json::ArrayIndex>::iterator Entry;
+ Json::Value SourceIndexes = Json::arrayValue;
+ };
+ std::map<Json::Value, Json::ArrayIndex> CompileGroupMap;
+ std::vector<CompileGroup> CompileGroups;
+
+ void ProcessLanguages();
+ void ProcessLanguage(std::string const& lang);
+
+ Json::ArrayIndex AddSourceGroup(cmSourceGroup* sg, Json::ArrayIndex si);
+ CompileData BuildCompileData(cmSourceFile* sf);
+ Json::ArrayIndex AddSourceCompileGroup(cmSourceFile* sf,
+ Json::ArrayIndex si);
+ void AddBacktrace(Json::Value& object, cmListFileBacktrace const& bt);
+ Json::Value DumpPaths();
+ Json::Value DumpCompileData(CompileData cd);
+ Json::Value DumpInclude(CompileData::IncludeEntry const& inc);
+ Json::Value DumpDefine(BT<std::string> const& def);
+ Json::Value DumpSources();
+ Json::Value DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
+ Json::ArrayIndex si);
+ Json::Value DumpSourceGroups();
+ Json::Value DumpSourceGroup(SourceGroup& sg);
+ Json::Value DumpCompileGroups();
+ Json::Value DumpCompileGroup(CompileGroup& cg);
+ Json::Value DumpSysroot(std::string const& path);
+ Json::Value DumpInstall();
+ Json::Value DumpInstallPrefix();
+ Json::Value DumpInstallDestinations();
+ Json::Value DumpInstallDestination(cmInstallTargetGenerator* itGen);
+ Json::Value DumpArtifacts();
+ Json::Value DumpLink();
+ Json::Value DumpArchive();
+ Json::Value DumpLinkCommandFragments();
+ Json::Value DumpCommandFragments(std::vector<BT<std::string>> const& frags);
+ Json::Value DumpCommandFragment(BT<std::string> const& frag,
+ std::string const& role = std::string());
+ Json::Value DumpDependencies();
+ Json::Value DumpDependency(cmTargetDepend const& td);
+ Json::Value DumpFolder();
+
+public:
+ Target(cmGeneratorTarget* gt, std::string const& config);
+ Json::Value Dump();
+};
+
+Codemodel::Codemodel(cmFileAPI& fileAPI, unsigned long version)
+ : FileAPI(fileAPI)
+ , Version(version)
+{
+}
+
+Json::Value Codemodel::Dump()
+{
+ Json::Value codemodel = Json::objectValue;
+
+ codemodel["paths"] = this->DumpPaths();
+ codemodel["configurations"] = this->DumpConfigurations();
+
+ return codemodel;
+}
+
+Json::Value Codemodel::DumpPaths()
+{
+ Json::Value paths = Json::objectValue;
+ paths["source"] = this->FileAPI.GetCMakeInstance()->GetHomeDirectory();
+ paths["build"] = this->FileAPI.GetCMakeInstance()->GetHomeOutputDirectory();
+ return paths;
+}
+
+Json::Value Codemodel::DumpConfigurations()
+{
+ std::vector<std::string> configs;
+ cmGlobalGenerator* gg =
+ this->FileAPI.GetCMakeInstance()->GetGlobalGenerator();
+ auto makefiles = gg->GetMakefiles();
+ if (!makefiles.empty()) {
+ makefiles[0]->GetConfigurations(configs);
+ if (configs.empty()) {
+ configs.emplace_back();
+ }
+ }
+ Json::Value configurations = Json::arrayValue;
+ for (std::string const& config : configs) {
+ configurations.append(this->DumpConfiguration(config));
+ }
+ return configurations;
+}
+
+Json::Value Codemodel::DumpConfiguration(std::string const& config)
+{
+ CodemodelConfig configuration(this->FileAPI, this->Version, config);
+ return configuration.Dump();
+}
+
+CodemodelConfig::CodemodelConfig(cmFileAPI& fileAPI, unsigned long version,
+ std::string const& config)
+ : FileAPI(fileAPI)
+ , Version(version)
+ , Config(config)
+ , TopSource(this->FileAPI.GetCMakeInstance()->GetHomeDirectory())
+ , TopBuild(this->FileAPI.GetCMakeInstance()->GetHomeOutputDirectory())
+{
+ static_cast<void>(this->Version);
+}
+
+Json::Value CodemodelConfig::Dump()
+{
+ Json::Value configuration = Json::objectValue;
+ configuration["name"] = this->Config;
+ this->ProcessDirectories();
+ configuration["targets"] = this->DumpTargets();
+ configuration["directories"] = this->DumpDirectories();
+ configuration["projects"] = this->DumpProjects();
+ return configuration;
+}
+
+void CodemodelConfig::ProcessDirectories()
+{
+ cmGlobalGenerator* gg =
+ this->FileAPI.GetCMakeInstance()->GetGlobalGenerator();
+ std::vector<cmLocalGenerator*> const& localGens = gg->GetLocalGenerators();
+
+ // Add directories in forward order to process parents before children.
+ this->Directories.reserve(localGens.size());
+ for (cmLocalGenerator* lg : localGens) {
+ auto directoryIndex =
+ static_cast<Json::ArrayIndex>(this->Directories.size());
+ this->Directories.emplace_back();
+ Directory& d = this->Directories[directoryIndex];
+ d.Snapshot = lg->GetStateSnapshot().GetBuildsystemDirectory();
+ d.LocalGenerator = lg;
+ this->DirectoryMap[d.Snapshot] = directoryIndex;
+
+ d.ProjectIndex = this->AddProject(d.Snapshot);
+ this->Projects[d.ProjectIndex].DirectoryIndexes.append(directoryIndex);
+ }
+
+ // Update directories in reverse order to process children before parents.
+ for (auto di = this->Directories.rbegin(); di != this->Directories.rend();
+ ++di) {
+ Directory& d = *di;
+
+ // Accumulate the presence of install rules on the way up.
+ for (auto gen : d.LocalGenerator->GetMakefile()->GetInstallGenerators()) {
+ if (!dynamic_cast<cmInstallSubdirectoryGenerator*>(gen)) {
+ d.HasInstallRule = true;
+ break;
+ }
+ }
+ if (!d.HasInstallRule) {
+ for (cmStateSnapshot const& child : d.Snapshot.GetChildren()) {
+ cmStateSnapshot childDir = child.GetBuildsystemDirectory();
+ Json::ArrayIndex const childIndex = this->GetDirectoryIndex(childDir);
+ if (this->Directories[childIndex].HasInstallRule) {
+ d.HasInstallRule = true;
+ break;
+ }
+ }
+ }
+ }
+}
+
+Json::ArrayIndex CodemodelConfig::GetDirectoryIndex(cmLocalGenerator const* lg)
+{
+ return this->GetDirectoryIndex(
+ lg->GetStateSnapshot().GetBuildsystemDirectory());
+}
+
+Json::ArrayIndex CodemodelConfig::GetDirectoryIndex(cmStateSnapshot s)
+{
+ auto i = this->DirectoryMap.find(s);
+ assert(i != this->DirectoryMap.end());
+ return i->second;
+}
+
+Json::ArrayIndex CodemodelConfig::AddProject(cmStateSnapshot s)
+{
+ cmStateSnapshot ps = s.GetBuildsystemDirectoryParent();
+ if (ps.IsValid() && ps.GetProjectName() == s.GetProjectName()) {
+ // This directory is part of its parent directory project.
+ Json::ArrayIndex const parentDirIndex = this->GetDirectoryIndex(ps);
+ return this->Directories[parentDirIndex].ProjectIndex;
+ }
+
+ // This directory starts a new project.
+ auto projectIndex = static_cast<Json::ArrayIndex>(this->Projects.size());
+ this->Projects.emplace_back();
+ Project& p = this->Projects[projectIndex];
+ p.Snapshot = s;
+ this->ProjectMap[s] = projectIndex;
+ if (ps.IsValid()) {
+ Json::ArrayIndex const parentDirIndex = this->GetDirectoryIndex(ps);
+ p.ParentIndex = this->Directories[parentDirIndex].ProjectIndex;
+ this->Projects[p.ParentIndex].ChildIndexes.append(projectIndex);
+ }
+ return projectIndex;
+}
+
+Json::Value CodemodelConfig::DumpTargets()
+{
+ Json::Value targets = Json::arrayValue;
+
+ std::vector<cmGeneratorTarget*> targetList;
+ cmGlobalGenerator* gg =
+ this->FileAPI.GetCMakeInstance()->GetGlobalGenerator();
+ for (cmLocalGenerator const* lg : gg->GetLocalGenerators()) {
+ std::vector<cmGeneratorTarget*> const& list = lg->GetGeneratorTargets();
+ targetList.insert(targetList.end(), list.begin(), list.end());
+ }
+ std::sort(targetList.begin(), targetList.end(),
+ [](cmGeneratorTarget* l, cmGeneratorTarget* r) {
+ return l->GetName() < r->GetName();
+ });
+
+ for (cmGeneratorTarget* gt : targetList) {
+ if (gt->GetType() == cmStateEnums::GLOBAL_TARGET ||
+ gt->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ continue;
+ }
+
+ targets.append(this->DumpTarget(gt, targets.size()));
+ }
+
+ return targets;
+}
+
+Json::Value CodemodelConfig::DumpTarget(cmGeneratorTarget* gt,
+ Json::ArrayIndex ti)
+{
+ Target t(gt, this->Config);
+ std::string prefix = "target-" + gt->GetName();
+ if (!this->Config.empty()) {
+ prefix += "-" + this->Config;
+ }
+ Json::Value target = this->FileAPI.MaybeJsonFile(t.Dump(), prefix);
+ target["name"] = gt->GetName();
+ target["id"] = TargetId(gt, this->TopBuild);
+
+ // Cross-reference directory containing target.
+ Json::ArrayIndex di = this->GetDirectoryIndex(gt->GetLocalGenerator());
+ target["directoryIndex"] = di;
+ this->Directories[di].TargetIndexes.append(ti);
+
+ // Cross-reference project containing target.
+ Json::ArrayIndex pi = this->Directories[di].ProjectIndex;
+ target["projectIndex"] = pi;
+ this->Projects[pi].TargetIndexes.append(ti);
+
+ return target;
+}
+
+Json::Value CodemodelConfig::DumpDirectories()
+{
+ Json::Value directories = Json::arrayValue;
+ for (Directory& d : this->Directories) {
+ directories.append(this->DumpDirectory(d));
+ }
+ return directories;
+}
+
+Json::Value CodemodelConfig::DumpDirectory(Directory& d)
+{
+ Json::Value directory = Json::objectValue;
+
+ std::string sourceDir = d.Snapshot.GetDirectory().GetCurrentSource();
+ directory["source"] = RelativeIfUnder(this->TopSource, sourceDir);
+
+ std::string buildDir = d.Snapshot.GetDirectory().GetCurrentBinary();
+ directory["build"] = RelativeIfUnder(this->TopBuild, buildDir);
+
+ cmStateSnapshot parentDir = d.Snapshot.GetBuildsystemDirectoryParent();
+ if (parentDir.IsValid()) {
+ directory["parentIndex"] = this->GetDirectoryIndex(parentDir);
+ }
+
+ Json::Value childIndexes = Json::arrayValue;
+ for (cmStateSnapshot const& child : d.Snapshot.GetChildren()) {
+ childIndexes.append(
+ this->GetDirectoryIndex(child.GetBuildsystemDirectory()));
+ }
+ if (!childIndexes.empty()) {
+ directory["childIndexes"] = std::move(childIndexes);
+ }
+
+ directory["projectIndex"] = d.ProjectIndex;
+
+ if (!d.TargetIndexes.empty()) {
+ directory["targetIndexes"] = std::move(d.TargetIndexes);
+ }
+
+ Json::Value minimumCMakeVersion = this->DumpMinimumCMakeVersion(d.Snapshot);
+ if (!minimumCMakeVersion.isNull()) {
+ directory["minimumCMakeVersion"] = std::move(minimumCMakeVersion);
+ }
+
+ if (d.HasInstallRule) {
+ directory["hasInstallRule"] = true;
+ }
+
+ return directory;
+}
+
+Json::Value CodemodelConfig::DumpProjects()
+{
+ Json::Value projects = Json::arrayValue;
+ for (Project& p : this->Projects) {
+ projects.append(this->DumpProject(p));
+ }
+ return projects;
+}
+
+Json::Value CodemodelConfig::DumpProject(Project& p)
+{
+ Json::Value project = Json::objectValue;
+
+ project["name"] = p.Snapshot.GetProjectName();
+
+ if (p.ParentIndex != Project::NoParentIndex) {
+ project["parentIndex"] = p.ParentIndex;
+ }
+
+ if (!p.ChildIndexes.empty()) {
+ project["childIndexes"] = std::move(p.ChildIndexes);
+ }
+
+ project["directoryIndexes"] = std::move(p.DirectoryIndexes);
+
+ if (!p.TargetIndexes.empty()) {
+ project["targetIndexes"] = std::move(p.TargetIndexes);
+ }
+
+ return project;
+}
+
+Json::Value CodemodelConfig::DumpMinimumCMakeVersion(cmStateSnapshot s)
+{
+ Json::Value minimumCMakeVersion;
+ if (std::string const* def =
+ s.GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION")) {
+ minimumCMakeVersion = Json::objectValue;
+ minimumCMakeVersion["string"] = *def;
+ }
+ return minimumCMakeVersion;
+}
+
+Target::Target(cmGeneratorTarget* gt, std::string const& config)
+ : GT(gt)
+ , Config(config)
+ , TopSource(gt->GetGlobalGenerator()->GetCMakeInstance()->GetHomeDirectory())
+ , TopBuild(
+ gt->GetGlobalGenerator()->GetCMakeInstance()->GetHomeOutputDirectory())
+ , SourceGroupsLocal(this->GT->Makefile->GetSourceGroups())
+ , Backtraces(this->TopSource)
+{
+}
+
+Json::Value Target::Dump()
+{
+ Json::Value target = Json::objectValue;
+
+ cmStateEnums::TargetType const type = this->GT->GetType();
+
+ target["name"] = this->GT->GetName();
+ target["type"] = cmState::GetTargetTypeName(type);
+ target["id"] = TargetId(this->GT, this->TopBuild);
+ target["paths"] = this->DumpPaths();
+ if (this->GT->Target->GetIsGeneratorProvided()) {
+ target["isGeneratorProvided"] = true;
+ }
+
+ this->AddBacktrace(target, this->GT->GetBacktrace());
+
+ if (this->GT->Target->GetHaveInstallRule()) {
+ target["install"] = this->DumpInstall();
+ }
+
+ if (this->GT->HaveWellDefinedOutputFiles()) {
+ Json::Value artifacts = this->DumpArtifacts();
+ if (!artifacts.empty()) {
+ target["artifacts"] = std::move(artifacts);
+ }
+ }
+
+ if (type == cmStateEnums::EXECUTABLE ||
+ type == cmStateEnums::SHARED_LIBRARY ||
+ type == cmStateEnums::MODULE_LIBRARY) {
+ target["nameOnDisk"] = this->GT->GetFullName(this->Config);
+ target["link"] = this->DumpLink();
+ } else if (type == cmStateEnums::STATIC_LIBRARY) {
+ target["nameOnDisk"] = this->GT->GetFullName(this->Config);
+ target["archive"] = this->DumpArchive();
+ }
+
+ Json::Value dependencies = this->DumpDependencies();
+ if (!dependencies.empty()) {
+ target["dependencies"] = dependencies;
+ }
+
+ {
+ this->ProcessLanguages();
+
+ target["sources"] = this->DumpSources();
+
+ Json::Value folder = this->DumpFolder();
+ if (!folder.isNull()) {
+ target["folder"] = std::move(folder);
+ }
+
+ Json::Value sourceGroups = this->DumpSourceGroups();
+ if (!sourceGroups.empty()) {
+ target["sourceGroups"] = std::move(sourceGroups);
+ }
+
+ Json::Value compileGroups = this->DumpCompileGroups();
+ if (!compileGroups.empty()) {
+ target["compileGroups"] = std::move(compileGroups);
+ }
+ }
+
+ target["backtraceGraph"] = this->Backtraces.Dump();
+
+ return target;
+}
+
+void Target::ProcessLanguages()
+{
+ std::set<std::string> languages;
+ this->GT->GetLanguages(languages, this->Config);
+ for (std::string const& lang : languages) {
+ this->ProcessLanguage(lang);
+ }
+}
+
+void Target::ProcessLanguage(std::string const& lang)
+{
+ CompileData& cd = this->CompileDataMap[lang];
+ cd.Language = lang;
+ if (const char* sysrootCompile =
+ this->GT->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
+ cd.Sysroot = sysrootCompile;
+ } else if (const char* sysroot =
+ this->GT->Makefile->GetDefinition("CMAKE_SYSROOT")) {
+ cd.Sysroot = sysroot;
+ }
+ cmLocalGenerator* lg = this->GT->GetLocalGenerator();
+ {
+ // FIXME: Add flags from end section of ExpandRuleVariable,
+ // which may need to be factored out.
+ std::string flags;
+ lg->GetTargetCompileFlags(this->GT, this->Config, lang, flags);
+ cd.Flags.emplace_back(std::move(flags), cmListFileBacktrace());
+ }
+ std::set<BT<std::string>> defines =
+ lg->GetTargetDefines(this->GT, this->Config, lang);
+ cd.SetDefines(defines);
+ std::vector<BT<std::string>> includePathList =
+ lg->GetIncludeDirectories(this->GT, lang, this->Config);
+ for (BT<std::string> const& i : includePathList) {
+ cd.Includes.emplace_back(
+ i, this->GT->IsSystemIncludeDirectory(i.Value, this->Config, lang));
+ }
+}
+
+Json::ArrayIndex Target::AddSourceGroup(cmSourceGroup* sg, Json::ArrayIndex si)
+{
+ std::unordered_map<cmSourceGroup const*, Json::ArrayIndex>::iterator i =
+ this->SourceGroupsMap.find(sg);
+ if (i == this->SourceGroupsMap.end()) {
+ auto sgIndex = static_cast<Json::ArrayIndex>(this->SourceGroups.size());
+ i = this->SourceGroupsMap.emplace(sg, sgIndex).first;
+ SourceGroup g;
+ g.Name = sg->GetFullName();
+ this->SourceGroups.push_back(std::move(g));
+ }
+ this->SourceGroups[i->second].SourceIndexes.append(si);
+ return i->second;
+}
+
+CompileData Target::BuildCompileData(cmSourceFile* sf)
+{
+ CompileData fd;
+
+ fd.Language = sf->GetLanguage();
+ if (fd.Language.empty()) {
+ return fd;
+ }
+ CompileData const& cd = this->CompileDataMap.at(fd.Language);
+
+ fd.Sysroot = cd.Sysroot;
+
+ cmLocalGenerator* lg = this->GT->GetLocalGenerator();
+ cmGeneratorExpressionInterpreter genexInterpreter(lg, this->Config, this->GT,
+ fd.Language);
+
+ fd.Flags = cd.Flags;
+ const std::string COMPILE_FLAGS("COMPILE_FLAGS");
+ if (const char* cflags = sf->GetProperty(COMPILE_FLAGS)) {
+ std::string flags = genexInterpreter.Evaluate(cflags, COMPILE_FLAGS);
+ fd.Flags.emplace_back(std::move(flags), cmListFileBacktrace());
+ }
+ const std::string COMPILE_OPTIONS("COMPILE_OPTIONS");
+ if (const char* coptions = sf->GetProperty(COMPILE_OPTIONS)) {
+ std::string flags;
+ lg->AppendCompileOptions(
+ flags, genexInterpreter.Evaluate(coptions, COMPILE_OPTIONS));
+ fd.Flags.emplace_back(std::move(flags), cmListFileBacktrace());
+ }
+
+ // Add include directories from source file properties.
+ {
+ std::vector<std::string> includes;
+ const std::string INCLUDE_DIRECTORIES("INCLUDE_DIRECTORIES");
+ if (const char* cincludes = sf->GetProperty(INCLUDE_DIRECTORIES)) {
+ const std::string& evaluatedIncludes =
+ genexInterpreter.Evaluate(cincludes, INCLUDE_DIRECTORIES);
+ lg->AppendIncludeDirectories(includes, evaluatedIncludes, *sf);
+
+ for (std::string const& include : includes) {
+ bool const isSystemInclude = this->GT->IsSystemIncludeDirectory(
+ include, this->Config, fd.Language);
+ fd.Includes.emplace_back(include, isSystemInclude);
+ }
+ }
+ }
+ fd.Includes.insert(fd.Includes.end(), cd.Includes.begin(),
+ cd.Includes.end());
+
+ const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS");
+ std::set<std::string> fileDefines;
+ if (const char* defs = sf->GetProperty(COMPILE_DEFINITIONS)) {
+ lg->AppendDefines(fileDefines,
+ genexInterpreter.Evaluate(defs, COMPILE_DEFINITIONS));
+ }
+
+ const std::string defPropName =
+ "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(this->Config);
+ if (const char* config_defs = sf->GetProperty(defPropName)) {
+ lg->AppendDefines(
+ fileDefines,
+ genexInterpreter.Evaluate(config_defs, COMPILE_DEFINITIONS));
+ }
+
+ std::set<BT<std::string>> defines;
+ defines.insert(fileDefines.begin(), fileDefines.end());
+ defines.insert(cd.Defines.begin(), cd.Defines.end());
+
+ fd.SetDefines(defines);
+
+ return fd;
+}
+
+Json::ArrayIndex Target::AddSourceCompileGroup(cmSourceFile* sf,
+ Json::ArrayIndex si)
+{
+ Json::Value compileDataJson =
+ this->DumpCompileData(this->BuildCompileData(sf));
+ std::map<Json::Value, Json::ArrayIndex>::iterator i =
+ this->CompileGroupMap.find(compileDataJson);
+ if (i == this->CompileGroupMap.end()) {
+ Json::ArrayIndex cgIndex =
+ static_cast<Json::ArrayIndex>(this->CompileGroups.size());
+ i =
+ this->CompileGroupMap.emplace(std::move(compileDataJson), cgIndex).first;
+ CompileGroup g;
+ g.Entry = i;
+ this->CompileGroups.push_back(std::move(g));
+ }
+ this->CompileGroups[i->second].SourceIndexes.append(si);
+ return i->second;
+}
+
+void Target::AddBacktrace(Json::Value& object, cmListFileBacktrace const& bt)
+{
+ Json::ArrayIndex backtrace;
+ if (this->Backtraces.Add(bt, backtrace)) {
+ object["backtrace"] = backtrace;
+ }
+}
+
+Json::Value Target::DumpPaths()
+{
+ Json::Value paths = Json::objectValue;
+ cmLocalGenerator* lg = this->GT->GetLocalGenerator();
+
+ std::string const& sourceDir = lg->GetCurrentSourceDirectory();
+ paths["source"] = RelativeIfUnder(this->TopSource, sourceDir);
+
+ std::string const& buildDir = lg->GetCurrentBinaryDirectory();
+ paths["build"] = RelativeIfUnder(this->TopBuild, buildDir);
+
+ return paths;
+}
+
+Json::Value Target::DumpSources()
+{
+ Json::Value sources = Json::arrayValue;
+ cmGeneratorTarget::KindedSources const& kinded =
+ this->GT->GetKindedSources(this->Config);
+ for (cmGeneratorTarget::SourceAndKind const& sk : kinded.Sources) {
+ sources.append(this->DumpSource(sk, sources.size()));
+ }
+ return sources;
+}
+
+Json::Value Target::DumpSource(cmGeneratorTarget::SourceAndKind const& sk,
+ Json::ArrayIndex si)
+{
+ Json::Value source = Json::objectValue;
+
+ std::string const path = sk.Source.Value->GetFullPath();
+ source["path"] = RelativeIfUnder(this->TopSource, path);
+ if (sk.Source.Value->GetIsGenerated()) {
+ source["isGenerated"] = true;
+ }
+ this->AddBacktrace(source, sk.Source.Backtrace);
+
+ if (cmSourceGroup* sg =
+ this->GT->Makefile->FindSourceGroup(path, this->SourceGroupsLocal)) {
+ source["sourceGroupIndex"] = this->AddSourceGroup(sg, si);
+ }
+
+ switch (sk.Kind) {
+ case cmGeneratorTarget::SourceKindObjectSource: {
+ source["compileGroupIndex"] =
+ this->AddSourceCompileGroup(sk.Source.Value, si);
+ } break;
+ case cmGeneratorTarget::SourceKindAppManifest:
+ case cmGeneratorTarget::SourceKindCertificate:
+ case cmGeneratorTarget::SourceKindCustomCommand:
+ case cmGeneratorTarget::SourceKindExternalObject:
+ case cmGeneratorTarget::SourceKindExtra:
+ case cmGeneratorTarget::SourceKindHeader:
+ case cmGeneratorTarget::SourceKindIDL:
+ case cmGeneratorTarget::SourceKindManifest:
+ case cmGeneratorTarget::SourceKindModuleDefinition:
+ case cmGeneratorTarget::SourceKindResx:
+ case cmGeneratorTarget::SourceKindXaml:
+ break;
+ }
+
+ return source;
+}
+
+Json::Value Target::DumpCompileData(CompileData cd)
+{
+ Json::Value result = Json::objectValue;
+
+ if (!cd.Language.empty()) {
+ result["language"] = cd.Language;
+ }
+ if (!cd.Sysroot.empty()) {
+ result["sysroot"] = this->DumpSysroot(cd.Sysroot);
+ }
+ if (!cd.Flags.empty()) {
+ result["compileCommandFragments"] = this->DumpCommandFragments(cd.Flags);
+ }
+ if (!cd.Includes.empty()) {
+ Json::Value includes = Json::arrayValue;
+ for (auto const& i : cd.Includes) {
+ includes.append(this->DumpInclude(i));
+ }
+ result["includes"] = includes;
+ }
+ if (!cd.Defines.empty()) {
+ Json::Value defines = Json::arrayValue;
+ for (BT<std::string> const& d : cd.Defines) {
+ defines.append(this->DumpDefine(d));
+ }
+ result["defines"] = std::move(defines);
+ }
+
+ return result;
+}
+
+Json::Value Target::DumpInclude(CompileData::IncludeEntry const& inc)
+{
+ Json::Value include = Json::objectValue;
+ include["path"] = inc.Path.Value;
+ if (inc.IsSystem) {
+ include["isSystem"] = true;
+ }
+ this->AddBacktrace(include, inc.Path.Backtrace);
+ return include;
+}
+
+Json::Value Target::DumpDefine(BT<std::string> const& def)
+{
+ Json::Value define = Json::objectValue;
+ define["define"] = def.Value;
+ this->AddBacktrace(define, def.Backtrace);
+ return define;
+}
+
+Json::Value Target::DumpSourceGroups()
+{
+ Json::Value sourceGroups = Json::arrayValue;
+ for (auto& sg : this->SourceGroups) {
+ sourceGroups.append(this->DumpSourceGroup(sg));
+ }
+ return sourceGroups;
+}
+
+Json::Value Target::DumpSourceGroup(SourceGroup& sg)
+{
+ Json::Value group = Json::objectValue;
+ group["name"] = sg.Name;
+ group["sourceIndexes"] = std::move(sg.SourceIndexes);
+ return group;
+}
+
+Json::Value Target::DumpCompileGroups()
+{
+ Json::Value compileGroups = Json::arrayValue;
+ for (auto& cg : this->CompileGroups) {
+ compileGroups.append(this->DumpCompileGroup(cg));
+ }
+ return compileGroups;
+}
+
+Json::Value Target::DumpCompileGroup(CompileGroup& cg)
+{
+ Json::Value group = cg.Entry->first;
+ group["sourceIndexes"] = std::move(cg.SourceIndexes);
+ return group;
+}
+
+Json::Value Target::DumpSysroot(std::string const& path)
+{
+ Json::Value sysroot = Json::objectValue;
+ sysroot["path"] = path;
+ return sysroot;
+}
+
+Json::Value Target::DumpInstall()
+{
+ Json::Value install = Json::objectValue;
+ install["prefix"] = this->DumpInstallPrefix();
+ install["destinations"] = this->DumpInstallDestinations();
+ return install;
+}
+
+Json::Value Target::DumpInstallPrefix()
+{
+ Json::Value prefix = Json::objectValue;
+ std::string p =
+ this->GT->Makefile->GetSafeDefinition("CMAKE_INSTALL_PREFIX");
+ cmSystemTools::ConvertToUnixSlashes(p);
+ prefix["path"] = p;
+ return prefix;
+}
+
+Json::Value Target::DumpInstallDestinations()
+{
+ Json::Value destinations = Json::arrayValue;
+ auto installGens = this->GT->Makefile->GetInstallGenerators();
+ for (auto iGen : installGens) {
+ auto itGen = dynamic_cast<cmInstallTargetGenerator*>(iGen);
+ if (itGen != nullptr && itGen->GetTarget() == this->GT) {
+ destinations.append(this->DumpInstallDestination(itGen));
+ }
+ }
+ return destinations;
+}
+
+Json::Value Target::DumpInstallDestination(cmInstallTargetGenerator* itGen)
+{
+ Json::Value destination = Json::objectValue;
+ destination["path"] = itGen->GetDestination(this->Config);
+ this->AddBacktrace(destination, itGen->GetBacktrace());
+ return destination;
+}
+
+Json::Value Target::DumpArtifacts()
+{
+ Json::Value artifacts = Json::arrayValue;
+
+ // Object libraries have only object files as artifacts.
+ if (this->GT->GetType() == cmStateEnums::OBJECT_LIBRARY) {
+ if (!this->GT->GetGlobalGenerator()->HasKnownObjectFileLocation(nullptr)) {
+ return artifacts;
+ }
+ std::vector<cmSourceFile const*> objectSources;
+ this->GT->GetObjectSources(objectSources, this->Config);
+ std::string const obj_dir = this->GT->GetObjectDirectory(this->Config);
+ for (cmSourceFile const* sf : objectSources) {
+ const std::string& obj = this->GT->GetObjectName(sf);
+ Json::Value artifact = Json::objectValue;
+ artifact["path"] = RelativeIfUnder(this->TopBuild, obj_dir + obj);
+ artifacts.append(std::move(artifact)); // NOLINT(*)
+ }
+ return artifacts;
+ }
+
+ // Other target types always have a "main" artifact.
+ {
+ Json::Value artifact = Json::objectValue;
+ artifact["path"] =
+ RelativeIfUnder(this->TopBuild,
+ this->GT->GetFullPath(
+ this->Config, cmStateEnums::RuntimeBinaryArtifact));
+ artifacts.append(std::move(artifact)); // NOLINT(*)
+ }
+
+ // Add Windows-specific artifacts produced by the linker.
+ if (this->GT->IsDLLPlatform() &&
+ this->GT->GetType() != cmStateEnums::STATIC_LIBRARY) {
+ if (this->GT->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ this->GT->IsExecutableWithExports()) {
+ Json::Value artifact = Json::objectValue;
+ artifact["path"] =
+ RelativeIfUnder(this->TopBuild,
+ this->GT->GetFullPath(
+ this->Config, cmStateEnums::ImportLibraryArtifact));
+ artifacts.append(std::move(artifact)); // NOLINT(*)
+ }
+ cmGeneratorTarget::OutputInfo const* output =
+ this->GT->GetOutputInfo(this->Config);
+ if (output && !output->PdbDir.empty()) {
+ Json::Value artifact = Json::objectValue;
+ artifact["path"] = RelativeIfUnder(this->TopBuild,
+ output->PdbDir + '/' +
+ this->GT->GetPDBName(this->Config));
+ artifacts.append(std::move(artifact)); // NOLINT(*)
+ }
+ }
+ return artifacts;
+}
+
+Json::Value Target::DumpLink()
+{
+ Json::Value link = Json::objectValue;
+ std::string lang = this->GT->GetLinkerLanguage(this->Config);
+ link["language"] = lang;
+ {
+ Json::Value commandFragments = this->DumpLinkCommandFragments();
+ if (!commandFragments.empty()) {
+ link["commandFragments"] = std::move(commandFragments);
+ }
+ }
+ if (const char* sysrootLink =
+ this->GT->Makefile->GetDefinition("CMAKE_SYSROOT_LINK")) {
+ link["sysroot"] = this->DumpSysroot(sysrootLink);
+ } else if (const char* sysroot =
+ this->GT->Makefile->GetDefinition("CMAKE_SYSROOT")) {
+ link["sysroot"] = this->DumpSysroot(sysroot);
+ }
+ if (this->GT->IsIPOEnabled(lang, this->Config)) {
+ link["lto"] = true;
+ }
+ return link;
+}
+
+Json::Value Target::DumpArchive()
+{
+ Json::Value archive = Json::objectValue;
+ {
+ // The "link" fragments not relevant to static libraries are empty.
+ Json::Value commandFragments = this->DumpLinkCommandFragments();
+ if (!commandFragments.empty()) {
+ archive["commandFragments"] = std::move(commandFragments);
+ }
+ }
+ std::string lang = this->GT->GetLinkerLanguage(this->Config);
+ if (this->GT->IsIPOEnabled(lang, this->Config)) {
+ archive["lto"] = true;
+ }
+ return archive;
+}
+
+Json::Value Target::DumpLinkCommandFragments()
+{
+ Json::Value linkFragments = Json::arrayValue;
+
+ std::string linkLanguageFlags;
+ std::string linkFlags;
+ std::string frameworkPath;
+ std::string linkPath;
+ std::string linkLibs;
+ cmLocalGenerator* lg = this->GT->GetLocalGenerator();
+ cmLinkLineComputer linkLineComputer(lg,
+ lg->GetStateSnapshot().GetDirectory());
+ lg->GetTargetFlags(&linkLineComputer, this->Config, linkLibs,
+ linkLanguageFlags, linkFlags, frameworkPath, linkPath,
+ this->GT);
+ linkLanguageFlags = cmSystemTools::TrimWhitespace(linkLanguageFlags);
+ linkFlags = cmSystemTools::TrimWhitespace(linkFlags);
+ frameworkPath = cmSystemTools::TrimWhitespace(frameworkPath);
+ linkPath = cmSystemTools::TrimWhitespace(linkPath);
+ linkLibs = cmSystemTools::TrimWhitespace(linkLibs);
+
+ if (!linkLanguageFlags.empty()) {
+ linkFragments.append(
+ this->DumpCommandFragment(std::move(linkLanguageFlags), "flags"));
+ }
+
+ if (!linkFlags.empty()) {
+ linkFragments.append(
+ this->DumpCommandFragment(std::move(linkFlags), "flags"));
+ }
+
+ if (!frameworkPath.empty()) {
+ linkFragments.append(
+ this->DumpCommandFragment(std::move(frameworkPath), "frameworkPath"));
+ }
+
+ if (!linkPath.empty()) {
+ linkFragments.append(
+ this->DumpCommandFragment(std::move(linkPath), "libraryPath"));
+ }
+
+ if (!linkLibs.empty()) {
+ linkFragments.append(
+ this->DumpCommandFragment(std::move(linkLibs), "libraries"));
+ }
+
+ return linkFragments;
+}
+
+Json::Value Target::DumpCommandFragments(
+ std::vector<BT<std::string>> const& frags)
+{
+ Json::Value commandFragments = Json::arrayValue;
+ for (BT<std::string> const& f : frags) {
+ commandFragments.append(this->DumpCommandFragment(f));
+ }
+ return commandFragments;
+}
+
+Json::Value Target::DumpCommandFragment(BT<std::string> const& frag,
+ std::string const& role)
+{
+ Json::Value fragment = Json::objectValue;
+ fragment["fragment"] = frag.Value;
+ if (!role.empty()) {
+ fragment["role"] = role;
+ }
+ this->AddBacktrace(fragment, frag.Backtrace);
+ return fragment;
+}
+
+Json::Value Target::DumpDependencies()
+{
+ Json::Value dependencies = Json::arrayValue;
+ cmGlobalGenerator* gg = this->GT->GetGlobalGenerator();
+ for (cmTargetDepend const& td : gg->GetTargetDirectDepends(this->GT)) {
+ dependencies.append(this->DumpDependency(td));
+ }
+ return dependencies;
+}
+
+Json::Value Target::DumpDependency(cmTargetDepend const& td)
+{
+ Json::Value dependency = Json::objectValue;
+ dependency["id"] = TargetId(td, this->TopBuild);
+ this->AddBacktrace(dependency, td.GetBacktrace());
+ return dependency;
+}
+
+Json::Value Target::DumpFolder()
+{
+ Json::Value folder;
+ if (const char* f = this->GT->GetProperty("FOLDER")) {
+ folder = Json::objectValue;
+ folder["name"] = f;
+ }
+ return folder;
+}
+}
+
+Json::Value cmFileAPICodemodelDump(cmFileAPI& fileAPI, unsigned long version)
+{
+ Codemodel codemodel(fileAPI, version);
+ return codemodel.Dump();
+}
diff --git a/Source/cmFileAPICodemodel.h b/Source/cmFileAPICodemodel.h
new file mode 100644
index 000000000..ffbd92863
--- /dev/null
+++ b/Source/cmFileAPICodemodel.h
@@ -0,0 +1,15 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmFileAPICodemodel_h
+#define cmFileAPICodemodel_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cm_jsoncpp_value.h"
+
+class cmFileAPI;
+
+extern Json::Value cmFileAPICodemodelDump(cmFileAPI& fileAPI,
+ unsigned long version);
+
+#endif
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5d34b7114..0f911c170 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -10,12 +10,14 @@
#include <algorithm>
#include <assert.h>
+#include <cmath>
#include <ctype.h>
#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <utility>
#include <vector>
#include "cmAlgorithms.h"
@@ -30,6 +32,7 @@
#include "cmInstallType.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSystemTools.h"
#include "cmTimestamp.h"
@@ -176,6 +179,15 @@ bool cmFileCommand::InitialPass(std::vector<std::string> const& args,
if (subCommand == "LOCK") {
return this->HandleLockCommand(args);
}
+ if (subCommand == "SIZE") {
+ return this->HandleSizeCommand(args);
+ }
+ if (subCommand == "READ_SYMLINK") {
+ return this->HandleReadSymlinkCommand(args);
+ }
+ if (subCommand == "CREATE_LINK") {
+ return this->HandleCreateLinkCommand(args);
+ }
std::string e = "does not recognize sub-command " + subCommand;
this->SetError(e);
@@ -213,7 +225,7 @@ bool cmFileCommand::HandleWriteCommand(std::vector<std::string> const& args,
// Set permissions to writable
if (cmSystemTools::GetPermissions(fileName.c_str(), mode)) {
#if defined(_MSC_VER) || defined(__MINGW32__)
- writable = mode & S_IWRITE;
+ writable = (mode & S_IWRITE) != 0;
mode_t newMode = mode | S_IWRITE;
#else
writable = mode & S_IWUSR;
@@ -549,7 +561,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
if (hex_conversion_enabled) {
// TODO: should work without temp file, but just on a memory buffer
std::string binaryFileName = this->Makefile->GetCurrentBinaryDirectory();
- binaryFileName += cmake::GetCMakeFilesDirectory();
+ binaryFileName += "/CMakeFiles";
binaryFileName += "/FileCommandStringsBinaryFile";
if (cmHexFileConverter::TryConvert(fileName.c_str(),
binaryFileName.c_str())) {
@@ -826,13 +838,13 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
// Generated build system depends on glob results
if (!configureDepends && warnConfigureLate) {
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
"CONFIGURE_DEPENDS flag was given after a glob expression was "
"already evaluated.");
}
if (workingMode != cmake::NORMAL_MODE) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"CONFIGURE_DEPENDS is invalid for script and find package modes.");
return false;
}
@@ -863,12 +875,12 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
for (cmsys::Glob::Message const& globMessage : globMessages) {
if (globMessage.type == cmsys::Glob::cyclicRecursion) {
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
"Cyclic recursion detected while globbing for '" + *i + "':\n" +
globMessage.content);
} else {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"Error has occurred while globbing for '" + *i + "' - " +
globMessage.content);
shouldExit = true;
@@ -917,7 +929,7 @@ bool cmFileCommand::HandleGlobCommand(std::vector<std::string> const& args,
// symlinks without being explicitly asked to: warn the author.
if (warnFollowedSymlinks) {
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0009));
}
break;
@@ -1067,7 +1079,7 @@ struct cmFileCopier
, Doing(DoingNone)
{
}
- virtual ~cmFileCopier() {}
+ virtual ~cmFileCopier() = default;
bool Run(std::vector<std::string> const& args);
@@ -1088,13 +1100,8 @@ protected:
// Properties set by pattern and regex match rules.
struct MatchProperties
{
- bool Exclude;
- mode_t Permissions;
- MatchProperties()
- : Exclude(false)
- , Permissions(0)
- {
- }
+ bool Exclude = false;
+ mode_t Permissions = 0;
};
struct MatchRule
{
@@ -2453,7 +2460,7 @@ bool cmFileCommand::HandleRename(std::vector<std::string> const& args)
newname += "/" + args[2];
}
- if (!cmSystemTools::RenameFile(oldname.c_str(), newname.c_str())) {
+ if (!cmSystemTools::RenameFile(oldname, newname)) {
std::string err = cmSystemTools::GetLastSystemError();
std::ostringstream e;
/* clang-format off */
@@ -2525,7 +2532,7 @@ bool cmFileCommand::HandleCMakePathCommand(
// remove double quotes in the path
std::string& s = *j;
- if (s.size() > 1 && s[0] == '\"' && s[s.size() - 1] == '\"') {
+ if (s.size() > 1 && s.front() == '\"' && s.back() == '\"') {
s = s.substr(1, s.size() - 2);
}
}
@@ -2602,10 +2609,10 @@ public:
bool UpdatePercentage(double value, double total, std::string& status)
{
- int OldPercentage = this->CurrentPercentage;
+ long OldPercentage = this->CurrentPercentage;
if (total > 0.0) {
- this->CurrentPercentage = static_cast<int>(value / total * 100.0 + 0.5);
+ this->CurrentPercentage = std::lround(value / total * 100.0);
if (this->CurrentPercentage > 100) {
// Avoid extra progress reports for unexpected data beyond total.
this->CurrentPercentage = 100;
@@ -2627,7 +2634,7 @@ public:
cmFileCommand* GetFileCommand() { return this->FileCommand; }
private:
- int CurrentPercentage;
+ long CurrentPercentage;
cmFileCommand* FileCommand;
std::string Text;
};
@@ -2695,12 +2702,14 @@ private:
#endif
#define check_curl_result(result, errstr) \
- if (result != CURLE_OK) { \
- std::string e(errstr); \
- e += ::curl_easy_strerror(result); \
- this->SetError(e); \
- return false; \
- }
+ do { \
+ if (result != CURLE_OK) { \
+ std::string e(errstr); \
+ e += ::curl_easy_strerror(result); \
+ this->SetError(e); \
+ return false; \
+ } \
+ } while (false)
bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
{
@@ -2824,7 +2833,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
std::string algo = i->substr(0, pos);
expectedHash = cmSystemTools::LowerCase(i->substr(pos + 1));
hash = std::unique_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
- if (!hash.get()) {
+ if (!hash) {
std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
err += algo;
this->SetError(err);
@@ -2849,7 +2858,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
// Do not return error for compatibility reason.
std::string err = "Unexpected argument: ";
err += *i;
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err);
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, err);
}
++i;
}
@@ -3161,7 +3170,7 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args)
// Do not return error for compatibility reason.
std::string err = "Unexpected argument: ";
err += *i;
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, err);
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, err);
}
++i;
@@ -3415,7 +3424,8 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
// Parse arguments
if (args.size() < 2) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR, "sub-command LOCK requires at least two arguments.");
+ MessageType::FATAL_ERROR,
+ "sub-command LOCK requires at least two arguments.");
return false;
}
@@ -3429,7 +3439,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
++i;
const char* merr = "expected FUNCTION, FILE or PROCESS after GUARD";
if (i >= args.size()) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, merr);
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, merr);
return false;
}
if (args[i] == "FUNCTION") {
@@ -3441,7 +3451,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
} else {
std::ostringstream e;
e << merr << ", but got:\n \"" << args[i] << "\".";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -3449,14 +3459,15 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
++i;
if (i >= args.size()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR, "expected variable name after RESULT_VARIABLE");
+ MessageType::FATAL_ERROR,
+ "expected variable name after RESULT_VARIABLE");
return false;
}
resultVariable = args[i];
} else if (args[i] == "TIMEOUT") {
++i;
if (i >= args.size()) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"expected timeout value after TIMEOUT");
return false;
}
@@ -3465,7 +3476,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
scanned < 0) {
std::ostringstream e;
e << "TIMEOUT value \"" << args[i] << "\" is not an unsigned integer.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
timeout = static_cast<unsigned long>(scanned);
@@ -3473,7 +3484,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
std::ostringstream e;
e << "expected DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE or TIMEOUT\n";
e << "but got: \"" << args[i] << "\".";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
}
@@ -3495,7 +3506,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
std::ostringstream e;
e << "directory\n \"" << parentDir << "\"\ncreation failed ";
e << "(check permissions).";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -3503,7 +3514,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
if (!file) {
std::ostringstream e;
e << "file\n \"" << path << "\"\ncreation failed (check permissions).";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -3538,7 +3549,7 @@ bool cmFileCommand::HandleLockCommand(std::vector<std::string> const& args)
if (resultVariable.empty() && !fileLockResult.IsOk()) {
std::ostringstream e;
e << "error locking file\n \"" << path << "\"\n" << result << ".";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -3597,3 +3608,174 @@ bool cmFileCommand::HandleTimestampCommand(
return true;
}
+
+bool cmFileCommand::HandleSizeCommand(std::vector<std::string> const& args)
+{
+ if (args.size() != 3) {
+ std::ostringstream e;
+ e << args[0] << " requires a file name and output variable";
+ this->SetError(e.str());
+ return false;
+ }
+
+ unsigned int argsIndex = 1;
+
+ const std::string& filename = args[argsIndex++];
+
+ const std::string& outputVariable = args[argsIndex++];
+
+ if (!cmSystemTools::FileExists(filename, true)) {
+ std::ostringstream e;
+ e << "SIZE requested of path that is not readable:\n " << filename;
+ this->SetError(e.str());
+ return false;
+ }
+
+ this->Makefile->AddDefinition(
+ outputVariable,
+ std::to_string(cmSystemTools::FileLength(filename)).c_str());
+
+ return true;
+}
+
+bool cmFileCommand::HandleReadSymlinkCommand(
+ std::vector<std::string> const& args)
+{
+ if (args.size() != 3) {
+ std::ostringstream e;
+ e << args[0] << " requires a file name and output variable";
+ this->SetError(e.str());
+ return false;
+ }
+
+ const std::string& filename = args[1];
+ const std::string& outputVariable = args[2];
+
+ std::string result;
+ if (!cmSystemTools::ReadSymlink(filename, result)) {
+ std::ostringstream e;
+ e << "READ_SYMLINK requested of path that is not a symlink:\n "
+ << filename;
+ this->SetError(e.str());
+ return false;
+ }
+
+ this->Makefile->AddDefinition(outputVariable, result.c_str());
+
+ return true;
+}
+
+bool cmFileCommand::HandleCreateLinkCommand(
+ std::vector<std::string> const& args)
+{
+ if (args.size() < 3) {
+ this->SetError("CREATE_LINK must be called with at least two additional "
+ "arguments");
+ return false;
+ }
+
+ cmCommandArgumentsHelper argHelper;
+ cmCommandArgumentGroup group;
+
+ cmCAString linkArg(&argHelper, "CREATE_LINK");
+ cmCAString fileArg(&argHelper, nullptr);
+ cmCAString newFileArg(&argHelper, nullptr);
+
+ cmCAString resultArg(&argHelper, "RESULT", &group);
+ cmCAEnabler copyOnErrorArg(&argHelper, "COPY_ON_ERROR", &group);
+ cmCAEnabler symbolicArg(&argHelper, "SYMBOLIC", &group);
+
+ linkArg.Follows(nullptr);
+ fileArg.Follows(&linkArg);
+ newFileArg.Follows(&fileArg);
+ group.Follows(&newFileArg);
+
+ std::vector<std::string> unconsumedArgs;
+ argHelper.Parse(&args, &unconsumedArgs);
+
+ if (!unconsumedArgs.empty()) {
+ this->SetError("unknown argument: \"" + unconsumedArgs.front() + '\"');
+ return false;
+ }
+
+ std::string fileName = fileArg.GetString();
+ std::string newFileName = newFileArg.GetString();
+
+ // Output variable for storing the result.
+ const std::string& resultVar = resultArg.GetString();
+
+ // The system error message generated in the operation.
+ std::string result;
+
+ // Check if the paths are distinct.
+ if (fileName == newFileName) {
+ result = "CREATE_LINK cannot use same file and newfile";
+ if (!resultVar.empty()) {
+ this->Makefile->AddDefinition(resultVar, result.c_str());
+ return true;
+ }
+ this->SetError(result);
+ return false;
+ }
+
+ // Hard link requires original file to exist.
+ if (!symbolicArg.IsEnabled() && !cmSystemTools::FileExists(fileName)) {
+ result = "Cannot hard link \'" + fileName + "\' as it does not exist.";
+ if (!resultVar.empty()) {
+ this->Makefile->AddDefinition(resultVar, result.c_str());
+ return true;
+ }
+ this->SetError(result);
+ return false;
+ }
+
+ // Check if the new file already exists and remove it.
+ if ((cmSystemTools::FileExists(newFileName) ||
+ cmSystemTools::FileIsSymlink(newFileName)) &&
+ !cmSystemTools::RemoveFile(newFileName)) {
+ std::ostringstream e;
+ e << "Failed to create link '" << newFileName
+ << "' because existing path cannot be removed: "
+ << cmSystemTools::GetLastSystemError() << "\n";
+
+ if (!resultVar.empty()) {
+ this->Makefile->AddDefinition(resultVar, e.str().c_str());
+ return true;
+ }
+ this->SetError(e.str());
+ return false;
+ }
+
+ // Whether the operation completed successfully.
+ bool completed = false;
+
+ // Check if the command requires a symbolic link.
+ if (symbolicArg.IsEnabled()) {
+ completed = cmSystemTools::CreateSymlink(fileName, newFileName, &result);
+ } else {
+ completed = cmSystemTools::CreateLink(fileName, newFileName, &result);
+ }
+
+ // Check if copy-on-error is enabled in the arguments.
+ if (!completed && copyOnErrorArg.IsEnabled()) {
+ completed = cmSystemTools::cmCopyFile(fileName, newFileName);
+ if (!completed) {
+ result = "Copy failed: " + cmSystemTools::GetLastSystemError();
+ }
+ }
+
+ // Check if the operation was successful.
+ if (completed) {
+ result = "0";
+ } else if (resultVar.empty()) {
+ // The operation failed and the result is not reported in a variable.
+ this->SetError(result);
+ return false;
+ }
+
+ if (!resultVar.empty()) {
+ this->Makefile->AddDefinition(resultVar, result.c_str());
+ }
+
+ return true;
+}
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index 719dca29e..12c511514 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -59,6 +59,9 @@ protected:
bool HandleTimestampCommand(std::vector<std::string> const& args);
bool HandleGenerateCommand(std::vector<std::string> const& args);
bool HandleLockCommand(std::vector<std::string> const& args);
+ bool HandleSizeCommand(std::vector<std::string> const& args);
+ bool HandleReadSymlinkCommand(std::vector<std::string> const& args);
+ bool HandleCreateLinkCommand(std::vector<std::string> const& args);
private:
void AddEvaluationFile(const std::string& inputName,
diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h
index 6c9a7b86f..2130d65db 100644
--- a/Source/cmFileLock.h
+++ b/Source/cmFileLock.h
@@ -21,12 +21,13 @@ class cmFileLockResult;
*/
class cmFileLock
{
- CM_DISABLE_COPY(cmFileLock)
-
public:
cmFileLock();
~cmFileLock();
+ cmFileLock(cmFileLock const&) = delete;
+ cmFileLock& operator=(cmFileLock const&) = delete;
+
/**
* @brief Lock the file.
* @param timeoutSec Lock timeout. If -1 try until success or fatal error.
@@ -51,14 +52,13 @@ private:
cmFileLockResult LockWithTimeout(unsigned long timeoutSec);
#if defined(_WIN32)
- typedef HANDLE FileId;
+ HANDLE File = INVALID_HANDLE_VALUE;
BOOL LockFile(DWORD flags);
#else
- typedef int FileId;
+ int File = -1;
int LockFile(int cmd, int type);
#endif
- FileId File;
std::string Filename;
};
diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx
index 5dc9243a1..d700a79c3 100644
--- a/Source/cmFileLockPool.cxx
+++ b/Source/cmFileLockPool.cxx
@@ -8,9 +8,7 @@
#include "cmFileLock.h"
#include "cmFileLockResult.h"
-cmFileLockPool::cmFileLockPool()
-{
-}
+cmFileLockPool::cmFileLockPool() = default;
cmFileLockPool::~cmFileLockPool()
{
@@ -111,9 +109,7 @@ bool cmFileLockPool::IsAlreadyLocked(const std::string& filename) const
return this->ProcessScope.IsAlreadyLocked(filename);
}
-cmFileLockPool::ScopePool::ScopePool()
-{
-}
+cmFileLockPool::ScopePool::ScopePool() = default;
cmFileLockPool::ScopePool::~ScopePool()
{
diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h
index 0197354c3..41203baac 100644
--- a/Source/cmFileLockPool.h
+++ b/Source/cmFileLockPool.h
@@ -13,12 +13,13 @@ class cmFileLockResult;
class cmFileLockPool
{
- CM_DISABLE_COPY(cmFileLockPool)
-
public:
cmFileLockPool();
~cmFileLockPool();
+ cmFileLockPool(cmFileLockPool const&) = delete;
+ cmFileLockPool& operator=(cmFileLockPool const&) = delete;
+
//@{
/**
* @brief Function scope control.
@@ -58,12 +59,13 @@ private:
class ScopePool
{
- CM_DISABLE_COPY(ScopePool)
-
public:
ScopePool();
~ScopePool();
+ ScopePool(ScopePool const&) = delete;
+ ScopePool& operator=(ScopePool const&) = delete;
+
cmFileLockResult Lock(const std::string& filename,
unsigned long timeoutSec);
cmFileLockResult Release(const std::string& filename);
diff --git a/Source/cmFileLockUnix.cxx b/Source/cmFileLockUnix.cxx
index 7353b01fc..1bf5013ad 100644
--- a/Source/cmFileLockUnix.cxx
+++ b/Source/cmFileLockUnix.cxx
@@ -8,10 +8,7 @@
#include <stdio.h> // SEEK_SET
#include <unistd.h>
-cmFileLock::cmFileLock()
- : File(-1)
-{
-}
+cmFileLock::cmFileLock() = default;
cmFileLockResult cmFileLock::Release()
{
diff --git a/Source/cmFileLockWin32.cxx b/Source/cmFileLockWin32.cxx
index 51ac24993..a61d360ab 100644
--- a/Source/cmFileLockWin32.cxx
+++ b/Source/cmFileLockWin32.cxx
@@ -6,7 +6,6 @@
#include <windows.h> // CreateFileW
cmFileLock::cmFileLock()
- : File(INVALID_HANDLE_VALUE)
{
}
diff --git a/Source/cmFileMonitor.cxx b/Source/cmFileMonitor.cxx
index b36ac7805..56ee739b0 100644
--- a/Source/cmFileMonitor.cxx
+++ b/Source/cmFileMonitor.cxx
@@ -19,7 +19,6 @@ void on_fs_close(uv_handle_t* handle);
class cmIBaseWatcher
{
public:
- cmIBaseWatcher() = default;
virtual ~cmIBaseWatcher() = default;
virtual void Trigger(const std::string& pathSegment, int events,
@@ -150,11 +149,6 @@ public:
p->AddChildWatcher(ps, this);
}
- ~cmRealDirectoryWatcher() override
- {
- // Handle is freed via uv_handle_close callback!
- }
-
void StartWatching() final
{
if (!this->Handle) {
diff --git a/Source/cmFileMonitor.h b/Source/cmFileMonitor.h
index 632e7514f..7ffc9294e 100644
--- a/Source/cmFileMonitor.h
+++ b/Source/cmFileMonitor.h
@@ -14,12 +14,14 @@ class cmRootWatcher;
class cmFileMonitor
{
- CM_DISABLE_COPY(cmFileMonitor)
public:
cmFileMonitor(uv_loop_t* l);
~cmFileMonitor();
+ cmFileMonitor(cmFileMonitor const&) = delete;
+ cmFileMonitor& operator=(cmFileMonitor const&) = delete;
+
using Callback = std::function<void(const std::string&, int, int)>;
void MonitorPaths(const std::vector<std::string>& paths, Callback const& cb);
void StopMonitoring();
diff --git a/Source/cmFilePathChecksum.cxx b/Source/cmFilePathChecksum.cxx
index f84360e7f..2cffa7c5b 100644
--- a/Source/cmFilePathChecksum.cxx
+++ b/Source/cmFilePathChecksum.cxx
@@ -9,9 +9,7 @@
#include <vector>
-cmFilePathChecksum::cmFilePathChecksum()
-{
-}
+cmFilePathChecksum::cmFilePathChecksum() = default;
cmFilePathChecksum::cmFilePathChecksum(std::string const& currentSrcDir,
std::string const& currentBinDir,
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 8f6993d1e..8b3911e4b 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -21,9 +21,10 @@ class cmFileTimeComparisonInternal
{
public:
// Internal comparison method.
- inline bool FileTimeCompare(const char* f1, const char* f2, int* result);
+ inline bool FileTimeCompare(const std::string& f1, const std::string& f2,
+ int* result);
- bool FileTimesDiffer(const char* f1, const char* f2);
+ bool FileTimesDiffer(const std::string& f1, const std::string& f2);
private:
typedef std::unordered_map<std::string, cmFileTimeComparison_Type>
@@ -31,14 +32,14 @@ private:
FileStatsMap Files;
// Internal methods to lookup and compare modification times.
- inline bool Stat(const char* fname, cmFileTimeComparison_Type* st);
+ inline bool Stat(const std::string& fname, cmFileTimeComparison_Type* st);
inline int Compare(cmFileTimeComparison_Type* st1,
cmFileTimeComparison_Type* st2);
inline bool TimesDiffer(cmFileTimeComparison_Type* st1,
cmFileTimeComparison_Type* st2);
};
-bool cmFileTimeComparisonInternal::Stat(const char* fname,
+bool cmFileTimeComparisonInternal::Stat(const std::string& fname,
cmFileTimeComparison_Type* st)
{
// Use the stored time if available.
@@ -51,7 +52,7 @@ bool cmFileTimeComparisonInternal::Stat(const char* fname,
#if !defined(_WIN32) || defined(__CYGWIN__)
// POSIX version. Use the stat function.
- int res = ::stat(fname, st);
+ int res = ::stat(fname.c_str(), st);
if (res != 0) {
return false;
}
@@ -83,13 +84,14 @@ cmFileTimeComparison::~cmFileTimeComparison()
delete this->Internals;
}
-bool cmFileTimeComparison::FileTimeCompare(const char* f1, const char* f2,
- int* result)
+bool cmFileTimeComparison::FileTimeCompare(const std::string& f1,
+ const std::string& f2, int* result)
{
return this->Internals->FileTimeCompare(f1, f2, result);
}
-bool cmFileTimeComparison::FileTimesDiffer(const char* f1, const char* f2)
+bool cmFileTimeComparison::FileTimesDiffer(const std::string& f1,
+ const std::string& f2)
{
return this->Internals->FileTimesDiffer(f1, f2);
}
@@ -199,8 +201,9 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
#endif
}
-bool cmFileTimeComparisonInternal::FileTimeCompare(const char* f1,
- const char* f2, int* result)
+bool cmFileTimeComparisonInternal::FileTimeCompare(const std::string& f1,
+ const std::string& f2,
+ int* result)
{
// Get the modification time for each file.
cmFileTimeComparison_Type s1;
@@ -215,8 +218,8 @@ bool cmFileTimeComparisonInternal::FileTimeCompare(const char* f1,
return false;
}
-bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
- const char* f2)
+bool cmFileTimeComparisonInternal::FileTimesDiffer(const std::string& f1,
+ const std::string& f2)
{
// Get the modification time for each file.
cmFileTimeComparison_Type s1;
diff --git a/Source/cmFileTimeComparison.h b/Source/cmFileTimeComparison.h
index 114989b51..5f74e3499 100644
--- a/Source/cmFileTimeComparison.h
+++ b/Source/cmFileTimeComparison.h
@@ -5,6 +5,8 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <string>
+
class cmFileTimeComparisonInternal;
/** \class cmFileTimeComparison
@@ -24,13 +26,14 @@ public:
* When true is returned, result has -1, 0, +1 for
* f1 older, same, or newer than f2.
*/
- bool FileTimeCompare(const char* f1, const char* f2, int* result);
+ bool FileTimeCompare(const std::string& f1, const std::string& f2,
+ int* result);
/**
* Compare file modification times. Return true unless both files
* exist and have modification times less than 1 second apart.
*/
- bool FileTimesDiffer(const char* f1, const char* f2);
+ bool FileTimesDiffer(const std::string& f1, const std::string& f2);
protected:
cmFileTimeComparisonInternal* Internals;
diff --git a/Source/cmFindBase.cxx b/Source/cmFindBase.cxx
index 865595b79..425546a83 100644
--- a/Source/cmFindBase.cxx
+++ b/Source/cmFindBase.cxx
@@ -129,13 +129,13 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
this->VariableDocumentation += "the (unknown) library be found";
} else if (this->Names.size() == 1) {
this->VariableDocumentation +=
- "the " + this->Names[0] + " library be found";
+ "the " + this->Names.front() + " library be found";
} else {
this->VariableDocumentation += "one of the ";
this->VariableDocumentation +=
cmJoin(cmMakeRange(this->Names).retreat(1), ", ");
this->VariableDocumentation +=
- " or " + this->Names[this->Names.size() - 1] + " libraries be found";
+ " or " + this->Names.back() + " libraries be found";
}
}
diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx
index fbaacfcf5..78be64e09 100644
--- a/Source/cmFindCommon.cxx
+++ b/Source/cmFindCommon.cxx
@@ -48,9 +48,7 @@ cmFindCommon::cmFindCommon()
this->InitializeSearchPathGroups();
}
-cmFindCommon::~cmFindCommon()
-{
-}
+cmFindCommon::~cmFindCommon() = default;
void cmFindCommon::InitializeSearchPathGroups()
{
@@ -178,13 +176,13 @@ void cmFindCommon::RerootPaths(std::vector<std::string>& paths)
cmSystemTools::ExpandListArgument(rootPath, roots);
}
if (sysrootCompile) {
- roots.push_back(sysrootCompile);
+ roots.emplace_back(sysrootCompile);
}
if (sysrootLink) {
- roots.push_back(sysrootLink);
+ roots.emplace_back(sysrootLink);
}
if (sysroot) {
- roots.push_back(sysroot);
+ roots.emplace_back(sysroot);
}
for (std::string& r : roots) {
cmSystemTools::ConvertToUnixSlashes(r);
@@ -293,13 +291,13 @@ void cmFindCommon::AddPathSuffix(std::string const& arg)
if (suffix.empty()) {
return;
}
- if (suffix[0] == '/') {
+ if (suffix.front() == '/') {
suffix = suffix.substr(1);
}
if (suffix.empty()) {
return;
}
- if (suffix[suffix.size() - 1] == '/') {
+ if (suffix.back() == '/') {
suffix = suffix.substr(0, suffix.size() - 1);
}
if (suffix.empty()) {
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index 1e1ab147f..73d602de7 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -7,6 +7,7 @@
#include <set>
#include <stdio.h>
#include <string.h>
+#include <utility>
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
@@ -198,13 +199,9 @@ struct cmFindLibraryHelper
// Current names under consideration.
struct Name
{
- bool TryRaw;
+ bool TryRaw = false;
std::string Raw;
cmsys::RegularExpression Regex;
- Name()
- : TryRaw(false)
- {
- }
};
std::vector<Name> Names;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 96de6adce..c2e0712ff 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -21,12 +21,12 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSearchPath.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmVersion.h"
-#include "cmake.h"
#if defined(__HAIKU__)
# include <FindDirectory.h>
@@ -95,6 +95,7 @@ cmFindPackageCommand::cmFindPackageCommand()
this->UseLib32Paths = false;
this->UseLib64Paths = false;
this->UseLibx32Paths = false;
+ this->UseRealPath = false;
this->PolicyScope = true;
this->VersionMajor = 0;
this->VersionMinor = 0;
@@ -111,6 +112,8 @@ cmFindPackageCommand::cmFindPackageCommand()
this->SortOrder = None;
this->SortDirection = Asc;
this->AppendSearchPathGroups();
+
+ this->DeprecatedFindModules["Qt"] = cmPolicies::CMP0084;
}
void cmFindPackageCommand::AppendSearchPathGroups()
@@ -193,6 +196,11 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
this->NoSystemRegistry = true;
}
+ // Check whether we should resolve symlinks when finding packages
+ if (this->Makefile->IsOn("CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS")) {
+ this->UseRealPath = true;
+ }
+
// Check if Sorting should be enabled
if (const char* so =
this->Makefile->GetDefinition("CMAKE_FIND_PACKAGE_SORT_ORDER")) {
@@ -382,7 +390,8 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
if (this->Version.empty() && this->VersionExact) {
this->VersionExact = false;
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING, "Ignoring EXACT since no version is requested.");
+ MessageType::AUTHOR_WARNING,
+ "Ignoring EXACT since no version is requested.");
}
if (this->Version.empty() || components.empty()) {
@@ -471,7 +480,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0074));
break;
case cmPolicies::NEW: {
@@ -534,7 +543,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args,
}
aw << "\n"
"(Variable CMAKE_FIND_PACKAGE_WARN_NO_MODULE enabled this warning.)";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, aw.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, aw.str());
}
// No find module. Assume the project has a CMake config file. Use
@@ -653,15 +662,38 @@ bool cmFindPackageCommand::FindModule(bool& found)
std::string module = "Find";
module += this->Name;
module += ".cmake";
- std::string mfile = this->Makefile->GetModulesFile(module.c_str());
+ bool system = false;
+ std::string mfile = this->Makefile->GetModulesFile(module, system);
if (!mfile.empty()) {
+ if (system) {
+ auto it = this->DeprecatedFindModules.find(this->Name);
+ if (it != this->DeprecatedFindModules.end()) {
+ cmPolicies::PolicyStatus status =
+ this->Makefile->GetPolicyStatus(it->second);
+ switch (status) {
+ case cmPolicies::WARN: {
+ std::ostringstream e;
+ e << cmPolicies::GetPolicyWarning(it->second) << "\n";
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
+ CM_FALLTHROUGH;
+ }
+ case cmPolicies::OLD:
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ return true;
+ }
+ }
+ }
+
// Load the module we found, and set "<name>_FIND_MODULE" to true
// while inside it.
found = true;
std::string var = this->Name;
var += "_FIND_MODULE";
this->Makefile->AddDefinition(var, "1");
- bool result = this->ReadListFile(mfile.c_str(), DoPolicyScope);
+ bool result = this->ReadListFile(mfile, DoPolicyScope);
this->Makefile->RemoveDefinition(var);
return result;
}
@@ -711,7 +743,8 @@ bool cmFindPackageCommand::HandlePackageMode()
// Sanity check.
if (fileFound && this->FileFound.empty()) {
this->Makefile->IssueMessage(
- cmake::INTERNAL_ERROR, "fileFound is true but FileFound is empty!");
+ MessageType::INTERNAL_ERROR,
+ "fileFound is true but FileFound is empty!");
fileFound = false;
}
}
@@ -743,7 +776,7 @@ bool cmFindPackageCommand::HandlePackageMode()
this->StoreVersionFound();
// Parse the configuration file.
- if (this->ReadListFile(this->FileFound.c_str(), DoPolicyScope)) {
+ if (this->ReadListFile(this->FileFound, DoPolicyScope)) {
// The package has been found.
found = true;
@@ -862,14 +895,15 @@ bool cmFindPackageCommand::HandlePackageMode()
}
}
- this->Makefile->IssueMessage(
- this->Required ? cmake::FATAL_ERROR : cmake::WARNING, e.str());
+ this->Makefile->IssueMessage(this->Required ? MessageType::FATAL_ERROR
+ : MessageType::WARNING,
+ e.str());
if (this->Required) {
cmSystemTools::SetFatalErrorOccured();
}
if (!aw.str().empty()) {
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, aw.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, aw.str());
}
}
// output result if in config mode but not in quiet mode
@@ -1002,7 +1036,8 @@ bool cmFindPackageCommand::FindAppBundleConfig()
return false;
}
-bool cmFindPackageCommand::ReadListFile(const char* f, PolicyScopeRule psr)
+bool cmFindPackageCommand::ReadListFile(const std::string& f,
+ PolicyScopeRule psr)
{
const bool noPolicyScope = !this->PolicyScope || psr == NoPolicyScope;
if (this->Makefile->ReadDependentFile(f, noPolicyScope)) {
@@ -1429,7 +1464,7 @@ void cmFindPackageCommand::FillPrefixesUserHints()
bool cmFindPackageCommand::SearchDirectory(std::string const& dir)
{
- assert(!dir.empty() && dir[dir.size() - 1] == '/');
+ assert(!dir.empty() && dir.back() == '/');
// Check each path suffix on this directory.
for (std::string const& s : this->SearchPathSuffixes) {
@@ -1447,7 +1482,7 @@ bool cmFindPackageCommand::SearchDirectory(std::string const& dir)
bool cmFindPackageCommand::CheckDirectory(std::string const& dir)
{
- assert(!dir.empty() && dir[dir.size() - 1] == '/');
+ assert(!dir.empty() && dir.back() == '/');
// Look for the file in this directory.
std::string d = dir.substr(0, dir.size() - 1);
@@ -1474,6 +1509,10 @@ bool cmFindPackageCommand::FindConfigFile(std::string const& dir,
fprintf(stderr, "Checking file [%s]\n", file.c_str());
}
if (cmSystemTools::FileExists(file, true) && this->CheckVersion(file)) {
+ // Allow resolving symlinks when the config file is found through a link
+ if (this->UseRealPath) {
+ file = cmSystemTools::GetRealPath(file);
+ }
return true;
}
}
@@ -1552,7 +1591,7 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
// Load the version check file. Pass NoPolicyScope because we do
// our own policy push/pop independent of CMP0011.
bool suitable = false;
- if (this->ReadListFile(version_file.c_str(), NoPolicyScope)) {
+ if (this->ReadListFile(version_file, NoPolicyScope)) {
// Check the output variables.
bool okay = this->Makefile->IsOn("PACKAGE_VERSION_EXACT");
bool unsuitable = this->Makefile->IsOn("PACKAGE_VERSION_UNSUITABLE");
@@ -1633,7 +1672,7 @@ void cmFindPackageCommand::StoreVersionFound()
class cmFileListGeneratorBase
{
public:
- virtual ~cmFileListGeneratorBase() {}
+ virtual ~cmFileListGeneratorBase() = default;
protected:
bool Consider(std::string const& fullPath, cmFileList& listing);
@@ -1650,12 +1689,7 @@ private:
class cmFileList
{
public:
- cmFileList()
- : First()
- , Last(nullptr)
- {
- }
- virtual ~cmFileList() {}
+ virtual ~cmFileList() = default;
cmFileList& operator/(cmFileListGeneratorBase const& rhs)
{
if (this->Last) {
@@ -1678,15 +1712,14 @@ private:
virtual bool Visit(std::string const& fullPath) = 0;
friend class cmFileListGeneratorBase;
std::unique_ptr<cmFileListGeneratorBase> First;
- cmFileListGeneratorBase* Last;
+ cmFileListGeneratorBase* Last = nullptr;
};
class cmFindPackageFileList : public cmFileList
{
public:
cmFindPackageFileList(cmFindPackageCommand* fpc, bool use_suffixes = true)
- : cmFileList()
- , FPC(fpc)
+ : FPC(fpc)
, UseSuffixes(use_suffixes)
{
}
@@ -1727,14 +1760,12 @@ bool cmFileListGeneratorBase::Consider(std::string const& fullPath,
class cmFileListGeneratorFixed : public cmFileListGeneratorBase
{
public:
- cmFileListGeneratorFixed(std::string const& str)
- : cmFileListGeneratorBase()
- , String(str)
+ cmFileListGeneratorFixed(std::string str)
+ : String(std::move(str))
{
}
cmFileListGeneratorFixed(cmFileListGeneratorFixed const& r)
- : cmFileListGeneratorBase()
- , String(r.String)
+ : String(r.String)
{
}
@@ -1757,13 +1788,11 @@ class cmFileListGeneratorEnumerate : public cmFileListGeneratorBase
{
public:
cmFileListGeneratorEnumerate(std::vector<std::string> const& v)
- : cmFileListGeneratorBase()
- , Vector(v)
+ : Vector(v)
{
}
cmFileListGeneratorEnumerate(cmFileListGeneratorEnumerate const& r)
- : cmFileListGeneratorBase()
- , Vector(r.Vector)
+ : Vector(r.Vector)
{
}
@@ -1792,14 +1821,12 @@ public:
cmFileListGeneratorProject(std::vector<std::string> const& names,
cmFindPackageCommand::SortOrderType so,
cmFindPackageCommand::SortDirectionType sd)
- : cmFileListGeneratorBase()
- , Names(names)
+ : Names(names)
{
this->SetSort(so, sd);
}
cmFileListGeneratorProject(cmFileListGeneratorProject const& r)
- : cmFileListGeneratorBase()
- , Names(r.Names)
+ : Names(r.Names)
{
this->SetSort(r.SortOrder, r.SortDirection);
}
@@ -1831,7 +1858,7 @@ private:
}
for (std::string const& n : this->Names) {
if (cmsysString_strncasecmp(fname, n.c_str(), n.length()) == 0) {
- matches.push_back(fname);
+ matches.emplace_back(fname);
}
}
}
@@ -1863,14 +1890,12 @@ class cmFileListGeneratorMacProject : public cmFileListGeneratorBase
public:
cmFileListGeneratorMacProject(std::vector<std::string> const& names,
const char* ext)
- : cmFileListGeneratorBase()
- , Names(names)
+ : Names(names)
, Extension(ext)
{
}
cmFileListGeneratorMacProject(cmFileListGeneratorMacProject const& r)
- : cmFileListGeneratorBase()
- , Names(r.Names)
+ : Names(r.Names)
, Extension(r.Extension)
{
}
@@ -1892,7 +1917,7 @@ private:
for (std::string name : this->Names) {
name += this->Extension;
if (cmsysString_strcasecmp(fname, name.c_str()) == 0) {
- matches.push_back(fname);
+ matches.emplace_back(fname);
}
}
}
@@ -1915,15 +1940,13 @@ private:
class cmFileListGeneratorCaseInsensitive : public cmFileListGeneratorBase
{
public:
- cmFileListGeneratorCaseInsensitive(std::string const& str)
- : cmFileListGeneratorBase()
- , String(str)
+ cmFileListGeneratorCaseInsensitive(std::string str)
+ : String(std::move(str))
{
}
cmFileListGeneratorCaseInsensitive(
cmFileListGeneratorCaseInsensitive const& r)
- : cmFileListGeneratorBase()
- , String(r.String)
+ : String(r.String)
{
}
@@ -1959,14 +1982,12 @@ private:
class cmFileListGeneratorGlob : public cmFileListGeneratorBase
{
public:
- cmFileListGeneratorGlob(std::string const& str)
- : cmFileListGeneratorBase()
- , Pattern(str)
+ cmFileListGeneratorGlob(std::string str)
+ : Pattern(std::move(str))
{
}
cmFileListGeneratorGlob(cmFileListGeneratorGlob const& r)
- : cmFileListGeneratorBase()
- , Pattern(r.Pattern)
+ : Pattern(r.Pattern)
{
}
@@ -2001,7 +2022,7 @@ private:
bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
{
- assert(!prefix_in.empty() && prefix_in[prefix_in.size() - 1] == '/');
+ assert(!prefix_in.empty() && prefix_in.back() == '/');
if (this->DebugMode) {
fprintf(stderr, "Checking prefix [%s]\n", prefix_in.c_str());
}
@@ -2059,16 +2080,16 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
common.push_back("lib/" + this->LibraryArchitecture);
}
if (this->UseLib32Paths) {
- common.push_back("lib32");
+ common.emplace_back("lib32");
}
if (this->UseLib64Paths) {
- common.push_back("lib64");
+ common.emplace_back("lib64");
}
if (this->UseLibx32Paths) {
- common.push_back("libx32");
+ common.emplace_back("libx32");
}
- common.push_back("lib");
- common.push_back("share");
+ common.emplace_back("lib");
+ common.emplace_back("share");
// PREFIX/(lib/ARCH|lib*|share)/cmake/(Foo|foo|FOO).*/
{
@@ -2157,7 +2178,7 @@ bool cmFindPackageCommand::SearchPrefix(std::string const& prefix_in)
bool cmFindPackageCommand::SearchFrameworkPrefix(std::string const& prefix_in)
{
- assert(!prefix_in.empty() && prefix_in[prefix_in.size() - 1] == '/');
+ assert(!prefix_in.empty() && prefix_in.back() == '/');
if (this->DebugMode) {
fprintf(stderr, "Checking framework prefix [%s]\n", prefix_in.c_str());
}
@@ -2218,7 +2239,7 @@ bool cmFindPackageCommand::SearchFrameworkPrefix(std::string const& prefix_in)
bool cmFindPackageCommand::SearchAppBundlePrefix(std::string const& prefix_in)
{
- assert(!prefix_in.empty() && prefix_in[prefix_in.size() - 1] == '/');
+ assert(!prefix_in.empty() && prefix_in.back() == '/');
if (this->DebugMode) {
fprintf(stderr, "Checking bundle prefix [%s]\n", prefix_in.c_str());
}
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 48f17ef11..a11d25304 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -4,6 +4,7 @@
#define cmFindPackageCommand_h
#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmPolicies.h"
#include "cm_kwiml.h"
#include <cstddef>
@@ -109,7 +110,7 @@ private:
NoPolicyScope,
DoPolicyScope
};
- bool ReadListFile(const char* f, PolicyScopeRule psr);
+ bool ReadListFile(const std::string& f, PolicyScopeRule psr);
void StoreVersionFound();
void ComputePrefixes();
@@ -148,6 +149,8 @@ private:
};
std::map<std::string, OriginalDef> OriginalDefs;
+ std::map<std::string, cmPolicies::PolicyID> DeprecatedFindModules;
+
std::string Name;
std::string Variable;
std::string Version;
@@ -175,6 +178,7 @@ private:
bool UseLib32Paths;
bool UseLib64Paths;
bool UseLibx32Paths;
+ bool UseRealPath;
bool PolicyScope;
std::string LibraryArchitecture;
std::vector<std::string> Names;
diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx
index db340772f..782f746ef 100644
--- a/Source/cmFindProgramCommand.cxx
+++ b/Source/cmFindProgramCommand.cxx
@@ -77,7 +77,7 @@ struct cmFindProgramHelper
this->TestNameExt = name;
this->TestNameExt += ext;
this->TestPath =
- cmSystemTools::CollapseCombinedPath(path, this->TestNameExt);
+ cmSystemTools::CollapseFullPath(this->TestNameExt, path);
if (cmSystemTools::FileExists(this->TestPath, true)) {
this->BestPath = this->TestPath;
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index 9ff967c50..e359deff9 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -10,8 +10,8 @@
#include "cmAlgorithms.h"
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include "cmake.h"
cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf)
: Makefile(mf)
@@ -38,7 +38,7 @@ bool cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
@@ -164,7 +164,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
break;
}
sprintf(buffer, "%d", cc);
- range.push_back(buffer);
+ range.emplace_back(buffer);
if (cc == stop) {
break;
}
@@ -210,7 +210,7 @@ bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
std::ostringstream e;
e << "Unknown argument:\n"
<< " " << args[i] << "\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return true;
}
}
diff --git a/Source/cmFortranParser.h b/Source/cmFortranParser.h
index 132b3e684..076234035 100644
--- a/Source/cmFortranParser.h
+++ b/Source/cmFortranParser.h
@@ -8,6 +8,7 @@
# include <set>
# include <string>
+# include <utility>
# include <vector>
#endif
@@ -114,10 +115,10 @@ int cmFortran_yyparse(yyscan_t);
// Define parser object internal structure.
struct cmFortranFile
{
- cmFortranFile(FILE* file, YY_BUFFER_STATE buffer, const std::string& dir)
+ cmFortranFile(FILE* file, YY_BUFFER_STATE buffer, std::string dir)
: File(file)
, Buffer(buffer)
- , Directory(dir)
+ , Directory(std::move(dir))
, LastCharWasNewline(false)
{
}
@@ -127,16 +128,29 @@ struct cmFortranFile
bool LastCharWasNewline;
};
+struct cmFortranCompiler
+{
+ std::string Id;
+ std::string SModSep;
+ std::string SModExt;
+};
+
struct cmFortranParser_s
{
- cmFortranParser_s(std::vector<std::string> const& includes,
- std::set<std::string> const& defines,
- cmFortranSourceInfo& info);
+ cmFortranParser_s(cmFortranCompiler fc, std::vector<std::string> includes,
+ std::set<std::string> defines, cmFortranSourceInfo& info);
~cmFortranParser_s();
bool FindIncludeFile(const char* dir, const char* includeName,
std::string& fileName);
+ std::string ModName(std::string const& mod_name) const;
+ std::string SModName(std::string const& mod_name,
+ std::string const& sub_name) const;
+
+ // What compiler.
+ cmFortranCompiler Compiler;
+
// The include file search path.
std::vector<std::string> IncludePath;
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index 01cbb7843..18e3c107d 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -8,6 +8,7 @@
#include <stack>
#include <stdio.h>
#include <string>
+#include <utility>
#include <vector>
bool cmFortranParser_s::FindIncludeFile(const char* dir,
@@ -42,11 +43,13 @@ bool cmFortranParser_s::FindIncludeFile(const char* dir,
return false;
}
-cmFortranParser_s::cmFortranParser_s(std::vector<std::string> const& includes,
- std::set<std::string> const& defines,
+cmFortranParser_s::cmFortranParser_s(cmFortranCompiler fc,
+ std::vector<std::string> includes,
+ std::set<std::string> defines,
cmFortranSourceInfo& info)
- : IncludePath(includes)
- , PPDefinitions(defines)
+ : Compiler(std::move(fc))
+ , IncludePath(std::move(includes))
+ , PPDefinitions(std::move(defines))
, Info(info)
{
this->InInterface = false;
@@ -68,6 +71,17 @@ cmFortranParser_s::~cmFortranParser_s()
cmFortran_yylex_destroy(this->Scanner);
}
+std::string cmFortranParser_s::ModName(std::string const& mod_name) const
+{
+ return mod_name + ".mod";
+}
+
+std::string cmFortranParser_s::SModName(std::string const& mod_name,
+ std::string const& sub_name) const
+{
+ return mod_name + this->Compiler.SModSep + sub_name + this->Compiler.SModExt;
+}
+
bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
{
// Open the new file and push it onto the stack. Save the old
@@ -177,7 +191,7 @@ void cmFortranParser_RuleUse(cmFortranParser* parser, const char* module_name)
// syntax: "use module_name"
// requires: "module_name.mod"
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
- parser->Info.Requires.insert(mod_name + ".mod");
+ parser->Info.Requires.insert(parser->ModName(mod_name));
}
void cmFortranParser_RuleLineDirective(cmFortranParser* parser,
@@ -241,7 +255,7 @@ void cmFortranParser_RuleModule(cmFortranParser* parser,
// syntax: "module module_name"
// provides: "module_name.mod"
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
- parser->Info.Provides.insert(mod_name + ".mod");
+ parser->Info.Provides.insert(parser->ModName(mod_name));
}
}
@@ -264,8 +278,8 @@ void cmFortranParser_RuleSubmodule(cmFortranParser* parser,
std::string const& mod_name = cmSystemTools::LowerCase(module_name);
std::string const& sub_name = cmSystemTools::LowerCase(submodule_name);
- parser->Info.Requires.insert(mod_name + ".mod");
- parser->Info.Provides.insert(mod_name + "@" + sub_name + ".smod");
+ parser->Info.Requires.insert(parser->ModName(mod_name));
+ parser->Info.Provides.insert(parser->SModName(mod_name, sub_name));
}
void cmFortranParser_RuleSubmoduleNested(cmFortranParser* parser,
@@ -285,8 +299,8 @@ void cmFortranParser_RuleSubmoduleNested(cmFortranParser* parser,
std::string const& sub_name = cmSystemTools::LowerCase(submodule_name);
std::string const& nest_name =
cmSystemTools::LowerCase(nested_submodule_name);
- parser->Info.Requires.insert(mod_name + "@" + sub_name + ".smod");
- parser->Info.Provides.insert(mod_name + "@" + nest_name + ".smod");
+ parser->Info.Requires.insert(parser->SModName(mod_name, sub_name));
+ parser->Info.Provides.insert(parser->SModName(mod_name, nest_name));
}
void cmFortranParser_RuleDefine(cmFortranParser* parser, const char* macro)
diff --git a/Source/cmFunctionBlocker.h b/Source/cmFunctionBlocker.h
index b3450b3f2..cd6b05db4 100644
--- a/Source/cmFunctionBlocker.h
+++ b/Source/cmFunctionBlocker.h
@@ -26,7 +26,7 @@ public:
return false;
}
- virtual ~cmFunctionBlocker() {}
+ virtual ~cmFunctionBlocker() = default;
/** Set/Get the context in which this blocker is created. */
void SetStartingContext(cmListFileContext const& lfc)
diff --git a/Source/cmFunctionCommand.cxx b/Source/cmFunctionCommand.cxx
index 67c9e9a5d..264a3385c 100644
--- a/Source/cmFunctionCommand.cxx
+++ b/Source/cmFunctionCommand.cxx
@@ -14,11 +14,6 @@
class cmFunctionHelperCommand : public cmCommand
{
public:
- cmFunctionHelperCommand() {}
-
- ///! clean up any memory allocated by the function
- ~cmFunctionHelperCommand() override {}
-
/**
* This is a virtual constructor for the command.
*/
diff --git a/Source/cmFunctionCommand.h b/Source/cmFunctionCommand.h
index 3352b9235..8b37df032 100644
--- a/Source/cmFunctionCommand.h
+++ b/Source/cmFunctionCommand.h
@@ -18,15 +18,13 @@ class cmMakefile;
class cmFunctionFunctionBlocker : public cmFunctionBlocker
{
public:
- cmFunctionFunctionBlocker() { this->Depth = 0; }
- ~cmFunctionFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
- int Depth;
+ int Depth = 0;
};
/// Starts function() ... endfunction() block
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx
index 186ec8c9e..4fe15874d 100644
--- a/Source/cmGeneratedFileStream.cxx
+++ b/Source/cmGeneratedFileStream.cxx
@@ -12,8 +12,6 @@
#endif
cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
- : cmGeneratedFileStreamBase()
- , Stream()
{
#ifdef CMAKE_BUILD_WITH_CMAKE
if (encoding != codecvt::None) {
@@ -104,23 +102,9 @@ void cmGeneratedFileStream::SetCompressionExtraExtension(bool ext)
this->CompressExtraExtension = ext;
}
-cmGeneratedFileStreamBase::cmGeneratedFileStreamBase()
- : Name()
- , TempName()
- , CopyIfDifferent(false)
- , Okay(false)
- , Compress(false)
- , CompressExtraExtension(true)
-{
-}
+cmGeneratedFileStreamBase::cmGeneratedFileStreamBase() = default;
cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(std::string const& name)
- : Name()
- , TempName()
- , CopyIfDifferent(false)
- , Okay(false)
- , Compress(false)
- , CompressExtraExtension(true)
{
this->Open(name);
}
@@ -224,7 +208,7 @@ int cmGeneratedFileStreamBase::CompressFile(std::string const&,
int cmGeneratedFileStreamBase::RenameFile(std::string const& oldname,
std::string const& newname)
{
- return cmSystemTools::RenameFile(oldname.c_str(), newname.c_str());
+ return cmSystemTools::RenameFile(oldname, newname);
}
void cmGeneratedFileStream::SetName(const std::string& fname)
diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h
index dacd16692..5b1eb5153 100644
--- a/Source/cmGeneratedFileStream.h
+++ b/Source/cmGeneratedFileStream.h
@@ -45,16 +45,16 @@ protected:
std::string TempName;
// Whether to do a copy-if-different.
- bool CopyIfDifferent;
+ bool CopyIfDifferent = false;
// Whether the real file stream was valid when it was closed.
- bool Okay;
+ bool Okay = false;
// Whether the destination file is compressed
- bool Compress;
+ bool Compress = false;
// Whether the destination file is compressed
- bool CompressExtraExtension;
+ bool CompressExtraExtension = true;
};
/** \class cmGeneratedFileStream
@@ -97,6 +97,8 @@ public:
*/
~cmGeneratedFileStream() override;
+ cmGeneratedFileStream(cmGeneratedFileStream const&) = delete;
+
/**
* Open an output file by name. This should be used only with a
* non-open stream. It automatically generates a name for the
@@ -134,9 +136,6 @@ public:
* the output file to be changed during the use of cmGeneratedFileStream.
*/
void SetName(const std::string& fname);
-
-private:
- cmGeneratedFileStream(cmGeneratedFileStream const&); // not implemented
};
#endif
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 2727d9ae4..175a26d2e 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -15,9 +15,8 @@
#include "cmGeneratorExpressionParser.h"
#include "cmSystemTools.h"
-cmGeneratorExpression::cmGeneratorExpression(
- const cmListFileBacktrace& backtrace)
- : Backtrace(backtrace)
+cmGeneratorExpression::cmGeneratorExpression(cmListFileBacktrace backtrace)
+ : Backtrace(std::move(backtrace))
{
}
@@ -34,9 +33,7 @@ std::unique_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
return this->Parse(std::string(input ? input : ""));
}
-cmGeneratorExpression::~cmGeneratorExpression()
-{
-}
+cmGeneratorExpression::~cmGeneratorExpression() = default;
const std::string& cmCompiledGeneratorExpression::Evaluate(
cmLocalGenerator* lg, const std::string& config, bool quiet,
@@ -71,16 +68,11 @@ const std::string& cmCompiledGeneratorExpression::EvaluateWithContext(
this->Output.clear();
- std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
- this->Evaluators.begin();
- const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end =
- this->Evaluators.end();
-
- for (; it != end; ++it) {
- this->Output += (*it)->Evaluate(&context, dagChecker);
+ for (const cmGeneratorExpressionEvaluator* it : this->Evaluators) {
+ this->Output += it->Evaluate(&context, dagChecker);
- this->SeenTargetProperties.insert(context.SeenTargetProperties.begin(),
- context.SeenTargetProperties.end());
+ this->SeenTargetProperties.insert(context.SeenTargetProperties.cbegin(),
+ context.SeenTargetProperties.cend());
if (context.HadError) {
this->Output.clear();
break;
@@ -101,9 +93,9 @@ const std::string& cmCompiledGeneratorExpression::EvaluateWithContext(
}
cmCompiledGeneratorExpression::cmCompiledGeneratorExpression(
- cmListFileBacktrace const& backtrace, const std::string& input)
- : Backtrace(backtrace)
- , Input(input)
+ cmListFileBacktrace backtrace, std::string input)
+ : Backtrace(std::move(backtrace))
+ , Input(std::move(input))
, HadContextSensitiveCondition(false)
, HadHeadSensitiveCondition(false)
, EvaluateForBuildsystem(false)
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 9c05f60c8..fd36c4bcb 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -11,6 +11,7 @@
#include <memory> // IWYU pragma: keep
#include <set>
#include <string>
+#include <utility>
#include <vector>
class cmCompiledGeneratorExpression;
@@ -31,14 +32,14 @@ struct cmGeneratorExpressionEvaluator;
*/
class cmGeneratorExpression
{
- CM_DISABLE_COPY(cmGeneratorExpression)
-
public:
/** Construct. */
- cmGeneratorExpression(
- cmListFileBacktrace const& backtrace = cmListFileBacktrace());
+ cmGeneratorExpression(cmListFileBacktrace backtrace = cmListFileBacktrace());
~cmGeneratorExpression();
+ cmGeneratorExpression(cmGeneratorExpression const&) = delete;
+ cmGeneratorExpression& operator=(cmGeneratorExpression const&) = delete;
+
std::unique_ptr<cmCompiledGeneratorExpression> Parse(
std::string const& input);
std::unique_ptr<cmCompiledGeneratorExpression> Parse(const char* input);
@@ -78,9 +79,13 @@ private:
class cmCompiledGeneratorExpression
{
- CM_DISABLE_COPY(cmCompiledGeneratorExpression)
-
public:
+ ~cmCompiledGeneratorExpression();
+
+ cmCompiledGeneratorExpression(cmCompiledGeneratorExpression const&) = delete;
+ cmCompiledGeneratorExpression& operator=(
+ cmCompiledGeneratorExpression const&) = delete;
+
const std::string& Evaluate(
cmLocalGenerator* lg, const std::string& config, bool quiet = false,
cmGeneratorTarget const* headTarget = nullptr,
@@ -109,8 +114,6 @@ public:
return this->AllTargetsSeen;
}
- ~cmCompiledGeneratorExpression();
-
std::string const& GetInput() const { return this->Input; }
cmListFileBacktrace GetBacktrace() const { return this->Backtrace; }
@@ -140,8 +143,8 @@ private:
cmGeneratorExpressionContext& context,
cmGeneratorExpressionDAGChecker* dagChecker) const;
- cmCompiledGeneratorExpression(cmListFileBacktrace const& backtrace,
- const std::string& input);
+ cmCompiledGeneratorExpression(cmListFileBacktrace backtrace,
+ std::string input);
friend class cmGeneratorExpression;
@@ -165,20 +168,23 @@ private:
class cmGeneratorExpressionInterpreter
{
- CM_DISABLE_COPY(cmGeneratorExpressionInterpreter)
-
public:
cmGeneratorExpressionInterpreter(cmLocalGenerator* localGenerator,
- std::string const& config,
+ std::string config,
cmGeneratorTarget const* headTarget,
- std::string const& lang = std::string())
+ std::string lang = std::string())
: LocalGenerator(localGenerator)
- , Config(config)
+ , Config(std::move(config))
, HeadTarget(headTarget)
- , Language(lang)
+ , Language(std::move(lang))
{
}
+ cmGeneratorExpressionInterpreter(cmGeneratorExpressionInterpreter const&) =
+ delete;
+ cmGeneratorExpressionInterpreter& operator=(
+ cmGeneratorExpressionInterpreter const&) = delete;
+
const std::string& Evaluate(const char* expression,
const std::string& property);
const std::string& Evaluate(const std::string& expression,
diff --git a/Source/cmGeneratorExpressionContext.cxx b/Source/cmGeneratorExpressionContext.cxx
index a6dde5d39..6d973310c 100644
--- a/Source/cmGeneratorExpressionContext.cxx
+++ b/Source/cmGeneratorExpressionContext.cxx
@@ -2,15 +2,17 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGeneratorExpressionContext.h"
+#include <utility>
+
cmGeneratorExpressionContext::cmGeneratorExpressionContext(
- cmLocalGenerator* lg, std::string const& config, bool quiet,
+ cmLocalGenerator* lg, std::string config, bool quiet,
cmGeneratorTarget const* headTarget, const cmGeneratorTarget* currentTarget,
- bool evaluateForBuildsystem, cmListFileBacktrace const& backtrace,
- std::string const& language)
- : Backtrace(backtrace)
+ bool evaluateForBuildsystem, cmListFileBacktrace backtrace,
+ std::string language)
+ : Backtrace(std::move(backtrace))
, LG(lg)
- , Config(config)
- , Language(language)
+ , Config(std::move(config))
+ , Language(std::move(language))
, HeadTarget(headTarget)
, CurrentTarget(currentTarget)
, Quiet(quiet)
diff --git a/Source/cmGeneratorExpressionContext.h b/Source/cmGeneratorExpressionContext.h
index 5b0123ec8..6e076bf54 100644
--- a/Source/cmGeneratorExpressionContext.h
+++ b/Source/cmGeneratorExpressionContext.h
@@ -14,12 +14,12 @@ class cmLocalGenerator;
struct cmGeneratorExpressionContext
{
- cmGeneratorExpressionContext(cmLocalGenerator* lg, std::string const& config,
+ cmGeneratorExpressionContext(cmLocalGenerator* lg, std::string config,
bool quiet, const cmGeneratorTarget* headTarget,
cmGeneratorTarget const* currentTarget,
bool evaluateForBuildsystem,
- cmListFileBacktrace const& backtrace,
- std::string const& language);
+ cmListFileBacktrace backtrace,
+ std::string language);
cmListFileBacktrace Backtrace;
std::set<cmGeneratorTarget*> DependTargets;
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
index 8d57441c3..728f2a4fd 100644
--- a/Source/cmGeneratorExpressionDAGChecker.cxx
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -7,6 +7,7 @@
#include "cmGeneratorExpressionEvaluator.h"
#include "cmGeneratorTarget.h"
#include "cmLocalGenerator.h"
+#include "cmMessageType.h"
#include "cmake.h"
#include <sstream>
@@ -14,26 +15,26 @@
#include <utility>
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
- const cmListFileBacktrace& backtrace, cmGeneratorTarget const* target,
- const std::string& property, const GeneratorExpressionContent* content,
+ cmListFileBacktrace backtrace, cmGeneratorTarget const* target,
+ std::string property, const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent)
: Parent(parent)
, Target(target)
- , Property(property)
+ , Property(std::move(property))
, Content(content)
- , Backtrace(backtrace)
+ , Backtrace(std::move(backtrace))
, TransitivePropertiesOnly(false)
{
Initialize();
}
cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
- cmGeneratorTarget const* target, const std::string& property,
+ cmGeneratorTarget const* target, std::string property,
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent)
: Parent(parent)
, Target(target)
- , Property(property)
+ , Property(std::move(property))
, Content(content)
, Backtrace()
, TransitivePropertiesOnly(false)
@@ -55,7 +56,7 @@ void cmGeneratorExpressionDAGChecker::Initialize()
if (CheckResult == DAG &&
(CM_FOR_EACH_TRANSITIVE_PROPERTY_METHOD(
- TEST_TRANSITIVE_PROPERTY_METHOD) false)) // NOLINT(clang-tidy)
+ TEST_TRANSITIVE_PROPERTY_METHOD) false)) // NOLINT(*)
#undef TEST_TRANSITIVE_PROPERTY_METHOD
{
std::map<cmGeneratorTarget const*, std::set<std::string>>::const_iterator
@@ -99,8 +100,8 @@ void cmGeneratorExpressionDAGChecker::ReportError(
<< " " << expr << "\n"
<< "Self reference on target \"" << context->HeadTarget->GetName()
<< "\".\n";
- context->LG->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- parent->Backtrace);
+ context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str(), parent->Backtrace);
return;
}
@@ -111,8 +112,8 @@ void cmGeneratorExpressionDAGChecker::ReportError(
<< " " << expr << "\n"
<< "Dependency loop found.";
/* clang-format on */
- context->LG->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- context->Backtrace);
+ context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str(), context->Backtrace);
}
int loopStep = 1;
@@ -122,8 +123,8 @@ void cmGeneratorExpressionDAGChecker::ReportError(
<< " "
<< (parent->Content ? parent->Content->GetOriginalExpression() : expr)
<< "\n";
- context->LG->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- parent->Backtrace);
+ context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str(), parent->Backtrace);
parent = parent->Parent;
++loopStep;
}
@@ -156,6 +157,12 @@ bool cmGeneratorExpressionDAGChecker::GetTransitivePropertiesOnly()
bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression()
{
+ return this->Property.find("TARGET_GENEX_EVAL:") == 0 ||
+ this->Property.find("GENEX_EVAL:", 0) == 0;
+}
+
+bool cmGeneratorExpressionDAGChecker::EvaluatingPICExpression()
+{
const cmGeneratorExpressionDAGChecker* top = this;
const cmGeneratorExpressionDAGChecker* parent = this->Parent;
while (parent) {
@@ -163,7 +170,7 @@ bool cmGeneratorExpressionDAGChecker::EvaluatingGenexExpression()
parent = parent->Parent;
}
- return top->Property == "TARGET_GENEX_EVAL" || top->Property == "GENEX_EVAL";
+ return top->Property == "INTERFACE_POSITION_INDEPENDENT_CODE";
}
bool cmGeneratorExpressionDAGChecker::EvaluatingLinkLibraries(
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
index a5134c315..e1fba5e5c 100644
--- a/Source/cmGeneratorExpressionDAGChecker.h
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -42,13 +42,13 @@ class cmGeneratorTarget;
struct cmGeneratorExpressionDAGChecker
{
- cmGeneratorExpressionDAGChecker(const cmListFileBacktrace& backtrace,
+ cmGeneratorExpressionDAGChecker(cmListFileBacktrace backtrace,
cmGeneratorTarget const* target,
- const std::string& property,
+ std::string property,
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent);
cmGeneratorExpressionDAGChecker(cmGeneratorTarget const* target,
- const std::string& property,
+ std::string property,
const GeneratorExpressionContent* content,
cmGeneratorExpressionDAGChecker* parent);
@@ -66,6 +66,7 @@ struct cmGeneratorExpressionDAGChecker
const std::string& expr);
bool EvaluatingGenexExpression();
+ bool EvaluatingPICExpression();
bool EvaluatingLinkLibraries(cmGeneratorTarget const* tgt = nullptr);
#define DECLARE_TRANSITIVE_PROPERTY_METHOD(METHOD) bool METHOD() const;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index e7a55e054..326cb0e55 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -12,17 +12,17 @@
#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSourceFile.h"
#include "cmSourceFileLocationKind.h"
#include "cmSystemTools.h"
-#include "cmake.h"
cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
- const std::string& input,
+ std::string input,
std::unique_ptr<cmCompiledGeneratorExpression> outputFileExpr,
std::unique_ptr<cmCompiledGeneratorExpression> condition,
bool inputIsContent, cmPolicies::PolicyStatus policyStatusCMP0070)
- : Input(input)
+ : Input(std::move(input))
, OutputFileExpr(std::move(outputFileExpr))
, Condition(std::move(condition))
, InputIsContent(inputIsContent)
@@ -48,7 +48,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(
<< "\" did "
"not evaluate to valid content. Got \""
<< condResult << "\".";
- lg->IssueMessage(cmake::FATAL_ERROR, e.str());
+ lg->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
}
@@ -77,7 +77,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(
"This is generally caused by the content evaluating the "
"configuration type, language, or location of object files:\n "
<< outputFileName;
- lg->IssueMessage(cmake::FATAL_ERROR, e.str());
+ lg->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -137,7 +137,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
if (!fin) {
std::ostringstream e;
e << "Evaluation file \"" << inputFileName << "\" cannot be read.";
- lg->IssueMessage(cmake::FATAL_ERROR, e.str());
+ lg->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -204,7 +204,7 @@ std::string cmGeneratorExpressionEvaluationFile::FixRelativePath(
"undefined behavior will be used."
;
/* clang-format on */
- lg->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ lg->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 2a790697f..89a239057 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -20,7 +20,7 @@ class cmGeneratorExpressionEvaluationFile
{
public:
cmGeneratorExpressionEvaluationFile(
- const std::string& input,
+ std::string input,
std::unique_ptr<cmCompiledGeneratorExpression> outputFileExpr,
std::unique_ptr<cmCompiledGeneratorExpression> condition,
bool inputIsContent, cmPolicies::PolicyStatus policyStatusCMP0070);
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index 056179950..453015262 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -16,8 +16,13 @@ struct cmGeneratorExpressionNode;
struct cmGeneratorExpressionEvaluator
{
- cmGeneratorExpressionEvaluator() {}
- virtual ~cmGeneratorExpressionEvaluator() {}
+ cmGeneratorExpressionEvaluator() = default;
+ virtual ~cmGeneratorExpressionEvaluator() = default;
+
+ cmGeneratorExpressionEvaluator(cmGeneratorExpressionEvaluator const&) =
+ delete;
+ cmGeneratorExpressionEvaluator& operator=(
+ cmGeneratorExpressionEvaluator const&) = delete;
enum Type
{
@@ -29,9 +34,6 @@ struct cmGeneratorExpressionEvaluator
virtual std::string Evaluate(cmGeneratorExpressionContext* context,
cmGeneratorExpressionDAGChecker*) const = 0;
-
-private:
- CM_DISABLE_COPY(cmGeneratorExpressionEvaluator)
};
struct TextContent : public cmGeneratorExpressionEvaluator
diff --git a/Source/cmGeneratorExpressionLexer.cxx b/Source/cmGeneratorExpressionLexer.cxx
index e37f165a8..a7f090ac7 100644
--- a/Source/cmGeneratorExpressionLexer.cxx
+++ b/Source/cmGeneratorExpressionLexer.cxx
@@ -2,11 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGeneratorExpressionLexer.h"
-cmGeneratorExpressionLexer::cmGeneratorExpressionLexer()
- : SawBeginExpression(false)
- , SawGeneratorExpression(false)
-{
-}
+cmGeneratorExpressionLexer::cmGeneratorExpressionLexer() = default;
static void InsertText(const char* upto, const char* c,
std::vector<cmGeneratorExpressionToken>& result)
@@ -22,8 +18,8 @@ std::vector<cmGeneratorExpressionToken> cmGeneratorExpressionLexer::Tokenize(
std::vector<cmGeneratorExpressionToken> result;
if (input.find('$') == std::string::npos) {
- result.push_back(cmGeneratorExpressionToken(
- cmGeneratorExpressionToken::Text, input.c_str(), input.size()));
+ result.emplace_back(cmGeneratorExpressionToken::Text, input.c_str(),
+ input.size());
return result;
}
diff --git a/Source/cmGeneratorExpressionLexer.h b/Source/cmGeneratorExpressionLexer.h
index e53f0b547..bf2430818 100644
--- a/Source/cmGeneratorExpressionLexer.h
+++ b/Source/cmGeneratorExpressionLexer.h
@@ -46,8 +46,8 @@ public:
}
private:
- bool SawBeginExpression;
- bool SawGeneratorExpression;
+ bool SawBeginExpression = false;
+ bool SawGeneratorExpression = false;
};
#endif
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index f901215e3..70c80c90d 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -12,6 +12,7 @@
#include "cmLinkItem.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmStateTypes.h"
@@ -55,7 +56,7 @@ std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
static const struct ZeroNode : public cmGeneratorExpressionNode
{
- ZeroNode() {}
+ ZeroNode() {} // NOLINT(modernize-use-equals-default)
bool GeneratesContent() const override { return false; }
@@ -73,7 +74,7 @@ static const struct ZeroNode : public cmGeneratorExpressionNode
static const struct OneNode : public cmGeneratorExpressionNode
{
- OneNode() {}
+ OneNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -94,7 +95,7 @@ static const struct ZeroNode installInterfaceNode;
#define BOOLEAN_OP_NODE(OPNAME, OP, SUCCESS_VALUE, FAILURE_VALUE) \
static const struct OP##Node : public cmGeneratorExpressionNode \
{ \
- OP##Node() {} \
+ OP##Node() {} /* NOLINT(modernize-use-equals-default) */ \
virtual int NumExpectedParameters() const { return OneOrMoreParameters; } \
\
std::string Evaluate(const std::vector<std::string>& parameters, \
@@ -126,7 +127,7 @@ BOOLEAN_OP_NODE(orNode, OR, 0, 1)
static const struct NotNode : public cmGeneratorExpressionNode
{
- NotNode() {}
+ NotNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -146,7 +147,7 @@ static const struct NotNode : public cmGeneratorExpressionNode
static const struct BoolNode : public cmGeneratorExpressionNode
{
- BoolNode() {}
+ BoolNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -162,7 +163,7 @@ static const struct BoolNode : public cmGeneratorExpressionNode
static const struct IfNode : public cmGeneratorExpressionNode
{
- IfNode() {}
+ IfNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 3; }
@@ -183,7 +184,7 @@ static const struct IfNode : public cmGeneratorExpressionNode
static const struct StrEqualNode : public cmGeneratorExpressionNode
{
- StrEqualNode() {}
+ StrEqualNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -199,7 +200,7 @@ static const struct StrEqualNode : public cmGeneratorExpressionNode
static const struct EqualNode : public cmGeneratorExpressionNode
{
- EqualNode() {}
+ EqualNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -277,20 +278,45 @@ static const struct EqualNode : public cmGeneratorExpressionNode
static const struct InListNode : public cmGeneratorExpressionNode
{
- InListNode() {}
+ InListNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
std::string Evaluate(
const std::vector<std::string>& parameters,
- cmGeneratorExpressionContext* /*context*/,
+ cmGeneratorExpressionContext* context,
const GeneratorExpressionContent* /*content*/,
cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
{
- std::vector<std::string> values;
- cmSystemTools::ExpandListArgument(parameters[1], values);
- if (values.empty()) {
- return "0";
+ std::vector<std::string> values, checkValues;
+ bool check = false;
+ switch (context->LG->GetPolicyStatus(cmPolicies::CMP0085)) {
+ case cmPolicies::WARN:
+ if (parameters.front().empty()) {
+ check = true;
+ cmSystemTools::ExpandListArgument(parameters[1], checkValues, true);
+ }
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ cmSystemTools::ExpandListArgument(parameters[1], values);
+ if (check && values != checkValues) {
+ std::ostringstream e;
+ e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0085)
+ << "\nSearch Item:\n \"" << parameters.front()
+ << "\"\nList:\n \"" << parameters[1] << "\"\n";
+ context->LG->GetCMakeInstance()->IssueMessage(
+ MessageType ::AUTHOR_WARNING, e.str(), context->Backtrace);
+ return "0";
+ }
+ if (values.empty()) {
+ return "0";
+ }
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ cmSystemTools::ExpandListArgument(parameters[1], values, true);
+ break;
}
return std::find(values.cbegin(), values.cend(), parameters.front()) ==
@@ -302,7 +328,7 @@ static const struct InListNode : public cmGeneratorExpressionNode
static const struct TargetExistsNode : public cmGeneratorExpressionNode
{
- TargetExistsNode() {}
+ TargetExistsNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -333,7 +359,7 @@ static const struct TargetExistsNode : public cmGeneratorExpressionNode
static const struct TargetNameIfExistsNode : public cmGeneratorExpressionNode
{
- TargetNameIfExistsNode() {}
+ TargetNameIfExistsNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -367,7 +393,7 @@ static const struct TargetNameIfExistsNode : public cmGeneratorExpressionNode
struct GenexEvaluator : public cmGeneratorExpressionNode
{
- GenexEvaluator() {}
+ GenexEvaluator() {} // NOLINT(modernize-use-equals-default)
protected:
std::string EvaluateExpression(
@@ -378,8 +404,8 @@ protected:
{
if (context->HeadTarget) {
cmGeneratorExpressionDAGChecker dagChecker(
- context->Backtrace, context->HeadTarget, genexOperator, content,
- dagCheckerParent);
+ context->Backtrace, context->HeadTarget,
+ genexOperator + ":" + expression, content, dagCheckerParent);
switch (dagChecker.Check()) {
case cmGeneratorExpressionDAGChecker::SELF_REFERENCE:
case cmGeneratorExpressionDAGChecker::CYCLIC_REFERENCE: {
@@ -404,7 +430,7 @@ protected:
static const struct TargetGenexEvalNode : public GenexEvaluator
{
- TargetGenexEvalNode() {}
+ TargetGenexEvalNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -450,7 +476,7 @@ static const struct TargetGenexEvalNode : public GenexEvaluator
static const struct GenexEvalNode : public GenexEvaluator
{
- GenexEvalNode() {}
+ GenexEvalNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -474,7 +500,7 @@ static const struct GenexEvalNode : public GenexEvaluator
static const struct LowerCaseNode : public cmGeneratorExpressionNode
{
- LowerCaseNode() {}
+ LowerCaseNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -490,7 +516,7 @@ static const struct LowerCaseNode : public cmGeneratorExpressionNode
static const struct UpperCaseNode : public cmGeneratorExpressionNode
{
- UpperCaseNode() {}
+ UpperCaseNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -506,7 +532,7 @@ static const struct UpperCaseNode : public cmGeneratorExpressionNode
static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
{
- MakeCIdentifierNode() {}
+ MakeCIdentifierNode() {} // NOLINT(modernize-use-equals-default)
bool AcceptsArbitraryContentParameter() const override { return true; }
@@ -522,7 +548,7 @@ static const struct MakeCIdentifierNode : public cmGeneratorExpressionNode
static const struct Angle_RNode : public cmGeneratorExpressionNode
{
- Angle_RNode() {}
+ Angle_RNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -538,7 +564,7 @@ static const struct Angle_RNode : public cmGeneratorExpressionNode
static const struct CommaNode : public cmGeneratorExpressionNode
{
- CommaNode() {}
+ CommaNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -554,7 +580,7 @@ static const struct CommaNode : public cmGeneratorExpressionNode
static const struct SemicolonNode : public cmGeneratorExpressionNode
{
- SemicolonNode() {}
+ SemicolonNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -570,7 +596,7 @@ static const struct SemicolonNode : public cmGeneratorExpressionNode
struct CompilerIdNode : public cmGeneratorExpressionNode
{
- CompilerIdNode() {}
+ CompilerIdNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -607,7 +633,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0044);
context->LG->GetCMakeInstance()->IssueMessage(
- cmake::AUTHOR_WARNING, e.str(), context->Backtrace);
+ MessageType::AUTHOR_WARNING, e.str(), context->Backtrace);
CM_FALLTHROUGH;
}
case cmPolicies::OLD:
@@ -624,7 +650,7 @@ struct CompilerIdNode : public cmGeneratorExpressionNode
static const struct CCompilerIdNode : public CompilerIdNode
{
- CCompilerIdNode() {}
+ CCompilerIdNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -646,7 +672,7 @@ static const struct CCompilerIdNode : public CompilerIdNode
static const struct CXXCompilerIdNode : public CompilerIdNode
{
- CXXCompilerIdNode() {}
+ CXXCompilerIdNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -666,9 +692,31 @@ static const struct CXXCompilerIdNode : public CompilerIdNode
}
} cxxCompilerIdNode;
+static const struct FortranCompilerIdNode : public CompilerIdNode
+{
+ FortranCompilerIdNode() {} // NOLINT(modernize-use-equals-default)
+
+ std::string Evaluate(
+ const std::vector<std::string>& parameters,
+ cmGeneratorExpressionContext* context,
+ const GeneratorExpressionContent* content,
+ cmGeneratorExpressionDAGChecker* dagChecker) const override
+ {
+ if (!context->HeadTarget) {
+ reportError(
+ context, content->GetOriginalExpression(),
+ "$<Fortran_COMPILER_ID> may only be used with binary targets. It may "
+ "not be used with add_custom_command or add_custom_target.");
+ return std::string();
+ }
+ return this->EvaluateWithLanguage(parameters, context, content, dagChecker,
+ "Fortran");
+ }
+} fortranCompilerIdNode;
+
struct CompilerVersionNode : public cmGeneratorExpressionNode
{
- CompilerVersionNode() {}
+ CompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -705,7 +753,7 @@ struct CompilerVersionNode : public cmGeneratorExpressionNode
static const struct CCompilerVersionNode : public CompilerVersionNode
{
- CCompilerVersionNode() {}
+ CCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -727,7 +775,7 @@ static const struct CCompilerVersionNode : public CompilerVersionNode
static const struct CxxCompilerVersionNode : public CompilerVersionNode
{
- CxxCompilerVersionNode() {}
+ CxxCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -747,9 +795,31 @@ static const struct CxxCompilerVersionNode : public CompilerVersionNode
}
} cxxCompilerVersionNode;
+static const struct FortranCompilerVersionNode : public CompilerVersionNode
+{
+ FortranCompilerVersionNode() {} // NOLINT(modernize-use-equals-default)
+
+ std::string Evaluate(
+ const std::vector<std::string>& parameters,
+ cmGeneratorExpressionContext* context,
+ const GeneratorExpressionContent* content,
+ cmGeneratorExpressionDAGChecker* dagChecker) const override
+ {
+ if (!context->HeadTarget) {
+ reportError(
+ context, content->GetOriginalExpression(),
+ "$<Fortran_COMPILER_VERSION> may only be used with binary targets. "
+ "It may not be used with add_custom_command or add_custom_target.");
+ return std::string();
+ }
+ return this->EvaluateWithLanguage(parameters, context, content, dagChecker,
+ "Fortran");
+ }
+} fortranCompilerVersionNode;
+
struct PlatformIdNode : public cmGeneratorExpressionNode
{
- PlatformIdNode() {}
+ PlatformIdNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -778,7 +848,7 @@ struct PlatformIdNode : public cmGeneratorExpressionNode
static const struct VersionGreaterNode : public cmGeneratorExpressionNode
{
- VersionGreaterNode() {}
+ VersionGreaterNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -798,7 +868,7 @@ static const struct VersionGreaterNode : public cmGeneratorExpressionNode
static const struct VersionGreaterEqNode : public cmGeneratorExpressionNode
{
- VersionGreaterEqNode() {}
+ VersionGreaterEqNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -818,7 +888,7 @@ static const struct VersionGreaterEqNode : public cmGeneratorExpressionNode
static const struct VersionLessNode : public cmGeneratorExpressionNode
{
- VersionLessNode() {}
+ VersionLessNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -838,7 +908,7 @@ static const struct VersionLessNode : public cmGeneratorExpressionNode
static const struct VersionLessEqNode : public cmGeneratorExpressionNode
{
- VersionLessEqNode() {}
+ VersionLessEqNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -858,7 +928,7 @@ static const struct VersionLessEqNode : public cmGeneratorExpressionNode
static const struct VersionEqualNode : public cmGeneratorExpressionNode
{
- VersionEqualNode() {}
+ VersionEqualNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -878,7 +948,7 @@ static const struct VersionEqualNode : public cmGeneratorExpressionNode
static const struct LinkOnlyNode : public cmGeneratorExpressionNode
{
- LinkOnlyNode() {}
+ LinkOnlyNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -900,7 +970,7 @@ static const struct LinkOnlyNode : public cmGeneratorExpressionNode
static const struct ConfigurationNode : public cmGeneratorExpressionNode
{
- ConfigurationNode() {}
+ ConfigurationNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 0; }
@@ -917,7 +987,7 @@ static const struct ConfigurationNode : public cmGeneratorExpressionNode
static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
{
- ConfigurationTestNode() {}
+ ConfigurationTestNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -976,7 +1046,7 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
static const struct JoinNode : public cmGeneratorExpressionNode
{
- JoinNode() {}
+ JoinNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 2; }
@@ -996,7 +1066,7 @@ static const struct JoinNode : public cmGeneratorExpressionNode
static const struct CompileLanguageNode : public cmGeneratorExpressionNode
{
- CompileLanguageNode() {}
+ CompileLanguageNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrZeroParameters; }
@@ -1076,7 +1146,7 @@ std::string getLinkedTargetsContent(
static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{
- TargetPropertyNode() {}
+ TargetPropertyNode() {} // NOLINT(modernize-use-equals-default)
// This node handles errors on parameter count itself.
int NumExpectedParameters() const override { return OneOrMoreParameters; }
@@ -1225,13 +1295,14 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
const char* prop = target->GetProperty(propertyName);
if (dagCheckerParent) {
- if (dagCheckerParent->EvaluatingGenexExpression()) {
+ if (dagCheckerParent->EvaluatingGenexExpression() ||
+ dagCheckerParent->EvaluatingPICExpression()) {
// No check required.
} else if (dagCheckerParent->EvaluatingLinkLibraries()) {
#define TRANSITIVE_PROPERTY_COMPARE(PROPERTY) \
(#PROPERTY == propertyName || "INTERFACE_" #PROPERTY == propertyName) ||
if (CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(
- TRANSITIVE_PROPERTY_COMPARE) false) { // NOLINT(clang-tidy)
+ TRANSITIVE_PROPERTY_COMPARE) false) { // NOLINT(*)
reportError(
context, content->GetOriginalExpression(),
"$<TARGET_PROPERTY:...> expression in link libraries "
@@ -1371,7 +1442,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
static const struct TargetNameNode : public cmGeneratorExpressionNode
{
- TargetNameNode() {}
+ TargetNameNode() {} // NOLINT(modernize-use-equals-default)
bool GeneratesContent() const override { return true; }
@@ -1393,7 +1464,7 @@ static const struct TargetNameNode : public cmGeneratorExpressionNode
static const struct TargetObjectsNode : public cmGeneratorExpressionNode
{
- TargetObjectsNode() {}
+ TargetObjectsNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -1475,7 +1546,7 @@ static const struct TargetObjectsNode : public cmGeneratorExpressionNode
static const struct CompileFeaturesNode : public cmGeneratorExpressionNode
{
- CompileFeaturesNode() {}
+ CompileFeaturesNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return OneOrMoreParameters; }
@@ -1600,7 +1671,7 @@ cmPolicies::PolicyID policyForString(const char* policy_id)
static const struct TargetPolicyNode : public cmGeneratorExpressionNode
{
- TargetPolicyNode() {}
+ TargetPolicyNode() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -1628,7 +1699,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
switch (statusForTarget(context->HeadTarget, policy)) {
case cmPolicies::WARN:
lg->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(policyForString(policy)));
CM_FALLTHROUGH;
case cmPolicies::REQUIRED_IF_USED:
@@ -1661,7 +1732,7 @@ static const struct TargetPolicyNode : public cmGeneratorExpressionNode
static const struct InstallPrefixNode : public cmGeneratorExpressionNode
{
- InstallPrefixNode() {}
+ InstallPrefixNode() {} // NOLINT(modernize-use-equals-default)
bool GeneratesContent() const override { return true; }
int NumExpectedParameters() const override { return 0; }
@@ -1882,7 +1953,7 @@ struct TargetFilesystemArtifactResultGetter<ArtifactPathTag>
template <typename ArtifactT, typename ComponentT>
struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
{
- TargetFilesystemArtifact() {}
+ TargetFilesystemArtifact() {} // NOLINT(modernize-use-equals-default)
int NumExpectedParameters() const override { return 1; }
@@ -1938,7 +2009,9 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
template <typename ArtifactT>
struct TargetFilesystemArtifactNodeGroup
{
- TargetFilesystemArtifactNodeGroup() {}
+ TargetFilesystemArtifactNodeGroup() // NOLINT(modernize-use-equals-default)
+ {
+ }
TargetFilesystemArtifact<ArtifactT, ArtifactPathTag> File;
TargetFilesystemArtifact<ArtifactT, ArtifactNameTag> FileName;
@@ -1966,7 +2039,7 @@ static const TargetFilesystemArtifact<ArtifactBundleContentDirTag,
static const struct ShellPathNode : public cmGeneratorExpressionNode
{
- ShellPathNode() {}
+ ShellPathNode() {} // NOLINT(modernize-use-equals-default)
std::string Evaluate(
const std::vector<std::string>& parameters,
@@ -1997,6 +2070,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
nodeMap["NOT"] = &notNode;
nodeMap["C_COMPILER_ID"] = &cCompilerIdNode;
nodeMap["CXX_COMPILER_ID"] = &cxxCompilerIdNode;
+ nodeMap["Fortran_COMPILER_ID"] = &fortranCompilerIdNode;
nodeMap["VERSION_GREATER"] = &versionGreaterNode;
nodeMap["VERSION_GREATER_EQUAL"] = &versionGreaterEqNode;
nodeMap["VERSION_LESS"] = &versionLessNode;
@@ -2004,6 +2078,7 @@ const cmGeneratorExpressionNode* cmGeneratorExpressionNode::GetNode(
nodeMap["VERSION_EQUAL"] = &versionEqualNode;
nodeMap["C_COMPILER_VERSION"] = &cCompilerVersionNode;
nodeMap["CXX_COMPILER_VERSION"] = &cxxCompilerVersionNode;
+ nodeMap["Fortran_COMPILER_VERSION"] = &fortranCompilerVersionNode;
nodeMap["PLATFORM_ID"] = &platformIdNode;
nodeMap["COMPILE_FEATURES"] = &compileFeaturesNode;
nodeMap["CONFIGURATION"] = &configurationNode;
@@ -2070,6 +2145,6 @@ void reportError(cmGeneratorExpressionContext* context,
<< " " << expr << "\n"
<< result;
/* clang-format on */
- context->LG->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- context->Backtrace);
+ context->LG->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str(), context->Backtrace);
}
diff --git a/Source/cmGeneratorExpressionNode.h b/Source/cmGeneratorExpressionNode.h
index ece1c113c..3dbfc6e5e 100644
--- a/Source/cmGeneratorExpressionNode.h
+++ b/Source/cmGeneratorExpressionNode.h
@@ -22,7 +22,7 @@ struct cmGeneratorExpressionNode
OneOrMoreParameters = -1,
OneOrZeroParameters = -2
};
- virtual ~cmGeneratorExpressionNode() {}
+ virtual ~cmGeneratorExpressionNode() = default;
virtual bool GeneratesContent() const { return true; }
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index 489970ce3..949a86d81 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -9,8 +9,8 @@
#include <utility>
cmGeneratorExpressionParser::cmGeneratorExpressionParser(
- const std::vector<cmGeneratorExpressionToken>& tokens)
- : Tokens(tokens)
+ std::vector<cmGeneratorExpressionToken> tokens)
+ : Tokens(std::move(tokens))
, NestingLevel(0)
{
}
diff --git a/Source/cmGeneratorExpressionParser.h b/Source/cmGeneratorExpressionParser.h
index 633381c8a..e663496da 100644
--- a/Source/cmGeneratorExpressionParser.h
+++ b/Source/cmGeneratorExpressionParser.h
@@ -13,8 +13,7 @@ struct cmGeneratorExpressionEvaluator;
struct cmGeneratorExpressionParser
{
- cmGeneratorExpressionParser(
- const std::vector<cmGeneratorExpressionToken>& tokens);
+ cmGeneratorExpressionParser(std::vector<cmGeneratorExpressionToken> tokens);
void Parse(std::vector<cmGeneratorExpressionEvaluator*>& result);
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 5c294f8c4..25349d42e 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -14,6 +14,7 @@
#include <stdlib.h>
#include <string.h>
#include <unordered_set>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
@@ -25,6 +26,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPropertyMap.h"
#include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
@@ -201,7 +203,7 @@ std::string cmGeneratorTarget::GetExportName() const
std::ostringstream e;
e << "EXPORT_NAME property \"" << exportName << "\" for \""
<< this->GetName() << "\": is not valid.";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return "";
}
return exportName;
@@ -318,7 +320,7 @@ std::string cmGeneratorTarget::GetOutputName(
props.push_back(configUpper + "_OUTPUT_NAME");
}
// OUTPUT_NAME
- props.push_back("OUTPUT_NAME");
+ props.emplace_back("OUTPUT_NAME");
std::string outName;
for (std::string const& p : props) {
@@ -340,7 +342,7 @@ std::string cmGeneratorTarget::GetOutputName(
// An empty map entry indicates we have been called recursively
// from the above block.
this->LocalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"Target '" + this->GetName() + "' OUTPUT_NAME depends on itself.",
this->GetBacktrace());
}
@@ -354,20 +356,22 @@ void cmGeneratorTarget::ClearSourcesCache()
this->Objects.clear();
}
-void cmGeneratorTarget::AddSourceCommon(const std::string& src)
+void cmGeneratorTarget::AddSourceCommon(const std::string& src, bool before)
{
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
cmGeneratorExpression ge(lfbt);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
cge->SetEvaluateForBuildsystem(true);
- this->SourceEntries.push_back(new TargetPropertyEntry(std::move(cge)));
+ this->SourceEntries.insert(before ? this->SourceEntries.begin()
+ : this->SourceEntries.end(),
+ new TargetPropertyEntry(std::move(cge)));
this->ClearSourcesCache();
}
-void cmGeneratorTarget::AddSource(const std::string& src)
+void cmGeneratorTarget::AddSource(const std::string& src, bool before)
{
- this->Target->AddSource(src);
- this->AddSourceCommon(src);
+ this->Target->AddSource(src, before);
+ this->AddSourceCommon(src, before);
}
void cmGeneratorTarget::AddTracedSources(std::vector<std::string> const& srcs)
@@ -386,12 +390,10 @@ void cmGeneratorTarget::AddIncludeDirectory(const std::string& src,
cmGeneratorExpression ge(lfbt);
std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
cge->SetEvaluateForBuildsystem(true);
- // Insert before begin/end
- std::vector<TargetPropertyEntry*>::iterator pos = before
- ? this->IncludeDirectoriesEntries.begin()
- : this->IncludeDirectoriesEntries.end();
this->IncludeDirectoriesEntries.insert(
- pos, new TargetPropertyEntry(std::move(cge)));
+ before ? this->IncludeDirectoriesEntries.begin()
+ : this->IncludeDirectoriesEntries.end(),
+ new TargetPropertyEntry(std::move(cge)));
}
std::vector<cmSourceFile*> const* cmGeneratorTarget::GetSourceDepends(
@@ -435,14 +437,14 @@ static void handleSystemIncludesDep(
/* clang-format off */
#define IMPLEMENT_VISIT(KIND) \
- { \
+ do { \
KindedSources const& kinded = this->GetKindedSources(config); \
for (SourceAndKind const& s : kinded.Sources) { \
if (s.Kind == KIND) { \
- data.push_back(s.Source); \
+ data.push_back(s.Source.Value); \
} \
} \
- }
+ } while (false)
/* clang-format on */
void cmGeneratorTarget::GetObjectSources(
@@ -495,6 +497,25 @@ const char* cmGeneratorTarget::GetFeature(const std::string& feature,
return this->LocalGenerator->GetFeature(feature, config);
}
+const char* cmGeneratorTarget::GetLinkPIEProperty(
+ const std::string& config) const
+{
+ static std::string PICValue;
+
+ PICValue = this->GetLinkInterfaceDependentStringAsBoolProperty(
+ "POSITION_INDEPENDENT_CODE", config);
+
+ if (PICValue == "(unset)") {
+ // POSITION_INDEPENDENT_CODE is not set
+ return nullptr;
+ }
+
+ auto status = this->GetPolicyStatusCMP0083();
+ return (status != cmPolicies::WARN && status != cmPolicies::OLD)
+ ? PICValue.c_str()
+ : nullptr;
+}
+
bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
std::string const& config) const
{
@@ -529,7 +550,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
w << "INTERPROCEDURAL_OPTIMIZATION property will be ignored for target "
<< "'" << this->GetName() << "'.";
this->LocalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::AUTHOR_WARNING, w.str(), this->GetBacktrace());
+ MessageType::AUTHOR_WARNING, w.str(), this->GetBacktrace());
this->PolicyReportedCMP0069 = true;
}
@@ -560,7 +581,7 @@ bool cmGeneratorTarget::IsIPOEnabled(std::string const& lang,
this->PolicyReportedCMP0069 = true;
this->LocalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, message, this->GetBacktrace());
+ MessageType::FATAL_ERROR, message, this->GetBacktrace());
return false;
}
@@ -674,13 +695,13 @@ std::set<cmLinkItem> const& cmGeneratorTarget::GetUtilityItems() const
{
if (!this->UtilityItemsDone) {
this->UtilityItemsDone = true;
- std::set<std::string> const& utilities = this->GetUtilities();
- for (std::string const& i : utilities) {
+ std::set<BT<std::string>> const& utilities = this->GetUtilities();
+ for (BT<std::string> const& i : utilities) {
if (cmGeneratorTarget* gt =
- this->LocalGenerator->FindGeneratorTargetToUse(i)) {
- this->UtilityItems.insert(cmLinkItem(gt));
+ this->LocalGenerator->FindGeneratorTargetToUse(i.Value)) {
+ this->UtilityItems.insert(cmLinkItem(gt, i.Backtrace));
} else {
- this->UtilityItems.insert(cmLinkItem(i));
+ this->UtilityItems.insert(cmLinkItem(i.Value, i.Backtrace));
}
}
}
@@ -865,7 +886,8 @@ static void AddObjectEntries(
static bool processSources(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& srcs, std::unordered_set<std::string>& uniqueSrcs,
+ std::vector<BT<std::string>>& srcs,
+ std::unordered_set<std::string>& uniqueSrcs,
cmGeneratorExpressionDAGChecker* dagChecker, std::string const& config,
bool debugSources)
{
@@ -893,7 +915,7 @@ static bool processSources(
if (fullPath.empty()) {
if (!e.empty()) {
cmake* cm = tgt->GetLocalGenerator()->GetCMakeInstance();
- cm->IssueMessage(cmake::FATAL_ERROR, e, tgt->GetBacktrace());
+ cm->IssueMessage(MessageType::FATAL_ERROR, e, tgt->GetBacktrace());
}
return contextDependent;
}
@@ -908,7 +930,8 @@ static bool processSources(
err << "Found relative path while evaluating sources of \""
<< tgt->GetName() << "\":\n \"" << src << "\"\n";
}
- tgt->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, err.str());
+ tgt->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
+ err.str());
return contextDependent;
}
src = fullPath;
@@ -916,7 +939,7 @@ static bool processSources(
std::string usedSources;
for (std::string const& src : entrySources) {
if (uniqueSrcs.insert(src).second) {
- srcs.push_back(src);
+ srcs.emplace_back(src, entry->ge->GetBacktrace());
if (debugSources) {
usedSources += " * " + src + "\n";
}
@@ -924,7 +947,7 @@ static bool processSources(
}
if (!usedSources.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::LOG,
+ MessageType::LOG,
std::string("Used sources for target ") + tgt->GetName() + ":\n" +
usedSources,
entry->ge->GetBacktrace());
@@ -933,9 +956,10 @@ static bool processSources(
return contextDependent;
}
-void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files,
- const std::string& config) const
+std::vector<BT<std::string>> cmGeneratorTarget::GetSourceFilePaths(
+ std::string const& config) const
{
+ std::vector<BT<std::string>> files;
assert(this->GetType() != cmStateEnums::INTERFACE_LIBRARY);
if (!this->LocalGenerator->GetGlobalGenerator()->GetConfigureDoneCMP0026()) {
@@ -951,13 +975,13 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files,
cmSystemTools::ExpandListArgument(entry, items);
for (std::string const& item : items) {
if (cmHasLiteralPrefix(item, "$<TARGET_OBJECTS:") &&
- item[item.size() - 1] == '>') {
+ item.back() == '>') {
continue;
}
- files.push_back(item);
+ files.emplace_back(item);
}
}
- return;
+ return files;
}
std::vector<std::string> debugProperties;
@@ -1009,11 +1033,23 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files,
cmDeleteAll(linkInterfaceSourcesEntries);
cmDeleteAll(linkObjectsEntries);
+ return files;
}
void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*>& files,
const std::string& config) const
{
+ std::vector<BT<cmSourceFile*>> tmp = this->GetSourceFiles(config);
+ files.reserve(tmp.size());
+ for (BT<cmSourceFile*>& v : tmp) {
+ files.push_back(v.Value);
+ }
+}
+
+std::vector<BT<cmSourceFile*>> cmGeneratorTarget::GetSourceFiles(
+ std::string const& config) const
+{
+ std::vector<BT<cmSourceFile*>> files;
if (!this->GlobalGenerator->GetConfigureDoneCMP0026()) {
// Since we are still configuring not all sources may exist yet,
// so we need to avoid full source classification because that
@@ -1021,16 +1057,15 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*>& files,
// Since this is only for compatibility with old policies that
// projects should not depend on anymore, just compute the files
// without memoizing them.
- std::vector<std::string> srcs;
- this->GetSourceFiles(srcs, config);
+ std::vector<BT<std::string>> srcs = this->GetSourceFilePaths(config);
std::set<cmSourceFile*> emitted;
- for (std::string const& s : srcs) {
- cmSourceFile* sf = this->Makefile->GetOrCreateSource(s);
+ for (BT<std::string> const& s : srcs) {
+ cmSourceFile* sf = this->Makefile->GetOrCreateSource(s.Value);
if (emitted.insert(sf).second) {
- files.push_back(sf);
+ files.emplace_back(sf, s.Backtrace);
}
}
- return;
+ return files;
}
KindedSources const& kinded = this->GetKindedSources(config);
@@ -1038,18 +1073,33 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*>& files,
for (SourceAndKind const& si : kinded.Sources) {
files.push_back(si.Source);
}
+ return files;
}
void cmGeneratorTarget::GetSourceFilesWithoutObjectLibraries(
std::vector<cmSourceFile*>& files, const std::string& config) const
{
+ std::vector<BT<cmSourceFile*>> tmp =
+ this->GetSourceFilesWithoutObjectLibraries(config);
+ files.reserve(tmp.size());
+ for (BT<cmSourceFile*>& v : tmp) {
+ files.push_back(v.Value);
+ }
+}
+
+std::vector<BT<cmSourceFile*>>
+cmGeneratorTarget::GetSourceFilesWithoutObjectLibraries(
+ std::string const& config) const
+{
+ std::vector<BT<cmSourceFile*>> files;
KindedSources const& kinded = this->GetKindedSources(config);
files.reserve(kinded.Sources.size());
for (SourceAndKind const& si : kinded.Sources) {
- if (si.Source->GetObjectLibrary().empty()) {
+ if (si.Source.Value->GetObjectLibrary().empty()) {
files.push_back(si.Source);
}
}
+ return files;
}
cmGeneratorTarget::KindedSources const& cmGeneratorTarget::GetKindedSources(
@@ -1071,7 +1121,7 @@ cmGeneratorTarget::KindedSources const& cmGeneratorTarget::GetKindedSources(
<< "\" use a generator expression that depends on the "
"SOURCES themselves.";
this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
+ MessageType::FATAL_ERROR, e.str(), this->GetBacktrace());
static KindedSources empty;
return empty;
}
@@ -1089,16 +1139,15 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files,
std::string const& config) const
{
// Get the source file paths by string.
- std::vector<std::string> srcs;
- this->GetSourceFiles(srcs, config);
+ std::vector<BT<std::string>> srcs = this->GetSourceFilePaths(config);
cmsys::RegularExpression header_regex(CM_HEADER_REGEX);
std::vector<cmSourceFile*> badObjLib;
std::set<cmSourceFile*> emitted;
- for (std::string const& s : srcs) {
+ for (BT<std::string> const& s : srcs) {
// Create each source at most once.
- cmSourceFile* sf = this->Makefile->GetOrCreateSource(s);
+ cmSourceFile* sf = this->Makefile->GetOrCreateSource(s.Value);
if (!emitted.insert(sf).second) {
continue;
}
@@ -1161,7 +1210,7 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files,
}
// Save this classified source file in the result vector.
- files.Sources.push_back({ sf, kind });
+ files.Sources.push_back({ BT<cmSourceFile*>(sf, s.Backtrace), kind });
}
if (!badObjLib.empty()) {
@@ -1173,7 +1222,7 @@ void cmGeneratorTarget::ComputeKindedSources(KindedSources& files,
e << "but may contain only sources that compile, header files, and "
"other files that would not affect linking of a normal library.";
this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
+ MessageType::FATAL_ERROR, e.str(), this->GetBacktrace());
}
}
@@ -1197,14 +1246,14 @@ void cmGeneratorTarget::ComputeAllConfigSources() const
KindedSources const& sources = this->GetKindedSources(configs[ci]);
for (SourceAndKind const& src : sources.Sources) {
std::map<cmSourceFile const*, size_t>::iterator mi =
- index.find(src.Source);
+ index.find(src.Source.Value);
if (mi == index.end()) {
AllConfigSource acs;
- acs.Source = src.Source;
+ acs.Source = src.Source.Value;
acs.Kind = src.Kind;
this->AllConfigSources.push_back(std::move(acs));
std::map<cmSourceFile const*, size_t>::value_type entry(
- src.Source, this->AllConfigSources.size() - 1);
+ src.Source.Value, this->AllConfigSources.size() - 1);
mi = index.insert(entry).first;
}
this->AllConfigSources[mi->second].Configs.push_back(ci);
@@ -1331,7 +1380,7 @@ bool cmGeneratorTarget::NeedRelinkBeforeInstall(
/* clang-format on */
cmake* cm = this->LocalGenerator->GetCMakeInstance();
- cm->IssueMessage(cmake::FATAL_ERROR, w.str(), this->GetBacktrace());
+ cm->IssueMessage(MessageType::FATAL_ERROR, w.str(), this->GetBacktrace());
}
return have_rpath;
@@ -1462,7 +1511,7 @@ bool cmGeneratorTarget::HasMacOSXRpathInstallNameDir(
w << " less than 10.5 or because CMake's platform configuration is";
w << " corrupt.";
cmake* cm = this->LocalGenerator->GetCMakeInstance();
- cm->IssueMessage(cmake::FATAL_ERROR, w.str(), this->GetBacktrace());
+ cm->IssueMessage(MessageType::FATAL_ERROR, w.str(), this->GetBacktrace());
}
return true;
@@ -1710,17 +1759,11 @@ cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
return this->Target->GetBacktrace();
}
-const std::set<std::string>& cmGeneratorTarget::GetUtilities() const
+const std::set<BT<std::string>>& cmGeneratorTarget::GetUtilities() const
{
return this->Target->GetUtilities();
}
-const cmListFileBacktrace* cmGeneratorTarget::GetUtilityBacktrace(
- const std::string& u) const
-{
- return this->Target->GetUtilityBacktrace(u);
-}
-
bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
{
return this->GetType() == cmStateEnums::STATIC_LIBRARY ||
@@ -1730,7 +1773,7 @@ bool cmGeneratorTarget::HaveWellDefinedOutputFiles() const
this->GetType() == cmStateEnums::EXECUTABLE;
}
-const char* cmGeneratorTarget::GetExportMacro() const
+const std::string* cmGeneratorTarget::GetExportMacro() const
{
// Define the symbol for targets that export symbols.
if (this->GetType() == cmStateEnums::SHARED_LIBRARY ||
@@ -1743,7 +1786,7 @@ const char* cmGeneratorTarget::GetExportMacro() const
in += "_EXPORTS";
this->ExportMacro = cmSystemTools::MakeCidentifier(in);
}
- return this->ExportMacro.c_str();
+ return &this->ExportMacro;
}
return nullptr;
}
@@ -1752,10 +1795,10 @@ class cmTargetCollectLinkLanguages
{
public:
cmTargetCollectLinkLanguages(cmGeneratorTarget const* target,
- const std::string& config,
+ std::string config,
std::unordered_set<std::string>& languages,
cmGeneratorTarget const* head)
- : Config(config)
+ : Config(std::move(config))
, Languages(languages)
, HeadTarget(head)
, Target(target)
@@ -1768,13 +1811,13 @@ public:
if (!item.Target) {
if (item.AsStr().find("::") != std::string::npos) {
bool noMessage = false;
- cmake::MessageType messageType = cmake::FATAL_ERROR;
+ MessageType messageType = MessageType::FATAL_ERROR;
std::ostringstream e;
switch (this->Target->GetLocalGenerator()->GetPolicyStatus(
cmPolicies::CMP0028)) {
case cmPolicies::WARN: {
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0028) << "\n";
- messageType = cmake::AUTHOR_WARNING;
+ messageType = MessageType::AUTHOR_WARNING;
} break;
case cmPolicies::OLD:
noMessage = true;
@@ -1877,7 +1920,7 @@ public:
}
e << "Set the LINKER_LANGUAGE property for this target.";
cmake* cm = this->Target->GetLocalGenerator()->GetCMakeInstance();
- cm->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ cm->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Target->GetBacktrace());
}
return *this->Preferred.begin();
@@ -2002,7 +2045,7 @@ cmGeneratorTarget::CompileInfo const* cmGeneratorTarget::GetCompileInfo(
msg += this->GetName();
msg += " which has type ";
msg += cmState::GetTargetTypeName(this->GetType());
- this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
+ this->LocalGenerator->IssueMessage(MessageType::INTERNAL_ERROR, msg);
return nullptr;
}
@@ -2188,7 +2231,7 @@ cmTargetTraceDependencies::cmTargetTraceDependencies(cmGeneratorTarget* target)
<< "\"\ndepends on the sources of a target it is used in. This "
"is a dependency loop and is not allowed.";
this->GeneratorTarget->LocalGenerator->IssueMessage(
- cmake::FATAL_ERROR, e.str());
+ MessageType::FATAL_ERROR, e.str());
return;
}
if (emitted.insert(sf).second &&
@@ -2480,7 +2523,7 @@ std::string cmGeneratorTarget::GetCreateRuleVariable(
static void processIncludeDirectories(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& includes,
+ std::vector<BT<std::string>>& includes,
std::unordered_set<std::string>& uniqueIncludes,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugIncludes, const std::string& language)
@@ -2500,14 +2543,14 @@ static void processIncludeDirectories(
for (std::string& entryInclude : entryIncludes) {
if (fromImported && !cmSystemTools::FileExists(entryInclude)) {
std::ostringstream e;
- cmake::MessageType messageType = cmake::FATAL_ERROR;
+ MessageType messageType = MessageType::FATAL_ERROR;
if (checkCMP0027) {
switch (tgt->GetPolicyStatusCMP0027()) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0027) << "\n";
CM_FALLTHROUGH;
case cmPolicies::OLD:
- messageType = cmake::AUTHOR_WARNING;
+ messageType = MessageType::AUTHOR_WARNING;
break;
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
@@ -2533,7 +2576,7 @@ static void processIncludeDirectories(
if (!cmSystemTools::FileIsFullPath(entryInclude)) {
std::ostringstream e;
bool noMessage = false;
- cmake::MessageType messageType = cmake::FATAL_ERROR;
+ MessageType messageType = MessageType::FATAL_ERROR;
if (!targetName.empty()) {
/* clang-format off */
e << "Target \"" << targetName << "\" contains relative "
@@ -2544,7 +2587,7 @@ static void processIncludeDirectories(
switch (tgt->GetPolicyStatusCMP0021()) {
case cmPolicies::WARN: {
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0021) << "\n";
- messageType = cmake::AUTHOR_WARNING;
+ messageType = MessageType::AUTHOR_WARNING;
} break;
case cmPolicies::OLD:
noMessage = true;
@@ -2560,7 +2603,7 @@ static void processIncludeDirectories(
}
if (!noMessage) {
tgt->GetLocalGenerator()->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return;
}
}
@@ -2572,7 +2615,7 @@ static void processIncludeDirectories(
std::string inc = entryInclude;
if (uniqueIncludes.insert(inc).second) {
- includes.push_back(inc);
+ includes.emplace_back(inc, entry->ge->GetBacktrace());
if (debugIncludes) {
usedIncludes += " * " + inc + "\n";
}
@@ -2580,7 +2623,7 @@ static void processIncludeDirectories(
}
if (!usedIncludes.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::LOG,
+ MessageType::LOG,
std::string("Used includes for target ") + tgt->GetName() + ":\n" +
usedIncludes,
entry->ge->GetBacktrace());
@@ -2588,10 +2631,10 @@ static void processIncludeDirectories(
}
}
-std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
+std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
const std::string& config, const std::string& lang) const
{
- std::vector<std::string> includes;
+ std::vector<BT<std::string>> includes;
std::unordered_set<std::string> uniqueIncludes;
cmGeneratorExpressionDAGChecker dagChecker(this, "INCLUDE_DIRECTORIES",
@@ -2661,7 +2704,7 @@ enum class OptionsParse
static void processOptionsInternal(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& options,
+ std::vector<BT<std::string>>& options,
std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions, const char* logName, std::string const& language,
@@ -2678,9 +2721,13 @@ static void processOptionsInternal(
if (uniqueOptions.insert(opt).second) {
if (parse == OptionsParse::Shell &&
cmHasLiteralPrefix(opt, "SHELL:")) {
- cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, options);
+ std::vector<std::string> tmp;
+ cmSystemTools::ParseUnixCommandLine(opt.c_str() + 6, tmp);
+ for (std::string& o : tmp) {
+ options.emplace_back(std::move(o), entry->ge->GetBacktrace());
+ }
} else {
- options.push_back(opt);
+ options.emplace_back(opt, entry->ge->GetBacktrace());
}
if (debugOptions) {
usedOptions += " * " + opt + "\n";
@@ -2689,7 +2736,7 @@ static void processOptionsInternal(
}
if (!usedOptions.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::LOG,
+ MessageType::LOG,
std::string("Used ") + logName + std::string(" for target ") +
tgt->GetName() + ":\n" + usedOptions,
entry->ge->GetBacktrace());
@@ -2700,7 +2747,7 @@ static void processOptionsInternal(
static void processCompileOptions(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& options,
+ std::vector<BT<std::string>>& options,
std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions, std::string const& language)
@@ -2714,6 +2761,17 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const
{
+ std::vector<BT<std::string>> tmp = this->GetCompileOptions(config, language);
+ result.reserve(tmp.size());
+ for (BT<std::string>& v : tmp) {
+ result.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmGeneratorTarget::GetCompileOptions(
+ std::string const& config, std::string const& language) const
+{
+ std::vector<BT<std::string>> result;
std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_OPTIONS", nullptr,
@@ -2749,12 +2807,13 @@ void cmGeneratorTarget::GetCompileOptions(std::vector<std::string>& result,
language);
cmDeleteAll(linkInterfaceCompileOptionsEntries);
+ return result;
}
static void processCompileFeatures(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& options,
+ std::vector<BT<std::string>>& options,
std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions)
@@ -2767,6 +2826,17 @@ static void processCompileFeatures(
void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string>& result,
const std::string& config) const
{
+ std::vector<BT<std::string>> tmp = this->GetCompileFeatures(config);
+ result.reserve(tmp.size());
+ for (BT<std::string>& v : tmp) {
+ result.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmGeneratorTarget::GetCompileFeatures(
+ std::string const& config) const
+{
+ std::vector<BT<std::string>> result;
std::unordered_set<std::string> uniqueFeatures;
cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_FEATURES", nullptr,
@@ -2799,12 +2869,13 @@ void cmGeneratorTarget::GetCompileFeatures(std::vector<std::string>& result,
uniqueFeatures, &dagChecker, config, debugFeatures);
cmDeleteAll(linkInterfaceCompileFeaturesEntries);
+ return result;
}
static void processCompileDefinitions(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& options,
+ std::vector<BT<std::string>>& options,
std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions, std::string const& language)
@@ -2815,9 +2886,21 @@ static void processCompileDefinitions(
}
void cmGeneratorTarget::GetCompileDefinitions(
- std::vector<std::string>& list, const std::string& config,
+ std::vector<std::string>& result, const std::string& config,
const std::string& language) const
{
+ std::vector<BT<std::string>> tmp =
+ this->GetCompileDefinitions(config, language);
+ result.reserve(tmp.size());
+ for (BT<std::string>& v : tmp) {
+ result.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmGeneratorTarget::GetCompileDefinitions(
+ std::string const& config, std::string const& language) const
+{
+ std::vector<BT<std::string>> list;
std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(this, "COMPILE_DEFINITIONS",
@@ -2855,7 +2938,8 @@ void cmGeneratorTarget::GetCompileDefinitions(
case cmPolicies::WARN: {
std::ostringstream e;
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0043);
- this->LocalGenerator->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->LocalGenerator->IssueMessage(MessageType::AUTHOR_WARNING,
+ e.str());
CM_FALLTHROUGH;
}
case cmPolicies::OLD: {
@@ -2878,13 +2962,14 @@ void cmGeneratorTarget::GetCompileDefinitions(
language);
cmDeleteAll(linkInterfaceCompileDefinitionsEntries);
+ return list;
}
namespace {
void processLinkOptions(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& options,
+ std::vector<BT<std::string>>& options,
std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugOptions, std::string const& language)
@@ -2899,6 +2984,17 @@ void cmGeneratorTarget::GetLinkOptions(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const
{
+ std::vector<BT<std::string>> tmp = this->GetLinkOptions(config, language);
+ result.reserve(tmp.size());
+ for (BT<std::string>& v : tmp) {
+ result.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmGeneratorTarget::GetLinkOptions(
+ std::string const& config, std::string const& language) const
+{
+ std::vector<BT<std::string>> result;
std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_OPTIONS", nullptr,
@@ -2952,21 +3048,24 @@ void cmGeneratorTarget::GetLinkOptions(std::vector<std::string>& result,
const std::string SHELL{ "SHELL:" };
const std::string LINKER_SHELL = LINKER + SHELL;
- std::vector<std::string>::iterator entry;
+ std::vector<BT<std::string>>::iterator entry;
while ((entry = std::find_if(result.begin(), result.end(),
- [&LINKER](const std::string& item) -> bool {
- return item.compare(0, LINKER.length(),
- LINKER) == 0;
+ [&LINKER](BT<std::string> const& item) -> bool {
+ return item.Value.compare(0, LINKER.length(),
+ LINKER) == 0;
})) != result.end()) {
+ std::string value = std::move(entry->Value);
+ cmListFileBacktrace bt = std::move(entry->Backtrace);
+ entry = result.erase(entry);
+
std::vector<std::string> linkerOptions;
- if (entry->compare(0, LINKER_SHELL.length(), LINKER_SHELL) == 0) {
+ if (value.compare(0, LINKER_SHELL.length(), LINKER_SHELL) == 0) {
cmSystemTools::ParseUnixCommandLine(
- entry->c_str() + LINKER_SHELL.length(), linkerOptions);
+ value.c_str() + LINKER_SHELL.length(), linkerOptions);
} else {
linkerOptions =
- cmSystemTools::tokenize(entry->substr(LINKER.length()), ",");
+ cmSystemTools::tokenize(value.substr(LINKER.length()), ",");
}
- entry = result.erase(entry);
if (linkerOptions.empty() ||
(linkerOptions.size() == 1 && linkerOptions.front().empty())) {
@@ -2979,59 +3078,67 @@ void cmGeneratorTarget::GetLinkOptions(std::vector<std::string>& result,
return item.find(SHELL) != std::string::npos;
}) != linkerOptions.end()) {
this->LocalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"'SHELL:' prefix is not supported as part of 'LINKER:' arguments.",
this->GetBacktrace());
- return;
+ return result;
}
+ std::vector<BT<std::string>> options;
if (wrapperFlag.empty()) {
// nothing specified, insert elements as is
- result.insert(entry, linkerOptions.begin(), linkerOptions.end());
+ options.reserve(linkerOptions.size());
+ for (std::string& o : linkerOptions) {
+ options.emplace_back(std::move(o), bt);
+ }
} else {
- std::vector<std::string> options;
-
if (!wrapperSep.empty()) {
if (concatFlagAndArgs) {
// insert flag elements except last one
- options.insert(options.end(), wrapperFlag.begin(),
- wrapperFlag.end() - 1);
+ for (auto i = wrapperFlag.begin(); i != wrapperFlag.end() - 1; ++i) {
+ options.emplace_back(*i, bt);
+ }
// concatenate last flag element and all LINKER list values
// in one option
- options.push_back(wrapperFlag.back() +
- cmJoin(linkerOptions, wrapperSep));
+ options.emplace_back(
+ wrapperFlag.back() + cmJoin(linkerOptions, wrapperSep), bt);
} else {
- options.insert(options.end(), wrapperFlag.begin(),
- wrapperFlag.end());
+ for (std::string const& i : wrapperFlag) {
+ options.emplace_back(i, bt);
+ }
// concatenate all LINKER list values in one option
- options.push_back(cmJoin(linkerOptions, wrapperSep));
+ options.emplace_back(cmJoin(linkerOptions, wrapperSep), bt);
}
} else {
// prefix each element of LINKER list with wrapper
if (concatFlagAndArgs) {
- std::transform(
- linkerOptions.begin(), linkerOptions.end(), linkerOptions.begin(),
- [&wrapperFlag](const std::string& value) -> std::string {
- return wrapperFlag.back() + value;
- });
+ std::transform(linkerOptions.begin(), linkerOptions.end(),
+ linkerOptions.begin(),
+ [&wrapperFlag](std::string const& o) -> std::string {
+ return wrapperFlag.back() + o;
+ });
}
- for (const auto& value : linkerOptions) {
- options.insert(options.end(), wrapperFlag.begin(),
- concatFlagAndArgs ? wrapperFlag.end() - 1
- : wrapperFlag.end());
- options.push_back(value);
+ for (std::string& o : linkerOptions) {
+ for (auto i = wrapperFlag.begin(),
+ e = concatFlagAndArgs ? wrapperFlag.end() - 1
+ : wrapperFlag.end();
+ i != e; ++i) {
+ options.emplace_back(*i, bt);
+ }
+ options.emplace_back(std::move(o), bt);
}
}
- result.insert(entry, options.begin(), options.end());
}
+ result.insert(entry, options.begin(), options.end());
}
+ return result;
}
namespace {
void processStaticLibraryLinkOptions(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& options,
+ std::vector<BT<std::string>>& options,
std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
std::string const& language)
@@ -3046,6 +3153,18 @@ void cmGeneratorTarget::GetStaticLibraryLinkOptions(
std::vector<std::string>& result, const std::string& config,
const std::string& language) const
{
+ std::vector<BT<std::string>> tmp =
+ this->GetStaticLibraryLinkOptions(config, language);
+ result.reserve(tmp.size());
+ for (BT<std::string>& v : tmp) {
+ result.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmGeneratorTarget::GetStaticLibraryLinkOptions(
+ std::string const& config, std::string const& language) const
+{
+ std::vector<BT<std::string>> result;
std::vector<cmGeneratorTarget::TargetPropertyEntry*> entries;
std::unordered_set<std::string> uniqueOptions;
@@ -3066,13 +3185,14 @@ void cmGeneratorTarget::GetStaticLibraryLinkOptions(
&dagChecker, config, language);
cmDeleteAll(entries);
+ return result;
}
namespace {
void processLinkDirectories(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& directories,
+ std::vector<BT<std::string>>& directories,
std::unordered_set<std::string>& uniqueDirectories,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
bool debugDirectories, std::string const& language)
@@ -3092,7 +3212,7 @@ void processLinkDirectories(
if (!cmSystemTools::FileIsFullPath(entryDirectory)) {
std::ostringstream e;
bool noMessage = false;
- cmake::MessageType messageType = cmake::FATAL_ERROR;
+ MessageType messageType = MessageType::FATAL_ERROR;
if (!targetName.empty()) {
/* clang-format off */
e << "Target \"" << targetName << "\" contains relative "
@@ -3103,7 +3223,7 @@ void processLinkDirectories(
switch (tgt->GetPolicyStatusCMP0081()) {
case cmPolicies::WARN: {
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0081) << "\n";
- messageType = cmake::AUTHOR_WARNING;
+ messageType = MessageType::AUTHOR_WARNING;
} break;
case cmPolicies::OLD:
noMessage = true;
@@ -3120,7 +3240,7 @@ void processLinkDirectories(
}
if (!noMessage) {
tgt->GetLocalGenerator()->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return;
}
}
@@ -3130,7 +3250,7 @@ void processLinkDirectories(
// in case projects set the LINK_DIRECTORIES property directly.
cmSystemTools::ConvertToUnixSlashes(entryDirectory);
if (uniqueDirectories.insert(entryDirectory).second) {
- directories.push_back(entryDirectory);
+ directories.emplace_back(entryDirectory);
if (debugDirectories) {
usedDirectories += " * " + entryDirectory + "\n";
}
@@ -3138,7 +3258,7 @@ void processLinkDirectories(
}
if (!usedDirectories.empty()) {
tgt->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::LOG,
+ MessageType::LOG,
std::string("Used link directories for target ") + tgt->GetName() +
":\n" + usedDirectories,
entry->ge->GetBacktrace());
@@ -3151,6 +3271,18 @@ void cmGeneratorTarget::GetLinkDirectories(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const
{
+ std::vector<BT<std::string>> tmp =
+ this->GetLinkDirectories(config, language);
+ result.reserve(tmp.size());
+ for (BT<std::string>& v : tmp) {
+ result.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDirectories(
+ std::string const& config, std::string const& language) const
+{
+ std::vector<BT<std::string>> result;
std::unordered_set<std::string> uniqueDirectories;
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DIRECTORIES", nullptr,
@@ -3186,13 +3318,14 @@ void cmGeneratorTarget::GetLinkDirectories(std::vector<std::string>& result,
debugDirectories, language);
cmDeleteAll(linkInterfaceLinkDirectoriesEntries);
+ return result;
}
namespace {
void processLinkDepends(
cmGeneratorTarget const* tgt,
const std::vector<cmGeneratorTarget::TargetPropertyEntry*>& entries,
- std::vector<std::string>& options,
+ std::vector<BT<std::string>>& options,
std::unordered_set<std::string>& uniqueOptions,
cmGeneratorExpressionDAGChecker* dagChecker, const std::string& config,
std::string const& language)
@@ -3207,6 +3340,17 @@ void cmGeneratorTarget::GetLinkDepends(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const
{
+ std::vector<BT<std::string>> tmp = this->GetLinkDepends(config, language);
+ result.reserve(tmp.size());
+ for (BT<std::string>& v : tmp) {
+ result.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmGeneratorTarget::GetLinkDepends(
+ std::string const& config, std::string const& language) const
+{
+ std::vector<BT<std::string>> result;
std::vector<cmGeneratorTarget::TargetPropertyEntry*> linkDependsEntries;
std::unordered_set<std::string> uniqueOptions;
cmGeneratorExpressionDAGChecker dagChecker(this, "LINK_DEPENDS", nullptr,
@@ -3228,6 +3372,7 @@ void cmGeneratorTarget::GetLinkDepends(std::vector<std::string>& result,
&dagChecker, config, language);
cmDeleteAll(linkDependsEntries);
+ return result;
}
void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const
@@ -3293,10 +3438,9 @@ void cmGeneratorTarget::ComputeTargetManifest(const std::string& config) const
bool cmGeneratorTarget::ComputeCompileFeatures(std::string const& config) const
{
- std::vector<std::string> features;
- this->GetCompileFeatures(features, config);
- for (std::string const& f : features) {
- if (!this->Makefile->AddRequiredTargetFeature(this->Target, f)) {
+ std::vector<BT<std::string>> features = this->GetCompileFeatures(config);
+ for (BT<std::string> const& f : features) {
+ if (!this->Makefile->AddRequiredTargetFeature(this->Target, f.Value)) {
return false;
}
}
@@ -3360,7 +3504,7 @@ std::string cmGeneratorTarget::NormalGetRealName(
if (this->IsImported()) {
std::string msg = "NormalGetRealName called on imported target: ";
msg += this->GetName();
- this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
+ this->LocalGenerator->IssueMessage(MessageType::INTERNAL_ERROR, msg);
}
if (this->GetType() == cmStateEnums::EXECUTABLE) {
@@ -3394,7 +3538,7 @@ void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
if (this->IsImported()) {
std::string msg = "GetLibraryNames called on imported target: ";
msg += this->GetName();
- this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
+ this->LocalGenerator->IssueMessage(MessageType::INTERNAL_ERROR, msg);
return;
}
@@ -3471,7 +3615,7 @@ void cmGeneratorTarget::GetExecutableNames(std::string& name,
if (this->IsImported()) {
std::string msg = "GetExecutableNames called on imported target: ";
msg += this->GetName();
- this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
+ this->LocalGenerator->IssueMessage(MessageType::INTERNAL_ERROR, msg);
}
// This versioning is supported only for executables and then only
@@ -3684,7 +3828,7 @@ std::string cmGeneratorTarget::GetPDBName(const std::string& config) const
}
// PDB_NAME
- props.push_back("PDB_NAME");
+ props.emplace_back("PDB_NAME");
for (std::string const& p : props) {
if (const char* outName = this->GetProperty(p)) {
@@ -3704,6 +3848,13 @@ std::string cmGeneratorTarget::GetObjectDirectory(
// find and replace $(PROJECT_NAME) xcode placeholder
const std::string projectName = this->LocalGenerator->GetProjectName();
cmSystemTools::ReplaceString(obj_dir, "$(PROJECT_NAME)", projectName);
+ // Replace Xcode's placeholder for the object file directory since
+ // installation and export scripts need to know the real directory.
+ // Xcode has build-time settings (e.g. for sanitizers) that affect this,
+ // but we use the default here. Users that want to enable sanitizers
+ // will do so at the cost of object library installation and export.
+ cmSystemTools::ReplaceString(obj_dir, "$(OBJECT_FILE_DIR_normal:base)",
+ "Objects-normal");
#endif
return obj_dir;
}
@@ -3972,7 +4123,8 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender,
"This is not allowed. Only user-defined properties may appear "
"listed in the "
<< propName << " property.";
- depender->GetLocalGenerator()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ depender->GetLocalGenerator()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str());
return;
}
if (emitted.insert(p).second) {
@@ -4112,10 +4264,33 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
"in a boolean interpretation, a numeric minimum, a numeric maximum "
"or a "
"string interpretation, but not a mixture.";
- this->LocalGenerator->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->LocalGenerator->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
}
+template <typename PropertyType>
+std::string valueAsString(PropertyType);
+template <>
+std::string valueAsString<bool>(bool value)
+{
+ return value ? "TRUE" : "FALSE";
+}
+template <>
+std::string valueAsString<const char*>(const char* value)
+{
+ return value ? value : "(unset)";
+}
+template <>
+std::string valueAsString<std::string>(std::string value)
+{
+ return value;
+}
+template <>
+std::string valueAsString<std::nullptr_t>(std::nullptr_t /*unused*/)
+{
+ return "(unset)";
+}
+
std::string compatibilityType(CompatibleType t)
{
switch (t) {
@@ -4147,34 +4322,49 @@ std::string compatibilityAgree(CompatibleType t, bool dominant)
}
template <typename PropertyType>
-PropertyType getTypedProperty(cmGeneratorTarget const* tgt,
- const std::string& prop);
+PropertyType getTypedProperty(
+ cmGeneratorTarget const* tgt, const std::string& prop,
+ cmGeneratorExpressionInterpreter* genexInterpreter = nullptr);
template <>
bool getTypedProperty<bool>(cmGeneratorTarget const* tgt,
- const std::string& prop)
+ const std::string& prop,
+ cmGeneratorExpressionInterpreter* genexInterpreter)
{
- return tgt->GetPropertyAsBool(prop);
-}
+ if (genexInterpreter == nullptr) {
+ return tgt->GetPropertyAsBool(prop);
+ }
-template <>
-const char* getTypedProperty<const char*>(cmGeneratorTarget const* tgt,
- const std::string& prop)
-{
- return tgt->GetProperty(prop);
+ const char* value = tgt->GetProperty(prop);
+ return cmSystemTools::IsOn(genexInterpreter->Evaluate(value, prop));
}
-template <typename PropertyType>
-std::string valueAsString(PropertyType);
template <>
-std::string valueAsString<bool>(bool value)
+const char* getTypedProperty<const char*>(
+ cmGeneratorTarget const* tgt, const std::string& prop,
+ cmGeneratorExpressionInterpreter* genexInterpreter)
{
- return value ? "TRUE" : "FALSE";
+ const char* value = tgt->GetProperty(prop);
+
+ if (genexInterpreter == nullptr) {
+ return value;
+ }
+
+ return genexInterpreter->Evaluate(value, prop).c_str();
}
+
template <>
-std::string valueAsString<const char*>(const char* value)
+std::string getTypedProperty<std::string>(
+ cmGeneratorTarget const* tgt, const std::string& prop,
+ cmGeneratorExpressionInterpreter* genexInterpreter)
{
- return value ? value : "(unset)";
+ const char* value = tgt->GetProperty(prop);
+
+ if (genexInterpreter == nullptr) {
+ return valueAsString(value);
+ }
+
+ return genexInterpreter->Evaluate(value, prop);
}
template <typename PropertyType>
@@ -4189,6 +4379,11 @@ const char* impliedValue<const char*>(const char* /*unused*/)
{
return "";
}
+template <>
+std::string impliedValue<std::string>(std::string /*unused*/) // NOLINT(*)
+{
+ return std::string();
+}
template <typename PropertyType>
std::pair<bool, PropertyType> consistentProperty(PropertyType lhs,
@@ -4209,6 +4404,13 @@ std::pair<bool, const char*> consistentStringProperty(const char* lhs,
return std::make_pair(b, b ? lhs : nullptr);
}
+std::pair<bool, std::string> consistentStringProperty(const std::string& lhs,
+ const std::string& rhs)
+{
+ const bool b = lhs == rhs;
+ return std::make_pair(b, b ? lhs : valueAsString(nullptr));
+}
+
std::pair<bool, const char*> consistentNumberProperty(const char* lhs,
const char* rhs,
CompatibleType t)
@@ -4251,9 +4453,10 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
const char* const null_ptr = nullptr;
switch (t) {
- case BoolType:
- assert(false && "consistentProperty for strings called with BoolType");
- return std::pair<bool, const char*>(false, null_ptr);
+ case BoolType: {
+ bool same = cmSystemTools::IsOn(lhs) == cmSystemTools::IsOn(rhs);
+ return std::make_pair(same, same ? lhs : nullptr);
+ }
case StringType:
return consistentStringProperty(lhs, rhs);
case NumberMinType:
@@ -4264,6 +4467,40 @@ std::pair<bool, const char*> consistentProperty(const char* lhs,
return std::pair<bool, const char*>(false, null_ptr);
}
+std::pair<bool, std::string> consistentProperty(const std::string& lhs,
+ const std::string& rhs,
+ CompatibleType t)
+{
+ const std::string null_ptr = valueAsString(nullptr);
+
+ if (lhs == null_ptr && rhs == null_ptr) {
+ return std::make_pair(true, lhs);
+ }
+ if (lhs == null_ptr) {
+ return std::make_pair(true, rhs);
+ }
+ if (rhs == null_ptr) {
+ return std::make_pair(true, lhs);
+ }
+
+ switch (t) {
+ case BoolType: {
+ bool same = cmSystemTools::IsOn(lhs) == cmSystemTools::IsOn(rhs);
+ return std::make_pair(same, same ? lhs : null_ptr);
+ }
+ case StringType:
+ return consistentStringProperty(lhs, rhs);
+ case NumberMinType:
+ case NumberMaxType: {
+ auto value = consistentNumberProperty(lhs.c_str(), rhs.c_str(), t);
+ return std::make_pair(
+ value.first, value.first ? std::string(value.second) : null_ptr);
+ }
+ }
+ assert(false && "Unreachable!");
+ return std::pair<bool, std::string>(false, null_ptr);
+}
+
template <typename PropertyType>
PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
const std::string& p,
@@ -4273,6 +4510,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
PropertyType* /*unused*/)
{
PropertyType propContent = getTypedProperty<PropertyType>(tgt, p);
+
std::vector<std::string> headPropKeys = tgt->GetPropertyKeys();
const bool explicitlySet =
std::find(headPropKeys.begin(), headPropKeys.end(), p) !=
@@ -4302,6 +4540,11 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
}
std::string interfaceProperty = "INTERFACE_" + p;
+ std::unique_ptr<cmGeneratorExpressionInterpreter> genexInterpreter(
+ p == "POSITION_INDEPENDENT_CODE" ? new cmGeneratorExpressionInterpreter(
+ tgt->GetLocalGenerator(), config, tgt)
+ : nullptr);
+
for (cmGeneratorTarget const* theTarget : deps) {
// An error should be reported if one dependency
// has INTERFACE_POSITION_INDEPENDENT_CODE ON and the other
@@ -4313,8 +4556,8 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
const bool ifaceIsSet = std::find(propKeys.begin(), propKeys.end(),
interfaceProperty) != propKeys.end();
- PropertyType ifacePropContent =
- getTypedProperty<PropertyType>(theTarget, interfaceProperty);
+ PropertyType ifacePropContent = getTypedProperty<PropertyType>(
+ theTarget, interfaceProperty, genexInterpreter.get());
std::string reportEntry;
if (ifaceIsSet) {
@@ -4340,7 +4583,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
<< " property requirement\nof "
"dependency \""
<< theTarget->GetName() << "\".\n";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
break;
}
propContent = consistent.second;
@@ -4365,7 +4608,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
"already. The INTERFACE_"
<< p << " property on\ndependency \"" << theTarget->GetName()
<< "\" is in conflict.\n";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
break;
}
propContent = consistent.second;
@@ -4385,7 +4628,7 @@ PropertyType checkInterfacePropertyCompatibility(cmGeneratorTarget const* tgt,
e << "The INTERFACE_" << p << " property of \""
<< theTarget->GetName() << "\" does\nnot agree with the value of "
<< p << " already determined\nfor \"" << tgt->GetName() << "\".\n";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
break;
}
propContent = consistent.second;
@@ -4412,6 +4655,13 @@ bool cmGeneratorTarget::GetLinkInterfaceDependentBoolProperty(
BoolType, nullptr);
}
+std::string cmGeneratorTarget::GetLinkInterfaceDependentStringAsBoolProperty(
+ const std::string& p, const std::string& config) const
+{
+ return checkInterfacePropertyCompatibility<std::string>(
+ this, p, config, "FALSE", BoolType, nullptr);
+}
+
const char* cmGeneratorTarget::GetLinkInterfaceDependentStringProperty(
const std::string& p, const std::string& config) const
{
@@ -4614,10 +4864,12 @@ void cmGeneratorTarget::ReportPropertyOrigin(
areport += result;
areport += "\"):\n" + report;
- this->LocalGenerator->GetCMakeInstance()->IssueMessage(cmake::LOG, areport);
+ this->LocalGenerator->GetCMakeInstance()->IssueMessage(MessageType::LOG,
+ areport);
}
void cmGeneratorTarget::LookupLinkItems(std::vector<std::string> const& names,
+ cmListFileBacktrace const& bt,
std::vector<cmLinkItem>& items) const
{
for (std::string const& n : names) {
@@ -4625,7 +4877,7 @@ void cmGeneratorTarget::LookupLinkItems(std::vector<std::string> const& names,
if (name == this->GetName() || name.empty()) {
continue;
}
- items.push_back(this->ResolveLinkItem(name));
+ items.push_back(this->ResolveLinkItem(name, bt));
}
}
@@ -4647,7 +4899,7 @@ void cmGeneratorTarget::ExpandLinkItems(
false, headTarget, this,
&dagChecker),
libs);
- this->LookupLinkItems(libs, items);
+ this->LookupLinkItems(libs, cge->GetBacktrace(), items);
hadHeadSensitiveCondition = cge->GetHadHeadSensitiveCondition();
}
@@ -4842,7 +5094,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
msg += this->GetName();
msg += " which has type ";
msg += cmState::GetTargetTypeName(this->GetType());
- this->LocalGenerator->IssueMessage(cmake::INTERNAL_ERROR, msg);
+ this->LocalGenerator->IssueMessage(MessageType::INTERNAL_ERROR, msg);
return nullptr;
}
@@ -4873,7 +5125,7 @@ cmGeneratorTarget::OutputInfo const* cmGeneratorTarget::GetOutputInfo(
// An empty map entry indicates we have been called recursively
// from the above block.
this->LocalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"Target '" + this->GetName() + "' OUTPUT_DIRECTORY depends on itself.",
this->GetBacktrace());
return nullptr;
@@ -5093,7 +5345,7 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
linkIfaceProp << ":\n"
" " << explicitLibraries << "\n";
/* clang-format on */
- this->LocalGenerator->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->LocalGenerator->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
this->PolicyWarnedCMP0022 = true;
}
}
@@ -5162,7 +5414,8 @@ void cmGeneratorTarget::ComputeLinkInterfaceLibraries(
"Link implementation:\n"
" " << oldLibraries << "\n";
/* clang-format on */
- this->LocalGenerator->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->LocalGenerator->IssueMessage(MessageType::AUTHOR_WARNING,
+ w.str());
this->PolicyWarnedCMP0022 = true;
}
}
@@ -5200,7 +5453,7 @@ const cmLinkInterface* cmGeneratorTarget::GetImportLinkInterface(
iface.HadHeadSensitiveCondition);
std::vector<std::string> deps;
cmSystemTools::ExpandListArgument(info->SharedDeps, deps);
- this->LookupLinkItems(deps, iface.SharedDeps);
+ this->LookupLinkItems(deps, cmListFileBacktrace(), iface.SharedDeps);
}
return &iface;
@@ -5470,7 +5723,7 @@ bool cmGeneratorTarget::GetConfigCommonSourceFiles(
"Config \"" << *it << "\":\n"
" " << thisConfigFiles << "\n";
/* clang-format on */
- this->LocalGenerator->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->LocalGenerator->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
}
@@ -5490,8 +5743,7 @@ void cmGeneratorTarget::GetObjectLibrariesCMP0026(
std::vector<std::string> files;
cmSystemTools::ExpandListArgument(entry, files);
for (std::string const& li : files) {
- if (cmHasLiteralPrefix(li, "$<TARGET_OBJECTS:") &&
- li[li.size() - 1] == '>') {
+ if (cmHasLiteralPrefix(li, "$<TARGET_OBJECTS:") && li.back() == '>') {
std::string objLibName = li.substr(17, li.size() - 18);
if (cmGeneratorExpression::Find(objLibName) != std::string::npos) {
@@ -5529,7 +5781,8 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0004) << "\n"
<< "Target \"" << this->GetName() << "\" links to item \"" << item
<< "\" which has leading or trailing whitespace.";
- cm->IssueMessage(cmake::AUTHOR_WARNING, w.str(), this->GetBacktrace());
+ cm->IssueMessage(MessageType::AUTHOR_WARNING, w.str(),
+ this->GetBacktrace());
}
case cmPolicies::OLD:
break;
@@ -5538,7 +5791,8 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
e << "Target \"" << this->GetName() << "\" links to item \"" << item
<< "\" which has leading or trailing whitespace. "
<< "This is now an error according to policy CMP0004.";
- cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
+ cm->IssueMessage(MessageType::FATAL_ERROR, e.str(),
+ this->GetBacktrace());
} break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS: {
@@ -5546,7 +5800,8 @@ std::string cmGeneratorTarget::CheckCMP0004(std::string const& item) const
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0004) << "\n"
<< "Target \"" << this->GetName() << "\" links to item \"" << item
<< "\" which has leading or trailing whitespace.";
- cm->IssueMessage(cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
+ cm->IssueMessage(MessageType::FATAL_ERROR, e.str(),
+ this->GetBacktrace());
} break;
}
}
@@ -5710,12 +5965,12 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
if (name == this->GetName() || name.empty()) {
if (name == this->GetName()) {
bool noMessage = false;
- cmake::MessageType messageType = cmake::FATAL_ERROR;
+ MessageType messageType = MessageType::FATAL_ERROR;
std::ostringstream e;
switch (this->GetPolicyStatusCMP0038()) {
case cmPolicies::WARN: {
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0038) << "\n";
- messageType = cmake::AUTHOR_WARNING;
+ messageType = MessageType::AUTHOR_WARNING;
} break;
case cmPolicies::OLD:
noMessage = true;
@@ -5730,7 +5985,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
e << "Target \"" << this->GetName() << "\" links to itself.";
this->LocalGenerator->GetCMakeInstance()->IssueMessage(
messageType, e.str(), this->GetBacktrace());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return;
}
}
@@ -5739,7 +5994,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
}
// The entry is meant for this configuration.
- impl.Libraries.emplace_back(this->ResolveLinkItem(name), *btIt,
+ impl.Libraries.emplace_back(this->ResolveLinkItem(name, *btIt),
evaluated != *le);
}
@@ -5767,7 +6022,8 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
continue;
}
// Support OLD behavior for CMP0003.
- impl.WrongConfigLibraries.push_back(this->ResolveLinkItem(name));
+ impl.WrongConfigLibraries.push_back(
+ this->ResolveLinkItem(name, cmListFileBacktrace()));
}
}
}
@@ -5814,12 +6070,13 @@ cmGeneratorTarget::TargetOrString cmGeneratorTarget::ResolveTargetReference(
return resolved;
}
-cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name) const
+cmLinkItem cmGeneratorTarget::ResolveLinkItem(
+ std::string const& name, cmListFileBacktrace const& bt) const
{
TargetOrString resolved = this->ResolveTargetReference(name);
if (!resolved.Target) {
- return cmLinkItem(resolved.String);
+ return cmLinkItem(resolved.String, bt);
}
// Skip targets that will not really be linked. This is probably a
@@ -5827,10 +6084,10 @@ cmLinkItem cmGeneratorTarget::ResolveLinkItem(std::string const& name) const
// within the project.
if (resolved.Target->GetType() == cmStateEnums::EXECUTABLE &&
!resolved.Target->IsExecutableWithExports()) {
- return cmLinkItem(resolved.Target->GetName());
+ return cmLinkItem(resolved.Target->GetName(), bt);
}
- return cmLinkItem(resolved.Target);
+ return cmLinkItem(resolved.Target, bt);
}
std::string cmGeneratorTarget::GetPDBDirectory(const std::string& config) const
@@ -5880,7 +6137,7 @@ bool cmGeneratorTarget::HasImportLibrary(std::string const& config) const
std::string cmGeneratorTarget::GetSupportDirectory() const
{
std::string dir = this->LocalGenerator->GetCurrentBinaryDirectory();
- dir += cmake::GetCMakeFilesDirectory();
+ dir += "/CMakeFiles";
dir += "/";
dir += this->GetName();
#if defined(__VMS)
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 5ed8e5ace..59d38afd7 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -27,12 +27,13 @@ class cmTarget;
class cmGeneratorTarget
{
- CM_DISABLE_COPY(cmGeneratorTarget)
-
public:
cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg);
~cmGeneratorTarget();
+ cmGeneratorTarget(cmGeneratorTarget const&) = delete;
+ cmGeneratorTarget& operator=(cmGeneratorTarget const&) = delete;
+
cmLocalGenerator* GetLocalGenerator() const;
cmGlobalGenerator* GetGlobalGenerator() const;
@@ -75,8 +76,8 @@ public:
bool GetPropertyAsBool(const std::string& prop) const;
void GetSourceFiles(std::vector<cmSourceFile*>& files,
const std::string& config) const;
- void GetSourceFilesWithoutObjectLibraries(std::vector<cmSourceFile*>& files,
- const std::string& config) const;
+ std::vector<BT<cmSourceFile*>> GetSourceFiles(
+ std::string const& config) const;
/** Source file kinds (classifications).
Generators use this to decide how to treat a source file. */
@@ -99,7 +100,7 @@ public:
/** A source file paired with a kind (classification). */
struct SourceAndKind
{
- cmSourceFile* Source;
+ BT<cmSourceFile*> Source;
SourceKind Kind;
};
@@ -110,11 +111,7 @@ public:
std::set<std::string> ExpectedResxHeaders;
std::set<std::string> ExpectedXamlHeaders;
std::set<std::string> ExpectedXamlSources;
- bool Initialized;
- KindedSources()
- : Initialized(false)
- {
- }
+ bool Initialized = false;
};
/** Get all sources needed for a configuration with kinds assigned. */
@@ -173,6 +170,8 @@ public:
const char* GetFeature(const std::string& feature,
const std::string& config) const;
+ const char* GetLinkPIEProperty(const std::string& config) const;
+
bool IsIPOEnabled(std::string const& lang, std::string const& config) const;
bool IsLinkInterfaceDependentBoolProperty(const std::string& p,
@@ -273,8 +272,7 @@ public:
cmListFileBacktrace GetBacktrace() const;
- std::set<std::string> const& GetUtilities() const;
- cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
+ std::set<BT<std::string>> const& GetUtilities() const;
bool LinkLanguagePropagatesToDependents() const
{
@@ -283,7 +281,7 @@ public:
/** Get the macro to define when building sources in this target.
If no macro should be defined null is returned. */
- const char* GetExportMacro() const;
+ const std::string* GetExportMacro() const;
/** Get the soname of the target. Allowed only for a shared library. */
std::string GetSOName(const std::string& config) const;
@@ -362,7 +360,8 @@ public:
};
TargetOrString ResolveTargetReference(std::string const& name) const;
- cmLinkItem ResolveLinkItem(std::string const& name) const;
+ cmLinkItem ResolveLinkItem(std::string const& name,
+ cmListFileBacktrace const& bt) const;
// Compute the set of languages compiled by the target. This is
// computed every time it is called because the languages can change
@@ -408,34 +407,49 @@ public:
std::string const& config) const;
/** Get the include directories for this target. */
- std::vector<std::string> GetIncludeDirectories(
+ std::vector<BT<std::string>> GetIncludeDirectories(
const std::string& config, const std::string& lang) const;
void GetCompileOptions(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const;
+ std::vector<BT<std::string>> GetCompileOptions(
+ std::string const& config, std::string const& language) const;
void GetCompileFeatures(std::vector<std::string>& features,
const std::string& config) const;
+ std::vector<BT<std::string>> GetCompileFeatures(
+ std::string const& config) const;
void GetCompileDefinitions(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const;
+ std::vector<BT<std::string>> GetCompileDefinitions(
+ std::string const& config, std::string const& language) const;
void GetLinkOptions(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const;
+ std::vector<BT<std::string>> GetLinkOptions(
+ std::string const& config, std::string const& language) const;
+
void GetStaticLibraryLinkOptions(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const;
+ std::vector<BT<std::string>> GetStaticLibraryLinkOptions(
+ std::string const& config, std::string const& language) const;
void GetLinkDirectories(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const;
+ std::vector<BT<std::string>> GetLinkDirectories(
+ std::string const& config, std::string const& language) const;
void GetLinkDepends(std::vector<std::string>& result,
const std::string& config,
const std::string& language) const;
+ std::vector<BT<std::string>> GetLinkDepends(
+ std::string const& config, std::string const& language) const;
bool IsSystemIncludeDirectory(const std::string& dir,
const std::string& config,
@@ -522,7 +536,7 @@ public:
*/
void ClearSourcesCache();
- void AddSource(const std::string& src);
+ void AddSource(const std::string& src, bool before = false);
void AddTracedSources(std::vector<std::string> const& srcs);
/**
@@ -548,13 +562,8 @@ public:
};
struct SourceFileFlags
{
- SourceFileFlags()
- : Type(SourceFileTypeNormal)
- , MacFolder(nullptr)
- {
- }
- SourceFileType Type;
- const char* MacFolder; // location inside Mac content folders
+ SourceFileType Type = SourceFileTypeNormal;
+ const char* MacFolder = nullptr; // location inside Mac content folders
};
void GetAutoUicOptions(std::vector<std::string>& result,
const std::string& config) const;
@@ -684,7 +693,7 @@ public:
const char* GetSourcesProperty() const;
private:
- void AddSourceCommon(const std::string& src);
+ void AddSourceCommon(const std::string& src, bool before = false);
std::string CreateFortranModuleDirectory(
std::string const& working_dir) const;
@@ -740,11 +749,7 @@ private:
struct CompatibleInterfaces : public CompatibleInterfacesBase
{
- CompatibleInterfaces()
- : Done(false)
- {
- }
- bool Done;
+ bool Done = false;
};
mutable std::map<std::string, CompatibleInterfaces> CompatibleInterfacesMap;
@@ -757,11 +762,7 @@ private:
struct LinkImplClosure : public std::vector<cmGeneratorTarget const*>
{
- LinkImplClosure()
- : Done(false)
- {
- }
- bool Done;
+ bool Done = false;
};
mutable std::map<std::string, LinkImplClosure> LinkImplClosureMap;
@@ -774,18 +775,15 @@ private:
cmHeadToLinkInterfaceMap& GetHeadToLinkInterfaceUsageRequirementsMap(
std::string const& config) const;
+ std::string GetLinkInterfaceDependentStringAsBoolProperty(
+ const std::string& p, const std::string& config) const;
+
// Cache import information from properties for each configuration.
struct ImportInfo
{
- ImportInfo()
- : NoSOName(false)
- , Managed(Native)
- , Multiplicity(0)
- {
- }
- bool NoSOName;
- ManagedType Managed;
- unsigned int Multiplicity;
+ bool NoSOName = false;
+ ManagedType Managed = Native;
+ unsigned int Multiplicity = 0;
std::string Location;
std::string SOName;
std::string ImportLibrary;
@@ -834,10 +832,15 @@ private:
std::vector<cmLinkItem>& items,
bool& hadHeadSensitiveCondition) const;
void LookupLinkItems(std::vector<std::string> const& names,
+ cmListFileBacktrace const& bt,
std::vector<cmLinkItem>& items) const;
- void GetSourceFiles(std::vector<std::string>& files,
- const std::string& config) const;
+ std::vector<BT<std::string>> GetSourceFilePaths(
+ std::string const& config) const;
+ std::vector<BT<cmSourceFile*>> GetSourceFilesWithoutObjectLibraries(
+ std::string const& config) const;
+ void GetSourceFilesWithoutObjectLibraries(std::vector<cmSourceFile*>& files,
+ const std::string& config) const;
struct HeadToLinkImplementationMap
: public std::map<cmGeneratorTarget const*, cmOptionalLinkImplementation>
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 0d4d6534c..a92eb7186 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -4,9 +4,9 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -76,7 +76,7 @@ bool cmGetDirectoryPropertyCommand::InitialPass(
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0059)) {
case cmPolicies::WARN:
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
CM_FALLTHROUGH;
case cmPolicies::OLD:
diff --git a/Source/cmGetFilenameComponentCommand.cxx b/Source/cmGetFilenameComponentCommand.cxx
index 1b358aba8..163b4c8ab 100644
--- a/Source/cmGetFilenameComponentCommand.cxx
+++ b/Source/cmGetFilenameComponentCommand.cxx
@@ -19,8 +19,8 @@ bool cmGetFilenameComponentCommand::InitialPass(
// Check and see if the value has been stored in the cache
// already, if so use that value
- if (args.size() >= 4 && args[args.size() - 1] == "CACHE") {
- const char* cacheValue = this->Makefile->GetDefinition(args[0]);
+ if (args.size() >= 4 && args.back() == "CACHE") {
+ const char* cacheValue = this->Makefile->GetDefinition(args.front());
if (cacheValue && !cmSystemTools::IsNOTFOUND(cacheValue)) {
return true;
}
@@ -88,6 +88,10 @@ bool cmGetFilenameComponentCommand::InitialPass(
result = cmSystemTools::GetFilenameExtension(filename);
} else if (args[2] == "NAME_WE") {
result = cmSystemTools::GetFilenameWithoutExtension(filename);
+ } else if (args[2] == "LAST_EXT") {
+ result = cmSystemTools::GetFilenameLastExtension(filename);
+ } else if (args[2] == "NAME_WLE") {
+ result = cmSystemTools::GetFilenameWithoutLastExtension(filename);
} else if (args[2] == "ABSOLUTE" || args[2] == "REALPATH") {
// If the path given is relative, evaluate it relative to the
// current source directory unless the user passes a different
@@ -113,20 +117,20 @@ bool cmGetFilenameComponentCommand::InitialPass(
return false;
}
- if (args.size() >= 4 && args[args.size() - 1] == "CACHE") {
+ if (args.size() >= 4 && args.back() == "CACHE") {
if (!programArgs.empty() && !storeArgs.empty()) {
this->Makefile->AddCacheDefinition(
storeArgs, programArgs.c_str(), "",
args[2] == "PATH" ? cmStateEnums::FILEPATH : cmStateEnums::STRING);
}
this->Makefile->AddCacheDefinition(
- args[0], result.c_str(), "",
+ args.front(), result.c_str(), "",
args[2] == "PATH" ? cmStateEnums::FILEPATH : cmStateEnums::STRING);
} else {
if (!programArgs.empty() && !storeArgs.empty()) {
this->Makefile->AddDefinition(storeArgs, programArgs.c_str());
}
- this->Makefile->AddDefinition(args[0], result.c_str());
+ this->Makefile->AddDefinition(args.front(), result.c_str());
}
return true;
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 1d812bd28..039f43922 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -8,6 +8,7 @@
#include "cmInstalledFile.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmPropertyDefinition.h"
@@ -230,7 +231,7 @@ bool cmGetPropertyCommand::HandleDirectoryMode()
if (this->PropertyName == "DEFINITIONS") {
switch (mf->GetPolicyStatus(cmPolicies::CMP0059)) {
case cmPolicies::WARN:
- mf->IssueMessage(cmake::AUTHOR_WARNING,
+ mf->IssueMessage(MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0059));
CM_FALLTHROUGH;
case cmPolicies::OLD:
diff --git a/Source/cmGetTargetPropertyCommand.cxx b/Source/cmGetTargetPropertyCommand.cxx
index ec485aa3e..fc0e9c693 100644
--- a/Source/cmGetTargetPropertyCommand.cxx
+++ b/Source/cmGetTargetPropertyCommand.cxx
@@ -6,10 +6,10 @@
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmTarget.h"
#include "cmTargetPropertyComputer.h"
-#include "cmake.h"
class cmExecutionStatus;
class cmMessenger;
@@ -52,7 +52,7 @@ bool cmGetTargetPropertyCommand::InitialPass(
} else {
bool issueMessage = false;
std::ostringstream e;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0045)) {
case cmPolicies::WARN:
issueMessage = true;
@@ -63,13 +63,13 @@ bool cmGetTargetPropertyCommand::InitialPass(
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
issueMessage = true;
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (issueMessage) {
e << "get_target_property() called with non-existent target \""
<< targetName << "\".";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
diff --git a/Source/cmGhsMultiGpj.cxx b/Source/cmGhsMultiGpj.cxx
index f58cfc1e5..c1f0742f2 100644
--- a/Source/cmGhsMultiGpj.cxx
+++ b/Source/cmGhsMultiGpj.cxx
@@ -4,31 +4,34 @@
#include "cmGeneratedFileStream.h"
-void GhsMultiGpj::WriteGpjTag(Types const gpjType,
- cmGeneratedFileStream* const filestream)
+static const char* GHS_TAG[] = { "[INTEGRITY Application]",
+ "[Library]",
+ "[Project]",
+ "[Program]",
+ "[Reference]",
+ "[Subproject]" };
+
+const char* GhsMultiGpj::GetGpjTag(Types const gpjType)
{
char const* tag;
switch (gpjType) {
case INTERGRITY_APPLICATION:
- tag = "INTEGRITY Application";
- break;
case LIBRARY:
- tag = "Library";
- break;
case PROJECT:
- tag = "Project";
- break;
case PROGRAM:
- tag = "Program";
- break;
case REFERENCE:
- tag = "Reference";
- break;
case SUBPROJECT:
- tag = "Subproject";
+ tag = GHS_TAG[gpjType];
break;
default:
tag = "";
}
- *filestream << "[" << tag << "]" << std::endl;
+ return tag;
+}
+
+void GhsMultiGpj::WriteGpjTag(Types const gpjType, std::ostream& fout)
+{
+ char const* tag;
+ tag = GhsMultiGpj::GetGpjTag(gpjType);
+ fout << tag << std::endl;
}
diff --git a/Source/cmGhsMultiGpj.h b/Source/cmGhsMultiGpj.h
index b1eead101..6d59225da 100644
--- a/Source/cmGhsMultiGpj.h
+++ b/Source/cmGhsMultiGpj.h
@@ -4,6 +4,7 @@
#define cmGhsMultiGpj_h
#include "cmConfigure.h" // IWYU pragma: keep
+#include <iosfwd>
class cmGeneratedFileStream;
@@ -20,8 +21,9 @@ public:
SUBPROJECT
};
- static void WriteGpjTag(Types const gpjType,
- cmGeneratedFileStream* filestream);
+ static void WriteGpjTag(Types const gpjType, std::ostream& fout);
+
+ static const char* GetGpjTag(Types const gpjType);
};
#endif // ! cmGhsMultiGpjType_h
diff --git a/Source/cmGhsMultiTargetGenerator.cxx b/Source/cmGhsMultiTargetGenerator.cxx
index 847230a82..5fe350c10 100644
--- a/Source/cmGhsMultiTargetGenerator.cxx
+++ b/Source/cmGhsMultiTargetGenerator.cxx
@@ -2,6 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmGhsMultiTargetGenerator.h"
+#include "cmComputeLinkInformation.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGhsMultiGenerator.h"
@@ -9,177 +10,128 @@
#include "cmLocalGhsMultiGenerator.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
+#include "cmSourceGroup.h"
#include "cmTarget.h"
-#include <assert.h>
-
-std::string const cmGhsMultiTargetGenerator::DDOption("-dynamic");
cmGhsMultiTargetGenerator::cmGhsMultiTargetGenerator(cmGeneratorTarget* target)
: GeneratorTarget(target)
, LocalGenerator(
static_cast<cmLocalGhsMultiGenerator*>(target->GetLocalGenerator()))
, Makefile(target->Target->GetMakefile())
- , TargetGroup(DetermineIfTargetGroup(target))
- , DynamicDownload(false)
-{
- this->RelBuildFilePath = this->GetRelBuildFilePath(target);
-
- this->RelOutputFileName = this->RelBuildFilePath + target->GetName() + ".a";
-
- this->RelBuildFileName = this->RelBuildFilePath;
- this->RelBuildFileName += this->GetBuildFileName(target);
-
- std::string absPathToRoot = this->GetAbsPathToRoot(target);
- absPathToRoot = this->AddSlashIfNeededToPath(absPathToRoot);
- this->AbsBuildFilePath = absPathToRoot + this->RelBuildFilePath;
- this->AbsBuildFileName = absPathToRoot + this->RelBuildFileName;
- this->AbsOutputFileName = absPathToRoot + this->RelOutputFileName;
-}
-
-cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
+ , Name(target->GetName())
{
- cmDeleteAll(this->FolderBuildStreams);
-}
-
-std::string cmGhsMultiTargetGenerator::GetRelBuildFilePath(
- const cmGeneratorTarget* target)
-{
- std::string output = target->GetEffectiveFolderName();
- cmSystemTools::ConvertToUnixSlashes(output);
- if (!output.empty()) {
- output += "/";
+ // Store the configuration name that is being used
+ if (const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) {
+ // Use the build type given by the user.
+ this->ConfigName = config;
+ } else {
+ // No configuration type given.
+ this->ConfigName.clear();
}
- output += target->GetName() + "/";
- return output;
-}
-
-std::string cmGhsMultiTargetGenerator::GetAbsPathToRoot(
- const cmGeneratorTarget* target)
-{
- return target->GetLocalGenerator()->GetBinaryDirectory();
}
-std::string cmGhsMultiTargetGenerator::GetAbsBuildFilePath(
- const cmGeneratorTarget* target)
-{
- std::string output;
- output = cmGhsMultiTargetGenerator::GetAbsPathToRoot(target);
- output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output);
- output += cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
- return output;
-}
-
-std::string cmGhsMultiTargetGenerator::GetRelBuildFileName(
- const cmGeneratorTarget* target)
-{
- std::string output;
- output = cmGhsMultiTargetGenerator::GetRelBuildFilePath(target);
- output = cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(output);
- output += cmGhsMultiTargetGenerator::GetBuildFileName(target);
- return output;
-}
-
-std::string cmGhsMultiTargetGenerator::GetBuildFileName(
- const cmGeneratorTarget* target)
-{
- std::string output;
- output = target->GetName();
- output += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
- return output;
-}
-
-std::string cmGhsMultiTargetGenerator::AddSlashIfNeededToPath(
- std::string const& input)
+cmGhsMultiTargetGenerator::~cmGhsMultiTargetGenerator()
{
- std::string output(input);
- if (!cmHasLiteralSuffix(output, "/")) {
- output += "/";
- }
- return output;
}
void cmGhsMultiTargetGenerator::Generate()
{
- std::vector<cmSourceFile*> objectSources = this->GetSources();
- if (!objectSources.empty() && this->IncludeThisTarget()) {
- if (!cmSystemTools::FileExists(this->AbsBuildFilePath.c_str())) {
- cmSystemTools::MakeDirectory(this->AbsBuildFilePath.c_str());
+ // Determine type of target for this project
+ switch (this->GeneratorTarget->GetType()) {
+ case cmStateEnums::EXECUTABLE: {
+ // Get the name of the executable to generate.
+ std::string targetName;
+ std::string targetNameImport;
+ std::string targetNamePDB;
+ this->GeneratorTarget->GetExecutableNames(
+ targetName, this->TargetNameReal, targetNameImport, targetNamePDB,
+ this->ConfigName);
+ if (cmGhsMultiTargetGenerator::DetermineIfIntegrityApp()) {
+ this->TagType = GhsMultiGpj::INTERGRITY_APPLICATION;
+ } else {
+ this->TagType = GhsMultiGpj::PROGRAM;
+ }
+ break;
+ }
+ case cmStateEnums::STATIC_LIBRARY: {
+ std::string targetName;
+ std::string targetNameSO;
+ std::string targetNameImport;
+ std::string targetNamePDB;
+ this->GeneratorTarget->GetLibraryNames(
+ targetName, targetNameSO, this->TargetNameReal, targetNameImport,
+ targetNamePDB, this->ConfigName);
+ this->TagType = GhsMultiGpj::LIBRARY;
+ break;
+ }
+ case cmStateEnums::SHARED_LIBRARY: {
+ std::string msg = "add_library(<name> SHARED ...) not supported: ";
+ msg += this->Name;
+ cmSystemTools::Message(msg);
+ return;
}
- cmGlobalGhsMultiGenerator::Open(std::string(""), this->AbsBuildFileName,
- &this->FolderBuildStreams);
- cmGlobalGhsMultiGenerator::OpenBuildFileStream(
- this->GetFolderBuildStreams());
- std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
- if (0 == config.length()) {
- config = "RELEASE";
+ case cmStateEnums::OBJECT_LIBRARY: {
+ std::string targetName;
+ std::string targetNameSO;
+ std::string targetNameImport;
+ std::string targetNamePDB;
+ this->GeneratorTarget->GetLibraryNames(
+ targetName, targetNameSO, this->TargetNameReal, targetNameImport,
+ targetNamePDB, this->ConfigName);
+ this->TagType = GhsMultiGpj::SUBPROJECT;
+ break;
}
- const std::string language(
- this->GeneratorTarget->GetLinkerLanguage(config));
- config = cmSystemTools::UpperCase(config);
- this->DynamicDownload = this->DetermineIfDynamicDownload(config, language);
- if (this->DynamicDownload) {
- *this->GetFolderBuildStreams()
- << "#component integrity_dynamic_download" << std::endl;
+ case cmStateEnums::MODULE_LIBRARY: {
+ std::string msg = "add_library(<name> MODULE ...) not supported: ";
+ msg += this->Name;
+ cmSystemTools::Message(msg);
+ return;
}
- GhsMultiGpj::WriteGpjTag(this->GetGpjTag(), this->GetFolderBuildStreams());
- cmGlobalGhsMultiGenerator::WriteDisclaimer(this->GetFolderBuildStreams());
-
- bool const notKernel = this->IsNotKernel(config, language);
- this->WriteTypeSpecifics(config, notKernel);
- this->SetCompilerFlags(config, language, notKernel);
- this->WriteCompilerFlags(config, language);
- this->WriteCompilerDefinitions(config, language);
- this->WriteIncludes(config, language);
- if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
- this->WriteTargetLinkLibraries(config, language);
+ case cmStateEnums::UTILITY: {
+ std::string msg = "add_custom_target(<name> ...) not supported: ";
+ msg += this->Name;
+ cmSystemTools::Message(msg);
+ return;
}
- this->WriteCustomCommands();
+ default:
+ return;
+ }
- std::map<const cmSourceFile*, std::string> objectNames =
- cmGhsMultiTargetGenerator::GetObjectNames(
- &objectSources, this->LocalGenerator, this->GeneratorTarget);
+ // Tell the global generator the name of the project file
+ this->GeneratorTarget->Target->SetProperty("GENERATOR_FILE_NAME",
+ this->Name.c_str());
+ this->GeneratorTarget->Target->SetProperty(
+ "GENERATOR_FILE_NAME_EXT", GhsMultiGpj::GetGpjTag(this->TagType));
- this->WriteSources(objectSources, objectNames);
- }
+ this->GenerateTarget();
}
-bool cmGhsMultiTargetGenerator::IncludeThisTarget()
+void cmGhsMultiTargetGenerator::GenerateTarget()
{
- bool output = true;
- char const* excludeFromAll =
- this->GeneratorTarget->GetProperty("EXCLUDE_FROM_ALL");
- if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
- '\0' == excludeFromAll[1]) {
- output = false;
- }
- return output;
-}
+ // Open the filestream in copy-if-different mode.
+ std::string fname = this->LocalGenerator->GetCurrentBinaryDirectory();
+ fname += "/";
+ fname += this->Name;
+ fname += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+ cmGeneratedFileStream fout(fname.c_str());
+ fout.SetCopyIfDifferent(true);
-std::vector<cmSourceFile*> cmGhsMultiTargetGenerator::GetSources() const
-{
- std::vector<cmSourceFile*> output;
- std::string config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
- this->GeneratorTarget->GetSourceFiles(output, config);
- return output;
-}
+ this->GetGlobalGenerator()->WriteFileHeader(fout);
+ GhsMultiGpj::WriteGpjTag(this->TagType, fout);
-GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag() const
-{
- return cmGhsMultiTargetGenerator::GetGpjTag(this->GeneratorTarget);
-}
+ const std::string language(
+ this->GeneratorTarget->GetLinkerLanguage(this->ConfigName));
-GhsMultiGpj::Types cmGhsMultiTargetGenerator::GetGpjTag(
- const cmGeneratorTarget* target)
-{
- GhsMultiGpj::Types output;
- if (cmGhsMultiTargetGenerator::DetermineIfTargetGroup(target)) {
- output = GhsMultiGpj::INTERGRITY_APPLICATION;
- } else if (target->GetType() == cmStateEnums::STATIC_LIBRARY) {
- output = GhsMultiGpj::LIBRARY;
- } else {
- output = GhsMultiGpj::PROGRAM;
- }
- return output;
+ this->WriteTargetSpecifics(fout, this->ConfigName);
+ this->SetCompilerFlags(this->ConfigName, language);
+ this->WriteCompilerFlags(fout, this->ConfigName, language);
+ this->WriteCompilerDefinitions(fout, this->ConfigName, language);
+ this->WriteIncludes(fout, this->ConfigName, language);
+ this->WriteTargetLinkLine(fout, this->ConfigName);
+ this->WriteCustomCommands(fout);
+ this->WriteSources(fout);
+ this->WriteReferences(fout);
+ fout.Close();
}
cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
@@ -189,41 +141,28 @@ cmGlobalGhsMultiGenerator* cmGhsMultiTargetGenerator::GetGlobalGenerator()
this->LocalGenerator->GetGlobalGenerator());
}
-void cmGhsMultiTargetGenerator::WriteTypeSpecifics(const std::string& config,
- bool const notKernel)
+void cmGhsMultiTargetGenerator::WriteTargetSpecifics(std::ostream& fout,
+ const std::string& config)
{
- std::string outputDir(this->GetOutputDirectory(config));
- std::string outputFilename(this->GetOutputFilename(config));
-
- if (this->GeneratorTarget->GetType() == cmStateEnums::STATIC_LIBRARY) {
- std::string const static_library_suffix =
- this->Makefile->GetSafeDefinition("CMAKE_STATIC_LIBRARY_SUFFIX");
- *this->GetFolderBuildStreams()
- << " -o \"" << outputDir << outputFilename << static_library_suffix
- << "\"" << std::endl;
- } else if (this->GeneratorTarget->GetType() == cmStateEnums::EXECUTABLE) {
- if (notKernel && !this->IsTargetGroup()) {
- *this->GetFolderBuildStreams() << " -relprog" << std::endl;
- }
- if (this->IsTargetGroup()) {
- *this->GetFolderBuildStreams()
- << " -o \"" << outputDir << outputFilename << ".elf\"" << std::endl;
- *this->GetFolderBuildStreams()
- << " :extraOutputFile=\"" << outputDir << outputFilename
- << ".elf.ael\"" << std::endl;
- } else {
- std::string const executable_suffix =
- this->Makefile->GetSafeDefinition("CMAKE_EXECUTABLE_SUFFIX");
- *this->GetFolderBuildStreams()
- << " -o \"" << outputDir << outputFilename << executable_suffix
- << "\"" << std::endl;
- }
+ std::string outpath;
+ std::string rootpath = this->LocalGenerator->GetCurrentBinaryDirectory();
+
+ if (this->TagType != GhsMultiGpj::SUBPROJECT) {
+ // set target binary file destination
+ outpath = this->GeneratorTarget->GetDirectory(config);
+ outpath =
+ this->LocalGenerator->MaybeConvertToRelativePath(rootpath, outpath);
+ fout << " :binDirRelative=\"" << outpath << "\"" << std::endl;
+ fout << " -o \"" << this->TargetNameReal << "\"" << std::endl;
}
+
+ // set target object file destination
+ outpath = this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
+ fout << " :outputDirRelative=\"" << outpath << "\"" << std::endl;
}
void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
- const std::string& language,
- bool const notKernel)
+ const std::string& language)
{
std::map<std::string, std::string>::iterator i =
this->FlagsByLanguage.find(language);
@@ -231,14 +170,9 @@ void cmGhsMultiTargetGenerator::SetCompilerFlags(std::string const& config,
std::string flags;
const char* lang = language.c_str();
- if (notKernel) {
- this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
- lang, config);
- } else {
- this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget,
- lang + std::string("_GHS_KERNEL"),
- config);
- }
+ this->LocalGenerator->AddLanguageFlags(flags, this->GeneratorTarget, lang,
+ config);
+
this->LocalGenerator->AddCMP0018Flags(flags, this->GeneratorTarget, lang,
config);
this->LocalGenerator->AddVisibilityPresetFlags(
@@ -267,14 +201,9 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string& language,
if (i == this->DefinesByLanguage.end()) {
std::set<std::string> defines;
const char* lang = language.c_str();
- // Add the export symbol definition for shared library objects.
- if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) {
- this->LocalGenerator->AppendDefines(defines, exportMacro);
- }
-
// Add preprocessor definitions for this target and configuration.
- this->LocalGenerator->AddCompileDefinitions(defines, this->GeneratorTarget,
- config, language);
+ this->LocalGenerator->GetTargetDefines(this->GeneratorTarget, config,
+ language, defines);
std::string definesString;
this->LocalGenerator->JoinDefines(defines, definesString, lang);
@@ -286,21 +215,25 @@ std::string cmGhsMultiTargetGenerator::GetDefines(const std::string& language,
return i->second;
}
-void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::string const&,
+void cmGhsMultiTargetGenerator::WriteCompilerFlags(std::ostream& fout,
+ std::string const&,
const std::string& language)
{
std::map<std::string, std::string>::iterator flagsByLangI =
this->FlagsByLanguage.find(language);
if (flagsByLangI != this->FlagsByLanguage.end()) {
if (!flagsByLangI->second.empty()) {
- *this->GetFolderBuildStreams()
- << " " << flagsByLangI->second << std::endl;
+ std::vector<std::string> ghsCompFlags =
+ cmSystemTools::ParseArguments(flagsByLangI->second.c_str());
+ for (auto& f : ghsCompFlags) {
+ fout << " " << f << std::endl;
+ }
}
}
}
void cmGhsMultiTargetGenerator::WriteCompilerDefinitions(
- const std::string& config, const std::string& language)
+ std::ostream& fout, const std::string& config, const std::string& language)
{
std::vector<std::string> compileDefinitions;
this->GeneratorTarget->GetCompileDefinitions(compileDefinitions, config,
@@ -308,11 +241,12 @@ void cmGhsMultiTargetGenerator::WriteCompilerDefinitions(
for (std::vector<std::string>::const_iterator cdI =
compileDefinitions.begin();
cdI != compileDefinitions.end(); ++cdI) {
- *this->GetFolderBuildStreams() << " -D" << (*cdI) << std::endl;
+ fout << " -D" << (*cdI) << std::endl;
}
}
-void cmGhsMultiTargetGenerator::WriteIncludes(const std::string& config,
+void cmGhsMultiTargetGenerator::WriteIncludes(std::ostream& fout,
+ const std::string& config,
const std::string& language)
{
std::vector<std::string> includes;
@@ -321,80 +255,73 @@ void cmGhsMultiTargetGenerator::WriteIncludes(const std::string& config,
for (std::vector<std::string>::const_iterator includes_i = includes.begin();
includes_i != includes.end(); ++includes_i) {
- *this->GetFolderBuildStreams()
- << " -I\"" << *includes_i << "\"" << std::endl;
+ fout << " -I\"" << *includes_i << "\"" << std::endl;
}
}
-void cmGhsMultiTargetGenerator::WriteTargetLinkLibraries(
- std::string const& config, std::string const& language)
+void cmGhsMultiTargetGenerator::WriteTargetLinkLine(std::ostream& fout,
+ std::string const& config)
{
- // library directories
- cmTargetDependSet tds =
- this->GetGlobalGenerator()->GetTargetDirectDepends(this->GeneratorTarget);
- for (cmTargetDependSet::iterator tdsI = tds.begin(); tdsI != tds.end();
- ++tdsI) {
- const cmGeneratorTarget* tg = *tdsI;
- *this->GetFolderBuildStreams()
- << " -L\"" << GetAbsBuildFilePath(tg) << "\"" << std::endl;
+ if (this->TagType == GhsMultiGpj::INTERGRITY_APPLICATION) {
+ return;
}
- // library targets
- cmTarget::LinkLibraryVectorType llv =
- this->GeneratorTarget->Target->GetOriginalLinkLibraries();
- for (cmTarget::LinkLibraryVectorType::const_iterator llvI = llv.begin();
- llvI != llv.end(); ++llvI) {
- std::string libName = llvI->first;
- // if it is a user defined target get the full path to the lib
- cmTarget* tg(GetGlobalGenerator()->FindTarget(libName));
- if (NULL != tg) {
- libName = tg->GetName() + ".a";
- }
- *this->GetFolderBuildStreams()
- << " -l\"" << libName << "\"" << std::endl;
+
+ std::string linkLibraries;
+ std::string flags;
+ std::string linkFlags;
+ std::string frameworkPath;
+ std::string linkPath;
+
+ std::unique_ptr<cmLinkLineComputer> linkLineComputer(
+ this->GetGlobalGenerator()->CreateLinkLineComputer(
+ this->LocalGenerator,
+ this->LocalGenerator->GetStateSnapshot().GetDirectory()));
+
+ this->LocalGenerator->GetTargetFlags(
+ linkLineComputer.get(), config, linkLibraries, flags, linkFlags,
+ frameworkPath, linkPath, this->GeneratorTarget);
+
+ // write out link options
+ std::vector<std::string> lopts =
+ cmSystemTools::ParseArguments(linkFlags.c_str());
+ for (auto& l : lopts) {
+ fout << " " << l << std::endl;
}
- if (!this->TargetGroup) {
- std::string linkLibraries;
- std::string flags;
- std::string linkFlags;
- std::string frameworkPath;
- std::string linkPath;
- std::string createRule =
- this->GeneratorTarget->GetCreateRuleVariable(language, config);
- bool useWatcomQuote =
- this->Makefile->IsOn(createRule + "_USE_WATCOM_QUOTE");
- std::unique_ptr<cmLinkLineComputer> linkLineComputer(
- this->GetGlobalGenerator()->CreateLinkLineComputer(
- this->LocalGenerator,
- this->LocalGenerator->GetStateSnapshot().GetDirectory()));
- linkLineComputer->SetUseWatcomQuote(useWatcomQuote);
-
- this->LocalGenerator->GetTargetFlags(
- linkLineComputer.get(), config, linkLibraries, flags, linkFlags,
- frameworkPath, linkPath, this->GeneratorTarget);
- linkFlags = cmSystemTools::TrimWhitespace(linkFlags);
-
- if (!linkPath.empty()) {
- linkPath = " " + linkPath.substr(0U, linkPath.size() - 1U);
- *this->GetFolderBuildStreams() << linkPath;
- }
+ // write out link search paths
+ // must be quoted for paths that contain spaces
+ std::vector<std::string> lpath =
+ cmSystemTools::ParseArguments(linkPath.c_str());
+ for (auto& l : lpath) {
+ fout << " -L\"" << l << "\"" << std::endl;
+ }
+
+ // write out link libs
+ // must be quoted for filepaths that contains spaces
+ std::string cbd = this->LocalGenerator->GetCurrentBinaryDirectory();
- if (!linkFlags.empty()) {
- *this->GetFolderBuildStreams() << " " << linkFlags << std::endl;
+ std::vector<std::string> llibs =
+ cmSystemTools::ParseArguments(linkLibraries.c_str());
+ for (auto& l : llibs) {
+ if (l.compare(0, 2, "-l") == 0) {
+ fout << " \"" << l << "\"" << std::endl;
+ } else {
+ std::string rl = cmSystemTools::CollapseCombinedPath(cbd, l);
+ fout << " -l\"" << rl << "\"" << std::endl;
}
}
}
-void cmGhsMultiTargetGenerator::WriteCustomCommands()
+void cmGhsMultiTargetGenerator::WriteCustomCommands(std::ostream& fout)
{
- WriteCustomCommandsHelper(this->GeneratorTarget->GetPreBuildCommands(),
+ WriteCustomCommandsHelper(fout, this->GeneratorTarget->GetPreBuildCommands(),
cmTarget::PRE_BUILD);
- WriteCustomCommandsHelper(this->GeneratorTarget->GetPostBuildCommands(),
- cmTarget::POST_BUILD);
+ WriteCustomCommandsHelper(
+ fout, this->GeneratorTarget->GetPostBuildCommands(), cmTarget::POST_BUILD);
}
void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
- std::vector<cmCustomCommand> const& commandsSet,
+ std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
cmTarget::CustomCommandType const commandType)
{
for (std::vector<cmCustomCommand>::const_iterator commandsSetI =
@@ -405,10 +332,10 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
commandI != commands.end(); ++commandI) {
switch (commandType) {
case cmTarget::PRE_BUILD:
- *this->GetFolderBuildStreams() << " :preexecShellSafe=";
+ fout << " :preexecShellSafe=";
break;
case cmTarget::POST_BUILD:
- *this->GetFolderBuildStreams() << " :postexecShellSafe=";
+ fout << " :postexecShellSafe=";
break;
default:
assert("Only pre and post are supported");
@@ -419,243 +346,237 @@ void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
std::string subCommandE =
this->LocalGenerator->EscapeForShell(*commandLineI, true);
if (!command.empty()) {
- *this->GetFolderBuildStreams()
- << (command.begin() == commandLineI ? "'" : " ");
+ fout << (command.begin() == commandLineI ? "'" : " ");
// Need to double escape backslashes
cmSystemTools::ReplaceString(subCommandE, "\\", "\\\\");
}
- *this->GetFolderBuildStreams() << subCommandE;
+ fout << subCommandE;
}
if (!command.empty()) {
- *this->GetFolderBuildStreams() << "'" << std::endl;
+ fout << "'" << std::endl;
}
}
}
}
-std::map<const cmSourceFile*, std::string>
-cmGhsMultiTargetGenerator::GetObjectNames(
- std::vector<cmSourceFile*>* const objectSources,
- cmLocalGhsMultiGenerator* const localGhsMultiGenerator,
- cmGeneratorTarget* const generatorTarget)
+void cmGhsMultiTargetGenerator::WriteSourceProperty(std::ostream& fout,
+ const cmSourceFile* sf,
+ std::string propName,
+ std::string propFlag)
{
- std::map<std::string, std::vector<cmSourceFile*>> filenameToSource;
- std::map<cmSourceFile*, std::string> sourceToFilename;
- for (std::vector<cmSourceFile*>::const_iterator sf = objectSources->begin();
- sf != objectSources->end(); ++sf) {
- const std::string filename =
- cmSystemTools::GetFilenameName((*sf)->GetFullPath());
- const std::string lower_filename = cmSystemTools::LowerCase(filename);
- filenameToSource[lower_filename].push_back(*sf);
- sourceToFilename[*sf] = lower_filename;
- }
-
- std::vector<cmSourceFile*> duplicateSources;
- for (std::map<std::string, std::vector<cmSourceFile*>>::const_iterator
- msvSourceI = filenameToSource.begin();
- msvSourceI != filenameToSource.end(); ++msvSourceI) {
- if (msvSourceI->second.size() > 1) {
- duplicateSources.insert(duplicateSources.end(),
- msvSourceI->second.begin(),
- msvSourceI->second.end());
+ const char* prop = sf->GetProperty(propName);
+ if (prop) {
+ std::vector<std::string> list;
+ cmSystemTools::ExpandListArgument(prop, list);
+ for (auto& p : list) {
+ fout << " " << propFlag << p << std::endl;
}
}
-
- std::map<const cmSourceFile*, std::string> objectNamesCorrected;
-
- for (std::vector<cmSourceFile*>::const_iterator sf =
- duplicateSources.begin();
- sf != duplicateSources.end(); ++sf) {
- std::string const longestObjectDirectory(
- cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
- localGhsMultiGenerator, generatorTarget, *sf));
- std::string objFilenameName =
- localGhsMultiGenerator->GetObjectFileNameWithoutTarget(
- **sf, longestObjectDirectory);
- cmsys::SystemTools::ReplaceString(objFilenameName, "/", "_");
- objectNamesCorrected[*sf] = objFilenameName;
- }
-
- return objectNamesCorrected;
}
-void cmGhsMultiTargetGenerator::WriteSources(
- std::vector<cmSourceFile*> const& objectSources,
- std::map<const cmSourceFile*, std::string> const& objectNames)
+void cmGhsMultiTargetGenerator::WriteSources(std::ostream& fout_proj)
{
- for (std::vector<cmSourceFile*>::const_iterator si = objectSources.begin();
- si != objectSources.end(); ++si) {
- std::vector<cmSourceGroup> sourceGroups(this->Makefile->GetSourceGroups());
- std::string const& sourceFullPath = (*si)->GetFullPath();
- cmSourceGroup* sourceGroup =
- this->Makefile->FindSourceGroup(sourceFullPath, sourceGroups);
- std::string sgPath = sourceGroup->GetFullName();
- cmSystemTools::ConvertToUnixSlashes(sgPath);
- cmGlobalGhsMultiGenerator::AddFilesUpToPath(
- this->GetFolderBuildStreams(), &this->FolderBuildStreams,
- this->LocalGenerator->GetBinaryDirectory().c_str(), sgPath,
- GhsMultiGpj::SUBPROJECT, this->RelBuildFilePath);
-
- std::string fullSourcePath((*si)->GetFullPath());
- if ((*si)->GetExtension() == "int" || (*si)->GetExtension() == "bsp") {
- *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
- } else {
- // WORKAROUND: GHS MULTI needs the path to use backslashes without quotes
- // to open files in search as of version 6.1.6
- cmsys::SystemTools::ReplaceString(fullSourcePath, "/", "\\");
- *this->FolderBuildStreams[sgPath] << fullSourcePath << std::endl;
- }
+ /* vector of all sources for this target */
+ std::vector<cmSourceFile*> sources;
+ this->GeneratorTarget->GetSourceFiles(sources, this->ConfigName);
- if ("ld" != (*si)->GetExtension() && "int" != (*si)->GetExtension() &&
- "bsp" != (*si)->GetExtension()) {
- this->WriteObjectLangOverride(this->FolderBuildStreams[sgPath], (*si));
- if (objectNames.end() != objectNames.find(*si)) {
- *this->FolderBuildStreams[sgPath]
- << " -o \"" << objectNames.find(*si)->second << "\"" << std::endl;
- }
+ /* vector of all groups defined for this target
+ * -- but the vector is not expanded with sub groups or in any useful order
+ */
+ std::vector<cmSourceGroup> sourceGroups = this->Makefile->GetSourceGroups();
- this->WriteObjectDir(this->FolderBuildStreams[sgPath],
- this->AbsBuildFilePath + sgPath);
- }
+ /* for each source file assign it to its group */
+ std::map<std::string, std::vector<cmSourceFile*>> groupFiles;
+ std::set<std::string> groupNames;
+ for (auto& sf : sources) {
+ cmSourceGroup* sourceGroup =
+ this->Makefile->FindSourceGroup(sf->GetFullPath(), sourceGroups);
+ std::string gn = sourceGroup->GetFullName();
+ groupFiles[gn].push_back(sf);
+ groupNames.insert(gn);
}
-}
-void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
- cmGeneratedFileStream* fileStream, cmSourceFile* sourceFile)
-{
- const char* rawLangProp = sourceFile->GetProperty("LANGUAGE");
- if (NULL != rawLangProp) {
- std::string sourceLangProp(rawLangProp);
- std::string extension(sourceFile->GetExtension());
- if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) {
- *fileStream << " -dotciscxx" << std::endl;
+ /* list of known groups and the order they are displayed in a project file */
+ const std::vector<std::string> standardGroups = {
+ "Header Files", "Source Files", "CMake Rules",
+ "Object Files", "Object Libraries", "Resources"
+ };
+
+ /* list of groups in the order they are displayed in a project file*/
+ std::vector<std::string> groupFilesList(groupFiles.size());
+
+ /* put the groups in the order they should be listed
+ * - standard groups first, and then everything else
+ * in the order used by std::map.
+ */
+ int i = 0;
+ for (const std::string& gn : standardGroups) {
+ auto n = groupNames.find(gn);
+ if (n != groupNames.end()) {
+ groupFilesList[i] = *n;
+ i += 1;
+ groupNames.erase(gn);
}
}
-}
-void cmGhsMultiTargetGenerator::WriteObjectDir(
- cmGeneratedFileStream* fileStream, std::string const& dir)
-{
- std::string workingDir(dir);
- cmSystemTools::ConvertToUnixSlashes(workingDir);
- if (!workingDir.empty()) {
- workingDir += "/";
+ { /* catch-all group - is last item */
+ std::string gn = "";
+ auto n = groupNames.find(gn);
+ if (n != groupNames.end()) {
+ groupFilesList.back() = *n;
+ groupNames.erase(gn);
+ }
}
- workingDir += "Objs";
- *fileStream << " -object_dir=\"" << workingDir << "\"" << std::endl;
-}
-std::string cmGhsMultiTargetGenerator::GetOutputDirectory(
- const std::string& config) const
-{
- std::string outputDir(AbsBuildFilePath);
-
- const char* runtimeOutputProp =
- this->GeneratorTarget->GetProperty("RUNTIME_OUTPUT_DIRECTORY");
- if (NULL != runtimeOutputProp) {
- outputDir = runtimeOutputProp;
+ for (auto& n : groupNames) {
+ groupFilesList[i] = n;
+ i += 1;
}
- std::string configCapped(cmSystemTools::UpperCase(config));
- const char* runtimeOutputSProp = this->GeneratorTarget->GetProperty(
- "RUNTIME_OUTPUT_DIRECTORY_" + configCapped);
- if (NULL != runtimeOutputSProp) {
- outputDir = runtimeOutputSProp;
+ /* sort the files within each group */
+ for (auto& n : groupFilesList) {
+ std::sort(groupFiles[n].begin(), groupFiles[n].end(),
+ [](cmSourceFile* l, cmSourceFile* r) {
+ return l->GetFullPath() < r->GetFullPath();
+ });
}
- cmSystemTools::ConvertToUnixSlashes(outputDir);
- if (!outputDir.empty()) {
- outputDir += "/";
- }
+ /* list of open project files */
+ std::vector<cmGeneratedFileStream*> gfiles;
+
+ /* write files into the proper project file
+ * -- groups go into main project file
+ * unless FOLDER property or variable is set.
+ */
+ for (auto& sg : groupFilesList) {
+ std::ostream* fout;
+ bool useProjectFile =
+ cmSystemTools::IsOn(
+ this->GeneratorTarget->GetProperty("GHS_NO_SOURCE_GROUP_FILE")) ||
+ cmSystemTools::IsOn(
+ this->Makefile->GetDefinition("CMAKE_GHS_NO_SOURCE_GROUP_FILE"));
+ if (useProjectFile || sg.empty()) {
+ fout = &fout_proj;
+ } else {
+ // Open the filestream in copy-if-different mode.
+ std::string gname = sg;
+ cmsys::SystemTools::ReplaceString(gname, "\\", "_");
+ std::string lpath =
+ this->LocalGenerator->GetTargetDirectory(this->GeneratorTarget);
+ lpath += "/";
+ lpath += gname;
+ lpath += cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+ std::string fpath = this->LocalGenerator->GetCurrentBinaryDirectory();
+ fpath += "/";
+ fpath += lpath;
+ cmGeneratedFileStream* f = new cmGeneratedFileStream(fpath.c_str());
+ f->SetCopyIfDifferent(true);
+ gfiles.push_back(f);
+ fout = f;
+ this->GetGlobalGenerator()->WriteFileHeader(*f);
+ GhsMultiGpj::WriteGpjTag(GhsMultiGpj::SUBPROJECT, *f);
+ fout_proj << lpath << " ";
+ GhsMultiGpj::WriteGpjTag(GhsMultiGpj::SUBPROJECT, fout_proj);
+ }
- return outputDir;
-}
+ if (useProjectFile) {
+ if (sg.empty()) {
+ *fout << "{comment} Others" << std::endl;
+ } else {
+ *fout << "{comment} " << sg << std::endl;
+ }
+ }
-std::string cmGhsMultiTargetGenerator::GetOutputFilename(
- const std::string& config) const
-{
- std::string outputFilename(this->GeneratorTarget->GetName());
+ /* output rule for each source file */
+ for (const cmSourceFile* si : groupFiles[sg]) {
- const char* outputNameProp =
- this->GeneratorTarget->GetProperty("OUTPUT_NAME");
- if (NULL != outputNameProp) {
- outputFilename = outputNameProp;
- }
+ // Convert filename to native system
+ // WORKAROUND: GHS MULTI 6.1.4 and 6.1.6 are known to need backslash on
+ // windows when opening some files from the search window.
+ std::string fname(si->GetFullPath());
+ cmSystemTools::ConvertToOutputSlashes(fname);
+ *fout << fname << std::endl;
+
+ if ("ld" != si->GetExtension() && "int" != si->GetExtension() &&
+ "bsp" != si->GetExtension()) {
+ this->WriteObjectLangOverride(*fout, si);
+ }
+
+ this->WriteSourceProperty(*fout, si, "INCLUDE_DIRECTORIES", "-I");
+ this->WriteSourceProperty(*fout, si, "COMPILE_DEFINITIONS", "-D");
+ this->WriteSourceProperty(*fout, si, "COMPILE_OPTIONS", "");
- std::string configCapped(cmSystemTools::UpperCase(config));
- const char* outputNameSProp =
- this->GeneratorTarget->GetProperty(configCapped + "_OUTPUT_NAME");
- if (NULL != outputNameSProp) {
- outputFilename = outputNameSProp;
+ /* to avoid clutter in the gui only print out the objectName if it has
+ * been renamed */
+ std::string objectName = this->GeneratorTarget->GetObjectName(si);
+ if (!objectName.empty() &&
+ this->GeneratorTarget->HasExplicitObjectName(si)) {
+ *fout << " -o " << objectName << std::endl;
+ }
+ }
}
- return outputFilename;
+ for (cmGeneratedFileStream* f : gfiles) {
+ f->Close();
+ }
}
-std::string cmGhsMultiTargetGenerator::ComputeLongestObjectDirectory(
- cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
- cmGeneratorTarget* const generatorTarget, cmSourceFile* const sourceFile)
+void cmGhsMultiTargetGenerator::WriteObjectLangOverride(
+ std::ostream& fout, const cmSourceFile* sourceFile)
{
- std::string dir_max;
- dir_max +=
- localGhsMultiGenerator->GetMakefile()->GetCurrentBinaryDirectory();
- dir_max += "/";
- dir_max += generatorTarget->Target->GetName();
- dir_max += "/";
- std::vector<cmSourceGroup> sourceGroups(
- localGhsMultiGenerator->GetMakefile()->GetSourceGroups());
- std::string const& sourceFullPath = sourceFile->GetFullPath();
- cmSourceGroup* sourceGroup =
- localGhsMultiGenerator->GetMakefile()->FindSourceGroup(sourceFullPath,
- sourceGroups);
- std::string const& sgPath = sourceGroup->GetFullName();
- dir_max += sgPath;
- dir_max += "/Objs/libs/";
- dir_max += generatorTarget->Target->GetName();
- dir_max += "/";
- return dir_max;
+ const char* rawLangProp = sourceFile->GetProperty("LANGUAGE");
+ if (NULL != rawLangProp) {
+ std::string sourceLangProp(rawLangProp);
+ std::string extension(sourceFile->GetExtension());
+ if ("CXX" == sourceLangProp && ("c" == extension || "C" == extension)) {
+ fout << " -dotciscxx" << std::endl;
+ }
+ }
}
-bool cmGhsMultiTargetGenerator::IsNotKernel(std::string const& config,
- const std::string& language)
+void cmGhsMultiTargetGenerator::WriteReferences(std::ostream& fout)
{
- bool output;
- std::vector<std::string> options;
- this->GeneratorTarget->GetCompileOptions(options, config, language);
- output =
- options.end() == std::find(options.begin(), options.end(), "-kernel");
- return output;
-}
+ // This only applies to INTEGRITY Applications
+ if (this->TagType != GhsMultiGpj::INTERGRITY_APPLICATION) {
+ return;
+ }
-bool cmGhsMultiTargetGenerator::DetermineIfTargetGroup(
- const cmGeneratorTarget* target)
-{
- bool output = false;
- std::vector<cmSourceFile*> sources;
- std::string config =
- target->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
- target->GetSourceFiles(sources, config);
- for (std::vector<cmSourceFile*>::const_iterator sources_i = sources.begin();
- sources.end() != sources_i; ++sources_i) {
- if ("int" == (*sources_i)->GetExtension()) {
- output = true;
- }
+ // Get the targets that this one depends upon
+ cmTargetDependSet unordered =
+ this->GetGlobalGenerator()->GetTargetDirectDepends(this->GeneratorTarget);
+ cmGlobalGhsMultiGenerator::OrderedTargetDependSet ordered(unordered,
+ this->Name);
+ for (auto& t : ordered) {
+ std::string tname = t->GetName();
+ std::string tpath = t->LocalGenerator->GetCurrentBinaryDirectory();
+ std::string rootpath = this->LocalGenerator->GetCurrentBinaryDirectory();
+ std::string outpath =
+ this->LocalGenerator->MaybeConvertToRelativePath(rootpath, tpath) + "/" +
+ tname + "REF" + cmGlobalGhsMultiGenerator::FILE_EXTENSION;
+
+ fout << outpath;
+ fout << " ";
+ GhsMultiGpj::WriteGpjTag(GhsMultiGpj::REFERENCE, fout);
+
+ // Tell the global generator that a refernce project needs to be created
+ t->Target->SetProperty("GHS_REFERENCE_PROJECT", "ON");
}
- return output;
}
-bool cmGhsMultiTargetGenerator::DetermineIfDynamicDownload(
- std::string const& config, const std::string& language)
+bool cmGhsMultiTargetGenerator::DetermineIfIntegrityApp(void)
{
- std::vector<std::string> options;
- bool output = false;
- this->GeneratorTarget->GetCompileOptions(options, config, language);
- for (std::vector<std::string>::const_iterator options_i = options.begin();
- options_i != options.end(); ++options_i) {
- std::string option = *options_i;
- if (this->DDOption == option) {
- output = true;
+ const char* p = this->GeneratorTarget->GetProperty("ghs_integrity_app");
+ if (p) {
+ return cmSystemTools::IsOn(
+ this->GeneratorTarget->GetProperty("ghs_integrity_app"));
+ } else {
+ std::vector<cmSourceFile*> sources;
+ this->GeneratorTarget->GetSourceFiles(sources, this->ConfigName);
+ for (auto& sf : sources) {
+ if ("int" == sf->GetExtension()) {
+ return true;
+ }
}
+ return false;
}
- return output;
}
diff --git a/Source/cmGhsMultiTargetGenerator.h b/Source/cmGhsMultiTargetGenerator.h
index 2cdf68e11..a241cc6bd 100644
--- a/Source/cmGhsMultiTargetGenerator.h
+++ b/Source/cmGhsMultiTargetGenerator.h
@@ -24,97 +24,49 @@ public:
virtual void Generate();
- bool IncludeThisTarget();
- std::vector<cmSourceFile*> GetSources() const;
- GhsMultiGpj::Types GetGpjTag() const;
- static GhsMultiGpj::Types GetGpjTag(const cmGeneratorTarget* target);
- const char* GetAbsBuildFilePath() const
- {
- return this->AbsBuildFilePath.c_str();
- }
- const char* GetRelBuildFileName() const
- {
- return this->RelBuildFileName.c_str();
- }
- const char* GetAbsBuildFileName() const
- {
- return this->AbsBuildFileName.c_str();
- }
- const char* GetAbsOutputFileName() const
- {
- return this->AbsOutputFileName.c_str();
- }
-
- static std::string GetRelBuildFilePath(const cmGeneratorTarget* target);
- static std::string GetAbsPathToRoot(const cmGeneratorTarget* target);
- static std::string GetAbsBuildFilePath(const cmGeneratorTarget* target);
- static std::string GetRelBuildFileName(const cmGeneratorTarget* target);
- static std::string GetBuildFileName(const cmGeneratorTarget* target);
- static std::string AddSlashIfNeededToPath(std::string const& input);
-
private:
cmGlobalGhsMultiGenerator* GetGlobalGenerator() const;
- cmGeneratedFileStream* GetFolderBuildStreams()
- {
- return this->FolderBuildStreams[""];
- };
- bool IsTargetGroup() const { return this->TargetGroup; }
-
- void WriteTypeSpecifics(const std::string& config, bool notKernel);
- void WriteCompilerFlags(const std::string& config,
+
+ void GenerateTarget();
+
+ void WriteTargetSpecifics(std::ostream& fout, const std::string& config);
+
+ void WriteCompilerFlags(std::ostream& fout, const std::string& config,
const std::string& language);
- void WriteCompilerDefinitions(const std::string& config,
+ void WriteCompilerDefinitions(std::ostream& fout, const std::string& config,
const std::string& language);
- void SetCompilerFlags(std::string const& config, const std::string& language,
- bool const notKernel);
+ void SetCompilerFlags(std::string const& config,
+ const std::string& language);
+
std::string GetDefines(const std::string& langugae,
std::string const& config);
- void WriteIncludes(const std::string& config, const std::string& language);
- void WriteTargetLinkLibraries(std::string const& config,
- std::string const& language);
- void WriteCustomCommands();
+ void WriteIncludes(std::ostream& fout, const std::string& config,
+ const std::string& language);
+ void WriteTargetLinkLine(std::ostream& fout, std::string const& config);
+ void WriteCustomCommands(std::ostream& fout);
void WriteCustomCommandsHelper(
- std::vector<cmCustomCommand> const& commandsSet,
+ std::ostream& fout, std::vector<cmCustomCommand> const& commandsSet,
cmTarget::CustomCommandType commandType);
- void WriteSources(
- std::vector<cmSourceFile*> const& objectSources,
- std::map<const cmSourceFile*, std::string> const& objectNames);
- static std::map<const cmSourceFile*, std::string> GetObjectNames(
- std::vector<cmSourceFile*>* objectSources,
- cmLocalGhsMultiGenerator* localGhsMultiGenerator,
- cmGeneratorTarget* generatorTarget);
- static void WriteObjectLangOverride(cmGeneratedFileStream* fileStream,
- cmSourceFile* sourceFile);
- static void WriteObjectDir(cmGeneratedFileStream* fileStream,
- std::string const& dir);
- std::string GetOutputDirectory(const std::string& config) const;
- std::string GetOutputFilename(const std::string& config) const;
- static std::string ComputeLongestObjectDirectory(
- cmLocalGhsMultiGenerator const* localGhsMultiGenerator,
- cmGeneratorTarget* generatorTarget, cmSourceFile* const sourceFile);
-
- bool IsNotKernel(std::string const& config, const std::string& language);
- static bool DetermineIfTargetGroup(const cmGeneratorTarget* target);
- bool DetermineIfDynamicDownload(std::string const& config,
- const std::string& language);
+ void WriteSources(std::ostream& fout_proj);
+ void WriteSourceProperty(std::ostream& fout, const cmSourceFile* sf,
+ std::string propName, std::string propFlag);
+ void WriteReferences(std::ostream& fout);
+ static void WriteObjectLangOverride(std::ostream& fout,
+ const cmSourceFile* sourceFile);
+ bool DetermineIfIntegrityApp(void);
cmGeneratorTarget* GeneratorTarget;
cmLocalGhsMultiGenerator* LocalGenerator;
cmMakefile* Makefile;
- std::string AbsBuildFilePath;
- std::string RelBuildFilePath;
- std::string AbsBuildFileName;
- std::string RelBuildFileName;
- std::string RelOutputFileName;
- std::string AbsOutputFileName;
- std::map<std::string, cmGeneratedFileStream*> FolderBuildStreams;
- bool TargetGroup;
- bool DynamicDownload;
- static std::string const DDOption;
std::map<std::string, std::string> FlagsByLanguage;
std::map<std::string, std::string> DefinesByLanguage;
+
+ std::string TargetNameReal;
+ GhsMultiGpj::Types TagType;
+ std::string const Name;
+ std::string ConfigName; /* CMAKE_BUILD_TYPE */
};
#endif // ! cmGhsMultiTargetGenerator_h
diff --git a/Source/cmGlobVerificationManager.cxx b/Source/cmGlobVerificationManager.cxx
index e8959f2a0..5fd890eab 100644
--- a/Source/cmGlobVerificationManager.cxx
+++ b/Source/cmGlobVerificationManager.cxx
@@ -9,7 +9,6 @@
#include "cmListFileCache.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
-#include "cmake.h"
bool cmGlobVerificationManager::SaveVerificationScript(const std::string& path)
{
@@ -18,7 +17,7 @@ bool cmGlobVerificationManager::SaveVerificationScript(const std::string& path)
}
std::string scriptFile = path;
- scriptFile += cmake::GetCMakeFilesDirectory();
+ scriptFile += "/CMakeFiles";
std::string stampFile = scriptFile;
cmSystemTools::MakeDirectory(scriptFile);
scriptFile += "/VerifyGlobs.cmake";
@@ -165,7 +164,7 @@ void cmGlobVerificationManager::AddCacheEntry(
message << "\n " << std::get<0>(bt);
std::get<1>(bt).PrintTitle(message);
}
- cmSystemTools::Error(message.str().c_str());
+ cmSystemTools::Error(message.str());
} else {
value.Backtraces.emplace_back(variable, backtrace);
}
diff --git a/Source/cmGlobVerificationManager.h b/Source/cmGlobVerificationManager.h
index cf04c97c7..f7146bec0 100644
--- a/Source/cmGlobVerificationManager.h
+++ b/Source/cmGlobVerificationManager.h
@@ -21,9 +21,6 @@
*/
class cmGlobVerificationManager
{
-public:
- cmGlobVerificationManager() {}
-
protected:
///! Save verification script for given makefile.
///! Saves to output <path>/<CMakeFilesDirectory>/VerifyGlobs.cmake
@@ -55,13 +52,13 @@ private:
const bool FollowSymlinks;
const std::string Relative;
const std::string Expression;
- CacheEntryKey(const bool rec, const bool l, const bool s,
- const std::string& rel, const std::string& e)
+ CacheEntryKey(const bool rec, const bool l, const bool s, std::string rel,
+ std::string e)
: Recurse(rec)
, ListDirectories(l)
, FollowSymlinks(s)
- , Relative(rel)
- , Expression(e)
+ , Relative(std::move(rel))
+ , Expression(std::move(e))
{
}
bool operator<(const CacheEntryKey& r) const;
@@ -70,13 +67,9 @@ private:
struct CacheEntryValue
{
- bool Initialized;
+ bool Initialized = false;
std::vector<std::string> Files;
std::vector<std::pair<std::string, cmListFileBacktrace>> Backtraces;
- CacheEntryValue()
- : Initialized(false)
- {
- }
};
typedef std::map<CacheEntryKey, CacheEntryValue> CacheEntryMap;
diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx
index 23891031b..c2eb583a9 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.cxx
+++ b/Source/cmGlobalBorlandMakefileGenerator.cxx
@@ -5,6 +5,7 @@
#include "cmDocumentationEntry.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmake.h"
@@ -53,7 +54,7 @@ void cmGlobalBorlandMakefileGenerator::GetDocumentation(
}
void cmGlobalBorlandMakefileGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int /*jobs*/, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalBorlandMakefileGenerator.h b/Source/cmGlobalBorlandMakefileGenerator.h
index 27de6cc6c..ca04b7b73 100644
--- a/Source/cmGlobalBorlandMakefileGenerator.h
+++ b/Source/cmGlobalBorlandMakefileGenerator.h
@@ -46,7 +46,7 @@ public:
bool AllowDeleteOnError() const override { return false; }
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalCommonGenerator.cxx b/Source/cmGlobalCommonGenerator.cxx
index 3b7de4b9c..bf992b48b 100644
--- a/Source/cmGlobalCommonGenerator.cxx
+++ b/Source/cmGlobalCommonGenerator.cxx
@@ -9,6 +9,4 @@ cmGlobalCommonGenerator::cmGlobalCommonGenerator(cmake* cm)
{
}
-cmGlobalCommonGenerator::~cmGlobalCommonGenerator()
-{
-}
+cmGlobalCommonGenerator::~cmGlobalCommonGenerator() = default;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 5f7ff0bb9..386a3f716 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -32,10 +32,8 @@
#include "cmLocalGenerator.h"
#include "cmMSVC60LinkLineComputer.h"
#include "cmMakefile.h"
-#include "cmOutputConverter.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
-#include "cmQtAutoGen.h"
-#include "cmQtAutoGenInitializer.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmStateDirectory.h"
@@ -46,6 +44,7 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cmCryptoHash.h"
+# include "cmQtAutoGenGlobalInitializer.h"
# include "cm_jsoncpp_value.h"
# include "cm_jsoncpp_writer.h"
#endif
@@ -98,6 +97,8 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm)
this->ConfigureDoneCMP0026AndCMP0024 = false;
this->FirstTimeProgress = 0.0f;
+ this->RecursionDepth = 0;
+
cm->GetState()->SetIsGeneratorMultiConfig(false);
cm->GetState()->SetMinGWMake(false);
cm->GetState()->SetMSYSShell(false);
@@ -113,6 +114,15 @@ cmGlobalGenerator::~cmGlobalGenerator()
delete this->ExtraGenerator;
}
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+Json::Value cmGlobalGenerator::GetJson() const
+{
+ Json::Value generator = Json::objectValue;
+ generator["name"] = this->GetName();
+ return generator;
+}
+#endif
+
bool cmGlobalGenerator::SetGeneratorInstance(std::string const& i,
cmMakefile* mf)
{
@@ -129,7 +139,7 @@ bool cmGlobalGenerator::SetGeneratorInstance(std::string const& i,
" " << i << "\n"
"was specified.";
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -149,7 +159,7 @@ bool cmGlobalGenerator::SetGeneratorPlatform(std::string const& p,
" " << p << "\n"
"was specified.";
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -168,7 +178,7 @@ bool cmGlobalGenerator::SetGeneratorToolset(std::string const& ts,
" " << ts << "\n"
"was specified.";
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -293,7 +303,8 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
for (cmGeneratorTarget* target : targets) {
if (target->GetType() == cmStateEnums::TargetType::GLOBAL_TARGET ||
target->GetType() == cmStateEnums::TargetType::INTERFACE_LIBRARY ||
- target->GetType() == cmStateEnums::TargetType::UTILITY) {
+ target->GetType() == cmStateEnums::TargetType::UTILITY ||
+ cmSystemTools::IsOn(target->GetProperty("ghs_integrity_app"))) {
continue;
}
@@ -311,8 +322,8 @@ bool cmGlobalGenerator::CheckTargetsForMissingSources() const
if (srcs.empty()) {
std::ostringstream e;
e << "No SOURCES given to target: " << target->GetName();
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- target->GetBacktrace());
+ this->GetCMakeInstance()->IssueMessage(
+ MessageType::FATAL_ERROR, e.str(), target->GetBacktrace());
failed = true;
}
}
@@ -343,10 +354,9 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
}
if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) {
- std::string setMakeProgram =
- mf->GetModulesFile(this->FindMakeProgramFile.c_str());
+ std::string setMakeProgram = mf->GetModulesFile(this->FindMakeProgramFile);
if (!setMakeProgram.empty()) {
- mf->ReadListFile(setMakeProgram.c_str());
+ mf->ReadListFile(setMakeProgram);
}
}
if (!mf->GetDefinition("CMAKE_MAKE_PROGRAM") ||
@@ -355,7 +365,7 @@ bool cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
err << "CMake was unable to find a build program corresponding to \""
<< this->GetName() << "\". CMAKE_MAKE_PROGRAM is not set. You "
<< "probably need to select a different build tool.";
- cmSystemTools::Error(err.str().c_str());
+ cmSystemTools::Error(err.str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -446,7 +456,7 @@ void cmGlobalGenerator::EnableLanguage(
e << "Language '" << li
<< "' is currently being enabled. "
"Recursive call not allowed.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return;
}
@@ -454,16 +464,15 @@ void cmGlobalGenerator::EnableLanguage(
if (this->TryCompileOuterMakefile) {
// In a try-compile we can only enable languages provided by caller.
- for (std::string const& li : languages) {
- if (li == "NONE") {
+ for (std::string const& lang : languages) {
+ if (lang == "NONE") {
this->SetLanguageEnabled("NONE", mf);
} else {
- const char* lang = li.c_str();
if (this->LanguagesReady.find(lang) == this->LanguagesReady.end()) {
std::ostringstream e;
e << "The test project needs language " << lang
<< " which is not enabled.";
- this->TryCompileOuterMakefile->IssueMessage(cmake::FATAL_ERROR,
+ this->TryCompileOuterMakefile->IssueMessage(MessageType::FATAL_ERROR,
e.str());
cmSystemTools::SetFatalErrorOccured();
return;
@@ -476,7 +485,7 @@ void cmGlobalGenerator::EnableLanguage(
mf->AddDefinition("RUN_CONFIGURE", true);
std::string rootBin = this->CMakeInstance->GetHomeOutputDirectory();
- rootBin += cmake::GetCMakeFilesDirectory();
+ rootBin += "/CMakeFiles";
// If the configuration files path has been set,
// then we are in a try compile and need to copy the enable language
@@ -513,7 +522,7 @@ void cmGlobalGenerator::EnableLanguage(
if (readCMakeSystem) {
fpath += "/CMakeSystem.cmake";
if (cmSystemTools::FileExists(fpath)) {
- mf->ReadListFile(fpath.c_str());
+ mf->ReadListFile(fpath);
}
}
// Load the CMakeDetermineSystem.cmake file and find out
@@ -542,12 +551,12 @@ void cmGlobalGenerator::EnableLanguage(
#endif
// Read the DetermineSystem file
std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake");
- mf->ReadListFile(systemFile.c_str());
+ mf->ReadListFile(systemFile);
// load the CMakeSystem.cmake from the binary directory
// this file is configured by the CMakeDetermineSystem.cmake file
fpath = rootBin;
fpath += "/CMakeSystem.cmake";
- mf->ReadListFile(fpath.c_str());
+ mf->ReadListFile(fpath);
}
if (readCMakeSystem) {
@@ -558,11 +567,6 @@ void cmGlobalGenerator::EnableLanguage(
return;
}
- // Find the native build tool for this generator.
- if (!this->FindMakeProgram(mf)) {
- return;
- }
-
// Tell the generator about the target system.
std::string system = mf->GetSafeDefinition("CMAKE_SYSTEM_NAME");
if (!this->SetSystemName(system, mf)) {
@@ -583,6 +587,11 @@ void cmGlobalGenerator::EnableLanguage(
cmSystemTools::SetFatalErrorOccured();
return;
}
+
+ // Find the native build tool for this generator.
+ if (!this->FindMakeProgram(mf)) {
+ return;
+ }
}
// Check that the languages are supported by the generator and its
@@ -594,7 +603,7 @@ void cmGlobalGenerator::EnableLanguage(
// **** Load the system specific initialization if not yet loaded
if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INITIALIZE_LOADED")) {
fpath = mf->GetModulesFile("CMakeSystemSpecificInitialize.cmake");
- if (!mf->ReadListFile(fpath.c_str())) {
+ if (!mf->ReadListFile(fpath)) {
cmSystemTools::Error("Could not find cmake module file: "
"CMakeSystemSpecificInitialize.cmake");
}
@@ -606,10 +615,9 @@ void cmGlobalGenerator::EnableLanguage(
// load the CMakeDetermine(LANG)Compiler.cmake file to find
// the compiler
- for (std::string const& l : languages) {
- const char* lang = l.c_str();
+ for (std::string const& lang : languages) {
needSetLanguageEnabledMaps[lang] = false;
- if (l == "NONE") {
+ if (lang == "NONE") {
this->SetLanguageEnabled("NONE", mf);
continue;
}
@@ -626,7 +634,7 @@ void cmGlobalGenerator::EnableLanguage(
// version of CMake then try to load the configured file first
// to avoid duplicate compiler tests.
if (cmSystemTools::FileExists(fpath)) {
- if (!mf->ReadListFile(fpath.c_str())) {
+ if (!mf->ReadListFile(fpath)) {
cmSystemTools::Error("Could not find cmake module file: ",
fpath.c_str());
}
@@ -651,9 +659,8 @@ void cmGlobalGenerator::EnableLanguage(
std::string determineCompiler = "CMakeDetermine";
determineCompiler += lang;
determineCompiler += "Compiler.cmake";
- std::string determineFile =
- mf->GetModulesFile(determineCompiler.c_str());
- if (!mf->ReadListFile(determineFile.c_str())) {
+ std::string determineFile = mf->GetModulesFile(determineCompiler);
+ if (!mf->ReadListFile(determineFile)) {
cmSystemTools::Error("Could not find cmake module file: ",
determineCompiler.c_str());
}
@@ -687,7 +694,7 @@ void cmGlobalGenerator::EnableLanguage(
fpath += "/CMake";
fpath += lang;
fpath += "Compiler.cmake";
- if (!mf->ReadListFile(fpath.c_str())) {
+ if (!mf->ReadListFile(fpath)) {
cmSystemTools::Error("Could not find cmake module file: ",
fpath.c_str());
}
@@ -704,16 +711,15 @@ void cmGlobalGenerator::EnableLanguage(
// **** Load the system specific information if not yet loaded
if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED")) {
fpath = mf->GetModulesFile("CMakeSystemSpecificInformation.cmake");
- if (!mf->ReadListFile(fpath.c_str())) {
+ if (!mf->ReadListFile(fpath)) {
cmSystemTools::Error("Could not find cmake module file: "
"CMakeSystemSpecificInformation.cmake");
}
}
// loop over languages again loading CMake(LANG)Information.cmake
//
- for (std::string const& l : languages) {
- const char* lang = l.c_str();
- if (l == "NONE") {
+ for (std::string const& lang : languages) {
+ if (lang == "NONE") {
this->SetLanguageEnabled("NONE", mf);
continue;
}
@@ -734,7 +740,7 @@ void cmGlobalGenerator::EnableLanguage(
"No " << compilerName << " could be found.\n"
;
/* clang-format on */
- } else if (strcmp(lang, "RC") != 0 && strcmp(lang, "ASM_MASM") != 0) {
+ } else if ((lang != "RC") && (lang != "ASM_MASM")) {
if (!cmSystemTools::FileIsFullPath(compilerFile)) {
/* clang-format off */
noCompiler <<
@@ -767,7 +773,7 @@ void cmGlobalGenerator::EnableLanguage(
if (!this->CMakeInstance->GetIsInTryCompile()) {
this->PrintCompilerAdvice(noCompiler, lang,
mf->GetDefinition(compilerEnv));
- mf->IssueMessage(cmake::FATAL_ERROR, noCompiler.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, noCompiler.str());
fatalError = true;
}
}
@@ -780,11 +786,11 @@ void cmGlobalGenerator::EnableLanguage(
fpath = "CMake";
fpath += lang;
fpath += "Information.cmake";
- std::string informationFile = mf->GetModulesFile(fpath.c_str());
+ std::string informationFile = mf->GetModulesFile(fpath);
if (informationFile.empty()) {
cmSystemTools::Error("Could not find cmake module file: ",
fpath.c_str());
- } else if (!mf->ReadListFile(informationFile.c_str())) {
+ } else if (!mf->ReadListFile(informationFile)) {
cmSystemTools::Error("Could not process cmake module file: ",
informationFile.c_str());
}
@@ -804,8 +810,8 @@ void cmGlobalGenerator::EnableLanguage(
std::string testLang = "CMakeTest";
testLang += lang;
testLang += "Compiler.cmake";
- std::string ifpath = mf->GetModulesFile(testLang.c_str());
- if (!mf->ReadListFile(ifpath.c_str())) {
+ std::string ifpath = mf->GetModulesFile(testLang);
+ if (!mf->ReadListFile(ifpath)) {
cmSystemTools::Error("Could not find cmake module file: ",
testLang.c_str());
}
@@ -843,7 +849,7 @@ void cmGlobalGenerator::EnableLanguage(
projectCompatibility += mf->GetSafeDefinition("PROJECT_NAME");
projectCompatibility += "Compatibility.cmake";
if (cmSystemTools::FileExists(projectCompatibility)) {
- mf->ReadListFile(projectCompatibility.c_str());
+ mf->ReadListFile(projectCompatibility);
}
// Inform any extra generator of the new language.
if (this->ExtraGenerator) {
@@ -895,7 +901,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
" compiler id \"AppleClang\" to \"Clang\" for compatibility."
;
/* clang-format on */
- mf->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
@@ -905,7 +911,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
mf->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0025));
case cmPolicies::NEW:
// NEW behavior is to keep AppleClang.
@@ -925,7 +931,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
" compiler id \"QCC\" to \"GNU\" for compatibility."
;
/* clang-format on */
- mf->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ mf->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
@@ -940,7 +946,7 @@ void cmGlobalGenerator::CheckCompilerIdCompatibility(
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
mf->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0047));
CM_FALLTHROUGH;
case cmPolicies::NEW:
@@ -1053,7 +1059,7 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const std::string& l,
if (preference < 0) {
std::string msg = linkerPrefVar;
msg += " is negative, adjusting it to 0";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
preference = 0;
}
@@ -1161,6 +1167,7 @@ void cmGlobalGenerator::Configure()
this->CMakeInstance->GetHomeOutputDirectory());
cmMakefile* dirMf = new cmMakefile(this, snapshot);
+ dirMf->SetRecursionDepth(this->RecursionDepth);
this->Makefiles.push_back(dirMf);
this->IndexMakefile(dirMf);
@@ -1205,7 +1212,7 @@ void cmGlobalGenerator::Configure()
const char* logs[] = { "CMakeOutput.log", "CMakeError.log", nullptr };
for (const char** log = logs; *log; ++log) {
std::string f = this->CMakeInstance->GetHomeOutputDirectory();
- f += this->CMakeInstance->GetCMakeFilesDirectory();
+ f += "/CMakeFiles";
f += "/";
f += *log;
if (cmSystemTools::FileExists(f)) {
@@ -1277,7 +1284,7 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const
<< "duplicate custom targets. "
<< "Consider using a Makefiles generator or fix the project to not "
<< "use duplicate target names.";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return false;
}
@@ -1402,13 +1409,13 @@ void cmGlobalGenerator::Generate()
if (!this->GenerateCPackPropertiesFile()) {
this->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, "Could not write CPack properties file.");
+ MessageType::FATAL_ERROR, "Could not write CPack properties file.");
}
for (auto& buildExpSet : this->BuildExportSets) {
if (!buildExpSet.second->GenerateImportFile()) {
if (!cmSystemTools::GetErrorOccuredFlag()) {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR,
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
"Could not write export file.");
}
return;
@@ -1431,7 +1438,8 @@ void cmGlobalGenerator::Generate()
for (std::string const& t : this->CMP0042WarnTargets) {
w << " " << t << "\n";
}
- this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
+ w.str());
}
if (!this->CMP0068WarnTargets.empty()) {
@@ -1447,7 +1455,8 @@ void cmGlobalGenerator::Generate()
for (std::string const& t : this->CMP0068WarnTargets) {
w << " " << t << "\n";
}
- this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
+ w.str());
}
this->CMakeInstance->UpdateProgress("Generating done", -1);
@@ -1469,89 +1478,11 @@ bool cmGlobalGenerator::ComputeTargetDepends()
bool cmGlobalGenerator::QtAutoGen()
{
#ifdef CMAKE_BUILD_WITH_CMAKE
- std::vector<std::unique_ptr<cmQtAutoGenInitializer>> autogenInits;
-
- for (cmLocalGenerator* localGen : this->LocalGenerators) {
- const std::vector<cmGeneratorTarget*>& targets =
- localGen->GetGeneratorTargets();
- // Find targets that require AUTOGEN processing
- for (cmGeneratorTarget* target : targets) {
- if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
- continue;
- }
- if (target->GetType() != cmStateEnums::EXECUTABLE &&
- target->GetType() != cmStateEnums::STATIC_LIBRARY &&
- target->GetType() != cmStateEnums::SHARED_LIBRARY &&
- target->GetType() != cmStateEnums::MODULE_LIBRARY &&
- target->GetType() != cmStateEnums::OBJECT_LIBRARY) {
- continue;
- }
- if (target->IsImported()) {
- continue;
- }
-
- const bool mocEnabled = target->GetPropertyAsBool("AUTOMOC");
- const bool uicEnabled = target->GetPropertyAsBool("AUTOUIC");
- const bool rccEnabled = target->GetPropertyAsBool("AUTORCC");
- if (!mocEnabled && !uicEnabled && !rccEnabled) {
- continue;
- }
-
- auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
- // don't do anything if there is no Qt4 or Qt5Core (which contains moc)
- if (qtVersion.Major != 4 && qtVersion.Major != 5) {
- std::string msg = "AUTOGEN: No valid Qt version found for target ";
- msg += target->GetName();
- msg += ". ";
- {
- std::vector<std::string> lst;
- if (mocEnabled) {
- lst.emplace_back("AUTOMOC");
- }
- if (uicEnabled) {
- lst.emplace_back("AUTOUIC");
- }
- if (rccEnabled) {
- lst.emplace_back("AUTORCC");
- }
- msg += cmJoin(lst, ", ");
- }
- msg += " disabled. ";
- msg += "Consider adding:\n";
- if (uicEnabled) {
- msg += " find_package(Qt5 COMPONENTS Widgets)\n";
- } else {
- msg += " find_package(Qt5 COMPONENTS Core)\n";
- }
- msg += "to your CMakeLists.txt file.";
- target->Makefile->IssueMessage(cmake::AUTHOR_WARNING, msg);
- continue;
- }
-
- autogenInits.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
- target, mocEnabled, uicEnabled, rccEnabled, qtVersion));
- }
- }
-
- if (!autogenInits.empty()) {
- // Initialize custom targets
- for (auto& autoGen : autogenInits) {
- if (!autoGen->InitCustomTargets()) {
- return false;
- }
- }
-
- // Setup custom targets
- for (auto& autoGen : autogenInits) {
- if (!autoGen->SetupCustomTargets()) {
- return false;
- }
- autoGen.reset(nullptr);
- }
- }
-#endif
-
+ cmQtAutoGenGlobalInitializer initializer(this->LocalGenerators);
+ return initializer.generate();
+#else
return true;
+#endif
}
cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer(
@@ -1822,14 +1753,13 @@ int cmGlobalGenerator::TryCompile(int jobs, const std::string& srcdir,
}
void cmGlobalGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& /*unused*/,
+ GeneratedMakeCommand& makeCommand, const std::string& /*unused*/,
const std::string& /*unused*/, const std::string& /*unused*/,
const std::string& /*unused*/, const std::string& /*unused*/,
bool /*unused*/, int /*unused*/, bool /*unused*/,
std::vector<std::string> const& /*unused*/)
{
- makeCommand.push_back(
- "cmGlobalGenerator::GenerateBuildCommand not implemented");
+ makeCommand.add("cmGlobalGenerator::GenerateBuildCommand not implemented");
}
void cmGlobalGenerator::PrintBuildCommandAdvice(std::ostream& /*os*/,
@@ -1873,31 +1803,29 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
std::string outputBuffer;
std::string* outputPtr = &outputBuffer;
- std::vector<std::string> makeCommand;
+ GeneratedMakeCommand makeCommand;
this->GenerateBuildCommand(makeCommand, makeCommandCSTR, projectName, bindir,
target, config, fast, jobs, verbose,
nativeOptions);
- // Workaround to convince VCExpress.exe to produce output.
+ // Workaround to convince some commands to produce output.
if (outputflag == cmSystemTools::OUTPUT_PASSTHROUGH &&
- !makeCommand.empty() &&
- cmSystemTools::LowerCase(
- cmSystemTools::GetFilenameName(makeCommand[0])) == "vcexpress.exe") {
+ makeCommand.RequiresOutputForward) {
outputflag = cmSystemTools::OUTPUT_FORWARD;
}
// should we do a clean first?
if (clean) {
- std::vector<std::string> cleanCommand;
+ GeneratedMakeCommand cleanCommand;
this->GenerateBuildCommand(cleanCommand, makeCommandCSTR, projectName,
bindir, "clean", config, fast, jobs, verbose);
output += "\nRun Clean Command:";
- output += cmSystemTools::PrintSingleCommand(cleanCommand);
+ output += cleanCommand.printable();
output += "\n";
- if (!cmSystemTools::RunSingleCommand(cleanCommand, outputPtr, outputPtr,
- &retVal, nullptr, outputflag,
- timeout)) {
+ if (!cmSystemTools::RunSingleCommand(cleanCommand.PrimaryCommand,
+ outputPtr, outputPtr, &retVal,
+ nullptr, outputflag, timeout)) {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error("Generator: execution of make clean failed.");
output += *outputPtr;
@@ -1909,13 +1837,13 @@ int cmGlobalGenerator::Build(int jobs, const std::string& /*unused*/,
}
// now build
- std::string makeCommandStr = cmSystemTools::PrintSingleCommand(makeCommand);
- output += "\nRun Build Command:";
+ std::string makeCommandStr = makeCommand.printable();
+ output += "\nRun Build Command(s):";
output += makeCommandStr;
output += "\n";
- if (!cmSystemTools::RunSingleCommand(makeCommand, outputPtr, outputPtr,
- &retVal, nullptr, outputflag,
+ if (!cmSystemTools::RunSingleCommand(makeCommand.PrimaryCommand, outputPtr,
+ outputPtr, &retVal, nullptr, outputflag,
timeout)) {
cmSystemTools::SetRunCommandHideConsole(hideconsole);
cmSystemTools::Error(
@@ -2067,7 +1995,7 @@ void cmGlobalGenerator::SetConfiguredFilesPath(cmGlobalGenerator* gen)
this->ConfiguredFilesPath = gen->ConfiguredFilesPath;
} else {
this->ConfiguredFilesPath = gen->CMakeInstance->GetHomeOutputDirectory();
- this->ConfiguredFilesPath += cmake::GetCMakeFilesDirectory();
+ this->ConfiguredFilesPath += "/CMakeFiles";
}
}
@@ -2101,17 +2029,10 @@ bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
return this->IsExcluded(rootSnp, snp);
}
-bool cmGlobalGenerator::IsExcluded(cmLocalGenerator* root,
- cmGeneratorTarget* target) const
+bool cmGlobalGenerator::IsExcluded(cmGeneratorTarget* target) const
{
- if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
- target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
- // This target is excluded from its directory.
- return true;
- }
- // This target is included in its directory. Check whether the
- // directory is excluded.
- return this->IsExcluded(root, target->GetLocalGenerator());
+ return target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
+ target->GetPropertyAsBool("EXCLUDE_FROM_ALL");
}
void cmGlobalGenerator::GetEnabledLanguages(
@@ -2290,7 +2211,7 @@ bool cmGlobalGenerator::NameResolvesToFramework(
inline std::string removeQuotes(const std::string& s)
{
- if (s[0] == '\"' && s[s.size() - 1] == '\"') {
+ if (s.front() == '\"' && s.back() == '\"') {
return s.substr(1, s.size() - 2);
}
return s;
@@ -2303,7 +2224,7 @@ bool cmGlobalGenerator::CheckCMP0037(std::string const& targetName,
if (!tgt) {
return true;
}
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
std::ostringstream e;
bool issueMessage = false;
switch (tgt->GetPolicyStatusCMP0037()) {
@@ -2317,18 +2238,18 @@ bool cmGlobalGenerator::CheckCMP0037(std::string const& targetName,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
issueMessage = true;
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
break;
}
if (issueMessage) {
e << "The target name \"" << targetName << "\" is reserved " << reason
<< ".";
- if (messageType == cmake::AUTHOR_WARNING) {
+ if (messageType == MessageType::AUTHOR_WARNING) {
e << " It may result in undefined behavior.";
}
this->GetCMakeInstance()->IssueMessage(messageType, e.str(),
tgt->GetBacktrace());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
@@ -2380,12 +2301,12 @@ void cmGlobalGenerator::AddGlobalTarget_Package(
singleLine.push_back("./CPackConfig.cmake");
gti.CommandLines.push_back(std::move(singleLine));
if (this->GetPreinstallTargetName()) {
- gti.Depends.push_back(this->GetPreinstallTargetName());
+ gti.Depends.emplace_back(this->GetPreinstallTargetName());
} else {
const char* noPackageAll =
mf->GetDefinition("CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY");
if (!noPackageAll || cmSystemTools::IsOff(noPackageAll)) {
- gti.Depends.push_back(this->GetAllTargetName());
+ gti.Depends.emplace_back(this->GetAllTargetName());
}
}
targets.push_back(std::move(gti));
@@ -2523,7 +2444,7 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
bool skipInstallRules = mf->IsOn("CMAKE_SKIP_INSTALL_RULES");
if (this->InstallTargetEnabled && skipInstallRules) {
this->CMakeInstance->IssueMessage(
- cmake::WARNING,
+ MessageType::WARNING,
"CMAKE_SKIP_INSTALL_RULES was enabled even though "
"installation rules have been specified",
mf->GetBacktrace());
@@ -2550,12 +2471,12 @@ void cmGlobalGenerator::AddGlobalTarget_Install(
gti.UsesTerminal = true;
cmCustomCommandLine singleLine;
if (this->GetPreinstallTargetName()) {
- gti.Depends.push_back(this->GetPreinstallTargetName());
+ gti.Depends.emplace_back(this->GetPreinstallTargetName());
} else {
const char* noall =
mf->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
if (!noall || cmSystemTools::IsOff(noall)) {
- gti.Depends.push_back(this->GetAllTargetName());
+ gti.Depends.emplace_back(this->GetAllTargetName());
}
}
if (mf->GetDefinition("CMake_BINARY_DIR") &&
@@ -2685,8 +2606,7 @@ std::string cmGlobalGenerator::GenerateRuleFile(
ruleFile += ".rule";
const char* dir = this->GetCMakeCFGIntDir();
if (dir && dir[0] == '$') {
- cmSystemTools::ReplaceString(ruleFile, dir,
- cmake::GetCMakeFilesDirectory());
+ cmSystemTools::ReplaceString(ruleFile, dir, "/CMakeFiles");
}
return ruleFile;
}
@@ -2870,8 +2790,9 @@ void cmGlobalGenerator::AddRuleHash(const std::vector<std::string>& outputs,
}
// Shorten the output name (in expected use case).
- cmOutputConverter converter(this->GetMakefiles()[0]->GetStateSnapshot());
- std::string fname = converter.ConvertToRelativePath(
+ cmStateDirectory cmDir =
+ this->GetMakefiles()[0]->GetStateSnapshot().GetDirectory();
+ std::string fname = cmDir.ConvertToRelPathIfNotContained(
this->GetMakefiles()[0]->GetState()->GetBinaryDirectory(), outputs[0]);
// Associate the hash with this output.
@@ -2887,7 +2808,7 @@ void cmGlobalGenerator::CheckRuleHashes()
#if defined(CMAKE_BUILD_WITH_CMAKE)
std::string home = this->GetCMakeInstance()->GetHomeOutputDirectory();
std::string pfile = home;
- pfile += this->GetCMakeInstance()->GetCMakeFilesDirectory();
+ pfile += "/CMakeFiles";
pfile += "/CMakeRuleHashes.txt";
this->CheckRuleHashes(pfile, home);
this->WriteRuleHashes(pfile);
@@ -2927,7 +2848,7 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
if (strncmp(line.c_str(), rhi->second.Data, 32) != 0) {
// The rule has changed. Delete the output so it will be
// built again.
- fname = cmSystemTools::CollapseFullPath(fname, home.c_str());
+ fname = cmSystemTools::CollapseFullPath(fname, home);
cmSystemTools::RemoveFile(fname);
}
} else {
@@ -2937,7 +2858,7 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile,
// Instead, we keep the rule hash as long as the file exists so
// that if the feature is turned back on and the rule has
// changed the file is still rebuilt.
- std::string fpath = cmSystemTools::CollapseFullPath(fname, home.c_str());
+ std::string fpath = cmSystemTools::CollapseFullPath(fname, home);
if (cmSystemTools::FileExists(fpath)) {
RuleHash hash;
memcpy(hash.Data, line.c_str(), 32);
@@ -2966,7 +2887,7 @@ void cmGlobalGenerator::WriteSummary()
{
// Record all target directories in a central location.
std::string fname = this->CMakeInstance->GetHomeOutputDirectory();
- fname += cmake::GetCMakeFilesDirectory();
+ fname += "/CMakeFiles";
fname += "/TargetDirectories.txt";
cmGeneratedFileStream fout(fname);
@@ -3093,11 +3014,23 @@ void cmGlobalGenerator::WriteSummary(cmGeneratorTarget* target)
std::string cmGlobalGenerator::EscapeJSON(const std::string& s)
{
std::string result;
+ result.reserve(s.size());
for (char i : s) {
- if (i == '"' || i == '\\') {
- result += '\\';
+ switch (i) {
+ case '"':
+ case '\\':
+ result += '\\';
+ result += i;
+ break;
+ case '\n':
+ result += "\\n";
+ break;
+ case '\t':
+ result += "\\t";
+ break;
+ default:
+ result += i;
}
- result += i;
}
return result;
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 1ea2d2445..ac013268c 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -24,6 +24,7 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cmFileLockPool.h"
+# include "cm_jsoncpp_value.h"
#endif
#define CMAKE_DIRECTORY_ID_SEP "::@"
@@ -40,6 +41,54 @@ class cmSourceFile;
class cmStateDirectory;
class cmake;
+namespace detail {
+inline void AppendStrs(std::vector<std::string>&)
+{
+}
+template <typename T, typename... Ts>
+inline void AppendStrs(std::vector<std::string>& command, T&& s, Ts&&... ts)
+{
+ command.emplace_back(std::forward<T>(s));
+ AppendStrs(command, std::forward<Ts>(ts)...);
+}
+
+struct GeneratedMakeCommand
+{
+ // Add each argument as a separate element to the vector
+ template <typename... T>
+ void add(T&&... args)
+ {
+ // iterate the args and append each one
+ AppendStrs(PrimaryCommand, std::forward<T>(args)...);
+ }
+
+ // Add each value in the iterators as a separate element to the vector
+ void add(std::vector<std::string>::const_iterator start,
+ std::vector<std::string>::const_iterator end)
+ {
+ PrimaryCommand.insert(PrimaryCommand.end(), start, end);
+ }
+
+ std::string printable() const
+ {
+ std::size_t size = PrimaryCommand.size();
+ for (auto&& i : PrimaryCommand) {
+ size += i.size();
+ }
+ std::string buffer;
+ buffer.reserve(size);
+ for (auto&& i : PrimaryCommand) {
+ buffer.append(i);
+ buffer.append(1, ' ');
+ }
+ return buffer;
+ }
+
+ std::vector<std::string> PrimaryCommand;
+ bool RequiresOutputForward = false;
+};
+}
+
/** \class cmGlobalGenerator
* \brief Responsible for overseeing the generation process for the entire tree
*
@@ -70,6 +119,11 @@ public:
return codecvt::None;
}
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ /** Get a JSON object describing the generator. */
+ virtual Json::Value GetJson() const;
+#endif
+
/** Tell the generator about the target system. */
virtual bool SetSystemName(std::string const&, cmMakefile*) { return true; }
@@ -176,8 +230,12 @@ public:
virtual bool Open(const std::string& bindir, const std::string& projectName,
bool dryRun);
+ struct GeneratedMakeCommand final : public detail::GeneratedMakeCommand
+ {
+ };
+
virtual void GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose,
@@ -426,6 +484,8 @@ public:
std::string MakeSilentFlag;
+ int RecursionDepth;
+
protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
// for a project collect all its targets by following depend
@@ -462,7 +522,7 @@ protected:
bool IsExcluded(cmStateSnapshot const& root,
cmStateSnapshot const& snp) const;
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen) const;
- bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target) const;
+ bool IsExcluded(cmGeneratorTarget* target) const;
virtual void InitializeProgressMarks() {}
struct GlobalTargetInfo
@@ -472,11 +532,7 @@ protected:
cmCustomCommandLines CommandLines;
std::vector<std::string> Depends;
std::string WorkingDir;
- bool UsesTerminal;
- GlobalTargetInfo()
- : UsesTerminal(false)
- {
- }
+ bool UsesTerminal = false;
};
void CreateDefaultGlobalTargets(std::vector<GlobalTargetInfo>& targets);
@@ -602,13 +658,9 @@ private:
// Cache directory content and target files to be built.
struct DirectoryContent
{
- long LastDiskTime;
+ long LastDiskTime = -1;
std::set<std::string> All;
std::set<std::string> Generated;
- DirectoryContent()
- : LastDiskTime(-1)
- {
- }
};
std::map<std::string, DirectoryContent> DirectoryContentMap;
diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h
index 4e3e7705b..bb5f74cca 100644
--- a/Source/cmGlobalGeneratorFactory.h
+++ b/Source/cmGlobalGeneratorFactory.h
@@ -20,7 +20,7 @@ struct cmDocumentationEntry;
class cmGlobalGeneratorFactory
{
public:
- virtual ~cmGlobalGeneratorFactory() {}
+ virtual ~cmGlobalGeneratorFactory() = default;
/** Create a GlobalGenerator */
virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& n,
@@ -30,13 +30,20 @@ public:
virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0;
/** Get the names of the current registered generators */
- virtual void GetGenerators(std::vector<std::string>& names) const = 0;
+ virtual std::vector<std::string> GetGeneratorNames() const = 0;
+ virtual std::vector<std::string> GetGeneratorNamesWithPlatform() const = 0;
/** Determine whether or not this generator supports toolsets */
virtual bool SupportsToolset() const = 0;
/** Determine whether or not this generator supports platforms */
virtual bool SupportsPlatform() const = 0;
+
+ /** Get the list of supported platforms name for this generator */
+ virtual std::vector<std::string> GetKnownPlatforms() const = 0;
+
+ /** If the generator suports platforms, get its default. */
+ virtual std::string GetDefaultPlatformName() const = 0;
};
template <class T>
@@ -60,9 +67,15 @@ public:
}
/** Get the names of the current registered generators */
- void GetGenerators(std::vector<std::string>& names) const override
+ std::vector<std::string> GetGeneratorNames() const override
{
+ std::vector<std::string> names;
names.push_back(T::GetActualName());
+ return names;
+ }
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ return std::vector<std::string>();
}
/** Determine whether or not this generator supports toolsets */
@@ -70,6 +83,15 @@ public:
/** Determine whether or not this generator supports platforms */
bool SupportsPlatform() const override { return T::SupportsPlatform(); }
+
+ /** Get the list of supported platforms name for this generator */
+ std::vector<std::string> GetKnownPlatforms() const override
+ {
+ // default is no platform supported
+ return std::vector<std::string>();
+ }
+
+ std::string GetDefaultPlatformName() const override { return std::string(); }
};
#endif
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index a9742c531..45fa0529f 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -11,7 +11,9 @@
#include "cmGhsMultiTargetGenerator.h"
#include "cmLocalGhsMultiGenerator.h"
#include "cmMakefile.h"
+#include "cmState.h"
#include "cmVersion.h"
+#include "cmake.h"
const char* cmGlobalGhsMultiGenerator::FILE_EXTENSION = ".gpj";
const char* cmGlobalGhsMultiGenerator::DEFAULT_BUILD_PROGRAM = "gbuild.exe";
@@ -19,13 +21,12 @@ const char* cmGlobalGhsMultiGenerator::DEFAULT_TOOLSET_ROOT = "C:/ghs";
cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake* cm)
: cmGlobalGenerator(cm)
- , OSDirRelative(false)
{
+ cm->GetState()->SetGhsMultiIDE(true);
}
cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator()
{
- cmDeleteAll(TargetFolderBuildStreams);
}
cmLocalGenerator* cmGlobalGhsMultiGenerator::CreateLocalGenerator(
@@ -41,46 +42,59 @@ void cmGlobalGhsMultiGenerator::GetDocumentation(cmDocumentationEntry& entry)
"Generates Green Hills MULTI files (experimental, work-in-progress).";
}
+void cmGlobalGhsMultiGenerator::ComputeTargetObjectDirectory(
+ cmGeneratorTarget* gt) const
+{
+ // Compute full path to object file directory for this target.
+ std::string dir;
+ dir += gt->LocalGenerator->GetCurrentBinaryDirectory();
+ dir += "/";
+ dir += gt->LocalGenerator->GetTargetDirectory(gt);
+ dir += "/";
+ gt->ObjectDirectory = dir;
+}
+
bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
cmMakefile* mf)
{
- std::string tsp; /* toolset path */
- std::string tsn = ts; /* toolset name */
+ std::string tsp; /* toolset path */
- GetToolset(mf, tsp, tsn);
+ this->GetToolset(mf, tsp, ts);
/* no toolset was found */
- if (tsn.empty()) {
+ if (tsp.empty()) {
return false;
} else if (ts.empty()) {
std::string message;
message =
"Green Hills MULTI: -T <toolset> not specified; defaulting to \"";
- message += tsn;
+ message += tsp;
message += "\"";
- cmSystemTools::Message(message.c_str());
+ cmSystemTools::Message(message);
- /* store the toolset for later use
+ /* store the full toolset for later use
* -- already done if -T<toolset> was specified
*/
- mf->AddCacheDefinition("CMAKE_GENERATOR_TOOLSET", tsn.c_str(),
- "Name of generator toolset.",
+ mf->AddCacheDefinition("CMAKE_GENERATOR_TOOLSET", tsp.c_str(),
+ "Location of generator toolset.",
cmStateEnums::INTERNAL);
}
/* set the build tool to use */
+ std::string gbuild(tsp + ((tsp.back() == '/') ? "" : "/") +
+ DEFAULT_BUILD_PROGRAM);
const char* prevTool = mf->GetDefinition("CMAKE_MAKE_PROGRAM");
- std::string gbuild(tsp + "/" + tsn + "/" + DEFAULT_BUILD_PROGRAM);
/* check if the toolset changed from last generate */
if (prevTool != NULL && (gbuild != prevTool)) {
- std::string message = "generator toolset: ";
+ std::string message = "toolset build tool: ";
message += gbuild;
- message += "\nDoes not match the toolset used previously: ";
+ message += "\nDoes not match the previously used build tool: ";
message += prevTool;
message += "\nEither remove the CMakeCache.txt file and CMakeFiles "
"directory or choose a different binary directory.";
- cmSystemTools::Error(message.c_str());
+ cmSystemTools::Error(message);
+ return false;
} else {
/* store the toolset that is being used for this build */
mf->AddCacheDefinition("CMAKE_MAKE_PROGRAM", gbuild.c_str(),
@@ -88,25 +102,7 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorToolset(std::string const& ts,
true);
}
- mf->AddDefinition("CMAKE_SYSTEM_VERSION", tsn.c_str());
-
- // FIXME: compiler detection not implemented
- // gbuild uses the primaryTarget setting in the top-level project
- // file to determine which compiler to use. Because compiler
- // detection is not implemented these variables must be
- // set to skip past these tests. However cmake will verify that
- // the executable pointed to by CMAKE_<LANG>_COMPILER exists.
- // To pass this additional check gbuild is used as a place holder for the
- // actual compiler.
- mf->AddDefinition("CMAKE_C_COMPILER", gbuild.c_str());
- mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE");
- mf->AddDefinition("CMAKE_C_COMPILER_ID", "GHS");
- mf->AddDefinition("CMAKE_C_COMPILER_FORCED", "TRUE");
-
- mf->AddDefinition("CMAKE_CXX_COMPILER", gbuild.c_str());
- mf->AddDefinition("CMAKE_CXX_COMPILER_ID_RUN", "TRUE");
- mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GHS");
- mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE");
+ mf->AddDefinition("CMAKE_SYSTEM_VERSION", tsp.c_str());
return true;
}
@@ -129,6 +125,8 @@ bool cmGlobalGhsMultiGenerator::SetGeneratorPlatform(std::string const& p,
const char* tgtPlatform = mf->GetDefinition("GHS_TARGET_PLATFORM");
if (tgtPlatform == nullptr) {
+ cmSystemTools::Message("Green Hills MULTI: GHS_TARGET_PLATFORM not "
+ "specified; defaulting to \"integrity\"");
tgtPlatform = "integrity";
}
@@ -159,11 +157,11 @@ bool cmGlobalGhsMultiGenerator::FindMakeProgram(cmMakefile* /*mf*/)
}
void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
- std::string& ts)
+ const std::string& ts)
{
const char* ghsRoot = mf->GetDefinition("GHS_TOOLSET_ROOT");
- if (!ghsRoot) {
+ if (!ghsRoot || ghsRoot[0] == '\0') {
ghsRoot = DEFAULT_TOOLSET_ROOT;
}
tsd = ghsRoot;
@@ -172,156 +170,250 @@ void cmGlobalGhsMultiGenerator::GetToolset(cmMakefile* mf, std::string& tsd,
std::vector<std::string> output;
// Use latest? version
+ if (tsd.back() != '/') {
+ tsd += "/";
+ }
cmSystemTools::Glob(tsd, "comp_[^;]+", output);
if (output.empty()) {
- cmSystemTools::Error("GHS toolset not found in ", tsd.c_str());
- ts = "";
+ std::string msg =
+ "No GHS toolsets found in GHS_TOOLSET_ROOT \"" + tsd + "\".";
+ cmSystemTools::Error(msg);
+ tsd = "";
} else {
- ts = output.back();
+ tsd += output.back();
}
} else {
- std::string tryPath = tsd + std::string("/") + ts;
+ std::string tryPath;
+ /* CollapseCombinedPath will check if ts is an absolute path */
+ tryPath = cmSystemTools::CollapseCombinedPath(tsd, ts);
if (!cmSystemTools::FileExists(tryPath)) {
- cmSystemTools::Error("GHS toolset \"", ts.c_str(), "\" not found in ",
- tsd.c_str());
- ts = "";
+ std::string msg = "GHS toolset \"" + tryPath + "\" not found.";
+ cmSystemTools::Error(msg);
+ tsd = "";
+ } else {
+ tsd = tryPath;
}
}
}
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
- std::string const& filepath, cmGeneratedFileStream** filestream)
+void cmGlobalGhsMultiGenerator::WriteFileHeader(std::ostream& fout)
{
- // Get a stream where to generate things.
- if (NULL == *filestream) {
- *filestream = new cmGeneratedFileStream(filepath.c_str());
- if (NULL != *filestream) {
- OpenBuildFileStream(*filestream);
- }
- }
+ fout << "#!gbuild" << std::endl;
+ fout << "#" << std::endl
+ << "# CMAKE generated file: DO NOT EDIT!" << std::endl
+ << "# Generated by \"" << this->GetActualName() << "\""
+ << " Generator, CMake Version " << cmVersion::GetMajorVersion() << "."
+ << cmVersion::GetMinorVersion() << std::endl
+ << "#" << std::endl
+ << std::endl;
}
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream(
- cmGeneratedFileStream* filestream)
+void cmGlobalGhsMultiGenerator::WriteTopLevelProject(
+ std::ostream& fout, cmLocalGenerator* root,
+ std::vector<cmLocalGenerator*>& generators)
{
- *filestream << "#!gbuild" << std::endl;
-}
+ WriteFileHeader(fout);
-void cmGlobalGhsMultiGenerator::OpenBuildFileStream()
-{
- // Compute GHS MULTI's build file path.
- std::string buildFilePath =
- this->GetCMakeInstance()->GetHomeOutputDirectory();
- buildFilePath += "/";
- buildFilePath += "default";
- buildFilePath += FILE_EXTENSION;
-
- this->Open(std::string(""), buildFilePath, &this->TargetFolderBuildStreams);
- OpenBuildFileStream(GetBuildFileStream());
-
- char const* osDir =
- this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR");
- if (NULL == osDir) {
- osDir = "";
- cmSystemTools::Error("GHS_OS_DIR cache variable must be set");
- } else {
- this->GetCMakeInstance()->MarkCliAsUsed("GHS_OS_DIR");
- }
- std::string fOSDir(this->trimQuotes(osDir));
- std::replace(fOSDir.begin(), fOSDir.end(), '\\', '/');
- if (!fOSDir.empty() && ('c' == fOSDir[0] || 'C' == fOSDir[0])) {
- this->OSDirRelative = false;
- } else {
- this->OSDirRelative = true;
+ this->WriteMacros(fout);
+ this->WriteHighLevelDirectives(fout);
+ GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, fout);
+
+ fout << "# Top Level Project File" << std::endl;
+
+ // Specify BSP option if supplied by user
+ // -- not all platforms require this entry in the project file
+ // integrity platforms require this field; use default if needed
+ std::string platform;
+ if (const char* p =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_TARGET_PLATFORM")) {
+ platform = p;
}
std::string bspName;
- char const* bspCache =
- this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME");
- if (bspCache) {
+ if (char const* bspCache =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_BSP_NAME")) {
bspName = bspCache;
this->GetCMakeInstance()->MarkCliAsUsed("GHS_BSP_NAME");
+ } else {
+ bspName = "IGNORE";
}
- if (bspName.empty() || bspName.compare("IGNORE") == 0) {
+
+ if (platform.find("integrity") != std::string::npos &&
+ cmSystemTools::IsOff(bspName.c_str())) {
const char* a =
this->GetCMakeInstance()->GetCacheDefinition("CMAKE_GENERATOR_PLATFORM");
bspName = "sim";
bspName += (a ? a : "");
}
- this->WriteMacros();
- this->WriteHighLevelDirectives();
+ if (!cmSystemTools::IsOff(bspName.c_str())) {
+ fout << " -bsp " << bspName << std::endl;
+ }
+
+ // Specify OS DIR if supplied by user
+ // -- not all platforms require this entry in the project file
+ std::string osDir;
+ std::string osDirOption;
+ if (char const* osDirCache =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR")) {
+ osDir = osDirCache;
+ }
+
+ if (char const* osDirOptionCache =
+ this->GetCMakeInstance()->GetCacheDefinition("GHS_OS_DIR_OPTION")) {
+ osDirOption = osDirOptionCache;
+ }
- GhsMultiGpj::WriteGpjTag(GhsMultiGpj::PROJECT, this->GetBuildFileStream());
- this->WriteDisclaimer(this->GetBuildFileStream());
- *this->GetBuildFileStream() << "# Top Level Project File" << std::endl;
- *this->GetBuildFileStream() << " -bsp " << bspName << std::endl;
+ if (!cmSystemTools::IsOff(osDir.c_str()) ||
+ platform.find("integrity") != std::string::npos) {
+ std::replace(osDir.begin(), osDir.end(), '\\', '/');
+ fout << " " << osDirOption << "\"" << osDir << "\"" << std::endl;
+ }
- this->WriteCompilerOptions(fOSDir);
+ WriteSubProjects(fout, root, generators);
}
-void cmGlobalGhsMultiGenerator::CloseBuildFileStream(
- cmGeneratedFileStream** filestream)
+void cmGlobalGhsMultiGenerator::WriteSubProjects(
+ std::ostream& fout, cmLocalGenerator* root,
+ std::vector<cmLocalGenerator*>& generators)
{
- if (filestream) {
- delete *filestream;
- *filestream = NULL;
- } else {
- cmSystemTools::Error("Build file stream was not open.");
+ // Collect all targets under this root generator and the transitive
+ // closure of their dependencies.
+ TargetDependSet projectTargets;
+ TargetDependSet originalTargets;
+ this->GetTargetSets(projectTargets, originalTargets, root, generators);
+ OrderedTargetDependSet orderedProjectTargets(projectTargets, "");
+
+ // write out all the sub-projects
+ std::string rootBinaryDir = root->GetCurrentBinaryDirectory();
+ for (cmGeneratorTarget const* target : orderedProjectTargets) {
+ if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ continue;
+ }
+
+ const char* projName = target->GetProperty("GENERATOR_FILE_NAME");
+ const char* projType = target->GetProperty("GENERATOR_FILE_NAME_EXT");
+ if (projName && projType) {
+ cmLocalGenerator* lg = target->GetLocalGenerator();
+ std::string dir = lg->GetCurrentBinaryDirectory();
+ dir = root->MaybeConvertToRelativePath(rootBinaryDir, dir.c_str());
+ if (dir == ".") {
+ dir.clear();
+ } else {
+ if (dir.back() != '/') {
+ dir += "/";
+ }
+ }
+
+ if (cmSystemTools::IsOn(target->GetProperty("EXCLUDE_FROM_ALL"))) {
+ fout << "{comment} ";
+ }
+ std::string projFile = dir + projName + FILE_EXTENSION;
+ fout << projFile;
+ fout << " " << projType << std::endl;
+
+ if (cmSystemTools::IsOn(target->GetProperty("GHS_REFERENCE_PROJECT"))) {
+ // create reference project
+ std::string fname = dir;
+ fname += target->GetName();
+ fname += "REF";
+ fname += FILE_EXTENSION;
+
+ cmGeneratedFileStream fref(fname.c_str());
+ fref.SetCopyIfDifferent(true);
+
+ this->WriteFileHeader(fref);
+ GhsMultiGpj::WriteGpjTag(GhsMultiGpj::REFERENCE, fref);
+ fref << " :reference=" << projFile << std::endl;
+
+ fref.Close();
+ }
+ }
}
}
void cmGlobalGhsMultiGenerator::Generate()
{
+ // first do the superclass method
this->cmGlobalGenerator::Generate();
- if (!this->LocalGenerators.empty()) {
- this->OpenBuildFileStream();
+ // output top-level projects
+ for (auto& it : this->ProjectMap) {
+ this->OutputTopLevelProject(it.second[0], it.second);
+ }
+}
- // Build all the folder build files
- for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
- cmLocalGhsMultiGenerator* lg =
- static_cast<cmLocalGhsMultiGenerator*>(this->LocalGenerators[i]);
- const std::vector<cmGeneratorTarget*>& tgts = lg->GetGeneratorTargets();
- this->UpdateBuildFiles(tgts);
- }
+void cmGlobalGhsMultiGenerator::OutputTopLevelProject(
+ cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators)
+{
+ if (generators.empty()) {
+ return;
}
- cmDeleteAll(TargetFolderBuildStreams);
- this->TargetFolderBuildStreams.clear();
+ /* Name top-level projects as filename.top.gpj to avoid name clashes
+ * with target projects. This avoid the issue where the project has
+ * the same name as the executable target.
+ */
+ std::string fname = root->GetCurrentBinaryDirectory();
+ fname += "/";
+ fname += root->GetProjectName();
+ fname += ".top";
+ fname += FILE_EXTENSION;
+
+ cmGeneratedFileStream fout(fname.c_str());
+ fout.SetCopyIfDifferent(true);
+
+ this->WriteTopLevelProject(fout, root, generators);
+
+ fout.Close();
}
void cmGlobalGhsMultiGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
- const std::string& /*projectName*/, const std::string& /*projectDir*/,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
+ const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
{
const char* gbuild =
this->CMakeInstance->GetCacheDefinition("CMAKE_MAKE_PROGRAM");
- makeCommand.push_back(
- this->SelectMakeProgram(makeProgram, (std::string)gbuild));
+ makeCommand.add(this->SelectMakeProgram(makeProgram, (std::string)gbuild));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back("-parallel");
+ makeCommand.add("-parallel");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
+
+ /* determine which top-project file to use */
+ std::string proj = projectName + ".top" + FILE_EXTENSION;
+ std::vector<std::string> files;
+ cmSystemTools::Glob(projectDir, ".*\\.top\\.gpj", files);
+ if (!files.empty()) {
+ auto p = std::find(files.begin(), files.end(), proj);
+ if (p == files.end()) {
+ proj = files.at(0);
+ }
+ }
+
+ makeCommand.add("-top", proj);
if (!targetName.empty()) {
if (targetName == "clean") {
- makeCommand.push_back("-clean");
+ makeCommand.add("-clean");
} else {
- makeCommand.push_back(targetName);
+ if (targetName.compare(targetName.size() - 4, 4, ".gpj") == 0) {
+ makeCommand.add(targetName);
+ } else {
+ makeCommand.add(targetName + ".gpj");
+ }
}
}
}
-void cmGlobalGhsMultiGenerator::WriteMacros()
+void cmGlobalGhsMultiGenerator::WriteMacros(std::ostream& fout)
{
char const* ghsGpjMacros =
this->GetCMakeInstance()->GetCacheDefinition("GHS_GPJ_MACROS");
@@ -331,12 +423,12 @@ void cmGlobalGhsMultiGenerator::WriteMacros()
for (std::vector<std::string>::const_iterator expandedListI =
expandedList.begin();
expandedListI != expandedList.end(); ++expandedListI) {
- *this->GetBuildFileStream() << "macro " << *expandedListI << std::endl;
+ fout << "macro " << *expandedListI << std::endl;
}
}
}
-void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
+void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives(std::ostream& fout)
{
/* set primary target */
std::string tgt;
@@ -356,183 +448,46 @@ void cmGlobalGhsMultiGenerator::WriteHighLevelDirectives()
tgt += ".tgt";
}
- *this->GetBuildFileStream() << "primaryTarget=" << tgt << std::endl;
+ fout << "primaryTarget=" << tgt << std::endl;
char const* const customization =
this->GetCMakeInstance()->GetCacheDefinition("GHS_CUSTOMIZATION");
if (NULL != customization && strlen(customization) > 0) {
- *this->GetBuildFileStream()
- << "customization=" << trimQuotes(customization) << std::endl;
+ fout << "customization=" << trimQuotes(customization) << std::endl;
this->GetCMakeInstance()->MarkCliAsUsed("GHS_CUSTOMIZATION");
}
}
-void cmGlobalGhsMultiGenerator::WriteCompilerOptions(std::string const& fOSDir)
-{
- *this->GetBuildFileStream()
- << " -os_dir=\"" << fOSDir << "\"" << std::endl;
-}
-
-void cmGlobalGhsMultiGenerator::WriteDisclaimer(std::ostream* os)
-{
- (*os) << "#" << std::endl
- << "# CMAKE generated file: DO NOT EDIT!" << std::endl
- << "# Generated by \"" << GetActualName() << "\""
- << " Generator, CMake Version " << cmVersion::GetMajorVersion() << "."
- << cmVersion::GetMinorVersion() << std::endl
- << "#" << std::endl;
-}
-
-void cmGlobalGhsMultiGenerator::AddFilesUpToPath(
- cmGeneratedFileStream* mainBuildFile,
- std::map<std::string, cmGeneratedFileStream*>* targetFolderBuildStreams,
- char const* homeOutputDirectory, std::string const& path,
- GhsMultiGpj::Types projType, std::string const& relPath)
+std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const& str)
{
- std::string workingPath(path);
- cmSystemTools::ConvertToUnixSlashes(workingPath);
- std::vector<std::string> splitPath = cmSystemTools::SplitString(workingPath);
- std::string workingRelPath(relPath);
- cmSystemTools::ConvertToUnixSlashes(workingRelPath);
- if (!workingRelPath.empty()) {
- workingRelPath += "/";
- }
- std::string pathUpTo;
- for (std::vector<std::string>::const_iterator splitPathI = splitPath.begin();
- splitPath.end() != splitPathI; ++splitPathI) {
- pathUpTo += *splitPathI;
- if (targetFolderBuildStreams->end() ==
- targetFolderBuildStreams->find(pathUpTo)) {
- AddFilesUpToPathNewBuildFile(
- mainBuildFile, targetFolderBuildStreams, homeOutputDirectory, pathUpTo,
- splitPath.begin() == splitPathI, workingRelPath, projType);
+ std::string result;
+ result.reserve(str.size());
+ for (const char* ch = str.c_str(); *ch != '\0'; ++ch) {
+ if (*ch != '"') {
+ result += *ch;
}
- AddFilesUpToPathAppendNextFile(targetFolderBuildStreams, pathUpTo,
- splitPathI, splitPath.end(), projType);
- pathUpTo += "/";
- }
-}
-
-void cmGlobalGhsMultiGenerator::Open(
- std::string const& mapKeyName, std::string const& fileName,
- std::map<std::string, cmGeneratedFileStream*>* fileMap)
-{
- if (fileMap->end() == fileMap->find(fileName)) {
- cmGeneratedFileStream* temp(new cmGeneratedFileStream);
- temp->open(fileName.c_str());
- (*fileMap)[mapKeyName] = temp;
- }
-}
-
-void cmGlobalGhsMultiGenerator::AddFilesUpToPathNewBuildFile(
- cmGeneratedFileStream* mainBuildFile,
- std::map<std::string, cmGeneratedFileStream*>* targetFolderBuildStreams,
- char const* homeOutputDirectory, std::string const& pathUpTo,
- bool const isFirst, std::string const& relPath,
- GhsMultiGpj::Types const projType)
-{
- // create folders up to file path
- std::string absPath = std::string(homeOutputDirectory) + "/" + relPath;
- std::string newPath = absPath + pathUpTo;
- if (!cmSystemTools::FileExists(newPath.c_str())) {
- cmSystemTools::MakeDirectory(newPath.c_str());
- }
-
- // Write out to filename for first time
- std::string relFilename(GetFileNameFromPath(pathUpTo));
- std::string absFilename = absPath + relFilename;
- Open(pathUpTo, absFilename, targetFolderBuildStreams);
- OpenBuildFileStream((*targetFolderBuildStreams)[pathUpTo]);
- GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]);
- WriteDisclaimer((*targetFolderBuildStreams)[pathUpTo]);
-
- // Add to main build file
- if (isFirst) {
- *mainBuildFile << relFilename << " ";
- GhsMultiGpj::WriteGpjTag(projType, mainBuildFile);
- }
-}
-
-void cmGlobalGhsMultiGenerator::AddFilesUpToPathAppendNextFile(
- std::map<std::string, cmGeneratedFileStream*>* targetFolderBuildStreams,
- std::string const& pathUpTo,
- std::vector<std::string>::const_iterator splitPathI,
- std::vector<std::string>::const_iterator end,
- GhsMultiGpj::Types const projType)
-{
- std::vector<std::string>::const_iterator splitPathNextI = splitPathI + 1;
- if (end != splitPathNextI &&
- targetFolderBuildStreams->end() ==
- targetFolderBuildStreams->find(pathUpTo + "/" + *splitPathNextI)) {
- std::string nextFilename(*splitPathNextI);
- nextFilename = GetFileNameFromPath(nextFilename);
- *(*targetFolderBuildStreams)[pathUpTo] << nextFilename << " ";
- GhsMultiGpj::WriteGpjTag(projType, (*targetFolderBuildStreams)[pathUpTo]);
}
+ return result;
}
-std::string cmGlobalGhsMultiGenerator::GetFileNameFromPath(
- std::string const& path)
+bool cmGlobalGhsMultiGenerator::TargetCompare::operator()(
+ cmGeneratorTarget const* l, cmGeneratorTarget const* r) const
{
- std::string output(path);
- if (!path.empty()) {
- cmSystemTools::ConvertToUnixSlashes(output);
- std::vector<std::string> splitPath = cmSystemTools::SplitString(output);
- output += "/" + splitPath.back() + FILE_EXTENSION;
+ // Make sure a given named target is ordered first,
+ // e.g. to set ALL_BUILD as the default active project.
+ // When the empty string is named this is a no-op.
+ if (r->GetName() == this->First) {
+ return false;
}
- return output;
-}
-
-void cmGlobalGhsMultiGenerator::UpdateBuildFiles(
- const std::vector<cmGeneratorTarget*>& tgts)
-{
- for (std::vector<cmGeneratorTarget*>::const_iterator tgtsI = tgts.begin();
- tgtsI != tgts.end(); ++tgtsI) {
- const cmGeneratorTarget* tgt = *tgtsI;
- if (IsTgtForBuild(tgt)) {
- std::string folderName = tgt->GetEffectiveFolderName();
- if (this->TargetFolderBuildStreams.end() ==
- this->TargetFolderBuildStreams.find(folderName)) {
- this->AddFilesUpToPath(
- GetBuildFileStream(), &this->TargetFolderBuildStreams,
- this->GetCMakeInstance()->GetHomeOutputDirectory().c_str(),
- folderName, GhsMultiGpj::PROJECT);
- }
- std::vector<std::string> splitPath = cmSystemTools::SplitString(
- cmGhsMultiTargetGenerator::GetRelBuildFileName(tgt));
- std::string foldNameRelBuildFile(*(splitPath.end() - 2) + "/" +
- splitPath.back());
- *this->TargetFolderBuildStreams[folderName] << foldNameRelBuildFile
- << " ";
- GhsMultiGpj::WriteGpjTag(cmGhsMultiTargetGenerator::GetGpjTag(tgt),
- this->TargetFolderBuildStreams[folderName]);
- }
+ if (l->GetName() == this->First) {
+ return true;
}
+ return l->GetName() < r->GetName();
}
-bool cmGlobalGhsMultiGenerator::IsTgtForBuild(const cmGeneratorTarget* tgt)
+cmGlobalGhsMultiGenerator::OrderedTargetDependSet::OrderedTargetDependSet(
+ TargetDependSet const& targets, std::string const& first)
+ : derived(TargetCompare(first))
{
- const std::string config =
- tgt->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE");
- std::vector<cmSourceFile*> tgtSources;
- tgt->GetSourceFiles(tgtSources, config);
- bool tgtInBuild = true;
- char const* excludeFromAll = tgt->GetProperty("EXCLUDE_FROM_ALL");
- if (NULL != excludeFromAll && '1' == excludeFromAll[0] &&
- '\0' == excludeFromAll[1]) {
- tgtInBuild = false;
- }
- return !tgtSources.empty() && tgtInBuild;
-}
-
-std::string cmGlobalGhsMultiGenerator::trimQuotes(std::string const& str)
-{
- std::string result;
- result.reserve(str.size());
- for (const char* ch = str.c_str(); *ch != '\0'; ++ch) {
- if (*ch != '"') {
- result += *ch;
- }
- }
- return result;
+ this->insert(targets.begin(), targets.end());
}
diff --git a/Source/cmGlobalGhsMultiGenerator.h b/Source/cmGlobalGhsMultiGenerator.h
index 13c511302..bc2b199a0 100644
--- a/Source/cmGlobalGhsMultiGenerator.h
+++ b/Source/cmGlobalGhsMultiGenerator.h
@@ -13,7 +13,7 @@ class cmGeneratedFileStream;
class cmGlobalGhsMultiGenerator : public cmGlobalGenerator
{
public:
- /// The default name of GHS MULTI's build file. Typically: monolith.gpj.
+ // The default filename extension of GHS MULTI's build files.
static const char* FILE_EXTENSION;
cmGlobalGhsMultiGenerator(cmake* cm);
@@ -25,13 +25,13 @@ public:
}
///! create the correct local generator
- virtual cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf);
+ cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override;
/// @return the name of this generator.
static std::string GetActualName() { return "Green Hills MULTI"; }
///! Get the name for this generator
- virtual std::string GetName() const { return this->GetActualName(); }
+ std::string GetName() const override { return this->GetActualName(); }
/// Overloaded methods. @see cmGlobalGenerator::GetDocumentation()
static void GetDocumentation(cmDocumentationEntry& entry);
@@ -49,83 +49,85 @@ public:
static bool SupportsPlatform() { return true; }
// Toolset / Platform Support
- virtual bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf);
- virtual bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf);
+ bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override;
+ bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
/**
* Try to determine system information such as shared library
* extension, pthreads, byte order etc.
*/
- virtual void EnableLanguage(std::vector<std::string> const& languages,
- cmMakefile*, bool optional);
+ void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
+ bool optional) override;
/*
* Determine what program to use for building the project.
*/
bool FindMakeProgram(cmMakefile* mf) override;
- cmGeneratedFileStream* GetBuildFileStream()
- {
- return this->TargetFolderBuildStreams[""];
- }
+ void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const override;
- static void OpenBuildFileStream(std::string const& filepath,
- cmGeneratedFileStream** filestream);
- static void OpenBuildFileStream(cmGeneratedFileStream* filestream);
- static void CloseBuildFileStream(cmGeneratedFileStream** filestream);
- /// Write the common disclaimer text at the top of each build file.
- static void WriteDisclaimer(std::ostream* os);
- std::vector<std::string> GetLibDirs() { return this->LibDirs; }
-
- static void AddFilesUpToPath(
- cmGeneratedFileStream* mainBuildFile,
- std::map<std::string, cmGeneratedFileStream*>* targetFolderBuildStreams,
- char const* homeOutputDirectory, std::string const& path,
- GhsMultiGpj::Types projType, std::string const& relPath = "");
- static void Open(std::string const& mapKeyName, std::string const& fileName,
- std::map<std::string, cmGeneratedFileStream*>* fileMap);
-
- static std::string trimQuotes(std::string const& str);
- inline bool IsOSDirRelative() { return this->OSDirRelative; }
+ // Write the common disclaimer text at the top of each build file.
+ void WriteFileHeader(std::ostream& fout);
+
+ // Target dependency sorting
+ class TargetSet : public std::set<cmGeneratorTarget const*>
+ {
+ };
+ class TargetCompare
+ {
+ std::string First;
+
+ public:
+ TargetCompare(std::string const& first)
+ : First(first)
+ {
+ }
+ bool operator()(cmGeneratorTarget const* l,
+ cmGeneratorTarget const* r) const;
+ };
+ class OrderedTargetDependSet;
protected:
- virtual void Generate();
- virtual void GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
- const std::string& projectName, const std::string& projectDir,
- const std::string& targetName, const std::string& config, bool fast,
- int jobs, bool verbose,
- std::vector<std::string> const& makeOptions = std::vector<std::string>());
+ void Generate() override;
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
+ const std::string& makeProgram,
+ const std::string& projectName,
+ const std::string& projectDir,
+ const std::string& targetName,
+ const std::string& config, bool fast, int jobs,
+ bool verbose,
+ std::vector<std::string> const& makeOptions =
+ std::vector<std::string>()) override;
private:
- void GetToolset(cmMakefile* mf, std::string& tsd, std::string& ts);
- void OpenBuildFileStream();
-
- void WriteMacros();
- void WriteHighLevelDirectives();
- void WriteCompilerOptions(std::string const& fOSDir);
-
- static void AddFilesUpToPathNewBuildFile(
- cmGeneratedFileStream* mainBuildFile,
- std::map<std::string, cmGeneratedFileStream*>* targetFolderBuildStreams,
- char const* homeOutputDirectory, std::string const& pathUpTo, bool isFirst,
- std::string const& relPath, GhsMultiGpj::Types projType);
- static void AddFilesUpToPathAppendNextFile(
- std::map<std::string, cmGeneratedFileStream*>* targetFolderBuildStreams,
- std::string const& pathUpTo,
- std::vector<std::string>::const_iterator splitPathI,
- std::vector<std::string>::const_iterator end, GhsMultiGpj::Types projType);
- static std::string GetFileNameFromPath(std::string const& path);
- void UpdateBuildFiles(const std::vector<cmGeneratorTarget*>& tgts);
- bool IsTgtForBuild(const cmGeneratorTarget* tgt);
-
- std::vector<cmGeneratedFileStream*> TargetSubProjects;
- std::map<std::string, cmGeneratedFileStream*> TargetFolderBuildStreams;
-
- std::vector<std::string> LibDirs;
-
- bool OSDirRelative;
+ void GetToolset(cmMakefile* mf, std::string& tsd, const std::string& ts);
+
+ /* top-level project */
+ void OutputTopLevelProject(cmLocalGenerator* root,
+ std::vector<cmLocalGenerator*>& generators);
+ void WriteTopLevelProject(std::ostream& fout, cmLocalGenerator* root,
+ std::vector<cmLocalGenerator*>& generators);
+ void WriteMacros(std::ostream& fout);
+ void WriteHighLevelDirectives(std::ostream& fout);
+ void WriteSubProjects(std::ostream& fout, cmLocalGenerator* root,
+ std::vector<cmLocalGenerator*>& generators);
+
+ std::string trimQuotes(std::string const& str);
+
static const char* DEFAULT_BUILD_PROGRAM;
static const char* DEFAULT_TOOLSET_ROOT;
};
+class cmGlobalGhsMultiGenerator::OrderedTargetDependSet
+ : public std::multiset<cmTargetDepend,
+ cmGlobalGhsMultiGenerator::TargetCompare>
+{
+ typedef std::multiset<cmTargetDepend,
+ cmGlobalGhsMultiGenerator::TargetCompare>
+ derived;
+
+public:
+ typedef cmGlobalGenerator::TargetDependSet TargetDependSet;
+ OrderedTargetDependSet(TargetDependSet const&, std::string const& first);
+};
+
#endif
diff --git a/Source/cmGlobalJOMMakefileGenerator.cxx b/Source/cmGlobalJOMMakefileGenerator.cxx
index 0f41ea148..2b7f48695 100644
--- a/Source/cmGlobalJOMMakefileGenerator.cxx
+++ b/Source/cmGlobalJOMMakefileGenerator.cxx
@@ -6,6 +6,7 @@
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmState.h"
+#include "cmake.h"
cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator(cmake* cm)
: cmGlobalUnixMakefileGenerator3(cm)
@@ -54,7 +55,7 @@ void cmGlobalJOMMakefileGenerator::PrintCompilerAdvice(
}
void cmGlobalJOMMakefileGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalJOMMakefileGenerator.h b/Source/cmGlobalJOMMakefileGenerator.h
index bcf46d031..aa8b5fbb0 100644
--- a/Source/cmGlobalJOMMakefileGenerator.h
+++ b/Source/cmGlobalJOMMakefileGenerator.h
@@ -40,7 +40,7 @@ public:
bool optional) override;
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalMSYSMakefileGenerator.cxx b/Source/cmGlobalMSYSMakefileGenerator.cxx
index 3f223824a..3c2455662 100644
--- a/Source/cmGlobalMSYSMakefileGenerator.cxx
+++ b/Source/cmGlobalMSYSMakefileGenerator.cxx
@@ -7,6 +7,7 @@
#include "cmDocumentationEntry.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmake.h"
diff --git a/Source/cmGlobalMinGWMakefileGenerator.cxx b/Source/cmGlobalMinGWMakefileGenerator.cxx
index 3c3a5d1dc..c6d46e936 100644
--- a/Source/cmGlobalMinGWMakefileGenerator.cxx
+++ b/Source/cmGlobalMinGWMakefileGenerator.cxx
@@ -6,6 +6,7 @@
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmState.h"
+#include "cmake.h"
cmGlobalMinGWMakefileGenerator::cmGlobalMinGWMakefileGenerator(cmake* cm)
: cmGlobalUnixMakefileGenerator3(cm)
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index eb66bd12b..ffe95f905 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -6,6 +6,7 @@
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmState.h"
+#include "cmake.h"
cmGlobalNMakeMakefileGenerator::cmGlobalNMakeMakefileGenerator(cmake* cm)
: cmGlobalUnixMakefileGenerator3(cm)
@@ -54,7 +55,7 @@ void cmGlobalNMakeMakefileGenerator::PrintCompilerAdvice(
}
void cmGlobalNMakeMakefileGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int /*jobs*/, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalNMakeMakefileGenerator.h b/Source/cmGlobalNMakeMakefileGenerator.h
index 62dea6ebc..06c48e22b 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.h
+++ b/Source/cmGlobalNMakeMakefileGenerator.h
@@ -45,7 +45,7 @@ public:
bool optional) override;
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index f51340377..920f6393c 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -19,9 +19,11 @@
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmGeneratorTarget.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmLocalNinjaGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmNinjaLinkLineComputer.h"
#include "cmOutputConverter.h"
#include "cmState.h"
@@ -111,7 +113,7 @@ std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit)
std::string cmGlobalNinjaGenerator::EncodePath(const std::string& path)
{
- std::string result = path; // NOLINT(clang-tidy)
+ std::string result = path;
#ifdef _WIN32
if (this->IsGCCOnWindows())
std::replace(result.begin(), result.end(), '\\', '/');
@@ -253,7 +255,7 @@ void cmGlobalNinjaGenerator::WriteCustomCommandBuild(
bool restat, const cmNinjaDeps& outputs, const cmNinjaDeps& deps,
const cmNinjaDeps& orderOnly)
{
- std::string cmd = command; // NOLINT(clang-tidy)
+ std::string cmd = command; // NOLINT(*)
#ifdef _WIN32
if (cmd.empty())
// TODO Shouldn't an empty command be handled by ninja?
@@ -446,14 +448,13 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator(cmake* cm)
, BuildFileStream(nullptr)
, RulesFileStream(nullptr)
, CompileCommandsStream(nullptr)
- , Rules()
- , AllDependencies()
, UsingGCCOnWindows(false)
, ComputingUnknownDependencies(false)
, PolicyCMP0058(cmPolicies::WARN)
, NinjaSupportsConsolePool(false)
, NinjaSupportsImplicitOuts(false)
, NinjaSupportsManifestRestat(false)
+ , NinjaSupportsMultilineDepfile(false)
, NinjaSupportsDyndeps(0)
{
#ifdef _WIN32
@@ -502,8 +503,9 @@ void cmGlobalNinjaGenerator::Generate()
std::ostringstream msg;
msg << "The detected version of Ninja (" << this->NinjaVersion;
msg << ") is less than the version of Ninja required by CMake (";
- msg << this->RequiredNinjaVersion() << ").";
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, msg.str());
+ msg << cmGlobalNinjaGenerator::RequiredNinjaVersion() << ").";
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ msg.str());
return;
}
this->OpenBuildFileStream();
@@ -549,13 +551,13 @@ bool cmGlobalNinjaGenerator::FindMakeProgram(cmMakefile* mf)
this->NinjaCommand = ninjaCommand;
std::vector<std::string> command;
command.push_back(this->NinjaCommand);
- command.push_back("--version");
+ command.emplace_back("--version");
std::string version;
std::string error;
if (!cmSystemTools::RunSingleCommand(command, &version, &error, nullptr,
nullptr,
cmSystemTools::OUTPUT_NONE)) {
- mf->IssueMessage(cmake::FATAL_ERROR,
+ mf->IssueMessage(MessageType::FATAL_ERROR,
"Running\n '" + cmJoin(command, "' '") +
"'\n"
"failed with:\n " +
@@ -576,10 +578,13 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
RequiredNinjaVersionForConsolePool().c_str());
this->NinjaSupportsImplicitOuts = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
- this->RequiredNinjaVersionForImplicitOuts().c_str());
+ cmGlobalNinjaGenerator::RequiredNinjaVersionForImplicitOuts().c_str());
this->NinjaSupportsManifestRestat = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
RequiredNinjaVersionForManifestRestat().c_str());
+ this->NinjaSupportsMultilineDepfile = !cmSystemTools::VersionCompare(
+ cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
+ RequiredNinjaVersionForMultilineDepfile().c_str());
{
// Our ninja branch adds ".dyndep-#" to its version number,
// where '#' is a feature-specific version number. Extract it.
@@ -635,7 +640,7 @@ bool cmGlobalNinjaGenerator::CheckFortran(cmMakefile* mf) const
;
/* clang-format on */
}
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -672,31 +677,28 @@ void cmGlobalNinjaGenerator::EnableLanguage(
// Called by:
// cmGlobalGenerator::Build()
void cmGlobalNinjaGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& /*projectName*/, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& /*config*/, bool /*fast*/,
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
{
- makeCommand.push_back(this->SelectMakeProgram(makeProgram));
+ makeCommand.add(this->SelectMakeProgram(makeProgram));
if (verbose) {
- makeCommand.push_back("-v");
+ makeCommand.add("-v");
}
if ((jobs != cmake::NO_BUILD_PARALLEL_LEVEL) &&
(jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL)) {
- makeCommand.push_back("-j");
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add("-j", std::to_string(jobs));
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
if (!targetName.empty()) {
if (targetName == "clean") {
- makeCommand.push_back("-t");
- makeCommand.push_back("clean");
+ makeCommand.add("-t", "clean");
} else {
- makeCommand.push_back(targetName);
+ makeCommand.add(targetName);
}
}
}
@@ -837,7 +839,7 @@ static void EnsureTrailingSlash(std::string& path)
if (path.empty()) {
return;
}
- std::string::value_type last = path[path.size() - 1];
+ std::string::value_type last = path.back();
#ifdef _WIN32
if (last != '\\') {
path += '\\';
@@ -860,7 +862,7 @@ std::string const& cmGlobalNinjaGenerator::ConvertToNinjaPath(
cmLocalNinjaGenerator* ng =
static_cast<cmLocalNinjaGenerator*>(this->LocalGenerators[0]);
std::string const& bin_dir = ng->GetState()->GetBinaryDirectory();
- std::string convPath = ng->ConvertToRelativePath(bin_dir, path);
+ std::string convPath = ng->MaybeConvertToRelativePath(bin_dir, path);
convPath = this->NinjaOutputPath(convPath);
#ifdef _WIN32
std::replace(convPath.begin(), convPath.end(), '/', '\\');
@@ -1008,10 +1010,11 @@ void cmGlobalNinjaGenerator::AppendTargetDepends(
{
if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
// These depend only on other CMake-provided targets, e.g. "all".
- std::set<std::string> const& utils = target->GetUtilities();
- for (std::string const& util : utils) {
+ std::set<BT<std::string>> const& utils = target->GetUtilities();
+ for (BT<std::string> const& util : utils) {
std::string d =
- target->GetLocalGenerator()->GetCurrentBinaryDirectory() + "/" + util;
+ target->GetLocalGenerator()->GetCurrentBinaryDirectory() + "/" +
+ util.Value;
outputs.push_back(this->ConvertToNinjaPath(d));
}
} else {
@@ -1300,7 +1303,8 @@ void cmGlobalNinjaGenerator::WriteUnknownExplicitDependencies(std::ostream& os)
"options to the custom commands that produce these files."
;
/* clang-format on */
- this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
+ w.str());
}
}
@@ -1423,10 +1427,13 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
<< "is less than the version of Ninja required by CMake for adding "
"restat dependencies to the build.ninja manifest regeneration "
"target:\n"
- << " " << this->RequiredNinjaVersionForManifestRestat() << "\n";
+ << " "
+ << cmGlobalNinjaGenerator::RequiredNinjaVersionForManifestRestat()
+ << "\n";
msg << "Any pre-check scripts, such as those generated for file(GLOB "
"CONFIGURE_DEPENDS), will not be run by Ninja.";
- this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
+ this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
+ msg.str());
}
std::sort(implicitDeps.begin(), implicitDeps.end());
@@ -1475,6 +1482,11 @@ bool cmGlobalNinjaGenerator::SupportsManifestRestat() const
return this->NinjaSupportsManifestRestat;
}
+bool cmGlobalNinjaGenerator::SupportsMultilineDepfile() const
+{
+ return this->NinjaSupportsMultilineDepfile;
+}
+
void cmGlobalNinjaGenerator::WriteTargetClean(std::ostream& os)
{
WriteRule(*this->RulesFileStream, "CLEAN", ninjaCmd() + " -t clean",
@@ -1667,6 +1679,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
return 1;
}
+ cmFortranCompiler fc;
std::vector<std::string> includes;
{
Json::Value tdio;
@@ -1688,11 +1701,20 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
includes.push_back(tdi_include_dir.asString());
}
}
+
+ Json::Value const& tdi_compiler_id = tdi["compiler-id"];
+ fc.Id = tdi_compiler_id.asString();
+
+ Json::Value const& tdi_submodule_sep = tdi["submodule-sep"];
+ fc.SModSep = tdi_submodule_sep.asString();
+
+ Json::Value const& tdi_submodule_ext = tdi["submodule-ext"];
+ fc.SModExt = tdi_submodule_ext.asString();
}
cmFortranSourceInfo info;
std::set<std::string> defines;
- cmFortranParser parser(includes, defines, info);
+ cmFortranParser parser(fc, includes, defines, info);
if (!cmFortranParser_FilePush(&parser, arg_pp.c_str())) {
cmSystemTools::Error("-E cmake_ninja_depends failed to open ",
arg_pp.c_str());
@@ -1933,12 +1955,12 @@ int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
}
}
- cmake cm(cmake::RoleInternal);
+ cmake cm(cmake::RoleInternal, cmState::Unknown);
cm.SetHomeDirectory(dir_top_src);
cm.SetHomeOutputDirectory(dir_top_bld);
std::unique_ptr<cmGlobalNinjaGenerator> ggd(
static_cast<cmGlobalNinjaGenerator*>(cm.CreateGlobalGenerator("Ninja")));
- if (!ggd.get() ||
+ if (!ggd ||
!ggd->WriteDyndepFile(dir_top_src, dir_top_bld, dir_cur_src, dir_cur_bld,
arg_dd, arg_ddis, module_dir,
linked_target_dirs)) {
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 00fa348c0..c619e672f 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -183,8 +183,6 @@ public:
return new cmGlobalGeneratorSimpleFactory<cmGlobalNinjaGenerator>();
}
- ~cmGlobalNinjaGenerator() override {}
-
cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override;
std::string GetName() const override
@@ -202,7 +200,7 @@ public:
void EnableLanguage(std::vector<std::string> const& languages,
cmMakefile* mf, bool optional) override;
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -331,9 +329,9 @@ public:
return LocalGenerators;
}
- bool IsExcluded(cmLocalGenerator* root, cmGeneratorTarget* target)
+ bool IsExcluded(cmGeneratorTarget* target)
{
- return cmGlobalGenerator::IsExcluded(root, target);
+ return cmGlobalGenerator::IsExcluded(target);
}
int GetRuleCmdLength(const std::string& name) { return RuleCmdLength[name]; }
@@ -347,9 +345,14 @@ public:
static std::string RequiredNinjaVersionForConsolePool() { return "1.5"; }
static std::string RequiredNinjaVersionForImplicitOuts() { return "1.7"; }
static std::string RequiredNinjaVersionForManifestRestat() { return "1.8"; }
+ static std::string RequiredNinjaVersionForMultilineDepfile()
+ {
+ return "1.9";
+ }
bool SupportsConsolePool() const;
bool SupportsImplicitOuts() const;
bool SupportsManifestRestat() const;
+ bool SupportsMultilineDepfile() const;
std::string NinjaOutputPath(std::string const& path) const;
bool HasOutputPathPrefix() const { return !this->OutputPathPrefix.empty(); }
@@ -463,6 +466,7 @@ private:
bool NinjaSupportsConsolePool;
bool NinjaSupportsImplicitOuts;
bool NinjaSupportsManifestRestat;
+ bool NinjaSupportsMultilineDepfile;
unsigned long NinjaSupportsDyndeps;
private:
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index db7235366..dac6ea606 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -7,6 +7,7 @@
#include <sstream>
#include <utility>
+#include "cmAlgorithms.h"
#include "cmDocumentationEntry.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
@@ -145,7 +146,7 @@ void cmGlobalUnixMakefileGenerator3::Generate()
for (cmLocalGenerator* lg : this->LocalGenerators) {
std::string markFileName = lg->GetCurrentBinaryDirectory();
markFileName += "/";
- markFileName += cmake::GetCMakeFilesDirectory();
+ markFileName += "/CMakeFiles";
markFileName += "/progress.marks";
cmGeneratedFileStream markFile(markFileName);
markFile << this->CountProgressMarksInAll(lg) << "\n";
@@ -195,7 +196,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
// see if the build system must be regenerated.
std::string makefileName =
this->GetCMakeInstance()->GetHomeOutputDirectory();
- makefileName += cmake::GetCMakeFilesDirectory();
+ makefileName += "/CMakeFiles";
makefileName += "/Makefile2";
cmGeneratedFileStream makefileStream(makefileName, false,
this->GetMakefileEncoding());
@@ -215,7 +216,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainMakefile2()
// Just depend on the all target to drive the build.
std::vector<std::string> depends;
std::vector<std::string> no_commands;
- depends.push_back("all");
+ depends.emplace_back("all");
// Write the rule.
lg->WriteMakeRule(makefileStream,
@@ -267,7 +268,7 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
// see if the build system must be regenerated.
std::string cmakefileName =
this->GetCMakeInstance()->GetHomeOutputDirectory();
- cmakefileName += cmake::GetCMakeFilesDirectory();
+ cmakefileName += "/CMakeFiles";
cmakefileName += "/Makefile.cmake";
cmGeneratedFileStream cmakefileStream(cmakefileName);
if (!cmakefileStream) {
@@ -324,23 +325,26 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"CMakeCache.txt\"\n";
for (std::string const& f : lfiles) {
- cmakefileStream << " \"" << lg->ConvertToRelativePath(currentBinDir, f)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(currentBinDir, f)
<< "\"\n";
}
cmakefileStream << " )\n\n";
// Build the path to the cache check file.
std::string check = this->GetCMakeInstance()->GetHomeOutputDirectory();
- check += cmake::GetCMakeFilesDirectory();
+ check += "/CMakeFiles";
check += "/cmake.check_cache";
// Set the corresponding makefile in the cmake file.
cmakefileStream << "# The corresponding makefile is:\n"
<< "set(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \""
- << lg->ConvertToRelativePath(currentBinDir, makefileName)
+ << lg->MaybeConvertToRelativePath(currentBinDir,
+ makefileName)
<< "\"\n"
- << " \"" << lg->ConvertToRelativePath(currentBinDir, check)
+ << " \""
+ << lg->MaybeConvertToRelativePath(currentBinDir, check)
<< "\"\n";
cmakefileStream << " )\n\n";
@@ -353,7 +357,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
const std::vector<std::string>& outfiles =
lg->GetMakefile()->GetOutputFiles();
for (std::string const& outfile : outfiles) {
- cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, outfile)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(binDir, outfile)
<< "\"\n";
}
@@ -362,9 +367,10 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
for (cmLocalGenerator* localGen : this->LocalGenerators) {
lg = static_cast<cmLocalUnixMakefileGenerator3*>(localGen);
tmpStr = lg->GetCurrentBinaryDirectory();
- tmpStr += cmake::GetCMakeFilesDirectory();
+ tmpStr += "/CMakeFiles";
tmpStr += "/CMakeDirectoryInformation.cmake";
- cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, tmpStr)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(binDir, tmpStr)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -473,7 +479,7 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
// Begin the directory-level rules section.
std::string dir =
- cmSystemTools::ConvertToOutputPath(lg->ConvertToRelativePath(
+ cmSystemTools::ConvertToOutputPath(lg->MaybeConvertToRelativePath(
lg->GetBinaryDirectory(), lg->GetCurrentBinaryDirectory()));
lg->WriteDivider(ruleFileStream);
ruleFileStream << "# Directory level rules for directory " << dir << "\n\n";
@@ -489,11 +495,12 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
}
void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& /*projectName*/, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& /*config*/, bool fast,
- int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
+ int jobs, bool verbose, std::vector<std::string> const& makeOptions)
{
+ std::unique_ptr<cmMakefile> mfu;
cmMakefile* mf;
if (!this->Makefiles.empty()) {
mf = this->Makefiles[0];
@@ -504,33 +511,37 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
snapshot.GetDirectory().SetCurrentBinary(
this->CMakeInstance->GetHomeOutputDirectory());
snapshot.SetDefaultDefinitions();
- mf = new cmMakefile(this, snapshot);
+ mfu = cm::make_unique<cmMakefile>(this, snapshot);
+ mf = mfu.get();
}
- makeCommand.push_back(this->SelectMakeProgram(makeProgram));
+ // Make it possible to set verbosity also from command line
+ if (verbose) {
+ makeCommand.add(cmSystemTools::GetCMakeCommand());
+ makeCommand.add("-E");
+ makeCommand.add("env");
+ makeCommand.add("VERBOSE=1");
+ }
+ makeCommand.add(this->SelectMakeProgram(makeProgram));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back("-j");
+ makeCommand.add("-j");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
if (!targetName.empty()) {
std::string tname = targetName;
if (fast) {
tname += "/fast";
}
- cmOutputConverter conv(mf->GetStateSnapshot());
tname =
- conv.ConvertToRelativePath(mf->GetState()->GetBinaryDirectory(), tname);
+ mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfNotContained(
+ mf->GetState()->GetBinaryDirectory(), tname);
cmSystemTools::ConvertToOutputSlashes(tname);
- makeCommand.push_back(std::move(tname));
- }
- if (this->Makefiles.empty()) {
- delete mf;
+ makeCommand.add(std::move(tname));
}
}
@@ -542,7 +553,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
// write the target convenience rules
@@ -572,12 +583,12 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
// Write the rule.
commands.clear();
- std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string tmp = "CMakeFiles/";
tmp += "Makefile2";
- commands.push_back(lg->GetRecursiveMakeCall(tmp.c_str(), name));
+ commands.push_back(lg->GetRecursiveMakeCall(tmp, name));
depends.clear();
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
lg->WriteMakeRule(ruleFileStream, "Build rule for target.", name,
depends, commands, true);
@@ -594,7 +605,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
localName = name;
localName += "/fast";
commands.push_back(
- lg->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName));
+ lg->GetRecursiveMakeCall(makefileName, makeTargetName));
lg->WriteMakeRule(ruleFileStream, "fast build rule for target.",
localName, depends, commands, true);
@@ -608,7 +619,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
depends.clear();
commands.clear();
commands.push_back(
- lg->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName));
+ lg->GetRecursiveMakeCall(makefileName, makeTargetName));
lg->WriteMakeRule(ruleFileStream,
"Manual pre-install relink rule for target.",
localName, depends, commands, true);
@@ -631,7 +642,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
bool regenerate = !this->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
// for each target Generate the rule files for each target.
@@ -659,12 +670,12 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
makeTargetName = localName;
makeTargetName += "/depend";
commands.push_back(
- lg->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName));
+ lg->GetRecursiveMakeCall(makefileName, makeTargetName));
makeTargetName = localName;
makeTargetName += "/build";
commands.push_back(
- lg->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName));
+ lg->GetRecursiveMakeCall(makefileName, makeTargetName));
// Write the rule.
localName += "/all";
@@ -672,7 +683,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
cmLocalUnixMakefileGenerator3::EchoProgress progress;
progress.Dir = lg->GetBinaryDirectory();
- progress.Dir += cmake::GetCMakeFilesDirectory();
+ progress.Dir += "/CMakeFiles";
{
std::ostringstream progressArg;
const char* sep = "";
@@ -702,7 +713,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
localName, depends, commands, true);
// add the all/all dependency
- if (!this->IsExcluded(this->LocalGenerators[0], gtarget)) {
+ if (!this->IsExcluded(gtarget)) {
depends.clear();
depends.push_back(localName);
commands.clear();
@@ -726,9 +737,9 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
progCmd << " " << this->CountProgressMarksInTarget(gtarget, emitted);
commands.push_back(progCmd.str());
}
- std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string tmp = "CMakeFiles/";
tmp += "Makefile2";
- commands.push_back(lg->GetRecursiveMakeCall(tmp.c_str(), localName));
+ commands.push_back(lg->GetRecursiveMakeCall(tmp, localName));
{
std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
@@ -740,7 +751,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
}
depends.clear();
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
localName = lg->GetRelativeTargetDirectory(gtarget);
localName += "/rule";
@@ -761,13 +772,12 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
localName += "/preinstall";
depends.clear();
commands.clear();
- commands.push_back(
- lg->GetRecursiveMakeCall(makefileName.c_str(), localName));
+ commands.push_back(lg->GetRecursiveMakeCall(makefileName, localName));
lg->WriteMakeRule(ruleFileStream,
"Pre-install relink rule for target.", localName,
depends, commands, true);
- if (!this->IsExcluded(this->LocalGenerators[0], gtarget)) {
+ if (!this->IsExcluded(gtarget)) {
depends.clear();
depends.push_back(localName);
commands.clear();
@@ -783,7 +793,7 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2(
depends.clear();
commands.clear();
commands.push_back(
- lg->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName));
+ lg->GetRecursiveMakeCall(makefileName, makeTargetName));
lg->WriteMakeRule(ruleFileStream, "clean rule for target.",
makeTargetName, depends, commands, true);
commands.clear();
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index a2ad09516..8a80acc05 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -127,7 +127,7 @@ public:
std::string GetEmptyRuleHackDepends() { return this->EmptyRuleHackDepends; }
// change the build command for speed
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -217,11 +217,7 @@ protected:
// Store per-target progress counters.
struct TargetProgress
{
- TargetProgress()
- : NumberOfActions(0)
- {
- }
- unsigned long NumberOfActions;
+ unsigned long NumberOfActions = 0;
std::string VariableFile;
std::vector<unsigned long> Marks;
void WriteProgressVariables(unsigned long total, unsigned long& current);
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 82fcaadde..d8b2e892c 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -7,20 +7,13 @@
#include "cmGeneratorTarget.h"
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSourceFile.h"
-#include "cmVS10CLFlagTable.h"
-#include "cmVS10CSharpFlagTable.h"
-#include "cmVS10CudaFlagTable.h"
-#include "cmVS10CudaHostFlagTable.h"
-#include "cmVS10LibFlagTable.h"
-#include "cmVS10LinkFlagTable.h"
-#include "cmVS10MASMFlagTable.h"
-#include "cmVS10NASMFlagTable.h"
-#include "cmVS10RCFlagTable.h"
#include "cmVersion.h"
#include "cmVisualStudioSlnData.h"
#include "cmVisualStudioSlnParser.h"
#include "cmXMLWriter.h"
+#include "cm_jsoncpp_reader.h"
#include "cmake.h"
#include "cmsys/FStream.hxx"
@@ -30,6 +23,7 @@
#include <algorithm>
static const char vs10generatorName[] = "Visual Studio 10 2010";
+static std::map<std::string, std::vector<cmIDEFlagTable>> loadedFlagJsonFiles;
// Map generator name without year to name with year.
static const char* cmVS10GenName(const std::string& name, std::string& genName)
@@ -80,15 +74,34 @@ public:
"Optional [arch] can be \"Win64\" or \"IA64\".";
}
- void GetGenerators(std::vector<std::string>& names) const override
+ std::vector<std::string> GetGeneratorNames() const override
{
+ std::vector<std::string> names;
names.push_back(vs10generatorName);
+ return names;
+ }
+
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ std::vector<std::string> names;
names.push_back(vs10generatorName + std::string(" IA64"));
names.push_back(vs10generatorName + std::string(" Win64"));
+ 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("Itanium");
+ return platforms;
+ }
+
+ std::string GetDefaultPlatformName() const override { return "Win32"; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
@@ -97,8 +110,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
}
cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
- cmake* cm, const std::string& name, const std::string& platformName)
- : cmGlobalVisualStudio8Generator(cm, name, platformName)
+ cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudio8Generator(cm, name, platformInGeneratorName)
{
std::string vc10Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
@@ -120,15 +134,16 @@ cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
this->DefaultPlatformToolset = "v100";
}
}
- this->DefaultClFlagTable = cmVS10CLFlagTable;
- this->DefaultCSharpFlagTable = cmVS10CSharpFlagTable;
- this->DefaultLibFlagTable = cmVS10LibFlagTable;
- this->DefaultLinkFlagTable = cmVS10LinkFlagTable;
- this->DefaultCudaFlagTable = cmVS10CudaFlagTable;
- this->DefaultCudaHostFlagTable = cmVS10CudaHostFlagTable;
- this->DefaultMasmFlagTable = cmVS10MASMFlagTable;
- this->DefaultNasmFlagTable = cmVS10NASMFlagTable;
- this->DefaultRcFlagTable = cmVS10RCFlagTable;
+ this->DefaultCLFlagTableName = "v10";
+ this->DefaultCSharpFlagTableName = "v10";
+ this->DefaultLibFlagTableName = "v10";
+ this->DefaultLinkFlagTableName = "v10";
+ this->DefaultCudaFlagTableName = "v10";
+ this->DefaultCudaHostFlagTableName = "v10";
+ this->DefaultMasmFlagTableName = "v10";
+ this->DefaultNasmFlagTableName = "v10";
+ this->DefaultRCFlagTableName = "v10";
+
this->Version = VS10;
this->PlatformToolsetNeedsDebugEnum = false;
}
@@ -184,7 +199,7 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
std::ostringstream e;
e << this->GetName() << " Windows CE version '" << this->SystemVersion
<< "' requires CMAKE_GENERATOR_TOOLSET to be set.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -257,7 +272,7 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
"contains an invalid version specification."
;
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
// Clear the configured tool-set
this->GeneratorToolsetVersion.clear();
@@ -284,7 +299,7 @@ bool cmGlobalVisualStudio10Generator::SetGeneratorToolset(
" " << toolsetPath;
;
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
// Clear the configured tool-set
this->GeneratorToolsetVersion.clear();
@@ -338,7 +353,7 @@ bool cmGlobalVisualStudio10Generator::ParseGeneratorToolset(
"that contains a field after the first ',' with no '='."
;
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
std::string const key = fi->substr(0, pos);
@@ -354,7 +369,7 @@ bool cmGlobalVisualStudio10Generator::ParseGeneratorToolset(
"that contains duplicate field key '" << key << "'."
;
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
if (!this->ProcessGeneratorToolsetField(key, value)) {
@@ -368,7 +383,7 @@ bool cmGlobalVisualStudio10Generator::ParseGeneratorToolset(
"that contains invalid field '" << *fi << "'."
;
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
}
@@ -412,16 +427,16 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
return false;
}
} else if (this->SystemName == "Android") {
- if (this->DefaultPlatformName != "Win32") {
+ if (this->PlatformInGeneratorName) {
std::ostringstream e;
e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR "
<< "specifies a platform too: '" << this->GetName() << "'";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
std::string v = this->GetInstalledNsightTegraVersion();
if (v.empty()) {
- mf->IssueMessage(cmake::FATAL_ERROR,
+ mf->IssueMessage(MessageType::FATAL_ERROR,
"CMAKE_SYSTEM_NAME is 'Android' but "
"'NVIDIA Nsight Tegra Visual Studio Edition' "
"is not installed.");
@@ -443,11 +458,11 @@ bool cmGlobalVisualStudio10Generator::InitializeWindows(cmMakefile*)
bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
{
- if (this->DefaultPlatformName != "Win32") {
+ if (this->PlatformInGeneratorName) {
std::ostringstream e;
e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR "
<< "specifies a platform too: '" << this->GetName() << "'";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -460,7 +475,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsPhone(cmMakefile* mf)
{
std::ostringstream e;
e << this->GetName() << " does not support Windows Phone.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -468,7 +483,7 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsStore(cmMakefile* mf)
{
std::ostringstream e;
e << this->GetName() << " does not support Windows Store.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -494,16 +509,6 @@ std::string cmGlobalVisualStudio10Generator::SelectWindowsCEToolset() const
return "";
}
-void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
-{
- fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
- if (this->ExpressEdition) {
- fout << "# Visual C++ Express 2010\n";
- } else {
- fout << "# Visual Studio 2010\n";
- }
-}
-
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator* cmGlobalVisualStudio10Generator::CreateLocalGenerator(
cmMakefile* mf)
@@ -539,7 +544,7 @@ void cmGlobalVisualStudio10Generator::Generate()
"To avoid this problem CMake must use a full path for this file "
"which then triggers the VS 10 property dialog bug.";
/* clang-format on */
- lg->IssueMessage(cmake::WARNING, e.str().c_str());
+ lg->IssueMessage(MessageType::WARNING, e.str().c_str());
}
}
@@ -602,10 +607,26 @@ cmGlobalVisualStudio10Generator::GetPlatformToolsetVersionString() const
const char*
cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitecture() const
{
+ std::string const& hostArch =
+ this->GetPlatformToolsetHostArchitectureString();
+ if (hostArch.empty()) {
+ return nullptr;
+ }
+ return hostArch.c_str();
+}
+
+std::string const&
+cmGlobalVisualStudio10Generator::GetPlatformToolsetHostArchitectureString()
+ const
+{
if (!this->GeneratorToolsetHostArchitecture.empty()) {
- return this->GeneratorToolsetHostArchitecture.c_str();
+ return this->GeneratorToolsetHostArchitecture;
}
- return nullptr;
+ if (!this->DefaultPlatformToolsetHostArchitecture.empty()) {
+ return this->DefaultPlatformToolsetHostArchitecture;
+ }
+ static std::string const empty;
+ return empty;
}
const char* cmGlobalVisualStudio10Generator::GetPlatformToolsetCuda() const
@@ -701,7 +722,7 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
wd = this->ConfiguredFilesPath;
} else {
wd = this->GetCMakeInstance()->GetHomeOutputDirectory();
- wd += cmake::GetCMakeFilesDirectory();
+ wd += "/CMakeFiles";
}
wd += "/";
wd += cmVersion::GetCMakeVersion();
@@ -722,7 +743,7 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
// Prepare the work directory.
if (!cmSystemTools::MakeDirectory(wd)) {
std::string e = "Failed to make directory:\n " + wd;
- mf->IssueMessage(cmake::FATAL_ERROR, e.c_str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.c_str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -781,10 +802,9 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
}
cmXMLElement(eprj, "Import")
.Attribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
- if (!this->GeneratorToolsetHostArchitecture.empty()) {
+ if (const char* hostArch = this->GetPlatformToolsetHostArchitecture()) {
cmXMLElement epg(eprj, "PropertyGroup");
- cmXMLElement(epg, "PreferredToolArchitecture")
- .Content(this->GeneratorToolsetHostArchitecture);
+ cmXMLElement(epg, "PreferredToolArchitecture").Content(hostArch);
}
{
cmXMLElement epg(eprj, "PropertyGroup");
@@ -844,7 +864,7 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
if (ret != 0) {
e << "Exit code: " << ret << "\n";
}
- mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str().c_str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -859,7 +879,7 @@ bool cmGlobalVisualStudio10Generator::FindVCTargetsPath(cmMakefile* mf)
}
void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int jobs, bool verbose, std::vector<std::string> const& makeOptions)
@@ -874,6 +894,10 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
bool useDevEnv = (makeProgramLower.find("devenv") != std::string::npos ||
makeProgramLower.find("vcexpress") != std::string::npos);
+ // Workaround to convince VCExpress.exe to produce output.
+ makeCommand.RequiresOutputForward =
+ (makeProgramLower.find("vcexpress") != std::string::npos);
+
// MSBuild is preferred (and required for VS Express), but if the .sln has
// an Intel Fortran .vfproj then we have to use devenv. Parse it to find out.
cmSlnData slnData;
@@ -907,7 +931,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
return;
}
- makeCommand.push_back(makeProgramSelected);
+ makeCommand.add(makeProgramSelected);
std::string realTarget = targetName;
// msbuild.exe CxxOnly.sln /t:Build /p:Configuration=Debug /target:ALL_BUILD
@@ -916,8 +940,8 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
realTarget = "ALL_BUILD";
}
if (realTarget == "clean") {
- makeCommand.push_back(std::string(projectName) + ".sln");
- makeCommand.push_back("/t:Clean");
+ makeCommand.add(std::string(projectName) + ".sln");
+ makeCommand.add("/t:Clean");
} else {
std::string targetProject(realTarget);
targetProject += ".vcxproj";
@@ -929,7 +953,7 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
cmSystemTools::ConvertToUnixSlashes(targetProject);
}
}
- makeCommand.push_back(targetProject);
+ makeCommand.add(std::move(targetProject));
}
std::string configArg = "/p:Configuration=";
if (!config.empty()) {
@@ -937,23 +961,26 @@ void cmGlobalVisualStudio10Generator::GenerateBuildCommand(
} else {
configArg += "Debug";
}
- makeCommand.push_back(configArg);
- makeCommand.push_back("/p:Platform=" + this->GetPlatformName());
- makeCommand.push_back(std::string("/p:VisualStudioVersion=") +
- this->GetIDEVersion());
+ makeCommand.add(configArg);
+ makeCommand.add(std::string("/p:Platform=") + this->GetPlatformName());
+ makeCommand.add(std::string("/p:VisualStudioVersion=") +
+ this->GetIDEVersion());
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back("/m");
+ makeCommand.add("/m");
} else {
- makeCommand.push_back(std::string("/m:") + std::to_string(jobs));
+ makeCommand.add(std::string("/m:") + std::to_string(jobs));
}
// Having msbuild.exe and cl.exe using multiple jobs is discouraged
- makeCommand.push_back("/p:CL_MPCount=1");
+ makeCommand.add("/p:CL_MPCount=1");
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ // Respect the verbosity: 'n' normal will show build commands
+ // 'm' minimal only the build step's title
+ makeCommand.add(std::string("/v:") + ((verbose) ? "n" : "m"));
+
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
}
bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
@@ -988,7 +1015,7 @@ bool cmGlobalVisualStudio10Generator::Find64BitTools(cmMakefile* mf)
<< "Install the Microsoft Windows SDK v7.1 to get 64-bit tools:\n"
<< " http://msdn.microsoft.com/en-us/windows/bb980924.aspx";
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str().c_str());
cmSystemTools::SetFatalErrorOccured();
return false;
}
@@ -1000,7 +1027,7 @@ std::string cmGlobalVisualStudio10Generator::GenerateRuleFile(
// The VS 10 generator needs to create the .rule files on disk.
// Hide them away under the CMakeFiles directory.
std::string ruleDir = this->GetCMakeInstance()->GetHomeOutputDirectory();
- ruleDir += cmake::GetCMakeFilesDirectory();
+ ruleDir += "/CMakeFiles";
ruleDir += "/";
ruleDir += cmSystemTools::ComputeStringMD5(
cmSystemTools::GetFilenamePath(output).c_str());
@@ -1030,6 +1057,29 @@ std::string cmGlobalVisualStudio10Generator::Encoding()
return "utf-8";
}
+const char* cmGlobalVisualStudio10Generator::GetToolsVersion() const
+{
+ switch (this->Version) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ case cmGlobalVisualStudioGenerator::VS10:
+ case cmGlobalVisualStudioGenerator::VS11:
+ return "4.0";
+
+ // in Visual Studio 2013 they detached the MSBuild tools version
+ // from the .Net Framework version and instead made it have it's own
+ // version number
+ case cmGlobalVisualStudioGenerator::VS12:
+ return "12.0";
+ case cmGlobalVisualStudioGenerator::VS14:
+ return "14.0";
+ case cmGlobalVisualStudioGenerator::VS15:
+ return "15.0";
+ case cmGlobalVisualStudioGenerator::VS16:
+ return "16.0";
+ }
+ return "";
+}
+
bool cmGlobalVisualStudio10Generator::IsNsightTegra() const
{
return !this->NsightTegraVersion.empty();
@@ -1050,67 +1100,218 @@ std::string cmGlobalVisualStudio10Generator::GetInstalledNsightTegraVersion()
return version;
}
+static std::string cmLoadFlagTableString(Json::Value entry, const char* field)
+{
+ if (entry.isMember(field)) {
+ auto string = entry[field];
+ if (string.isConvertibleTo(Json::ValueType::stringValue)) {
+ return string.asString();
+ }
+ }
+ return "";
+}
+
+static unsigned int cmLoadFlagTableSpecial(Json::Value entry,
+ const char* field)
+{
+ unsigned int value = 0;
+ if (entry.isMember(field)) {
+ auto specials = entry[field];
+ if (specials.isArray()) {
+ for (auto const& special : specials) {
+ std::string s = special.asString();
+ if (s == "UserValue") {
+ value |= cmIDEFlagTable::UserValue;
+ } else if (s == "UserIgnored") {
+ value |= cmIDEFlagTable::UserIgnored;
+ } else if (s == "UserRequired") {
+ value |= cmIDEFlagTable::UserRequired;
+ } else if (s == "Continue") {
+ value |= cmIDEFlagTable::Continue;
+ } else if (s == "SemicolonAppendable") {
+ value |= cmIDEFlagTable::SemicolonAppendable;
+ } else if (s == "UserFollowing") {
+ value |= cmIDEFlagTable::UserFollowing;
+ } else if (s == "CaseInsensitive") {
+ value |= cmIDEFlagTable::CaseInsensitive;
+ } else if (s == "SpaceAppendable") {
+ value |= cmIDEFlagTable::SpaceAppendable;
+ } else if (s == "CommaAppendable") {
+ value |= cmIDEFlagTable::CommaAppendable;
+ }
+ }
+ }
+ }
+ return value;
+}
+
+static cmIDEFlagTable const* cmLoadFlagTableJson(
+ std::string const& flagJsonPath)
+{
+ cmIDEFlagTable* ret = nullptr;
+ auto savedFlagIterator = loadedFlagJsonFiles.find(flagJsonPath);
+ if (savedFlagIterator != loadedFlagJsonFiles.end()) {
+ ret = savedFlagIterator->second.data();
+ } else {
+ Json::Reader reader;
+ cmsys::ifstream stream;
+
+ stream.open(flagJsonPath.c_str(), std::ios_base::in);
+ if (stream) {
+ Json::Value flags;
+ if (reader.parse(stream, flags, false) && flags.isArray()) {
+ std::vector<cmIDEFlagTable> flagTable;
+ for (auto const& flag : flags) {
+ cmIDEFlagTable flagEntry;
+ flagEntry.IDEName = cmLoadFlagTableString(flag, "name");
+ flagEntry.commandFlag = cmLoadFlagTableString(flag, "switch");
+ flagEntry.comment = cmLoadFlagTableString(flag, "comment");
+ flagEntry.value = cmLoadFlagTableString(flag, "value");
+ flagEntry.special = cmLoadFlagTableSpecial(flag, "flags");
+ flagTable.push_back(flagEntry);
+ }
+ cmIDEFlagTable endFlag{ "", "", "", "", 0 };
+ flagTable.push_back(endFlag);
+
+ loadedFlagJsonFiles[flagJsonPath] = flagTable;
+ ret = loadedFlagJsonFiles[flagJsonPath].data();
+ }
+ }
+ }
+ return ret;
+}
+
+static std::string cmGetFlagTableName(std::string const& toolsetName,
+ std::string const& table)
+{
+ return cmSystemTools::GetCMakeRoot() + "/Templates/MSBuild/FlagTables/" +
+ toolsetName + "_" + table + ".json";
+}
+
+cmIDEFlagTable const* cmGlobalVisualStudio10Generator::LoadFlagTable(
+ std::string const& optionsName, std::string const& toolsetName,
+ std::string const& defaultName, std::string const& table) const
+{
+ cmIDEFlagTable const* ret = nullptr;
+
+ std::string filename;
+ if (!optionsName.empty()) {
+ filename = cmGetFlagTableName(optionsName, table);
+ ret = cmLoadFlagTableJson(filename);
+ } else {
+ filename = cmGetFlagTableName(toolsetName, table);
+ if (cmSystemTools::FileExists(filename)) {
+ ret = cmLoadFlagTableJson(filename);
+ } else {
+ filename = cmGetFlagTableName(defaultName, table);
+ ret = cmLoadFlagTableJson(filename);
+ }
+ }
+
+ if (!ret) {
+ cmMakefile* mf = this->GetCurrentMakefile();
+
+ std::ostringstream e;
+ /* clang-format off */
+ e << "JSON flag table \"" << filename <<
+ "\" could not be loaded.\n";
+ /* clang-format on */
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str().c_str());
+ }
+ return ret;
+}
+
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetClFlagTable() const
{
- cmIDEFlagTable const* table = this->ToolsetOptions.GetClFlagTable(
+ std::string optionsName = this->ToolsetOptions.GetClFlagTableName(
this->GetPlatformName(), this->GetPlatformToolsetString());
-
- return (table != nullptr) ? table : this->DefaultClFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultCLFlagTableName);
+ return LoadFlagTable(optionsName, toolsetName, defaultName, "CL");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCSharpFlagTable()
const
{
- cmIDEFlagTable const* table = this->ToolsetOptions.GetCSharpFlagTable(
+ std::string optionsName = this->ToolsetOptions.GetCSharpFlagTableName(
this->GetPlatformName(), this->GetPlatformToolsetString());
-
- return (table != nullptr) ? table : this->DefaultCSharpFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultCSharpFlagTableName);
+ return LoadFlagTable(optionsName, toolsetName, defaultName, "CSharp");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetRcFlagTable() const
{
- cmIDEFlagTable const* table = this->ToolsetOptions.GetRcFlagTable(
+ std::string optionsName = this->ToolsetOptions.GetRcFlagTableName(
this->GetPlatformName(), this->GetPlatformToolsetString());
-
- return (table != nullptr) ? table : this->DefaultRcFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultRCFlagTableName);
+ return LoadFlagTable(optionsName, toolsetName, defaultName, "RC");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLibFlagTable() const
{
- cmIDEFlagTable const* table = this->ToolsetOptions.GetLibFlagTable(
+ std::string optionsName = this->ToolsetOptions.GetLibFlagTableName(
this->GetPlatformName(), this->GetPlatformToolsetString());
-
- return (table != nullptr) ? table : this->DefaultLibFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultLibFlagTableName);
+ return LoadFlagTable(optionsName, toolsetName, defaultName, "LIB");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetLinkFlagTable() const
{
- cmIDEFlagTable const* table = this->ToolsetOptions.GetLinkFlagTable(
+ std::string optionsName = this->ToolsetOptions.GetLinkFlagTableName(
this->GetPlatformName(), this->GetPlatformToolsetString());
-
- return (table != nullptr) ? table : this->DefaultLinkFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultLinkFlagTableName);
+ return LoadFlagTable(optionsName, toolsetName, defaultName, "Link");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaFlagTable() const
{
- return this->DefaultCudaFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultCudaFlagTableName);
+ return LoadFlagTable("", toolsetName, defaultName, "Cuda");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetCudaHostFlagTable()
const
{
- return this->DefaultCudaHostFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultCudaHostFlagTableName);
+ return LoadFlagTable("", toolsetName, defaultName, "CudaHost");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetMasmFlagTable() const
{
- cmIDEFlagTable const* table = this->ToolsetOptions.GetMasmFlagTable(
+ std::string optionsName = this->ToolsetOptions.GetMasmFlagTableName(
this->GetPlatformName(), this->GetPlatformToolsetString());
-
- return (table != nullptr) ? table : this->DefaultMasmFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultMasmFlagTableName);
+ return LoadFlagTable(optionsName, toolsetName, defaultName, "MASM");
}
cmIDEFlagTable const* cmGlobalVisualStudio10Generator::GetNasmFlagTable() const
{
- return this->DefaultNasmFlagTable;
+ std::string toolsetName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->GetPlatformToolsetString());
+ std::string defaultName = this->ToolsetOptions.GetToolsetName(
+ this->GetPlatformName(), this->DefaultNasmFlagTableName);
+ return LoadFlagTable("", toolsetName, defaultName, "NASM");
}
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 63e690343..3ef7abfd0 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -14,8 +14,6 @@
class cmGlobalVisualStudio10Generator : public cmGlobalVisualStudio8Generator
{
public:
- cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name,
- const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
@@ -24,7 +22,7 @@ public:
bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
bool SetGeneratorToolset(std::string const& ts, cmMakefile* mf) override;
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -43,7 +41,6 @@ public:
*/
void EnableLanguage(std::vector<std::string> const& languages, cmMakefile*,
bool optional) override;
- void WriteSLNHeader(std::ostream& fout) override;
bool IsCudaEnabled() const { return this->CudaEnabled; }
@@ -61,6 +58,7 @@ public:
/** The toolset host architecture name (e.g. x64 for 64-bit host tools). */
const char* GetPlatformToolsetHostArchitecture() const;
+ std::string const& GetPlatformToolsetHostArchitectureString() const;
/** The cuda toolset version. */
const char* GetPlatformToolsetCuda() const;
@@ -86,7 +84,7 @@ public:
}
/** Return true if building for WindowsCE */
- bool TargetsWindowsCE() const { return this->SystemIsWindowsCE; }
+ bool TargetsWindowsCE() const override { return this->SystemIsWindowsCE; }
/** Return true if building for WindowsPhone */
bool TargetsWindowsPhone() const { return this->SystemIsWindowsPhone; }
@@ -104,7 +102,7 @@ public:
std::string const& sfRel);
std::string Encoding() override;
- virtual const char* GetToolsVersion() { return "4.0"; }
+ const char* GetToolsVersion() const;
virtual bool IsDefaultToolset(const std::string& version) const;
virtual std::string GetAuxiliaryToolset() const;
@@ -126,6 +124,9 @@ public:
cmIDEFlagTable const* GetNasmFlagTable() const;
protected:
+ cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName);
+
void Generate() override;
virtual bool InitializeSystem(cmMakefile* mf);
virtual bool InitializeWindows(cmMakefile* mf);
@@ -140,34 +141,40 @@ protected:
virtual bool SelectWindowsPhoneToolset(std::string& toolset) const;
virtual bool SelectWindowsStoreToolset(std::string& toolset) const;
- const char* GetIDEVersion() override { return "10.0"; }
-
std::string const& GetMSBuildCommand();
+ cmIDEFlagTable const* LoadFlagTable(std::string const& optionsName,
+ std::string const& toolsetName,
+ std::string const& defaultName,
+ std::string const& table) const;
+
std::string GeneratorToolset;
std::string GeneratorToolsetVersion;
std::string GeneratorToolsetHostArchitecture;
std::string GeneratorToolsetCuda;
std::string DefaultPlatformToolset;
+ std::string DefaultPlatformToolsetHostArchitecture;
std::string WindowsTargetPlatformVersion;
std::string SystemName;
std::string SystemVersion;
std::string NsightTegraVersion;
- cmIDEFlagTable const* DefaultClFlagTable;
- cmIDEFlagTable const* DefaultCSharpFlagTable;
- cmIDEFlagTable const* DefaultLibFlagTable;
- cmIDEFlagTable const* DefaultLinkFlagTable;
- cmIDEFlagTable const* DefaultCudaFlagTable;
- cmIDEFlagTable const* DefaultCudaHostFlagTable;
- cmIDEFlagTable const* DefaultMasmFlagTable;
- cmIDEFlagTable const* DefaultNasmFlagTable;
- cmIDEFlagTable const* DefaultRcFlagTable;
+ std::string DefaultCLFlagTableName;
+ std::string DefaultCSharpFlagTableName;
+ std::string DefaultLibFlagTableName;
+ std::string DefaultLinkFlagTableName;
+ std::string DefaultCudaFlagTableName;
+ std::string DefaultCudaHostFlagTableName;
+ std::string DefaultMasmFlagTableName;
+ std::string DefaultNasmFlagTableName;
+ std::string DefaultRCFlagTableName;
bool SystemIsWindowsCE;
bool SystemIsWindowsPhone;
bool SystemIsWindowsStore;
private:
class Factory;
+ friend class Factory;
+
struct LongestSourcePath
{
LongestSourcePath()
diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx
index f1d5a8c64..4eb78ba9c 100644
--- a/Source/cmGlobalVisualStudio11Generator.cxx
+++ b/Source/cmGlobalVisualStudio11Generator.cxx
@@ -6,12 +6,6 @@
#include "cmDocumentationEntry.h"
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
-#include "cmVS11CLFlagTable.h"
-#include "cmVS11CSharpFlagTable.h"
-#include "cmVS11LibFlagTable.h"
-#include "cmVS11LinkFlagTable.h"
-#include "cmVS11MASMFlagTable.h"
-#include "cmVS11RCFlagTable.h"
static const char vs11generatorName[] = "Visual Studio 11 2012";
@@ -75,9 +69,16 @@ public:
"Optional [arch] can be \"Win64\" or \"ARM\".";
}
- void GetGenerators(std::vector<std::string>& names) const override
+ 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"));
@@ -86,10 +87,30 @@ public:
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"; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
@@ -98,8 +119,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
}
cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
- cmake* cm, const std::string& name, const std::string& platformName)
- : cmGlobalVisualStudio10Generator(cm, name, platformName)
+ cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudio10Generator(cm, name, platformInGeneratorName)
{
std::string vc11Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
@@ -107,12 +129,12 @@ cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
"ProductDir",
vc11Express, cmSystemTools::KeyWOW64_32);
this->DefaultPlatformToolset = "v110";
- this->DefaultClFlagTable = cmVS11CLFlagTable;
- this->DefaultCSharpFlagTable = cmVS11CSharpFlagTable;
- this->DefaultLibFlagTable = cmVS11LibFlagTable;
- this->DefaultLinkFlagTable = cmVS11LinkFlagTable;
- this->DefaultMasmFlagTable = cmVS11MASMFlagTable;
- this->DefaultRcFlagTable = cmVS11RCFlagTable;
+ this->DefaultCLFlagTableName = "v11";
+ this->DefaultCSharpFlagTableName = "v11";
+ this->DefaultLibFlagTableName = "v11";
+ this->DefaultLinkFlagTableName = "v11";
+ this->DefaultMasmFlagTableName = "v11";
+ this->DefaultRCFlagTableName = "v11";
this->Version = VS11;
}
@@ -138,7 +160,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf)
<< "Desktop SDK as well as the Windows Phone '" << this->SystemVersion
<< "' SDK. Please make sure that you have both installed";
}
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
return true;
@@ -156,7 +178,7 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf)
<< "Desktop SDK as well as the Windows Store '" << this->SystemVersion
<< "' SDK. Please make sure that you have both installed";
}
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
return true;
@@ -194,17 +216,7 @@ bool cmGlobalVisualStudio11Generator::SelectWindowsStoreToolset(
toolset);
}
-void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout)
-{
- 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";
- }
-}
-
-bool cmGlobalVisualStudio11Generator::UseFolderProperty()
+bool cmGlobalVisualStudio11Generator::UseFolderProperty() const
{
// Intentionally skip up to the top-level class implementation.
// Folders are not supported by the Express editions in VS10 and earlier,
diff --git a/Source/cmGlobalVisualStudio11Generator.h b/Source/cmGlobalVisualStudio11Generator.h
index 40f02fb12..8b4c8b739 100644
--- a/Source/cmGlobalVisualStudio11Generator.h
+++ b/Source/cmGlobalVisualStudio11Generator.h
@@ -20,15 +20,14 @@ class cmake;
class cmGlobalVisualStudio11Generator : public cmGlobalVisualStudio10Generator
{
public:
- cmGlobalVisualStudio11Generator(cmake* cm, const std::string& name,
- const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
- void WriteSLNHeader(std::ostream& fout) override;
-
protected:
+ cmGlobalVisualStudio11Generator(cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName);
+
bool InitializeWindowsPhone(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;
bool SelectWindowsPhoneToolset(std::string& toolset) const override;
@@ -43,8 +42,7 @@ protected:
bool IsWindowsPhoneToolsetInstalled() const;
bool IsWindowsStoreToolsetInstalled() const;
- const char* GetIDEVersion() override { return "11.0"; }
- bool UseFolderProperty();
+ bool UseFolderProperty() const override;
static std::set<std::string> GetInstalledWindowsCESDKs();
/** Return true if the configuration needs to be deployed */
diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx
index e05ae70dc..d9702c9ee 100644
--- a/Source/cmGlobalVisualStudio12Generator.cxx
+++ b/Source/cmGlobalVisualStudio12Generator.cxx
@@ -6,12 +6,6 @@
#include "cmDocumentationEntry.h"
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
-#include "cmVS12CLFlagTable.h"
-#include "cmVS12CSharpFlagTable.h"
-#include "cmVS12LibFlagTable.h"
-#include "cmVS12LinkFlagTable.h"
-#include "cmVS12MASMFlagTable.h"
-#include "cmVS12RCFlagTable.h"
static const char vs12generatorName[] = "Visual Studio 12 2013";
@@ -64,15 +58,34 @@ public:
"Optional [arch] can be \"Win64\" or \"ARM\".";
}
- void GetGenerators(std::vector<std::string>& names) const override
+ std::vector<std::string> GetGeneratorNames() const override
{
+ std::vector<std::string> names;
names.push_back(vs12generatorName);
+ return names;
+ }
+
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ std::vector<std::string> names;
names.push_back(vs12generatorName + std::string(" ARM"));
names.push_back(vs12generatorName + std::string(" Win64"));
+ 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");
+ return platforms;
+ }
+
+ std::string GetDefaultPlatformName() const override { return "Win32"; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory()
@@ -81,8 +94,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory()
}
cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
- cmake* cm, const std::string& name, const std::string& platformName)
- : cmGlobalVisualStudio11Generator(cm, name, platformName)
+ cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudio11Generator(cm, name, platformInGeneratorName)
{
std::string vc12Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
@@ -90,12 +104,12 @@ cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
"ProductDir",
vc12Express, cmSystemTools::KeyWOW64_32);
this->DefaultPlatformToolset = "v120";
- this->DefaultClFlagTable = cmVS12CLFlagTable;
- this->DefaultCSharpFlagTable = cmVS12CSharpFlagTable;
- this->DefaultLibFlagTable = cmVS12LibFlagTable;
- this->DefaultLinkFlagTable = cmVS12LinkFlagTable;
- this->DefaultMasmFlagTable = cmVS12MASMFlagTable;
- this->DefaultRcFlagTable = cmVS12RCFlagTable;
+ this->DefaultCLFlagTableName = "v12";
+ this->DefaultCSharpFlagTableName = "v12";
+ this->DefaultLibFlagTableName = "v12";
+ this->DefaultLinkFlagTableName = "v12";
+ this->DefaultMasmFlagTableName = "v12";
+ this->DefaultRCFlagTableName = "v12";
this->Version = VS12;
}
@@ -112,8 +126,8 @@ bool cmGlobalVisualStudio12Generator::MatchesGeneratorName(
bool cmGlobalVisualStudio12Generator::ProcessGeneratorToolsetField(
std::string const& key, std::string const& value)
{
- if (key == "host" && value == "x64") {
- this->GeneratorToolsetHostArchitecture = "x64";
+ if (key == "host" && (value == "x64" || value == "x86")) {
+ this->GeneratorToolsetHostArchitecture = value;
return true;
}
return this->cmGlobalVisualStudio11Generator::ProcessGeneratorToolsetField(
@@ -134,7 +148,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf)
<< "Desktop SDK as well as the Windows Phone '" << this->SystemVersion
<< "' SDK. Please make sure that you have both installed";
}
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
return true;
@@ -154,7 +168,7 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf)
<< "Desktop SDK as well as the Windows Store '" << this->SystemVersion
<< "' SDK. Please make sure that you have both installed";
}
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
return true;
@@ -192,16 +206,6 @@ bool cmGlobalVisualStudio12Generator::SelectWindowsStoreToolset(
toolset);
}
-void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout)
-{
- fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
- if (this->ExpressEdition) {
- fout << "# Visual Studio Express 2013 for Windows Desktop\n";
- } else {
- fout << "# Visual Studio 2013\n";
- }
-}
-
bool cmGlobalVisualStudio12Generator::IsWindowsDesktopToolsetInstalled() const
{
const char desktop81Key[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
diff --git a/Source/cmGlobalVisualStudio12Generator.h b/Source/cmGlobalVisualStudio12Generator.h
index 9d6554a34..53b709157 100644
--- a/Source/cmGlobalVisualStudio12Generator.h
+++ b/Source/cmGlobalVisualStudio12Generator.h
@@ -18,20 +18,14 @@ class cmake;
class cmGlobalVisualStudio12Generator : public cmGlobalVisualStudio11Generator
{
public:
- cmGlobalVisualStudio12Generator(cmake* cm, const std::string& name,
- const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
- void WriteSLNHeader(std::ostream& fout) override;
-
- // in Visual Studio 2013 they detached the MSBuild tools version
- // from the .Net Framework version and instead made it have it's own
- // version number
- const char* GetToolsVersion() override { return "12.0"; }
-
protected:
+ cmGlobalVisualStudio12Generator(cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName);
+
bool ProcessGeneratorToolsetField(std::string const& key,
std::string const& value) override;
@@ -48,9 +42,9 @@ protected:
// of the toolset is installed
bool IsWindowsPhoneToolsetInstalled() const;
bool IsWindowsStoreToolsetInstalled() const;
- const char* GetIDEVersion() override { return "12.0"; }
private:
class Factory;
+ friend class Factory;
};
#endif
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 92ee2e074..20258678a 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -6,12 +6,6 @@
#include "cmDocumentationEntry.h"
#include "cmLocalVisualStudio10Generator.h"
#include "cmMakefile.h"
-#include "cmVS140CLFlagTable.h"
-#include "cmVS140CSharpFlagTable.h"
-#include "cmVS140LinkFlagTable.h"
-#include "cmVS14LibFlagTable.h"
-#include "cmVS14MASMFlagTable.h"
-#include "cmVS14RCFlagTable.h"
static const char vs14generatorName[] = "Visual Studio 14 2015";
@@ -64,15 +58,34 @@ public:
"Optional [arch] can be \"Win64\" or \"ARM\".";
}
- void GetGenerators(std::vector<std::string>& names) const override
+ std::vector<std::string> GetGeneratorNames() const override
{
+ std::vector<std::string> names;
names.push_back(vs14generatorName);
+ return names;
+ }
+
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ std::vector<std::string> names;
names.push_back(vs14generatorName + std::string(" ARM"));
names.push_back(vs14generatorName + std::string(" Win64"));
+ 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");
+ return platforms;
+ }
+
+ std::string GetDefaultPlatformName() const override { return "Win32"; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory()
@@ -81,8 +94,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory()
}
cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
- cmake* cm, const std::string& name, const std::string& platformName)
- : cmGlobalVisualStudio12Generator(cm, name, platformName)
+ cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudio12Generator(cm, name, platformInGeneratorName)
{
std::string vc14Express;
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
@@ -90,12 +104,12 @@ cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
"ProductDir",
vc14Express, cmSystemTools::KeyWOW64_32);
this->DefaultPlatformToolset = "v140";
- this->DefaultClFlagTable = cmVS140CLFlagTable;
- this->DefaultCSharpFlagTable = cmVS140CSharpFlagTable;
- this->DefaultLibFlagTable = cmVS14LibFlagTable;
- this->DefaultLinkFlagTable = cmVS140LinkFlagTable;
- this->DefaultMasmFlagTable = cmVS14MASMFlagTable;
- this->DefaultRcFlagTable = cmVS14RCFlagTable;
+ this->DefaultCLFlagTableName = "v140";
+ this->DefaultCSharpFlagTableName = "v140";
+ this->DefaultLibFlagTableName = "v14";
+ this->DefaultLinkFlagTableName = "v140";
+ this->DefaultMasmFlagTableName = "v14";
+ this->DefaultRCFlagTableName = "v14";
this->Version = VS14;
}
@@ -131,7 +145,7 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
<< "Desktop SDK as well as the Windows Store '" << this->SystemVersion
<< "' SDK. Please make sure that you have both installed";
}
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
if (cmHasLiteralPrefix(this->SystemVersion, "10.0")) {
@@ -144,14 +158,22 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
bool required)
{
// Find the default version of the Windows 10 SDK.
- this->WindowsTargetPlatformVersion = this->GetWindows10SDKVersion();
- if (required && this->WindowsTargetPlatformVersion.empty()) {
+ std::string const version = this->GetWindows10SDKVersion();
+ if (required && version.empty()) {
std::ostringstream e;
e << "Could not find an appropriate version of the Windows 10 SDK"
<< " installed on this machine";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
+ this->SetWindowsTargetPlatformVersion(version, mf);
+ return true;
+}
+
+void cmGlobalVisualStudio14Generator::SetWindowsTargetPlatformVersion(
+ std::string const& version, cmMakefile* mf)
+{
+ this->WindowsTargetPlatformVersion = version;
if (!cmSystemTools::VersionCompareEqual(this->WindowsTargetPlatformVersion,
this->SystemVersion)) {
std::ostringstream e;
@@ -161,7 +183,6 @@ bool cmGlobalVisualStudio14Generator::SelectWindows10SDK(cmMakefile* mf,
}
mf->AddDefinition("CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION",
this->WindowsTargetPlatformVersion.c_str());
- return true;
}
bool cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
@@ -180,17 +201,6 @@ bool cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
toolset);
}
-void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
-{
- // Visual Studio 14 writes .sln format 12.00
- fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
- if (this->ExpressEdition) {
- fout << "# Visual Studio Express 14 for Windows Desktop\n";
- } else {
- fout << "# Visual Studio 14\n";
- }
-}
-
bool cmGlobalVisualStudio14Generator::IsWindowsDesktopToolsetInstalled() const
{
const char desktop10Key[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
diff --git a/Source/cmGlobalVisualStudio14Generator.h b/Source/cmGlobalVisualStudio14Generator.h
index 9f5bb4e66..6e12d3e2c 100644
--- a/Source/cmGlobalVisualStudio14Generator.h
+++ b/Source/cmGlobalVisualStudio14Generator.h
@@ -18,17 +18,14 @@ class cmake;
class cmGlobalVisualStudio14Generator : public cmGlobalVisualStudio12Generator
{
public:
- cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name,
- const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
bool MatchesGeneratorName(const std::string& name) const override;
- void WriteSLNHeader(std::ostream& fout) override;
-
- const char* GetToolsVersion() override { return "14.0"; }
-
protected:
+ cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName);
+
bool InitializeWindows(cmMakefile* mf) override;
bool InitializeWindowsStore(cmMakefile* mf) override;
bool SelectWindowsStoreToolset(std::string& toolset) const override;
@@ -41,9 +38,11 @@ protected:
// version of the toolset.
virtual std::string GetWindows10SDKMaxVersion() const;
- const char* GetIDEVersion() override { return "14.0"; }
virtual bool SelectWindows10SDK(cmMakefile* mf, bool required);
+ void SetWindowsTargetPlatformVersion(std::string const& version,
+ cmMakefile* mf);
+
// Used to verify that the Desktop toolset for the current generator is
// installed on the machine.
bool IsWindowsDesktopToolsetInstalled() const override;
@@ -52,5 +51,6 @@ protected:
private:
class Factory;
+ friend class Factory;
};
#endif
diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx
deleted file mode 100644
index 23fd2d5b4..000000000
--- a/Source/cmGlobalVisualStudio15Generator.cxx
+++ /dev/null
@@ -1,298 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmGlobalVisualStudio15Generator.h"
-
-#include "cmAlgorithms.h"
-#include "cmDocumentationEntry.h"
-#include "cmLocalVisualStudio10Generator.h"
-#include "cmMakefile.h"
-#include "cmVS141CLFlagTable.h"
-#include "cmVS141CSharpFlagTable.h"
-#include "cmVS141LinkFlagTable.h"
-#include "cmVSSetupHelper.h"
-
-static const char vs15generatorName[] = "Visual Studio 15 2017";
-
-// Map generator name without year to name with year.
-static const char* cmVS15GenName(const std::string& name, std::string& genName)
-{
- if (strncmp(name.c_str(), vs15generatorName,
- sizeof(vs15generatorName) - 6) != 0) {
- return 0;
- }
- const char* p = name.c_str() + sizeof(vs15generatorName) - 6;
- if (cmHasLiteralPrefix(p, " 2017")) {
- p += 5;
- }
- genName = std::string(vs15generatorName) + p;
- return p;
-}
-
-class cmGlobalVisualStudio15Generator::Factory
- : public cmGlobalGeneratorFactory
-{
-public:
- virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name,
- cmake* cm) const
- {
- std::string genName;
- const char* p = cmVS15GenName(name, genName);
- if (!p) {
- return 0;
- }
- if (!*p) {
- return new cmGlobalVisualStudio15Generator(cm, genName, "");
- }
- if (*p++ != ' ') {
- return 0;
- }
- if (strcmp(p, "Win64") == 0) {
- return new cmGlobalVisualStudio15Generator(cm, genName, "x64");
- }
- if (strcmp(p, "ARM") == 0) {
- return new cmGlobalVisualStudio15Generator(cm, genName, "ARM");
- }
- return 0;
- }
-
- virtual void GetDocumentation(cmDocumentationEntry& entry) const
- {
- entry.Name = std::string(vs15generatorName) + " [arch]";
- entry.Brief = "Generates Visual Studio 2017 project files. "
- "Optional [arch] can be \"Win64\" or \"ARM\".";
- }
-
- virtual void GetGenerators(std::vector<std::string>& names) const
- {
- names.push_back(vs15generatorName);
- names.push_back(vs15generatorName + std::string(" ARM"));
- names.push_back(vs15generatorName + std::string(" Win64"));
- }
-
- bool SupportsToolset() const override { return true; }
- bool SupportsPlatform() const override { return true; }
-};
-
-cmGlobalGeneratorFactory* cmGlobalVisualStudio15Generator::NewFactory()
-{
- return new Factory;
-}
-
-cmGlobalVisualStudio15Generator::cmGlobalVisualStudio15Generator(
- cmake* cm, const std::string& name, const std::string& platformName)
- : cmGlobalVisualStudio14Generator(cm, name, platformName)
-{
- this->ExpressEdition = false;
- this->DefaultPlatformToolset = "v141";
- this->DefaultClFlagTable = cmVS141CLFlagTable;
- this->DefaultCSharpFlagTable = cmVS141CSharpFlagTable;
- this->DefaultLinkFlagTable = cmVS141LinkFlagTable;
- this->Version = VS15;
-}
-
-bool cmGlobalVisualStudio15Generator::MatchesGeneratorName(
- const std::string& name) const
-{
- std::string genName;
- if (cmVS15GenName(name, genName)) {
- return genName == this->GetName();
- }
- return false;
-}
-
-void cmGlobalVisualStudio15Generator::WriteSLNHeader(std::ostream& fout)
-{
- // Visual Studio 15 writes .sln format 12.00
- fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
- if (this->ExpressEdition) {
- fout << "# Visual Studio Express 15 for Windows Desktop\n";
- } else {
- fout << "# Visual Studio 15\n";
- }
-}
-
-bool cmGlobalVisualStudio15Generator::SetGeneratorInstance(
- std::string const& i, cmMakefile* mf)
-{
- if (!i.empty()) {
- if (!this->vsSetupAPIHelper.SetVSInstance(i)) {
- std::ostringstream e;
- /* clang-format off */
- e <<
- "Generator\n"
- " " << this->GetName() << "\n"
- "could not find specified instance of Visual Studio:\n"
- " " << i;
- /* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
- return false;
- }
- }
-
- std::string vsInstance;
- if (!this->vsSetupAPIHelper.GetVSInstanceInfo(vsInstance)) {
- std::ostringstream e;
- /* clang-format off */
- e <<
- "Generator\n"
- " " << this->GetName() << "\n"
- "could not find any instance of Visual Studio.\n";
- /* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
- return false;
- }
-
- // Save the selected instance persistently.
- std::string genInstance = mf->GetSafeDefinition("CMAKE_GENERATOR_INSTANCE");
- if (vsInstance != genInstance) {
- this->CMakeInstance->AddCacheEntry(
- "CMAKE_GENERATOR_INSTANCE", vsInstance.c_str(),
- "Generator instance identifier.", cmStateEnums::INTERNAL);
- }
-
- return true;
-}
-
-bool cmGlobalVisualStudio15Generator::GetVSInstance(std::string& dir) const
-{
- return vsSetupAPIHelper.GetVSInstanceInfo(dir);
-}
-
-bool cmGlobalVisualStudio15Generator::IsDefaultToolset(
- const std::string& version) const
-{
- if (version.empty()) {
- return true;
- }
-
- std::string vcToolsetVersion;
- if (this->vsSetupAPIHelper.GetVCToolsetVersion(vcToolsetVersion)) {
-
- cmsys::RegularExpression regex("[0-9][0-9]\\.[0-9]+");
- if (regex.find(version) && regex.find(vcToolsetVersion)) {
- const auto majorMinorEnd = vcToolsetVersion.find('.', 3);
- const auto majorMinor = vcToolsetVersion.substr(0, majorMinorEnd);
- return version == majorMinor;
- }
- }
-
- return false;
-}
-
-std::string cmGlobalVisualStudio15Generator::GetAuxiliaryToolset() const
-{
- const char* version = this->GetPlatformToolsetVersion();
- if (version) {
- std::string instancePath;
- GetVSInstance(instancePath);
- std::stringstream path;
- path << instancePath;
- path << "/VC/Auxiliary/Build/";
- path << version;
- path << "/Microsoft.VCToolsVersion." << version << ".props";
-
- std::string toolsetPath = path.str();
- cmSystemTools::ConvertToUnixSlashes(toolsetPath);
- return toolsetPath;
- }
- return {};
-}
-
-bool cmGlobalVisualStudio15Generator::InitializeWindows(cmMakefile* mf)
-{
- // If the Win 8.1 SDK is installed then we can select a SDK matching
- // the target Windows version.
- if (this->IsWin81SDKInstalled()) {
- return cmGlobalVisualStudio14Generator::InitializeWindows(mf);
- }
- // Otherwise we must choose a Win 10 SDK even if we are not targeting
- // Windows 10.
- return this->SelectWindows10SDK(mf, false);
-}
-
-bool cmGlobalVisualStudio15Generator::SelectWindowsStoreToolset(
- std::string& toolset) const
-{
- if (cmHasLiteralPrefix(this->SystemVersion, "10.0")) {
- if (this->IsWindowsStoreToolsetInstalled() &&
- this->IsWindowsDesktopToolsetInstalled()) {
- toolset = "v141"; // VS 15 uses v141 toolset
- return true;
- } else {
- return false;
- }
- }
- return this->cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
- toolset);
-}
-
-bool cmGlobalVisualStudio15Generator::IsWindowsDesktopToolsetInstalled() const
-{
- return vsSetupAPIHelper.IsVS2017Installed();
-}
-
-bool cmGlobalVisualStudio15Generator::IsWindowsStoreToolsetInstalled() const
-{
- return vsSetupAPIHelper.IsWin10SDKInstalled();
-}
-
-bool cmGlobalVisualStudio15Generator::IsWin81SDKInstalled() const
-{
- // Does the VS installer tool know about one?
- if (vsSetupAPIHelper.IsWin81SDKInstalled()) {
- return true;
- }
-
- // Does the registry know about one (e.g. from VS 2015)?
- std::string win81Root;
- if (cmSystemTools::ReadRegistryValue(
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
- "Windows Kits\\Installed Roots;KitsRoot81",
- win81Root, cmSystemTools::KeyWOW64_32) ||
- cmSystemTools::ReadRegistryValue(
- "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\"
- "Windows Kits\\Installed Roots;KitsRoot81",
- win81Root, cmSystemTools::KeyWOW64_32)) {
- return cmSystemTools::FileExists(win81Root + "/um/windows.h", true);
- }
- return false;
-}
-
-std::string cmGlobalVisualStudio15Generator::GetWindows10SDKMaxVersion() const
-{
- return std::string();
-}
-
-std::string cmGlobalVisualStudio15Generator::FindMSBuildCommand()
-{
- std::string msbuild;
-
- // Ask Visual Studio Installer tool.
- std::string vs;
- if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
- msbuild = vs + "/MSBuild/15.0/Bin/MSBuild.exe";
- if (cmSystemTools::FileExists(msbuild)) {
- return msbuild;
- }
- }
-
- msbuild = "MSBuild.exe";
- return msbuild;
-}
-
-std::string cmGlobalVisualStudio15Generator::FindDevEnvCommand()
-{
- std::string devenv;
-
- // Ask Visual Studio Installer tool.
- std::string vs;
- if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
- devenv = vs + "/Common7/IDE/devenv.com";
- if (cmSystemTools::FileExists(devenv)) {
- return devenv;
- }
- }
-
- devenv = "devenv.com";
- return devenv;
-}
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index ba12fac96..8e67fad89 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -6,7 +6,7 @@
#include "cmGeneratorTarget.h"
#include "cmLocalVisualStudio7Generator.h"
#include "cmMakefile.h"
-#include "cmake.h"
+#include "cmMessageType.h"
cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(
cmake* cm, const std::string& platformName)
@@ -149,7 +149,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(
m += target->GetName();
m += " depends on unknown target: ";
m += name;
- cmSystemTools::Error(m.c_str());
+ cmSystemTools::Error(m);
}
fout << "\t\t{" << guid << "} = {" << guid << "}\n";
}
@@ -159,7 +159,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectDepends(
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio71Generator::WriteExternalProject(
std::ostream& fout, const std::string& name, const char* location,
- const char* typeGuid, const std::set<std::string>& depends)
+ const char* typeGuid, const std::set<BT<std::string>>& depends)
{
fout << "Project(\"{"
<< (typeGuid ? typeGuid : this->ExternalProjectType(location))
@@ -171,9 +171,10 @@ void cmGlobalVisualStudio71Generator::WriteExternalProject(
// project instead of in the global section
if (!depends.empty()) {
fout << "\tProjectSection(ProjectDependencies) = postProject\n";
- for (std::string const& it : depends) {
- if (!it.empty()) {
- fout << "\t\t{" << this->GetGUID(it) << "} = {" << this->GetGUID(it)
+ for (BT<std::string> const& it : depends) {
+ std::string const& dep = it.Value;
+ if (!dep.empty()) {
+ fout << "\t\t{" << this->GetGUID(dep) << "} = {" << this->GetGUID(dep)
<< "}\n";
}
}
@@ -216,9 +217,3 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations(
}
}
}
-
-// output standard header for dsw file
-void cmGlobalVisualStudio71Generator::WriteSLNHeader(std::ostream& fout)
-{
- fout << "Microsoft Visual Studio Solution File, Format Version 8.00\n";
-}
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index 054c3421d..85755af60 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -33,11 +33,10 @@ protected:
const std::string& platformMapping = "") override;
void WriteExternalProject(std::ostream& fout, const std::string& name,
const char* path, const char* typeGuid,
- const std::set<std::string>& depends) override;
- void WriteSLNHeader(std::ostream& fout) override;
+ const std::set<BT<std::string>>& depends) override;
// Folders are not supported by VS 7.1.
- virtual bool UseFolderProperty() { return false; }
+ bool UseFolderProperty() const override { return false; }
std::string ProjectConfigurationSectionName;
};
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 21121f2bb..d457f60d1 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -6,6 +6,7 @@
#include "cmGeneratorTarget.h"
#include "cmLocalVisualStudio7Generator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmUuid.h"
#include "cmake.h"
@@ -37,23 +38,17 @@ static cmVS7FlagTable cmVS7ExtraFlagTable[] = {
// and have EHa passed on the command line by leaving out the table
// entry.
- { 0, 0, 0, 0, 0 }
+ { "", "", "", "", 0 }
};
cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
- cmake* cm, const std::string& platformName)
- : cmGlobalVisualStudioGenerator(cm)
+ cmake* cm, std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudioGenerator(cm, platformInGeneratorName)
{
this->IntelProjectVersion = 0;
this->DevEnvCommandInitialized = false;
this->MasmEnabled = false;
this->NasmEnabled = false;
-
- if (platformName.empty()) {
- this->DefaultPlatformName = "Win32";
- } else {
- this->DefaultPlatformName = platformName;
- }
this->ExtraFlagTable = cmVS7ExtraFlagTable;
}
@@ -196,7 +191,7 @@ const char* cmGlobalVisualStudio7Generator::ExternalProjectType(
return "8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942";
}
void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& config, bool /*fast*/,
int /*jobs*/, bool /*verbose*/, std::vector<std::string> const& makeOptions)
@@ -214,35 +209,25 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
makeProgramSelected = this->GetDevEnvCommand();
}
- makeCommand.push_back(makeProgramSelected);
+ // Workaround to convince VCExpress.exe to produce output.
+ makeCommand.RequiresOutputForward =
+ (makeProgramLower.find("vcexpress") != std::string::npos);
- makeCommand.push_back(std::string(projectName) + ".sln");
+ makeCommand.add(makeProgramSelected);
+
+ makeCommand.add(std::string(projectName) + ".sln");
std::string realTarget = targetName;
bool clean = false;
if (realTarget == "clean") {
clean = true;
realTarget = "ALL_BUILD";
}
- if (clean) {
- makeCommand.push_back("/clean");
- } else {
- makeCommand.push_back("/build");
- }
-
- if (!config.empty()) {
- makeCommand.push_back(config);
- } else {
- makeCommand.push_back("Debug");
- }
- makeCommand.push_back("/project");
- if (!realTarget.empty()) {
- makeCommand.push_back(realTarget);
- } else {
- makeCommand.push_back("ALL_BUILD");
- }
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ makeCommand.add((clean ? "/clean" : "/build"));
+ makeCommand.add((config.empty() ? "Debug" : config));
+ makeCommand.add("/project");
+ makeCommand.add((realTarget.empty() ? "ALL_BUILD" : realTarget));
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
}
///! Create a local generator appropriate to this Global Generator
@@ -254,13 +239,14 @@ cmLocalGenerator* cmGlobalVisualStudio7Generator::CreateLocalGenerator(
return lg;
}
-std::string const& cmGlobalVisualStudio7Generator::GetPlatformName() const
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+Json::Value cmGlobalVisualStudio7Generator::GetJson() const
{
- if (!this->GeneratorPlatform.empty()) {
- return this->GeneratorPlatform;
- }
- return this->DefaultPlatformName;
+ Json::Value generator = this->cmGlobalVisualStudioGenerator::GetJson();
+ generator["platform"] = this->GetPlatformName();
+ return generator;
}
+#endif
bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
cmMakefile* mf)
@@ -270,18 +256,6 @@ bool cmGlobalVisualStudio7Generator::SetSystemName(std::string const& s,
return this->cmGlobalVisualStudioGenerator::SetSystemName(s, mf);
}
-bool cmGlobalVisualStudio7Generator::SetGeneratorPlatform(std::string const& p,
- cmMakefile* mf)
-{
- if (this->GetPlatformName() == "x64") {
- mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
- } else if (this->GetPlatformName() == "Itanium") {
- mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE");
- }
- mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str());
- return this->cmGlobalVisualStudioGenerator::SetGeneratorPlatform(p, mf);
-}
-
void cmGlobalVisualStudio7Generator::Generate()
{
// first do the superclass method
@@ -383,7 +357,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if (vcprojName) {
cmLocalGenerator* lg = target->GetLocalGenerator();
std::string dir = lg->GetCurrentBinaryDirectory();
- dir = root->ConvertToRelativePath(rootBinaryDir, dir.c_str());
+ dir = root->MaybeConvertToRelativePath(rootBinaryDir, dir.c_str());
if (dir == ".") {
dir.clear(); // msbuild cannot handle ".\" prefix
}
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 0c9dd889b..3f1c1732d 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -18,19 +18,16 @@ struct cmIDEFlagTable;
class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
{
public:
- cmGlobalVisualStudio7Generator(cmake* cm,
- const std::string& platformName = "");
~cmGlobalVisualStudio7Generator();
- ///! Get the name for the platform.
- std::string const& GetPlatformName() const;
-
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator* CreateLocalGenerator(cmMakefile* mf) override;
- bool SetSystemName(std::string const& s, cmMakefile* mf) override;
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ Json::Value GetJson() const override;
+#endif
- bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
+ bool SetSystemName(std::string const& s, cmMakefile* mf) override;
/**
* Utilized by the generator factory to determine if this generator
@@ -55,7 +52,7 @@ public:
* Try running cmake and building a file. This is used for dynamically
* loaded commands, not as part of the usual build process.
*/
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -106,8 +103,10 @@ public:
cmIDEFlagTable const* ExtraFlagTable;
protected:
+ cmGlobalVisualStudio7Generator(cmake* cm,
+ std::string const& platformInGeneratorName);
+
void Generate() override;
- virtual const char* GetIDEVersion() = 0;
std::string const& GetDevEnvCommand();
virtual std::string FindDevEnvCommand();
@@ -131,7 +130,6 @@ protected:
virtual void WriteSLNGlobalSections(std::ostream& fout,
cmLocalGenerator* root);
virtual void WriteSLNFooter(std::ostream& fout);
- virtual void WriteSLNHeader(std::ostream& fout) = 0;
std::string WriteUtilityDepend(const cmGeneratorTarget* target) override;
virtual void WriteTargetsToSolution(
@@ -145,7 +143,7 @@ protected:
virtual void WriteExternalProject(
std::ostream& fout, const std::string& name, const char* path,
- const char* typeGuid, const std::set<std::string>& dependencies) = 0;
+ const char* typeGuid, const std::set<BT<std::string>>& dependencies) = 0;
std::string ConvertToSolutionPath(const char* path);
@@ -164,8 +162,6 @@ protected:
// Set during OutputSLNFile with the name of the current project.
// There is one SLN file per project.
std::string CurrentProject;
- std::string GeneratorPlatform;
- std::string DefaultPlatformName;
bool MasmEnabled;
bool NasmEnabled;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index ba138c22e..f6db018ea 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -7,13 +7,15 @@
#include "cmGeneratorTarget.h"
#include "cmLocalVisualStudio7Generator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSourceFile.h"
#include "cmVisualStudioWCEPlatformParser.h"
#include "cmake.h"
cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
- cmake* cm, const std::string& name, const std::string& platformName)
- : cmGlobalVisualStudio71Generator(cm, platformName)
+ cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudio71Generator(cm, platformInGeneratorName)
{
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
this->Name = name;
@@ -60,7 +62,7 @@ void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p,
cmMakefile* mf)
{
- if (this->DefaultPlatformName == "Win32") {
+ if (!this->PlatformInGeneratorName) {
this->GeneratorPlatform = p;
return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform("", mf);
} else {
@@ -78,7 +80,7 @@ void cmGlobalVisualStudio8Generator::Configure()
this->cmGlobalVisualStudio7Generator::Configure();
}
-bool cmGlobalVisualStudio8Generator::UseFolderProperty()
+bool cmGlobalVisualStudio8Generator::UseFolderProperty() const
{
return IsExpressEdition() ? false : cmGlobalGenerator::UseFolderProperty();
}
@@ -115,7 +117,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
// Create a list of all stamp files for this project.
std::vector<std::string> stamps;
- std::string stampList = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string stampList = "CMakeFiles/";
stampList += cmGlobalVisualStudio8Generator::GetGenerateStampList();
{
std::string stampListFile =
@@ -127,7 +129,7 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
for (cmLocalGenerator const* gi : generators) {
stampFile = gi->GetMakefile()->GetCurrentBinaryDirectory();
stampFile += "/";
- stampFile += cmake::GetCMakeFilesDirectoryPostSlash();
+ stampFile += "CMakeFiles/";
stampFile += "generate.stamp";
fout << stampFile << "\n";
stamps.push_back(stampFile);
@@ -315,9 +317,9 @@ bool cmGlobalVisualStudio8Generator::NeedLinkLibraryDependencies(
cmGeneratorTarget* target)
{
// Look for utility dependencies that magically link.
- for (std::string const& ui : target->GetUtilities()) {
+ for (BT<std::string> const& ui : target->GetUtilities()) {
if (cmGeneratorTarget* depTarget =
- target->GetLocalGenerator()->FindGeneratorTargetToUse(ui)) {
+ target->GetLocalGenerator()->FindGeneratorTargetToUse(ui.Value)) {
if (depTarget->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
depTarget->GetProperty("EXTERNAL_MSPROJECT")) {
// This utility dependency names an external .vcproj target.
@@ -362,7 +364,7 @@ static cmVS7FlagTable cmVS8ExtraFlagTable[] = {
{ "TreatWChar_tAsBuiltInType", "Zc:wchar_t-",
"wchar_t is not a built-in type", "false", 0 },
- { 0, 0, 0, 0, 0 }
+ { "", "", "", "", 0 }
};
cmIDEFlagTable const* cmGlobalVisualStudio8Generator::GetExtraFlagTableVS8()
{
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index 6f64b9c66..8719bf3bb 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -13,9 +13,6 @@
class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator
{
public:
- cmGlobalVisualStudio8Generator(cmake* cm, const std::string& name,
- const std::string& platformName);
-
///! Get the name for the generator.
std::string GetName() const override { return this->Name; }
@@ -44,12 +41,11 @@ public:
return !this->WindowsCEVersion.empty();
}
- /** Is the installed VS an Express edition? */
- bool IsExpressEdition() const { return this->ExpressEdition; }
-
protected:
+ cmGlobalVisualStudio8Generator(cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName);
+
void AddExtraIDETargets() override;
- const char* GetIDEVersion() override { return "8.0"; }
std::string FindDevEnvCommand() override;
@@ -73,10 +69,9 @@ protected:
const char* path,
const cmGeneratorTarget* t) override;
- bool UseFolderProperty();
+ bool UseFolderProperty() const override;
std::string Name;
std::string WindowsCEVersion;
- bool ExpressEdition;
};
#endif
diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx
index 7ac3a6f09..6e61d2681 100644
--- a/Source/cmGlobalVisualStudio9Generator.cxx
+++ b/Source/cmGlobalVisualStudio9Generator.cxx
@@ -5,8 +5,8 @@
#include "cmDocumentationEntry.h"
#include "cmLocalVisualStudio7Generator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmVisualStudioWCEPlatformParser.h"
-#include "cmake.h"
static const char vs9generatorName[] = "Visual Studio 9 2008";
@@ -59,9 +59,16 @@ public:
"Optional [arch] can be \"Win64\" or \"IA64\".";
}
- void GetGenerators(std::vector<std::string>& names) const override
+ std::vector<std::string> GetGeneratorNames() const override
{
+ std::vector<std::string> names;
names.push_back(vs9generatorName);
+ return names;
+ }
+
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ std::vector<std::string> names;
names.push_back(vs9generatorName + std::string(" Win64"));
names.push_back(vs9generatorName + std::string(" IA64"));
cmVisualStudioWCEPlatformParser parser;
@@ -71,10 +78,29 @@ public:
for (std::string const& i : availablePlatforms) {
names.push_back("Visual Studio 9 2008 " + i);
}
+ return names;
}
bool SupportsToolset() const override { return false; }
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("Itanium");
+ cmVisualStudioWCEPlatformParser parser;
+ parser.ParseVersion("9.0");
+ const std::vector<std::string>& availablePlatforms =
+ parser.GetAvailablePlatforms();
+ for (std::string const& i : availablePlatforms) {
+ platforms.emplace_back(i);
+ }
+ return platforms;
+ }
+
+ std::string GetDefaultPlatformName() const override { return "Win32"; }
};
cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory()
@@ -83,8 +109,9 @@ cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory()
}
cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
- cmake* cm, const std::string& name, const std::string& platformName)
- : cmGlobalVisualStudio8Generator(cm, name, platformName)
+ cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudio8Generator(cm, name, platformInGeneratorName)
{
this->Version = VS9;
std::string vc9Express;
@@ -94,12 +121,6 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator(
vc9Express, cmSystemTools::KeyWOW64_32);
}
-void cmGlobalVisualStudio9Generator::WriteSLNHeader(std::ostream& fout)
-{
- fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n";
- fout << "# Visual Studio 2008\n";
-}
-
std::string cmGlobalVisualStudio9Generator::GetUserMacrosDirectory()
{
std::string base;
diff --git a/Source/cmGlobalVisualStudio9Generator.h b/Source/cmGlobalVisualStudio9Generator.h
index 2aa6a91ee..7bebfd65f 100644
--- a/Source/cmGlobalVisualStudio9Generator.h
+++ b/Source/cmGlobalVisualStudio9Generator.h
@@ -13,17 +13,9 @@
class cmGlobalVisualStudio9Generator : public cmGlobalVisualStudio8Generator
{
public:
- cmGlobalVisualStudio9Generator(cmake* cm, const std::string& name,
- const std::string& platformName);
static cmGlobalGeneratorFactory* NewFactory();
/**
- * Try to determine system information such as shared library
- * extension, pthreads, byte order etc.
- */
- void WriteSLNHeader(std::ostream& fout) override;
-
- /**
* Where does this version of Visual Studio look for macros for the
* current user? Returns the empty string if this version of Visual
* Studio does not implement support for VB macros.
@@ -37,7 +29,8 @@ public:
std::string GetUserMacrosRegKeyBase() override;
protected:
- const char* GetIDEVersion() override { return "9.0"; }
+ cmGlobalVisualStudio9Generator(cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName);
private:
class Factory;
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index da3daf86b..639dc226d 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -19,13 +19,22 @@
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmTarget.h"
+#include "cmake.h"
-cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator(cmake* cm)
+cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator(
+ cmake* cm, std::string const& platformInGeneratorName)
: cmGlobalGenerator(cm)
{
cm->GetState()->SetIsGeneratorMultiConfig(true);
cm->GetState()->SetWindowsShell(true);
cm->GetState()->SetWindowsVSIDE(true);
+
+ if (platformInGeneratorName.empty()) {
+ this->DefaultPlatformName = "Win32";
+ } else {
+ this->DefaultPlatformName = platformInGeneratorName;
+ this->PlatformInGeneratorName = true;
+ }
}
cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator()
@@ -43,6 +52,108 @@ void cmGlobalVisualStudioGenerator::SetVersion(VSVersion v)
this->Version = v;
}
+bool cmGlobalVisualStudioGenerator::SetGeneratorPlatform(std::string const& p,
+ cmMakefile* mf)
+{
+ if (this->GetPlatformName() == "x64") {
+ mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE");
+ } else if (this->GetPlatformName() == "Itanium") {
+ mf->AddDefinition("CMAKE_FORCE_IA64", "TRUE");
+ }
+ mf->AddDefinition("CMAKE_VS_PLATFORM_NAME", this->GetPlatformName().c_str());
+ return this->cmGlobalGenerator::SetGeneratorPlatform(p, mf);
+}
+
+std::string const& cmGlobalVisualStudioGenerator::GetPlatformName() const
+{
+ if (!this->GeneratorPlatform.empty()) {
+ return this->GeneratorPlatform;
+ }
+ return this->DefaultPlatformName;
+}
+
+const char* cmGlobalVisualStudioGenerator::GetIDEVersion() const
+{
+ switch (this->Version) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ return "9.0";
+ case cmGlobalVisualStudioGenerator::VS10:
+ return "10.0";
+ case cmGlobalVisualStudioGenerator::VS11:
+ return "11.0";
+ case cmGlobalVisualStudioGenerator::VS12:
+ return "12.0";
+ case cmGlobalVisualStudioGenerator::VS14:
+ return "14.0";
+ case cmGlobalVisualStudioGenerator::VS15:
+ return "15.0";
+ case cmGlobalVisualStudioGenerator::VS16:
+ return "16.0";
+ }
+ return "";
+}
+
+void cmGlobalVisualStudioGenerator::WriteSLNHeader(std::ostream& fout)
+{
+ switch (this->Version) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ fout << "Microsoft Visual Studio Solution File, Format Version 10.00\n";
+ fout << "# Visual Studio 2008\n";
+ break;
+ case cmGlobalVisualStudioGenerator::VS10:
+ fout << "Microsoft Visual Studio Solution File, Format Version 11.00\n";
+ if (this->ExpressEdition) {
+ fout << "# Visual C++ Express 2010\n";
+ } else {
+ fout << "# Visual Studio 2010\n";
+ }
+ break;
+ case cmGlobalVisualStudioGenerator::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::VS12:
+ fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
+ if (this->ExpressEdition) {
+ fout << "# Visual Studio Express 2013 for Windows Desktop\n";
+ } else {
+ fout << "# Visual Studio 2013\n";
+ }
+ break;
+ case cmGlobalVisualStudioGenerator::VS14:
+ // Visual Studio 14 writes .sln format 12.00
+ fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
+ if (this->ExpressEdition) {
+ fout << "# Visual Studio Express 14 for Windows Desktop\n";
+ } else {
+ fout << "# Visual Studio 14\n";
+ }
+ break;
+ case cmGlobalVisualStudioGenerator::VS15:
+ // Visual Studio 15 writes .sln format 12.00
+ fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
+ if (this->ExpressEdition) {
+ fout << "# Visual Studio Express 15 for Windows Desktop\n";
+ } else {
+ fout << "# Visual Studio 15\n";
+ }
+ break;
+ case cmGlobalVisualStudioGenerator::VS16:
+ // Visual Studio 16 writes .sln format 12.00
+ fout << "Microsoft Visual Studio Solution File, Format Version 12.00\n";
+ if (this->ExpressEdition) {
+ fout << "# Visual Studio Express 16 for Windows Desktop\n";
+ } else {
+ fout << "# Visual Studio 16\n";
+ }
+ break;
+ }
+}
+
std::string cmGlobalVisualStudioGenerator::GetRegistryBase()
{
return cmGlobalVisualStudioGenerator::GetRegistryBase(this->GetIDEVersion());
@@ -90,7 +201,7 @@ void cmGlobalVisualStudioGenerator::AddExtraIDETargets()
tgt->IsImported()) {
continue;
}
- if (!this->IsExcluded(gen[0], tgt)) {
+ if (!this->IsExcluded(tgt)) {
allBuild->AddUtility(tgt->GetName());
}
}
@@ -151,13 +262,12 @@ void cmGlobalVisualStudioGenerator::ConfigureCMakeVisualStudioMacros()
// purposes but newer versions distributed with CMake will replace
// older versions in user directories.
int res;
- if (!cmSystemTools::FileTimeCompare(src.c_str(), dst.c_str(), &res) ||
- res > 0) {
- if (!cmSystemTools::CopyFileAlways(src.c_str(), dst.c_str())) {
+ if (!cmSystemTools::FileTimeCompare(src, dst, &res) || res > 0) {
+ if (!cmSystemTools::CopyFileAlways(src, dst)) {
std::ostringstream oss;
oss << "Could not copy from: " << src << std::endl;
oss << " to: " << dst << std::endl;
- cmSystemTools::Message(oss.str().c_str(), "Warning");
+ cmSystemTools::Message(oss.str(), "Warning");
}
}
@@ -413,7 +523,7 @@ std::string cmGlobalVisualStudioGenerator::GetStartupProjectName(
return startup;
} else {
root->GetMakefile()->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
"Directory property VS_STARTUP_PROJECT specifies target "
"'" +
startup + "' that does not exist. Ignoring.");
@@ -672,7 +782,7 @@ void RegisterVisualStudioMacros(const std::string& macrosFile,
<< "CMake needs to register Visual Studio macros when its macros"
<< " file is updated or when it detects that its current macros file"
<< " is no longer registered with Visual Studio." << std::endl;
- cmSystemTools::Message(oss.str().c_str(), "Warning");
+ cmSystemTools::Message(oss.str(), "Warning");
// Count them again now that the warning is over. In the case of a GUI
// warning, the user may have gone to close Visual Studio and then come
@@ -703,7 +813,6 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
cmGeneratorTarget const* gt)
{
// check to see if this is a fortran build
- std::set<std::string> languages;
{
// Issue diagnostic if the source files depend on the config.
std::vector<cmSourceFile*> sources;
@@ -711,27 +820,25 @@ bool cmGlobalVisualStudioGenerator::TargetIsFortranOnly(
return false;
}
}
+
// If there's only one source language, Fortran has to be used
// in order for the sources to compile.
- // Note: Via linker propagation, LINKER_LANGUAGE could become CXX in
- // this situation and mismatch from the actual language of the linker.
+ std::set<std::string> languages;
gt->GetLanguages(languages, "");
- if (languages.size() == 1) {
- if (*languages.begin() == "Fortran") {
- return true;
- }
+ // Consider an explicit linker language property, but *not* the
+ // computed linker language that may depend on linked targets.
+ // This allows the project to control the language choice in
+ // a target with none of its own sources, e.g. when also using
+ // object libraries.
+ const char* linkLang = gt->GetProperty("LINKER_LANGUAGE");
+ if (linkLang && *linkLang) {
+ languages.insert(linkLang);
}
- // In the case of mixed object files or sources mixed with objects,
- // decide the language based on the value of LINKER_LANGUAGE.
- // This will not make it possible to mix source files of different
- // languages, but object libraries will be linked together in the
- // same fashion as other generators do.
- if (gt->GetLinkerLanguage("") == "Fortran") {
- return true;
- }
+ // Intel Fortran .vfproj files do support the resource compiler.
+ languages.erase("RC");
- return false;
+ return languages.size() == 1 && *languages.begin() == "Fortran";
}
bool cmGlobalVisualStudioGenerator::TargetCompare::operator()(
diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h
index 07bc9a393..039191c6c 100644
--- a/Source/cmGlobalVisualStudioGenerator.h
+++ b/Source/cmGlobalVisualStudioGenerator.h
@@ -38,15 +38,26 @@ public:
VS12 = 120,
/* VS13 = 130 was skipped */
VS14 = 140,
- VS15 = 150
+ VS15 = 150,
+ VS16 = 160
};
- cmGlobalVisualStudioGenerator(cmake* cm);
virtual ~cmGlobalVisualStudioGenerator();
VSVersion GetVersion() const;
void SetVersion(VSVersion v);
+ /** Is the installed VS an Express edition? */
+ bool IsExpressEdition() const { return this->ExpressEdition; }
+
+ bool SetGeneratorPlatform(std::string const& p, cmMakefile* mf) override;
+
+ /**
+ * Get the name of the target platform (architecture) for which we generate.
+ * The names are as defined by VS, e.g. "Win32", "x64", "Itanium", "ARM".
+ */
+ std::string const& GetPlatformName() const;
+
/**
* Configure CMake's Visual Studio macros file into the user's Visual
* Studio macros directory.
@@ -118,7 +129,7 @@ public:
std::string ExpandCFGIntDir(const std::string& str,
const std::string& config) const override;
- void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const;
+ void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const override;
std::string GetStartupProjectName(cmLocalGenerator const* root) const;
@@ -130,6 +141,9 @@ public:
bool dryRun) override;
protected:
+ cmGlobalVisualStudioGenerator(cmake* cm,
+ std::string const& platformInGeneratorName);
+
void AddExtraIDETargets() override;
// Does this VS version link targets to each other if there are
@@ -137,7 +151,9 @@ protected:
// below 8.
virtual bool VSLinksDependencies() const { return true; }
- virtual const char* GetIDEVersion() = 0;
+ const char* GetIDEVersion() const;
+
+ void WriteSLNHeader(std::ostream& fout);
bool ComputeTargetDepends() override;
class VSDependSet : public std::set<std::string>
@@ -159,11 +175,16 @@ protected:
protected:
VSVersion Version;
+ bool ExpressEdition;
+
+ std::string GeneratorPlatform;
+ std::string DefaultPlatformName;
+ bool PlatformInGeneratorName = false;
private:
virtual std::string GetVSMakeProgram() = 0;
void PrintCompilerAdvice(std::ostream&, std::string const&,
- const char*) const
+ const char*) const override
{
}
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
new file mode 100644
index 000000000..f52abd0dc
--- /dev/null
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -0,0 +1,515 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmGlobalVisualStudioVersionedGenerator.h"
+
+#include "cmAlgorithms.h"
+#include "cmDocumentationEntry.h"
+#include "cmLocalVisualStudio10Generator.h"
+#include "cmMakefile.h"
+#include "cmVSSetupHelper.h"
+#include "cmake.h"
+
+#if defined(_M_ARM64)
+# define HOST_PLATFORM_NAME "ARM64"
+# define HOST_TOOLS_ARCH ""
+#elif defined(_M_ARM)
+# define HOST_PLATFORM_NAME "ARM"
+# define HOST_TOOLS_ARCH ""
+#elif defined(_M_IA64)
+# define HOST_PLATFORM_NAME "Itanium"
+# define HOST_TOOLS_ARCH ""
+#elif defined(_WIN64)
+# define HOST_PLATFORM_NAME "x64"
+# define HOST_TOOLS_ARCH "x64"
+#else
+static bool VSIsWow64()
+{
+ BOOL isWow64 = false;
+ return IsWow64Process(GetCurrentProcess(), &isWow64) && isWow64;
+}
+#endif
+
+static std::string VSHostPlatformName()
+{
+#ifdef HOST_PLATFORM_NAME
+ return HOST_PLATFORM_NAME;
+#else
+ if (VSIsWow64()) {
+ return "x64";
+ } else {
+ return "Win32";
+ }
+#endif
+}
+
+static std::string VSHostArchitecture()
+{
+#ifdef HOST_TOOLS_ARCH
+ return HOST_TOOLS_ARCH;
+#else
+ if (VSIsWow64()) {
+ return "x64";
+ } else {
+ return "x86";
+ }
+#endif
+}
+
+static unsigned int VSVersionToMajor(
+ cmGlobalVisualStudioGenerator::VSVersion v)
+{
+ switch (v) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ return 9;
+ case cmGlobalVisualStudioGenerator::VS10:
+ return 10;
+ case cmGlobalVisualStudioGenerator::VS11:
+ return 11;
+ case cmGlobalVisualStudioGenerator::VS12:
+ return 12;
+ case cmGlobalVisualStudioGenerator::VS14:
+ return 14;
+ case cmGlobalVisualStudioGenerator::VS15:
+ return 15;
+ case cmGlobalVisualStudioGenerator::VS16:
+ return 16;
+ }
+ return 0;
+}
+
+static const char* VSVersionToToolset(
+ cmGlobalVisualStudioGenerator::VSVersion v)
+{
+ switch (v) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ return "v90";
+ case cmGlobalVisualStudioGenerator::VS10:
+ return "v100";
+ case cmGlobalVisualStudioGenerator::VS11:
+ return "v110";
+ case cmGlobalVisualStudioGenerator::VS12:
+ return "v120";
+ case cmGlobalVisualStudioGenerator::VS14:
+ return "v140";
+ case cmGlobalVisualStudioGenerator::VS15:
+ return "v141";
+ case cmGlobalVisualStudioGenerator::VS16:
+ return "v142";
+ }
+ return "";
+}
+
+static const char vs15generatorName[] = "Visual Studio 15 2017";
+
+// Map generator name without year to name with year.
+static const char* cmVS15GenName(const std::string& name, std::string& genName)
+{
+ if (strncmp(name.c_str(), vs15generatorName,
+ sizeof(vs15generatorName) - 6) != 0) {
+ return 0;
+ }
+ const char* p = name.c_str() + sizeof(vs15generatorName) - 6;
+ if (cmHasLiteralPrefix(p, " 2017")) {
+ p += 5;
+ }
+ genName = std::string(vs15generatorName) + p;
+ return p;
+}
+
+class cmGlobalVisualStudioVersionedGenerator::Factory15
+ : public cmGlobalGeneratorFactory
+{
+public:
+ cmGlobalGenerator* CreateGlobalGenerator(const std::string& name,
+ cmake* cm) const override
+ {
+ std::string genName;
+ const char* p = cmVS15GenName(name, genName);
+ if (!p) {
+ return 0;
+ }
+ if (!*p) {
+ return new cmGlobalVisualStudioVersionedGenerator(
+ cmGlobalVisualStudioGenerator::VS15, cm, genName, "");
+ }
+ if (*p++ != ' ') {
+ return 0;
+ }
+ if (strcmp(p, "Win64") == 0) {
+ return new cmGlobalVisualStudioVersionedGenerator(
+ cmGlobalVisualStudioGenerator::VS15, cm, genName, "x64");
+ }
+ if (strcmp(p, "ARM") == 0) {
+ return new cmGlobalVisualStudioVersionedGenerator(
+ cmGlobalVisualStudioGenerator::VS15, cm, genName, "ARM");
+ }
+ return 0;
+ }
+
+ void GetDocumentation(cmDocumentationEntry& entry) const override
+ {
+ entry.Name = std::string(vs15generatorName) + " [arch]";
+ entry.Brief = "Generates Visual Studio 2017 project files. "
+ "Optional [arch] can be \"Win64\" or \"ARM\".";
+ }
+
+ std::vector<std::string> GetGeneratorNames() const override
+ {
+ std::vector<std::string> names;
+ names.push_back(vs15generatorName);
+ return names;
+ }
+
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ std::vector<std::string> names;
+ names.push_back(vs15generatorName + std::string(" ARM"));
+ names.push_back(vs15generatorName + std::string(" Win64"));
+ 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");
+ platforms.emplace_back("ARM64");
+ return platforms;
+ }
+
+ std::string GetDefaultPlatformName() const override { return "Win32"; }
+};
+
+cmGlobalGeneratorFactory*
+cmGlobalVisualStudioVersionedGenerator::NewFactory15()
+{
+ return new Factory15;
+}
+
+static const char vs16generatorName[] = "Visual Studio 16 2019";
+
+// Map generator name without year to name with year.
+static const char* cmVS16GenName(const std::string& name, std::string& genName)
+{
+ if (strncmp(name.c_str(), vs16generatorName,
+ sizeof(vs16generatorName) - 6) != 0) {
+ return 0;
+ }
+ const char* p = name.c_str() + sizeof(vs16generatorName) - 6;
+ if (cmHasLiteralPrefix(p, " 2019")) {
+ p += 5;
+ }
+ genName = std::string(vs16generatorName) + p;
+ return p;
+}
+
+class cmGlobalVisualStudioVersionedGenerator::Factory16
+ : public cmGlobalGeneratorFactory
+{
+public:
+ virtual cmGlobalGenerator* CreateGlobalGenerator(const std::string& name,
+ cmake* cm) const
+ {
+ std::string genName;
+ const char* p = cmVS16GenName(name, genName);
+ if (!p) {
+ return 0;
+ }
+ if (!*p) {
+ return new cmGlobalVisualStudioVersionedGenerator(
+ cmGlobalVisualStudioGenerator::VS16, cm, genName, "");
+ }
+ return 0;
+ }
+
+ virtual void GetDocumentation(cmDocumentationEntry& entry) const
+ {
+ entry.Name = std::string(vs16generatorName);
+ entry.Brief = "Generates Visual Studio 2019 project files. "
+ "Use -A option to specify architecture.";
+ }
+
+ std::vector<std::string> GetGeneratorNames() const override
+ {
+ std::vector<std::string> names;
+ names.push_back(vs16generatorName);
+ return names;
+ }
+
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ return std::vector<std::string>();
+ }
+
+ 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");
+ platforms.emplace_back("ARM64");
+ return platforms;
+ }
+
+ std::string GetDefaultPlatformName() const override
+ {
+ return VSHostPlatformName();
+ }
+};
+
+cmGlobalGeneratorFactory*
+cmGlobalVisualStudioVersionedGenerator::NewFactory16()
+{
+ return new Factory16;
+}
+
+cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
+ VSVersion version, cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName)
+ : cmGlobalVisualStudio14Generator(cm, name, platformInGeneratorName)
+ , vsSetupAPIHelper(VSVersionToMajor(version))
+{
+ this->Version = version;
+ this->ExpressEdition = false;
+ this->DefaultPlatformToolset = VSVersionToToolset(this->Version);
+ this->DefaultCLFlagTableName = VSVersionToToolset(this->Version);
+ this->DefaultCSharpFlagTableName = VSVersionToToolset(this->Version);
+ this->DefaultLinkFlagTableName = VSVersionToToolset(this->Version);
+ if (this->Version >= cmGlobalVisualStudioGenerator::VS16) {
+ this->DefaultPlatformName = VSHostPlatformName();
+ this->DefaultPlatformToolsetHostArchitecture = VSHostArchitecture();
+ }
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::MatchesGeneratorName(
+ const std::string& name) const
+{
+ std::string genName;
+ switch (this->Version) {
+ case cmGlobalVisualStudioGenerator::VS9:
+ case cmGlobalVisualStudioGenerator::VS10:
+ case cmGlobalVisualStudioGenerator::VS11:
+ case cmGlobalVisualStudioGenerator::VS12:
+ case cmGlobalVisualStudioGenerator::VS14:
+ break;
+ case cmGlobalVisualStudioGenerator::VS15:
+ if (cmVS15GenName(name, genName)) {
+ return genName == this->GetName();
+ }
+ break;
+ case cmGlobalVisualStudioGenerator::VS16:
+ if (cmVS16GenName(name, genName)) {
+ return genName == this->GetName();
+ }
+ break;
+ }
+ return false;
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::SetGeneratorInstance(
+ std::string const& i, cmMakefile* mf)
+{
+ if (!i.empty()) {
+ if (!this->vsSetupAPIHelper.SetVSInstance(i)) {
+ std::ostringstream e;
+ /* clang-format off */
+ e <<
+ "Generator\n"
+ " " << this->GetName() << "\n"
+ "could not find specified instance of Visual Studio:\n"
+ " " << i;
+ /* clang-format on */
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ return false;
+ }
+ }
+
+ std::string vsInstance;
+ if (!this->vsSetupAPIHelper.GetVSInstanceInfo(vsInstance)) {
+ std::ostringstream e;
+ /* clang-format off */
+ e <<
+ "Generator\n"
+ " " << this->GetName() << "\n"
+ "could not find any instance of Visual Studio.\n";
+ /* clang-format on */
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ return false;
+ }
+
+ // Save the selected instance persistently.
+ std::string genInstance = mf->GetSafeDefinition("CMAKE_GENERATOR_INSTANCE");
+ if (vsInstance != genInstance) {
+ this->CMakeInstance->AddCacheEntry(
+ "CMAKE_GENERATOR_INSTANCE", vsInstance.c_str(),
+ "Generator instance identifier.", cmStateEnums::INTERNAL);
+ }
+
+ return true;
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::GetVSInstance(
+ std::string& dir) const
+{
+ return vsSetupAPIHelper.GetVSInstanceInfo(dir);
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::IsDefaultToolset(
+ const std::string& version) const
+{
+ if (version.empty()) {
+ return true;
+ }
+
+ std::string vcToolsetVersion;
+ if (this->vsSetupAPIHelper.GetVCToolsetVersion(vcToolsetVersion)) {
+
+ cmsys::RegularExpression regex("[0-9][0-9]\\.[0-9]+");
+ if (regex.find(version) && regex.find(vcToolsetVersion)) {
+ const auto majorMinorEnd = vcToolsetVersion.find('.', 3);
+ const auto majorMinor = vcToolsetVersion.substr(0, majorMinorEnd);
+ return version == majorMinor;
+ }
+ }
+
+ return false;
+}
+
+std::string cmGlobalVisualStudioVersionedGenerator::GetAuxiliaryToolset() const
+{
+ const char* version = this->GetPlatformToolsetVersion();
+ if (version) {
+ std::string instancePath;
+ GetVSInstance(instancePath);
+ std::stringstream path;
+ path << instancePath;
+ path << "/VC/Auxiliary/Build/";
+ path << version;
+ path << "/Microsoft.VCToolsVersion." << version << ".props";
+
+ std::string toolsetPath = path.str();
+ cmSystemTools::ConvertToUnixSlashes(toolsetPath);
+ return toolsetPath;
+ }
+ return {};
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::InitializeWindows(cmMakefile* mf)
+{
+ // If the Win 8.1 SDK is installed then we can select a SDK matching
+ // the target Windows version.
+ if (this->IsWin81SDKInstalled()) {
+ // VS 2019 does not default to 8.1 so specify it explicitly when needed.
+ if (this->Version >= cmGlobalVisualStudioGenerator::VS16 &&
+ !cmSystemTools::VersionCompareGreater(this->SystemVersion, "8.1")) {
+ this->SetWindowsTargetPlatformVersion("8.1", mf);
+ return true;
+ }
+ return cmGlobalVisualStudio14Generator::InitializeWindows(mf);
+ }
+ // Otherwise we must choose a Win 10 SDK even if we are not targeting
+ // Windows 10.
+ return this->SelectWindows10SDK(mf, false);
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::SelectWindowsStoreToolset(
+ std::string& toolset) const
+{
+ if (cmHasLiteralPrefix(this->SystemVersion, "10.0")) {
+ if (this->IsWindowsStoreToolsetInstalled() &&
+ this->IsWindowsDesktopToolsetInstalled()) {
+ toolset = VSVersionToToolset(this->Version);
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return this->cmGlobalVisualStudio14Generator::SelectWindowsStoreToolset(
+ toolset);
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::IsWindowsDesktopToolsetInstalled()
+ const
+{
+ return vsSetupAPIHelper.IsVSInstalled();
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::IsWindowsStoreToolsetInstalled()
+ const
+{
+ return vsSetupAPIHelper.IsWin10SDKInstalled();
+}
+
+bool cmGlobalVisualStudioVersionedGenerator::IsWin81SDKInstalled() const
+{
+ // Does the VS installer tool know about one?
+ if (vsSetupAPIHelper.IsWin81SDKInstalled()) {
+ return true;
+ }
+
+ // Does the registry know about one (e.g. from VS 2015)?
+ std::string win81Root;
+ if (cmSystemTools::ReadRegistryValue(
+ "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
+ "Windows Kits\\Installed Roots;KitsRoot81",
+ win81Root, cmSystemTools::KeyWOW64_32) ||
+ cmSystemTools::ReadRegistryValue(
+ "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\"
+ "Windows Kits\\Installed Roots;KitsRoot81",
+ win81Root, cmSystemTools::KeyWOW64_32)) {
+ return cmSystemTools::FileExists(win81Root + "/include/um/windows.h",
+ true);
+ }
+ return false;
+}
+
+std::string cmGlobalVisualStudioVersionedGenerator::GetWindows10SDKMaxVersion()
+ const
+{
+ return std::string();
+}
+
+std::string cmGlobalVisualStudioVersionedGenerator::FindMSBuildCommand()
+{
+ std::string msbuild;
+
+ // Ask Visual Studio Installer tool.
+ std::string vs;
+ if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
+ msbuild = vs + "/MSBuild/Current/Bin/MSBuild.exe";
+ if (cmSystemTools::FileExists(msbuild)) {
+ return msbuild;
+ }
+ msbuild = vs + "/MSBuild/15.0/Bin/MSBuild.exe";
+ if (cmSystemTools::FileExists(msbuild)) {
+ return msbuild;
+ }
+ }
+
+ msbuild = "MSBuild.exe";
+ return msbuild;
+}
+
+std::string cmGlobalVisualStudioVersionedGenerator::FindDevEnvCommand()
+{
+ std::string devenv;
+
+ // Ask Visual Studio Installer tool.
+ std::string vs;
+ if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
+ devenv = vs + "/Common7/IDE/devenv.com";
+ if (cmSystemTools::FileExists(devenv)) {
+ return devenv;
+ }
+ }
+
+ devenv = "devenv.com";
+ return devenv;
+}
diff --git a/Source/cmGlobalVisualStudio15Generator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h
index 8ab63f141..466816ba8 100644
--- a/Source/cmGlobalVisualStudio15Generator.h
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.h
@@ -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. */
-#ifndef cmGlobalVisualStudio15Generator_h
-#define cmGlobalVisualStudio15Generator_h
+#ifndef cmGlobalVisualStudioVersionedGenerator_h
+#define cmGlobalVisualStudioVersionedGenerator_h
#include "cmConfigure.h" // IWYU pragma: keep
@@ -14,20 +14,16 @@
class cmGlobalGeneratorFactory;
class cmake;
-/** \class cmGlobalVisualStudio15Generator */
-class cmGlobalVisualStudio15Generator : public cmGlobalVisualStudio14Generator
+/** \class cmGlobalVisualStudioVersionedGenerator */
+class cmGlobalVisualStudioVersionedGenerator
+ : public cmGlobalVisualStudio14Generator
{
public:
- cmGlobalVisualStudio15Generator(cmake* cm, const std::string& name,
- const std::string& platformName);
- static cmGlobalGeneratorFactory* NewFactory();
+ static cmGlobalGeneratorFactory* NewFactory15();
+ static cmGlobalGeneratorFactory* NewFactory16();
bool MatchesGeneratorName(const std::string& name) const override;
- void WriteSLNHeader(std::ostream& fout) override;
-
- const char* GetToolsVersion() override { return "15.0"; }
-
bool SetGeneratorInstance(std::string const& i, cmMakefile* mf) override;
bool GetVSInstance(std::string& dir) const;
@@ -36,11 +32,13 @@ public:
std::string GetAuxiliaryToolset() const override;
protected:
+ cmGlobalVisualStudioVersionedGenerator(
+ VSVersion version, cmake* cm, const std::string& name,
+ std::string const& platformInGeneratorName);
+
bool InitializeWindows(cmMakefile* mf) override;
bool SelectWindowsStoreToolset(std::string& toolset) const override;
- const char* GetIDEVersion() override { return "15.0"; }
-
// Used to verify that the Desktop toolset for the current generator is
// installed on the machine.
bool IsWindowsDesktopToolsetInstalled() const override;
@@ -58,7 +56,10 @@ protected:
std::string FindDevEnvCommand() override;
private:
- class Factory;
+ class Factory15;
+ friend class Factory15;
+ class Factory16;
+ friend class Factory16;
mutable cmVSSetupAPIHelper vsSetupAPIHelper;
};
#endif
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index 558ef1585..c02c4711a 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -51,7 +51,7 @@ void cmGlobalWatcomWMakeGenerator::GetDocumentation(
}
void cmGlobalWatcomWMakeGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& projectDir,
const std::string& targetName, const std::string& config, bool fast,
int /*jobs*/, bool verbose, std::vector<std::string> const& makeOptions)
diff --git a/Source/cmGlobalWatcomWMakeGenerator.h b/Source/cmGlobalWatcomWMakeGenerator.h
index 0d10d58f4..6680b193f 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.h
+++ b/Source/cmGlobalWatcomWMakeGenerator.h
@@ -50,7 +50,7 @@ public:
bool AllowDeleteOnError() const override { return false; }
protected:
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e353a3770..51c001e75 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -21,6 +21,7 @@
#include "cmLocalGenerator.h"
#include "cmLocalXCodeGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmSourceFile.h"
#include "cmSourceGroup.h"
@@ -132,13 +133,27 @@ public:
cmGlobalXCodeGenerator::GetDocumentation(entry);
}
- void GetGenerators(std::vector<std::string>& names) const override
+ std::vector<std::string> GetGeneratorNames() const override
{
+ std::vector<std::string> names;
names.push_back(cmGlobalXCodeGenerator::GetActualName());
+ return names;
+ }
+
+ std::vector<std::string> GetGeneratorNamesWithPlatform() const override
+ {
+ return std::vector<std::string>();
}
bool SupportsToolset() const override { return true; }
bool SupportsPlatform() const override { return false; }
+
+ std::vector<std::string> GetKnownPlatforms() const override
+ {
+ return std::vector<std::string>();
+ }
+
+ std::string GetDefaultPlatformName() const override { return std::string(); }
};
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(
@@ -176,12 +191,14 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
std::string versionFile;
{
std::string out;
- std::string::size_type pos = 0;
- if (cmSystemTools::RunSingleCommand("xcode-select --print-path", &out,
- nullptr, nullptr, nullptr,
- cmSystemTools::OUTPUT_NONE) &&
- (pos = out.find(".app/"), pos != std::string::npos)) {
- versionFile = out.substr(0, pos + 5) + "Contents/version.plist";
+ bool commandResult = cmSystemTools::RunSingleCommand(
+ "xcode-select --print-path", &out, nullptr, nullptr, nullptr,
+ cmSystemTools::OUTPUT_NONE);
+ if (commandResult) {
+ std::string::size_type pos = out.find(".app/");
+ if (pos != std::string::npos) {
+ versionFile = out.substr(0, pos + 5) + "Contents/version.plist";
+ }
}
}
if (!versionFile.empty() && cmSystemTools::FileExists(versionFile.c_str())) {
@@ -201,7 +218,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
unsigned int version_number = 10 * v[0] + v[1];
if (version_number < 30) {
- cm->IssueMessage(cmake::FATAL_ERROR,
+ cm->IssueMessage(MessageType::FATAL_ERROR,
"Xcode " + version_string + " not supported.");
return nullptr;
}
@@ -263,7 +280,7 @@ bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts,
" " << ts << "\n"
"that was specified.";
/* clang-format on */
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
this->GeneratorToolset = ts;
@@ -322,20 +339,22 @@ bool cmGlobalXCodeGenerator::Open(const std::string& bindir,
}
void cmGlobalXCodeGenerator::GenerateBuildCommand(
- std::vector<std::string>& makeCommand, const std::string& makeProgram,
+ GeneratedMakeCommand& makeCommand, const std::string& makeProgram,
const std::string& projectName, const std::string& /*projectDir*/,
const std::string& targetName, const std::string& config, bool /*fast*/,
int jobs, bool /*verbose*/, std::vector<std::string> const& makeOptions)
{
// now build the test
- makeCommand.push_back(
+ makeCommand.add(
this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand()));
- makeCommand.push_back("-project");
- std::string projectArg = projectName;
- projectArg += ".xcode";
- projectArg += "proj";
- makeCommand.push_back(projectArg);
+ if (!projectName.empty()) {
+ makeCommand.add("-project");
+ std::string projectArg = projectName;
+ projectArg += ".xcode";
+ projectArg += "proj";
+ makeCommand.add(projectArg);
+ }
bool clean = false;
std::string realTarget = targetName;
@@ -343,29 +362,22 @@ void cmGlobalXCodeGenerator::GenerateBuildCommand(
clean = true;
realTarget = "ALL_BUILD";
}
- if (clean) {
- makeCommand.push_back("clean");
- } else {
- makeCommand.push_back("build");
- }
- makeCommand.push_back("-target");
- if (!realTarget.empty()) {
- makeCommand.push_back(realTarget);
- } else {
- makeCommand.push_back("ALL_BUILD");
- }
- makeCommand.push_back("-configuration");
- makeCommand.push_back(!config.empty() ? config : "Debug");
+
+ makeCommand.add((clean ? "clean" : "build"));
+ makeCommand.add("-target", (realTarget.empty() ? "ALL_BUILD" : realTarget));
+ makeCommand.add("-configuration", (config.empty() ? "Debug" : config));
if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back("-jobs");
+ makeCommand.add("-jobs");
if (jobs != cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
- makeCommand.push_back(std::to_string(jobs));
+ makeCommand.add(std::to_string(jobs));
}
}
- makeCommand.insert(makeCommand.end(), makeOptions.begin(),
- makeOptions.end());
+ if (this->XcodeVersion >= 70) {
+ makeCommand.add("-hideShellScriptEnvironment");
+ }
+ makeCommand.add(makeOptions.begin(), makeOptions.end());
}
///! Create a local generator appropriate to this Global Generator
@@ -473,6 +485,7 @@ std::string cmGlobalXCodeGenerator::PostBuildMakeTarget(
}
#define CMAKE_CHECK_BUILD_SYSTEM_TARGET "ZERO_CHECK"
+#define OBJECT_LIBRARY_ARTIFACT_DIR std::string()
void cmGlobalXCodeGenerator::AddExtraTargets(
cmLocalGenerator* root, std::vector<cmLocalGenerator*>& gens)
@@ -497,6 +510,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
makeHelper.push_back(dir);
makeHelper.push_back("-f");
makeHelper.push_back(this->CurrentXCodeHackMakefile);
+ makeHelper.push_back("OBJDIR=$(OBJDIR)");
makeHelper.push_back(""); // placeholder, see below
// Add ZERO_CHECK
@@ -521,10 +535,6 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
// now make the allbuild depend on all the non-utility targets
// in the project
for (auto& gen : gens) {
- if (this->IsExcluded(root, gen)) {
- continue;
- }
-
for (auto target : gen->GetGeneratorTargets()) {
if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
continue;
@@ -546,7 +556,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
target->GetType() == cmStateEnums::STATIC_LIBRARY ||
target->GetType() == cmStateEnums::SHARED_LIBRARY ||
target->GetType() == cmStateEnums::MODULE_LIBRARY))) {
- makeHelper[makeHelper.size() - 1] = // fill placeholder
+ makeHelper.back() = // fill placeholder
this->PostBuildMakeTarget(target->GetName(), "$(CONFIGURATION)");
cmCustomCommandLines commandLines;
commandLines.push_back(makeHelper);
@@ -557,8 +567,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
false, "", false, cmMakefile::AcceptObjectLibraryCommands);
}
- if (target->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
- !target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
+ if (!this->IsExcluded(target)) {
allbuild->AddUtility(target->GetName());
}
}
@@ -589,8 +598,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
this->CurrentReRunCMakeMakefile += "/CMakeScripts";
cmSystemTools::MakeDirectory(this->CurrentReRunCMakeMakefile.c_str());
this->CurrentReRunCMakeMakefile += "/ReRunCMake.make";
- cmGeneratedFileStream makefileStream(
- this->CurrentReRunCMakeMakefile.c_str());
+ cmGeneratedFileStream makefileStream(this->CurrentReRunCMakeMakefile);
makefileStream.SetCopyIfDifferent(true);
makefileStream << "# Generated by CMake, DO NOT EDIT\n\n";
@@ -607,7 +615,7 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
std::string checkCache = root->GetBinaryDirectory();
checkCache += "/";
- checkCache += cmake::GetCMakeFilesDirectoryPostSlash();
+ checkCache += "CMakeFiles/";
checkCache += "cmake.check_cache";
if (cm->DoWriteGlobVerifyTarget()) {
@@ -746,8 +754,6 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFileFromPath(
class XCodeGeneratorExpressionInterpreter
: public cmGeneratorExpressionInterpreter
{
- CM_DISABLE_COPY(XCodeGeneratorExpressionInterpreter)
-
public:
XCodeGeneratorExpressionInterpreter(cmSourceFile* sourceFile,
cmLocalGenerator* localGenerator,
@@ -759,6 +765,11 @@ public:
{
}
+ XCodeGeneratorExpressionInterpreter(
+ XCodeGeneratorExpressionInterpreter const&) = delete;
+ XCodeGeneratorExpressionInterpreter& operator=(
+ XCodeGeneratorExpressionInterpreter const&) = delete;
+
using cmGeneratorExpressionInterpreter::Evaluate;
const std::string& Evaluate(const char* expression,
@@ -775,7 +786,7 @@ public:
"specified for source:\n"
" " << this->SourceFile->GetFullPath() << "\n";
/* clang-format on */
- this->LocalGenerator->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->LocalGenerator->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
return processed;
@@ -1051,7 +1062,7 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
this->CurrentConfigurationTypes.clear();
this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes);
if (this->CurrentConfigurationTypes.empty()) {
- this->CurrentConfigurationTypes.push_back("");
+ this->CurrentConfigurationTypes.emplace_back();
}
}
@@ -1397,14 +1408,14 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt)
// language.
cmMakefile* mf = gtgt->Target->GetMakefile();
std::string fname = gtgt->GetLocalGenerator()->GetCurrentBinaryDirectory();
- fname += cmake::GetCMakeFilesDirectory();
+ fname += "/CMakeFiles";
fname += "/";
fname += gtgt->GetName();
fname += "-CMakeForceLinker";
fname += ".";
fname += cmSystemTools::LowerCase(llang);
{
- cmGeneratedFileStream fout(fname.c_str());
+ cmGeneratedFileStream fout(fname);
fout << "\n";
}
if (cmSourceFile* sf = mf->GetOrCreateSource(fname)) {
@@ -1655,6 +1666,7 @@ void cmGlobalXCodeGenerator::AddCommandsToBuildPhase(
makecmd += cdir;
makecmd += " -f ";
makecmd += this->ConvertToRelativeForMake((makefile + "$CONFIGURATION"));
+ makecmd += " OBJDIR=$(basename \"$OBJECT_FILE_DIR_normal\")";
makecmd += " all";
buildphase->AddAttribute("shellScript", this->CreateString(makecmd));
buildphase->AddAttribute("showEnvVarsInLog", this->CreateString("0"));
@@ -1666,7 +1678,7 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
{
std::string makefileName = makefileBasename;
makefileName += configName;
- cmGeneratedFileStream makefileStream(makefileName.c_str());
+ cmGeneratedFileStream makefileStream(makefileName);
if (!makefileStream) {
return;
}
@@ -1755,6 +1767,26 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
}
}
+void cmGlobalXCodeGenerator::AddPositionIndependentLinkAttribute(
+ cmGeneratorTarget* target, cmXCodeObject* buildSettings,
+ const std::string& configName)
+{
+ // For now, only EXECUTABLE is concerned
+ if (target->GetType() != cmStateEnums::EXECUTABLE) {
+ return;
+ }
+
+ const char* PICValue = target->GetLinkPIEProperty(configName);
+ if (PICValue == nullptr) {
+ // POSITION_INDEPENDENT_CODE is not set
+ return;
+ }
+
+ buildSettings->AddAttribute(
+ "LD_NO_PIE",
+ this->CreateString(cmSystemTools::IsOn(PICValue) ? "NO" : "YES"));
+}
+
void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
cmXCodeObject* buildSettings,
const std::string& configName)
@@ -1806,6 +1838,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
buildSettings->AddAttribute("LLVM_LTO", this->CreateString(ltoValue));
}
+ // Handle PIE linker configuration
+ this->AddPositionIndependentLinkAttribute(gtgt, buildSettings, configName);
+
// Add define flags
this->CurrentLocalGenerator->AppendFlags(
defFlags, this->CurrentMakefile->GetDefineFlags());
@@ -1814,9 +1849,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
BuildObjectListOrString ppDefs(this, true);
this->AppendDefines(
ppDefs, "CMAKE_INTDIR=\"$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)\"");
- if (const char* exportMacro = gtgt->GetExportMacro()) {
+ if (const std::string* exportMacro = gtgt->GetExportMacro()) {
// Add the export symbol definition for shared library objects.
- this->AppendDefines(ppDefs, exportMacro);
+ this->AppendDefines(ppDefs, exportMacro->c_str());
}
std::vector<std::string> targetDefines;
if (!langForPreprocessor.empty()) {
@@ -1939,8 +1974,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
pnbase = gtgt->GetName();
pnsuffix = ".a";
- std::string pncdir =
- this->GetObjectsNormalDirectory(this->CurrentProject, configName, gtgt);
+ std::string pncdir = this->GetObjectsDirectory(
+ this->CurrentProject, configName, gtgt, OBJECT_LIBRARY_ARTIFACT_DIR);
buildSettings->AddAttribute("CONFIGURATION_BUILD_DIR",
this->CreateString(pncdir));
}
@@ -2219,6 +2254,22 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
debugStr = "NO";
}
+ // extract C++ stdlib
+ for (auto const& language : languages) {
+ if (language != "CXX") {
+ continue;
+ }
+ std::string& flags = cflags[language];
+
+ auto stdlib =
+ this->ExtractFlagRegex("(^| )(-stdlib=[^ ]+)( |$)", 2, flags);
+ if (stdlib.size() > 8) {
+ const auto cxxLibrary = stdlib.substr(8);
+ buildSettings->AddAttribute("CLANG_CXX_LIBRARY",
+ this->CreateString(cxxLibrary));
+ }
+ }
+
buildSettings->AddAttribute("COMBINE_HIDPI_IMAGES",
this->CreateString("YES"));
buildSettings->AddAttribute("GCC_GENERATE_DEBUGGING_SYMBOLS",
@@ -2425,7 +2476,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateUtilityTarget(
this->AddXCodeProjBuildRule(gtgt, sources);
for (auto sourceFile : sources) {
- if (!sourceFile->GetPropertyAsBool("GENERATED")) {
+ if (!sourceFile->GetIsGenerated()) {
this->CreateXCodeFileReference(sourceFile, gtgt);
}
}
@@ -2841,8 +2892,7 @@ bool cmGlobalXCodeGenerator::CreateGroups(
}
// Add the file to the list of sources.
std::string const& source = sf->GetFullPath();
- cmSourceGroup* sourceGroup =
- mf->FindSourceGroup(source.c_str(), sourceGroups);
+ cmSourceGroup* sourceGroup = mf->FindSourceGroup(source, sourceGroups);
cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup);
std::string key = GetGroupMapKeyFromPath(gtgt, source);
this->GroupMap[key] = pbxgroup;
@@ -2855,8 +2905,7 @@ bool cmGlobalXCodeGenerator::CreateGroups(
listfile += "/CMakeLists.txt";
cmSourceFile* sf = gtgt->Makefile->GetOrCreateSource(listfile);
std::string const& source = sf->GetFullPath();
- cmSourceGroup* sourceGroup =
- mf->FindSourceGroup(source.c_str(), sourceGroups);
+ cmSourceGroup* sourceGroup = mf->FindSourceGroup(source, sourceGroups);
cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup);
std::string key = GetGroupMapKeyFromPath(gtgt, source);
this->GroupMap[key] = pbxgroup;
@@ -3109,6 +3158,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
if (const char* vers = this->CurrentMakefile->GetDefinition(
"CMAKE_Swift_LANGUAGE_VERSION")) {
swiftVersion = vers;
+ } else if (this->XcodeVersion >= 102) {
+ swiftVersion = "4.0";
} else if (this->XcodeVersion >= 83) {
swiftVersion = "3.0";
} else {
@@ -3172,9 +3223,9 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
return true;
}
-std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
+std::string cmGlobalXCodeGenerator::GetObjectsDirectory(
const std::string& projName, const std::string& configName,
- const cmGeneratorTarget* t) const
+ const cmGeneratorTarget* t, const std::string& variant) const
{
std::string dir = t->GetLocalGenerator()->GetCurrentBinaryDirectory();
dir += "/";
@@ -3183,8 +3234,8 @@ std::string cmGlobalXCodeGenerator::GetObjectsNormalDirectory(
dir += configName;
dir += "/";
dir += t->GetName();
- dir += ".build/Objects-normal/";
-
+ dir += ".build/";
+ dir += variant;
return dir;
}
@@ -3228,7 +3279,7 @@ void cmGlobalXCodeGenerator::ComputeObjectDirArch(cmMakefile* mf)
void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
std::vector<cmXCodeObject*>& targets)
{
- cmGeneratedFileStream makefileStream(this->CurrentXCodeHackMakefile.c_str());
+ cmGeneratedFileStream makefileStream(this->CurrentXCodeHackMakefile);
if (!makefileStream) {
cmSystemTools::Error("Could not create",
this->CurrentXCodeHackMakefile.c_str());
@@ -3311,8 +3362,9 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
for (auto objLib : objlibs) {
const std::string objLibName = objLib->GetName();
- std::string d = this->GetObjectsNormalDirectory(this->CurrentProject,
- configName, objLib);
+ std::string d =
+ this->GetObjectsDirectory(this->CurrentProject, configName, objLib,
+ OBJECT_LIBRARY_ARTIFACT_DIR);
d += "lib";
d += objLibName;
d += ".a";
@@ -3329,8 +3381,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
// if building for more than one architecture
// then remove those executables as well
if (this->Architectures.size() > 1) {
- std::string universal = this->GetObjectsNormalDirectory(
- this->CurrentProject, configName, gt);
+ std::string universal = this->GetObjectsDirectory(
+ this->CurrentProject, configName, gt, "$(OBJDIR)/");
for (const auto& architecture : this->Architectures) {
std::string universalFile = universal;
universalFile += architecture;
@@ -3369,7 +3421,7 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
xcodeDir += ".xcodeproj";
cmSystemTools::MakeDirectory(xcodeDir.c_str());
std::string xcodeProjFile = xcodeDir + "/project.pbxproj";
- cmGeneratedFileStream fout(xcodeProjFile.c_str());
+ cmGeneratedFileStream fout(xcodeProjFile);
fout.SetCopyIfDifferent(true);
if (!fout) {
return;
@@ -3446,7 +3498,7 @@ void cmGlobalXCodeGenerator::OutputXCodeWorkspaceSettings(
std::string workspaceSettingsFile = xcodeSharedDataDir;
workspaceSettingsFile += "/WorkspaceSettings.xcsettings";
- cmGeneratedFileStream fout(workspaceSettingsFile.c_str());
+ cmGeneratedFileStream fout(workspaceSettingsFile);
fout.SetCopyIfDifferent(true);
if (!fout) {
return;
@@ -3543,13 +3595,13 @@ std::string cmGlobalXCodeGenerator::RelativeToSource(const char* p)
{
// We force conversion because Xcode breakpoints do not work unless
// they are in a file named relative to the source tree.
- return cmOutputConverter::ForceToRelativePath(
+ return cmSystemTools::ForceToRelativePath(
cmSystemTools::JoinPath(this->ProjectSourceDirectoryComponents), p);
}
std::string cmGlobalXCodeGenerator::RelativeToBinary(const char* p)
{
- return this->CurrentLocalGenerator->ConvertToRelativePath(
+ return this->CurrentLocalGenerator->MaybeConvertToRelativePath(
cmSystemTools::JoinPath(this->ProjectOutputDirectoryComponents), p);
}
@@ -3684,7 +3736,7 @@ std::string cmGlobalXCodeGenerator::ComputeInfoPListLocation(
cmGeneratorTarget* target)
{
std::string plist = target->GetLocalGenerator()->GetCurrentBinaryDirectory();
- plist += cmake::GetCMakeFilesDirectory();
+ plist += "/CMakeFiles";
plist += "/";
plist += target->GetName();
plist += ".dir/Info.plist";
@@ -3734,8 +3786,8 @@ void cmGlobalXCodeGenerator::ComputeTargetObjectDirectory(
cmGeneratorTarget* gt) const
{
std::string configName = this->GetCMakeCFGIntDir();
- std::string dir =
- this->GetObjectsNormalDirectory("$(PROJECT_NAME)", configName, gt);
+ std::string dir = this->GetObjectsDirectory(
+ "$(PROJECT_NAME)", configName, gt, "$(OBJECT_FILE_DIR_normal:base)/");
dir += this->ObjectDirArch;
dir += "/";
gt->ObjectDirectory = dir;
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 62f70302a..e1e412dca 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -66,7 +66,7 @@ public:
* Try running cmake and building a file. This is used for dynalically
* loaded commands, not as part of the usual build process.
*/
- void GenerateBuildCommand(std::vector<std::string>& makeCommand,
+ void GenerateBuildCommand(GeneratedMakeCommand& makeCommand,
const std::string& makeProgram,
const std::string& projectName,
const std::string& projectDir,
@@ -171,6 +171,9 @@ private:
const std::string& configName);
cmXCodeObject* CreateUtilityTarget(cmGeneratorTarget* gtgt);
void AddDependAndLinkInformation(cmXCodeObject* target);
+ void AddPositionIndependentLinkAttribute(cmGeneratorTarget* target,
+ cmXCodeObject* buildSettings,
+ const std::string& configName);
void CreateBuildSettings(cmGeneratorTarget* gtgt,
cmXCodeObject* buildSettings,
const std::string& buildType);
@@ -261,9 +264,10 @@ private:
{
}
- std::string GetObjectsNormalDirectory(const std::string& projName,
- const std::string& configName,
- const cmGeneratorTarget* t) const;
+ std::string GetObjectsDirectory(const std::string& projName,
+ const std::string& configName,
+ const cmGeneratorTarget* t,
+ const std::string& variant) const;
static std::string GetDeploymentPlatform(const cmMakefile* mf);
diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h
index 6a0a79912..5ca9269ed 100644
--- a/Source/cmGraphAdjacencyList.h
+++ b/Source/cmGraphAdjacencyList.h
@@ -5,6 +5,9 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmListFileCache.h"
+
+#include <utility>
#include <vector>
/**
@@ -15,18 +18,22 @@
class cmGraphEdge
{
public:
- cmGraphEdge(int n = 0, bool s = true)
+ cmGraphEdge(int n, bool s, cmListFileBacktrace bt)
: Dest(n)
, Strong(s)
+ , Backtrace(std::move(bt))
{
}
operator int() const { return this->Dest; }
bool IsStrong() const { return this->Strong; }
+ cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
+
private:
int Dest;
bool Strong;
+ cmListFileBacktrace Backtrace;
};
struct cmGraphEdgeList : public std::vector<cmGraphEdge>
{
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index fcdf03fc9..4b6027995 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -13,6 +13,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
@@ -68,7 +69,7 @@ const char* getShapeForTarget(const cmGeneratorTarget* target)
}
std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
- cmTarget* Target)
+ cmTarget* Target, const cmGlobalGenerator* globalGenerator)
{
char sep = ';';
std::map<std::string, LinkLibraryScopeType> tokens;
@@ -95,6 +96,13 @@ std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
}
std::string element = interfaceLinkLibraries.substr(start, end - start);
+ if (globalGenerator->IsAlias(element)) {
+ const auto tgt = globalGenerator->FindTarget(element);
+ if (tgt) {
+ element = tgt->GetName();
+ }
+ }
+
if (std::string::npos == element.find("$<LINK_ONLY:", 0)) {
// we assume first, that this library is an interface library.
// if we find it again in the linklibraries property, we promote it to an
@@ -116,6 +124,12 @@ std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
}
std::string element = linkLibraries.substr(start, end - start);
+ if (globalGenerator->IsAlias(element)) {
+ const auto tgt = globalGenerator->FindTarget(element);
+ if (tgt) {
+ element = tgt->GetName();
+ }
+ }
if (tokens.find(element) == tokens.end()) {
// this library is not found in interfaceLinkLibraries but in
@@ -137,13 +151,13 @@ std::map<std::string, LinkLibraryScopeType> getScopedLinkLibrariesFromTarget(
}
}
-cmGraphVizWriter::cmGraphVizWriter(
- const std::vector<cmLocalGenerator*>& localGenerators)
+cmGraphVizWriter::cmGraphVizWriter(const cmGlobalGenerator* globalGenerator)
: GraphType("digraph")
, GraphName("GG")
, GraphHeader("node [\n fontsize = \"12\"\n];")
, GraphNodePrefix("node")
- , LocalGenerators(localGenerators)
+ , GlobalGenerator(globalGenerator)
+ , LocalGenerators(globalGenerator->GetLocalGenerators())
, GenerateForExecutables(true)
, GenerateForStaticLibs(true)
, GenerateForSharedLibs(true)
@@ -159,7 +173,7 @@ cmGraphVizWriter::cmGraphVizWriter(
void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
const char* fallbackSettingsFileName)
{
- cmake cm(cmake::RoleScript);
+ cmake cm(cmake::RoleScript, cmState::Unknown);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
@@ -185,12 +199,12 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
std::cout << "Reading GraphViz options file: " << inFileName << std::endl;
#define __set_if_set(var, cmakeDefinition) \
- { \
+ do { \
const char* value = mf.GetDefinition(cmakeDefinition); \
if (value) { \
(var) = value; \
} \
- }
+ } while (false)
__set_if_set(this->GraphType, "GRAPHVIZ_GRAPH_TYPE");
__set_if_set(this->GraphName, "GRAPHVIZ_GRAPH_NAME");
@@ -198,12 +212,12 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
__set_if_set(this->GraphNodePrefix, "GRAPHVIZ_NODE_PREFIX");
#define __set_bool_if_set(var, cmakeDefinition) \
- { \
+ do { \
const char* value = mf.GetDefinition(cmakeDefinition); \
if (value) { \
(var) = mf.IsOn(cmakeDefinition); \
} \
- }
+ } while (false)
__set_bool_if_set(this->GenerateForExecutables, "GRAPHVIZ_EXECUTABLES");
__set_bool_if_set(this->GenerateForStaticLibs, "GRAPHVIZ_STATIC_LIBS");
@@ -374,7 +388,8 @@ void cmGraphVizWriter::WriteConnections(
std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
std::map<std::string, LinkLibraryScopeType> ll =
- getScopedLinkLibrariesFromTarget(targetPtrIt->second->Target);
+ getScopedLinkLibrariesFromTarget(targetPtrIt->second->Target,
+ GlobalGenerator);
for (auto const& llit : ll) {
const char* libName = llit.first.c_str();
@@ -439,7 +454,7 @@ void cmGraphVizWriter::WriteDependerConnections(
// Now we have a target, check whether it links against targetName.
// If so, draw a connection, and then continue with dependers on that one.
std::map<std::string, LinkLibraryScopeType> ll =
- getScopedLinkLibrariesFromTarget(tptr.second->Target);
+ getScopedLinkLibrariesFromTarget(tptr.second->Target, GlobalGenerator);
for (auto const& llit : ll) {
if (llit.first == targetName) {
@@ -540,6 +555,13 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
continue;
}
+ if (GlobalGenerator->IsAlias(libName)) {
+ const auto tgt = GlobalGenerator->FindTarget(libName);
+ if (tgt) {
+ libName = tgt->GetName().c_str();
+ }
+ }
+
std::map<std::string, const cmGeneratorTarget*>::const_iterator tarIt =
this->TargetPtrs.find(libName);
if (tarIt == this->TargetPtrs.end()) {
diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h
index ac20da963..ed242f0ab 100644
--- a/Source/cmGraphVizWriter.h
+++ b/Source/cmGraphVizWriter.h
@@ -16,13 +16,14 @@
class cmGeneratedFileStream;
class cmGeneratorTarget;
class cmLocalGenerator;
+class cmGlobalGenerator;
/** This class implements writing files for graphviz (dot) for graphs
* representing the dependencies between the targets in the project. */
class cmGraphVizWriter
{
public:
- cmGraphVizWriter(const std::vector<cmLocalGenerator*>& localGenerators);
+ cmGraphVizWriter(const cmGlobalGenerator* globalGenerator);
void ReadSettings(const char* settingsFileName,
const char* fallbackSettingsFileName);
@@ -69,6 +70,7 @@ protected:
std::vector<cmsys::RegularExpression> TargetsToIgnoreRegex;
+ const cmGlobalGenerator* GlobalGenerator;
const std::vector<cmLocalGenerator*>& LocalGenerators;
std::map<std::string, const cmGeneratorTarget*> TargetPtrs;
diff --git a/Source/cmIDEFlagTable.h b/Source/cmIDEFlagTable.h
index 152e293eb..ff93432cb 100644
--- a/Source/cmIDEFlagTable.h
+++ b/Source/cmIDEFlagTable.h
@@ -3,13 +3,15 @@
#ifndef cmIDEFlagTable_h
#define cmIDEFlagTable_h
+#include <string>
+
// This is a table mapping XML tag IDE names to command line options
struct cmIDEFlagTable
{
- const char* IDEName; // name used in the IDE xml file
- const char* commandFlag; // command line flag
- const char* comment; // comment
- const char* value; // string value
+ std::string IDEName; // name used in the IDE xml file
+ std::string commandFlag; // command line flag
+ std::string comment; // comment
+ std::string value; // string value
unsigned int special; // flags for special handling requests
enum
{
@@ -27,6 +29,9 @@ struct cmIDEFlagTable
SpaceAppendable = (1 << 7), // a flag that if specified multiple times
// should have its value appended to the
// old value with spaces
+ CommaAppendable = (1 << 8), // a flag that if specified multiple times
+ // should have its value appended to the
+ // old value with commas (e.g. C# /nowarn
UserValueIgnored = UserValue | UserIgnored,
UserValueRequired = UserValue | UserRequired
diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx
index f996788d7..ea67d45fa 100644
--- a/Source/cmIDEOptions.cxx
+++ b/Source/cmIDEOptions.cxx
@@ -97,24 +97,24 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table,
{
const char* pf = flag.c_str() + 1;
// Look for an entry in the flag table matching this flag.
- for (cmIDEFlagTable const* entry = table; entry->IDEName; ++entry) {
+ for (cmIDEFlagTable const* entry = table; !entry->IDEName.empty(); ++entry) {
bool entry_found = false;
if (entry->special & cmIDEFlagTable::UserValue) {
// This flag table entry accepts a user-specified value. If
// the entry specifies UserRequired we must match only if a
// non-empty value is given.
- int n = static_cast<int>(strlen(entry->commandFlag));
- if ((strncmp(pf, entry->commandFlag, n) == 0 ||
+ int n = static_cast<int>(entry->commandFlag.length());
+ if ((strncmp(pf, entry->commandFlag.c_str(), n) == 0 ||
(entry->special & cmIDEFlagTable::CaseInsensitive &&
- cmsysString_strncasecmp(pf, entry->commandFlag, n))) &&
+ cmsysString_strncasecmp(pf, entry->commandFlag.c_str(), n))) &&
(!(entry->special & cmIDEFlagTable::UserRequired) ||
static_cast<int>(strlen(pf)) > n)) {
this->FlagMapUpdate(entry, std::string(pf + n));
entry_found = true;
}
- } else if (strcmp(pf, entry->commandFlag) == 0 ||
+ } else if (strcmp(pf, entry->commandFlag.c_str()) == 0 ||
(entry->special & cmIDEFlagTable::CaseInsensitive &&
- cmsysString_strcasecmp(pf, entry->commandFlag) == 0)) {
+ cmsysString_strcasecmp(pf, entry->commandFlag.c_str()) == 0)) {
if (entry->special & cmIDEFlagTable::UserFollowing) {
// This flag expects a value in the following argument.
this->DoingFollowing = entry;
@@ -148,6 +148,8 @@ void cmIDEOptions::FlagMapUpdate(cmIDEFlagTable const* entry,
this->FlagMap[entry->IDEName].push_back(new_value);
} else if (entry->special & cmIDEFlagTable::SpaceAppendable) {
this->FlagMap[entry->IDEName].append_with_space(new_value);
+ } else if (entry->special & cmIDEFlagTable::CommaAppendable) {
+ this->FlagMap[entry->IDEName].append_with_comma(new_value);
} else {
// Use the user-specified value.
this->FlagMap[entry->IDEName] = new_value;
diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h
index a4e575780..4a430732f 100644
--- a/Source/cmIDEOptions.h
+++ b/Source/cmIDEOptions.h
@@ -65,12 +65,22 @@ protected:
this->derived::operator=(r);
return *this;
}
+ FlagValue& append_with_comma(std::string const& r)
+ {
+ return append_with_separator(r, ',');
+ }
FlagValue& append_with_space(std::string const& r)
{
+ return append_with_separator(r, ' ');
+ }
+
+ private:
+ FlagValue& append_with_separator(std::string const& r, char separator)
+ {
this->resize(1);
std::string& l = this->operator[](0);
if (!l.empty()) {
- l += " ";
+ l += separator;
}
l += r;
return *this;
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index ae4041d8e..d1f8f58e2 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -6,6 +6,7 @@
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -39,7 +40,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
@@ -60,7 +61,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
if (this->ElseSeen) {
cmListFileBacktrace bt = mf.GetBacktrace(func);
mf.GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"A duplicate ELSE command was found inside an IF block.", bt);
cmSystemTools::SetFatalErrorOccured();
return true;
@@ -79,7 +80,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
if (this->ElseSeen) {
cmListFileBacktrace bt = mf.GetBacktrace(func);
mf.GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"An ELSEIF command was found after an ELSE command.", bt);
cmSystemTools::SetFatalErrorOccured();
return true;
@@ -98,7 +99,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
std::vector<cmExpandedCommandArgument> expandedArguments;
mf.ExpandArguments(func.Arguments, expandedArguments);
- cmake::MessageType messType;
+ MessageType messType;
cmListFileContext conditionContext =
cmListFileContext::FromCommandContext(
@@ -115,7 +116,7 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
err += errorString;
cmListFileBacktrace bt = mf.GetBacktrace(func);
mf.GetCMakeInstance()->IssueMessage(messType, err, bt);
- if (messType == cmake::FATAL_ERROR) {
+ if (messType == MessageType::FATAL_ERROR) {
cmSystemTools::SetFatalErrorOccured();
return true;
}
@@ -181,7 +182,7 @@ bool cmIfCommand::InvokeInitialPass(
std::vector<cmExpandedCommandArgument> expandedArguments;
this->Makefile->ExpandArguments(args, expandedArguments);
- cmake::MessageType status;
+ MessageType status;
cmConditionEvaluator conditionEvaluator(
*(this->Makefile), this->Makefile->GetExecutionContext(),
@@ -193,8 +194,8 @@ bool cmIfCommand::InvokeInitialPass(
if (!errorString.empty()) {
std::string err = "if " + cmIfCommandError(expandedArguments);
err += errorString;
- if (status == cmake::FATAL_ERROR) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, err);
+ if (status == MessageType::FATAL_ERROR) {
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, err);
cmSystemTools::SetFatalErrorOccured();
return true;
}
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index e3d30ddbd..d34ed02c8 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -19,13 +19,6 @@ class cmMakefile;
class cmIfFunctionBlocker : public cmFunctionBlocker
{
public:
- cmIfFunctionBlocker()
- {
- this->HasRun = false;
- this->ElseSeen = false;
- this->ScopeDepth = 0;
- }
- ~cmIfFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction& lff, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction& lff, cmMakefile& mf) override;
@@ -33,9 +26,9 @@ public:
std::vector<cmListFileArgument> Args;
std::vector<cmListFileFunction> Functions;
bool IsBlocking;
- bool HasRun;
- bool ElseSeen;
- unsigned int ScopeDepth;
+ bool HasRun = false;
+ bool ElseSeen = false;
+ unsigned int ScopeDepth = 0;
};
/// Starts an if block
diff --git a/Source/cmIncludeCommand.cxx b/Source/cmIncludeCommand.cxx
index f86257826..0d608bb9d 100644
--- a/Source/cmIncludeCommand.cxx
+++ b/Source/cmIncludeCommand.cxx
@@ -6,9 +6,9 @@
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -58,7 +58,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
}
if (fname.empty()) {
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING,
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING,
"include() given empty file name (ignored).");
return true;
}
@@ -67,7 +67,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
// Not a path. Maybe module.
std::string module = fname;
module += ".cmake";
- std::string mfile = this->Makefile->GetModulesFile(module.c_str());
+ std::string mfile = this->Makefile->GetModulesFile(module);
if (!mfile.empty()) {
fname = mfile;
}
@@ -80,7 +80,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
if (gg->IsExportedTargetsFile(fname_abs)) {
const char* modal = nullptr;
std::ostringstream e;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0024)) {
case cmPolicies::WARN:
@@ -92,7 +92,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
modal = "may";
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (modal) {
e << "The file\n " << fname_abs
@@ -103,7 +103,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
"include() command. Use ALIAS targets instead to refer to targets "
"by alternative names.\n";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
@@ -120,8 +120,7 @@ bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
return true;
}
- bool readit =
- this->Makefile->ReadDependentFile(listFile.c_str(), noPolicyScope);
+ bool readit = this->Makefile->ReadDependentFile(listFile, noPolicyScope);
// add the location of the included file if a result variable was given
if (!resultVarName.empty()) {
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index caec67db7..549a263e3 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -4,6 +4,7 @@
#include <algorithm>
#include <set>
+#include <utility>
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
diff --git a/Source/cmIncludeExternalMSProjectCommand.cxx b/Source/cmIncludeExternalMSProjectCommand.cxx
index c9217d374..93134adb6 100644
--- a/Source/cmIncludeExternalMSProjectCommand.cxx
+++ b/Source/cmIncludeExternalMSProjectCommand.cxx
@@ -8,6 +8,7 @@
# include "cmStateTypes.h"
# include "cmSystemTools.h"
# include "cmTarget.h"
+# include "cmake.h"
#endif
class cmExecutionStatus;
@@ -84,10 +85,12 @@ bool cmIncludeExternalMSProjectCommand::InitialPass(
// Create a target instance for this utility.
cmTarget* target = this->Makefile->AddNewTarget(cmStateEnums::UTILITY,
utility_name.c_str());
+ if (this->Makefile->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
+ target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
+ }
target->SetProperty("GENERATOR_FILE_NAME", utility_name.c_str());
target->SetProperty("EXTERNAL_MSPROJECT", path.c_str());
- target->SetProperty("EXCLUDE_FROM_ALL", "FALSE");
if (!customType.empty())
target->SetProperty("VS_PROJECT_TYPE", customType.c_str());
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 6e33cf7a3..20d1a3134 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -3,6 +3,7 @@
#include "cmInstallCommand.h"
#include "cmsys/Glob.hxx"
+#include <set>
#include <sstream>
#include <stddef.h>
#include <utility>
@@ -20,18 +21,20 @@
#include "cmInstallGenerator.h"
#include "cmInstallScriptGenerator.h"
#include "cmInstallTargetGenerator.h"
+#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmTargetExport.h"
-#include "cmake.h"
class cmExecutionStatus;
static cmInstallTargetGenerator* CreateInstallTargetGenerator(
cmTarget& target, const cmInstallCommandArguments& args, bool impLib,
+ cmListFileBacktrace const& backtrace, const std::string& destination,
bool forceOpt = false, bool namelink = false)
{
cmInstallGenerator::MessageLevel message =
@@ -40,24 +43,49 @@ static cmInstallTargetGenerator* CreateInstallTargetGenerator(
const char* component = namelink ? args.GetNamelinkComponent().c_str()
: args.GetComponent().c_str();
return new cmInstallTargetGenerator(
- target.GetName(), args.GetDestination().c_str(), impLib,
+ target.GetName(), destination.c_str(), impLib,
args.GetPermissions().c_str(), args.GetConfigurations(), component,
- message, args.GetExcludeFromAll(), args.GetOptional() || forceOpt);
+ message, args.GetExcludeFromAll(), args.GetOptional() || forceOpt,
+ backtrace);
+}
+
+static cmInstallTargetGenerator* CreateInstallTargetGenerator(
+ cmTarget& target, const cmInstallCommandArguments& args, bool impLib,
+ cmListFileBacktrace const& backtrace, bool forceOpt = false,
+ bool namelink = false)
+{
+ return CreateInstallTargetGenerator(target, args, impLib, backtrace,
+ args.GetDestination(), forceOpt,
+ namelink);
}
static cmInstallFilesGenerator* CreateInstallFilesGenerator(
cmMakefile* mf, const std::vector<std::string>& absFiles,
- const cmInstallCommandArguments& args, bool programs)
+ const cmInstallCommandArguments& args, bool programs,
+ const std::string& destination)
{
cmInstallGenerator::MessageLevel message =
cmInstallGenerator::SelectMessageLevel(mf);
return new cmInstallFilesGenerator(
- absFiles, args.GetDestination().c_str(), programs,
- args.GetPermissions().c_str(), args.GetConfigurations(),
- args.GetComponent().c_str(), message, args.GetExcludeFromAll(),
- args.GetRename().c_str(), args.GetOptional());
+ absFiles, destination.c_str(), programs, args.GetPermissions().c_str(),
+ args.GetConfigurations(), args.GetComponent().c_str(), message,
+ args.GetExcludeFromAll(), args.GetRename().c_str(), args.GetOptional());
}
+static cmInstallFilesGenerator* CreateInstallFilesGenerator(
+ cmMakefile* mf, const std::vector<std::string>& absFiles,
+ const cmInstallCommandArguments& args, bool programs)
+{
+ return CreateInstallFilesGenerator(mf, absFiles, args, programs,
+ args.GetDestination());
+}
+
+static const std::set<std::string> allowedTypes{
+ "BIN", "SBIN", "LIB", "INCLUDE", "SYSCONF",
+ "SHAREDSTATE", "LOCALSTATE", "RUNSTATE", "DATA", "INFO",
+ "LOCALE", "MAN", "DOC",
+};
+
// cmInstallCommand
bool cmInstallCommand::InitialPass(std::vector<std::string> const& args,
cmExecutionStatus&)
@@ -332,6 +360,17 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
"At most one of these two options may be specified.");
return false;
}
+ if (!genericArgs.GetType().empty() || !archiveArgs.GetType().empty() ||
+ !libraryArgs.GetType().empty() || !runtimeArgs.GetType().empty() ||
+ !objectArgs.GetType().empty() || !frameworkArgs.GetType().empty() ||
+ !bundleArgs.GetType().empty() || !privateHeaderArgs.GetType().empty() ||
+ !publicHeaderArgs.GetType().empty() || !resourceArgs.GetType().empty()) {
+ std::ostringstream e;
+ e << "TARGETS given TYPE option. The TYPE option may only be specified in "
+ " install(FILES) and install(DIRECTORIES).";
+ this->SetError(e.str());
+ return false;
+ }
// Select the mode for installing symlinks to versioned shared libraries.
cmInstallTargetGenerator::NamelinkModeType namelinkMode =
@@ -363,7 +402,11 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
cmTarget* target = this->Makefile->FindLocalNonAliasTarget(tgt);
if (!target) {
// If no local target has been found, find it in the global scope.
- target = this->Makefile->GetGlobalGenerator()->FindTarget(tgt, true);
+ cmTarget* const global_target =
+ this->Makefile->GetGlobalGenerator()->FindTarget(tgt, true);
+ if (global_target && !global_target->IsImported()) {
+ target = global_target;
+ }
}
if (target) {
// Found the target. Check its type.
@@ -435,17 +478,21 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// This is a DLL platform.
if (!archiveArgs.GetDestination().empty()) {
// The import library uses the ARCHIVE properties.
- archiveGenerator =
- CreateInstallTargetGenerator(target, archiveArgs, true);
+ archiveGenerator = CreateInstallTargetGenerator(
+ target, archiveArgs, true, this->Makefile->GetBacktrace());
}
if (!runtimeArgs.GetDestination().empty()) {
// The DLL uses the RUNTIME properties.
- runtimeGenerator =
- CreateInstallTargetGenerator(target, runtimeArgs, false);
+ runtimeGenerator = CreateInstallTargetGenerator(
+ target, runtimeArgs, false, this->Makefile->GetBacktrace());
}
if ((archiveGenerator == nullptr) && (runtimeGenerator == nullptr)) {
- this->SetError("Library TARGETS given no DESTINATION!");
- return false;
+ archiveGenerator = CreateInstallTargetGenerator(
+ target, archiveArgs, true, this->Makefile->GetBacktrace(),
+ this->GetArchiveDestination(nullptr));
+ runtimeGenerator = CreateInstallTargetGenerator(
+ target, runtimeArgs, false, this->Makefile->GetBacktrace(),
+ this->GetRuntimeDestination(nullptr));
}
} else {
// This is a non-DLL platform.
@@ -459,8 +506,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// Use the FRAMEWORK properties.
if (!frameworkArgs.GetDestination().empty()) {
- frameworkGenerator =
- CreateInstallTargetGenerator(target, frameworkArgs, false);
+ frameworkGenerator = CreateInstallTargetGenerator(
+ target, frameworkArgs, false, this->Makefile->GetBacktrace());
} else {
std::ostringstream e;
e << "TARGETS given no FRAMEWORK DESTINATION for shared library "
@@ -471,29 +518,22 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
}
} else {
// The shared library uses the LIBRARY properties.
- if (!libraryArgs.GetDestination().empty()) {
- if (namelinkMode != cmInstallTargetGenerator::NamelinkModeOnly) {
- libraryGenerator =
- CreateInstallTargetGenerator(target, libraryArgs, false);
- libraryGenerator->SetNamelinkMode(
- cmInstallTargetGenerator::NamelinkModeSkip);
- }
- if (namelinkMode != cmInstallTargetGenerator::NamelinkModeSkip) {
- namelinkGenerator = CreateInstallTargetGenerator(
- target, libraryArgs, false, false, true);
- namelinkGenerator->SetNamelinkMode(
- cmInstallTargetGenerator::NamelinkModeOnly);
- }
- namelinkOnly =
- (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly);
- } else {
- std::ostringstream e;
- e << "TARGETS given no LIBRARY DESTINATION for shared library "
- "target \""
- << target.GetName() << "\".";
- this->SetError(e.str());
- return false;
+ if (namelinkMode != cmInstallTargetGenerator::NamelinkModeOnly) {
+ libraryGenerator = CreateInstallTargetGenerator(
+ target, libraryArgs, false, this->Makefile->GetBacktrace(),
+ this->GetLibraryDestination(&libraryArgs));
+ libraryGenerator->SetNamelinkMode(
+ cmInstallTargetGenerator::NamelinkModeSkip);
}
+ if (namelinkMode != cmInstallTargetGenerator::NamelinkModeSkip) {
+ namelinkGenerator = CreateInstallTargetGenerator(
+ target, libraryArgs, false, this->Makefile->GetBacktrace(),
+ this->GetLibraryDestination(&libraryArgs), false, true);
+ namelinkGenerator->SetNamelinkMode(
+ cmInstallTargetGenerator::NamelinkModeOnly);
+ }
+ namelinkOnly =
+ (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly);
}
}
} break;
@@ -508,8 +548,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// Use the FRAMEWORK properties.
if (!frameworkArgs.GetDestination().empty()) {
- frameworkGenerator =
- CreateInstallTargetGenerator(target, frameworkArgs, false);
+ frameworkGenerator = CreateInstallTargetGenerator(
+ target, frameworkArgs, false, this->Makefile->GetBacktrace());
} else {
std::ostringstream e;
e << "TARGETS given no FRAMEWORK DESTINATION for static library "
@@ -520,24 +560,16 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
}
} else {
// Static libraries use ARCHIVE properties.
- if (!archiveArgs.GetDestination().empty()) {
- archiveGenerator =
- CreateInstallTargetGenerator(target, archiveArgs, false);
- } else {
- std::ostringstream e;
- e << "TARGETS given no ARCHIVE DESTINATION for static library "
- "target \""
- << target.GetName() << "\".";
- this->SetError(e.str());
- return false;
- }
+ archiveGenerator = CreateInstallTargetGenerator(
+ target, archiveArgs, false, this->Makefile->GetBacktrace(),
+ this->GetArchiveDestination(&archiveArgs));
}
} break;
case cmStateEnums::MODULE_LIBRARY: {
// Modules use LIBRARY properties.
if (!libraryArgs.GetDestination().empty()) {
- libraryGenerator =
- CreateInstallTargetGenerator(target, libraryArgs, false);
+ libraryGenerator = CreateInstallTargetGenerator(
+ target, libraryArgs, false, this->Makefile->GetBacktrace());
libraryGenerator->SetNamelinkMode(namelinkMode);
namelinkOnly =
(namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly);
@@ -563,8 +595,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
return false;
}
- objectGenerator =
- CreateInstallTargetGenerator(target, objectArgs, false);
+ objectGenerator = CreateInstallTargetGenerator(
+ target, objectArgs, false, this->Makefile->GetBacktrace());
} else {
// Installing an OBJECT library without a destination transforms
// it to an INTERFACE library. It installs no files but can be
@@ -575,15 +607,15 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
if (target.IsAppBundleOnApple()) {
// Application bundles use the BUNDLE properties.
if (!bundleArgs.GetDestination().empty()) {
- bundleGenerator =
- CreateInstallTargetGenerator(target, bundleArgs, false);
+ bundleGenerator = CreateInstallTargetGenerator(
+ target, bundleArgs, false, this->Makefile->GetBacktrace());
} else if (!runtimeArgs.GetDestination().empty()) {
bool failure = false;
if (this->CheckCMP0006(failure)) {
// For CMake 2.4 compatibility fallback to the RUNTIME
// properties.
- bundleGenerator =
- CreateInstallTargetGenerator(target, runtimeArgs, false);
+ bundleGenerator = CreateInstallTargetGenerator(
+ target, runtimeArgs, false, this->Makefile->GetBacktrace());
} else if (failure) {
return false;
}
@@ -598,17 +630,9 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
}
} else {
// Executables use the RUNTIME properties.
- if (!runtimeArgs.GetDestination().empty()) {
- runtimeGenerator =
- CreateInstallTargetGenerator(target, runtimeArgs, false);
- } else {
- std::ostringstream e;
- e << "TARGETS given no RUNTIME DESTINATION for executable "
- "target \""
- << target.GetName() << "\".";
- this->SetError(e.str());
- return false;
- }
+ runtimeGenerator = CreateInstallTargetGenerator(
+ target, runtimeArgs, false, this->Makefile->GetBacktrace(),
+ this->GetRuntimeDestination(&runtimeArgs));
}
// On DLL platforms an executable may also have an import
@@ -617,8 +641,8 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
if (dll_platform && !archiveArgs.GetDestination().empty() &&
target.IsExecutableWithExports()) {
// The import library uses the ARCHIVE properties.
- archiveGenerator =
- CreateInstallTargetGenerator(target, archiveArgs, true, true);
+ archiveGenerator = CreateInstallTargetGenerator(
+ target, archiveArgs, true, this->Makefile->GetBacktrace(), true);
}
} break;
case cmStateEnums::INTERFACE_LIBRARY:
@@ -655,15 +679,9 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
}
// Create the files install generator.
- if (!privateHeaderArgs.GetDestination().empty()) {
- privateHeaderGenerator = CreateInstallFilesGenerator(
- this->Makefile, absFiles, privateHeaderArgs, false);
- } else {
- std::ostringstream e;
- e << "INSTALL TARGETS - target " << target.GetName() << " has "
- << "PRIVATE_HEADER files but no PRIVATE_HEADER DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
- }
+ privateHeaderGenerator = CreateInstallFilesGenerator(
+ this->Makefile, absFiles, privateHeaderArgs, false,
+ this->GetIncludeDestination(&privateHeaderArgs));
}
files = target.GetProperty("PUBLIC_HEADER");
@@ -676,15 +694,9 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
}
// Create the files install generator.
- if (!publicHeaderArgs.GetDestination().empty()) {
- publicHeaderGenerator = CreateInstallFilesGenerator(
- this->Makefile, absFiles, publicHeaderArgs, false);
- } else {
- std::ostringstream e;
- e << "INSTALL TARGETS - target " << target.GetName() << " has "
- << "PUBLIC_HEADER files but no PUBLIC_HEADER DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
- }
+ publicHeaderGenerator = CreateInstallFilesGenerator(
+ this->Makefile, absFiles, publicHeaderArgs, false,
+ this->GetIncludeDestination(&publicHeaderArgs));
}
files = target.GetProperty("RESOURCE");
@@ -704,7 +716,7 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
std::ostringstream e;
e << "INSTALL TARGETS - target " << target.GetName() << " has "
<< "RESOURCE files but no RESOURCE DESTINATION.";
- cmSystemTools::Message(e.str().c_str(), "Warning");
+ cmSystemTools::Message(e.str(), "Warning");
}
}
}
@@ -820,6 +832,14 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
return false;
}
+ std::string type = ica.GetType();
+ if (!type.empty() && allowedTypes.count(type) == 0) {
+ std::ostringstream e;
+ e << args[0] << " given non-type \"" << type << "\" with TYPE argument.";
+ this->SetError(e.str());
+ return false;
+ }
+
const std::vector<std::string>& filesVector = files.GetVector();
// Check if there is something to do.
@@ -848,7 +868,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
if (gg->IsExportedTargetsFile(file)) {
const char* modal = nullptr;
std::ostringstream e;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (status) {
case cmPolicies::WARN:
@@ -860,7 +880,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
modal = "may";
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (modal) {
e << "The file\n " << file
@@ -871,7 +891,7 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
"install() command. Use the install(EXPORT) mechanism "
"instead. See the cmake-packages(7) manual for more.\n";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
@@ -882,7 +902,17 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
return false;
}
- if (ica.GetDestination().empty()) {
+ if (!type.empty() && !ica.GetDestination().empty()) {
+ std::ostringstream e;
+ e << args[0]
+ << " given both TYPE and DESTINATION arguments. You may only specify "
+ "one.";
+ this->SetError(e.str());
+ return false;
+ }
+
+ std::string destination = this->GetDestinationForType(&ica, type);
+ if (destination.empty()) {
// A destination is required.
std::ostringstream e;
e << args[0] << " given no DESTINATION!";
@@ -891,8 +921,8 @@ bool cmInstallCommand::HandleFilesMode(std::vector<std::string> const& args)
}
// Create the files install generator.
- this->Makefile->AddInstallGenerator(
- CreateInstallFilesGenerator(this->Makefile, absFiles, ica, programs));
+ this->Makefile->AddInstallGenerator(CreateInstallFilesGenerator(
+ this->Makefile, absFiles, ica, programs, destination));
// Tell the global generator about any installation component names
// specified.
@@ -916,7 +946,8 @@ bool cmInstallCommand::HandleDirectoryMode(
DoingPermsDir,
DoingPermsMatch,
DoingConfigurations,
- DoingComponent
+ DoingComponent,
+ DoingType
};
Doing doing = DoingDirs;
bool in_match_mode = false;
@@ -930,6 +961,7 @@ bool cmInstallCommand::HandleDirectoryMode(
std::vector<std::string> configurations;
std::string component = this->DefaultComponentName;
std::string literal_args;
+ std::string type;
for (unsigned int i = 1; i < args.size(); ++i) {
if (args[i] == "DESTINATION") {
if (in_match_mode) {
@@ -942,6 +974,17 @@ bool cmInstallCommand::HandleDirectoryMode(
// Switch to setting the destination property.
doing = DoingDestination;
+ } else if (args[i] == "TYPE") {
+ if (in_match_mode) {
+ std::ostringstream e;
+ e << args[0] << " does not allow \"" << args[i]
+ << "\" after PATTERN or REGEX.";
+ this->SetError(e.str());
+ return false;
+ }
+
+ // Switch to setting the type.
+ doing = DoingType;
} else if (args[i] == "OPTIONAL") {
if (in_match_mode) {
std::ostringstream e;
@@ -1102,6 +1145,17 @@ bool cmInstallCommand::HandleDirectoryMode(
} else if (doing == DoingDestination) {
destination = args[i].c_str();
doing = DoingNone;
+ } else if (doing == DoingType) {
+ if (allowedTypes.count(args[i]) == 0) {
+ std::ostringstream e;
+ e << args[0] << " given non-type \"" << args[i]
+ << "\" with TYPE argument.";
+ this->SetError(e.str());
+ return false;
+ }
+
+ type = args[i];
+ doing = DoingNone;
} else if (doing == DoingPattern) {
// Convert the pattern to a regular expression. Require a
// leading slash and trailing end-of-string in the matched
@@ -1175,10 +1229,22 @@ bool cmInstallCommand::HandleDirectoryMode(
if (dirs.empty()) {
return true;
}
+ std::string destinationStr;
if (!destination) {
- // A destination is required.
+ if (type.empty()) {
+ // A destination is required.
+ std::ostringstream e;
+ e << args[0] << " given no DESTINATION!";
+ this->SetError(e.str());
+ return false;
+ }
+ destinationStr = this->GetDestinationForType(nullptr, type);
+ destination = destinationStr.c_str();
+ } else if (!type.empty()) {
std::ostringstream e;
- e << args[0] << " given no DESTINATION!";
+ e << args[0]
+ << " given both TYPE and DESTINATION arguments. You may only specify "
+ "one.";
this->SetError(e.str());
return false;
}
@@ -1433,7 +1499,7 @@ bool cmInstallCommand::CheckCMP0006(bool& failure)
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0006)) {
case cmPolicies::WARN:
this->Makefile->IssueMessage(
- cmake::AUTHOR_WARNING,
+ MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0006));
CM_FALLTHROUGH;
case cmPolicies::OLD:
@@ -1446,9 +1512,169 @@ bool cmInstallCommand::CheckCMP0006(bool& failure)
case cmPolicies::REQUIRED_ALWAYS:
failure = true;
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0006));
break;
}
return false;
}
+
+std::string cmInstallCommand::GetDestination(
+ const cmInstallCommandArguments* args, const std::string& varName,
+ const std::string& guess)
+{
+ if (args && !args->GetDestination().empty()) {
+ return args->GetDestination();
+ }
+ std::string val = this->Makefile->GetSafeDefinition(varName);
+ if (!val.empty()) {
+ return val;
+ }
+ return guess;
+}
+
+std::string cmInstallCommand::GetRuntimeDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_BINDIR", "bin");
+}
+
+std::string cmInstallCommand::GetSbinDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_SBINDIR", "sbin");
+}
+
+std::string cmInstallCommand::GetArchiveDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_LIBDIR", "lib");
+}
+
+std::string cmInstallCommand::GetLibraryDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_LIBDIR", "lib");
+}
+
+std::string cmInstallCommand::GetIncludeDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_INCLUDEDIR", "include");
+}
+
+std::string cmInstallCommand::GetSysconfDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_SYSCONFDIR", "etc");
+}
+
+std::string cmInstallCommand::GetSharedStateDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_SHAREDSTATEDIR", "com");
+}
+
+std::string cmInstallCommand::GetLocalStateDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_LOCALSTATEDIR", "var");
+}
+
+std::string cmInstallCommand::GetRunStateDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_RUNSTATEDIR",
+ this->GetLocalStateDestination(nullptr) +
+ "/run");
+}
+
+std::string cmInstallCommand::GetDataRootDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_DATAROOTDIR", "share");
+}
+
+std::string cmInstallCommand::GetDataDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_DATADIR",
+ this->GetDataRootDestination(nullptr));
+}
+
+std::string cmInstallCommand::GetInfoDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_INFODIR",
+ this->GetDataRootDestination(nullptr) + "/info");
+}
+
+std::string cmInstallCommand::GetLocaleDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_LOCALEDIR",
+ this->GetDataRootDestination(nullptr) +
+ "/locale");
+}
+
+std::string cmInstallCommand::GetManDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_MANDIR",
+ this->GetDataRootDestination(nullptr) + "/man");
+}
+
+std::string cmInstallCommand::GetDocDestination(
+ const cmInstallCommandArguments* args)
+{
+ return this->GetDestination(args, "CMAKE_INSTALL_DOCDIR",
+ this->GetDataRootDestination(nullptr) + "/doc");
+}
+
+std::string cmInstallCommand::GetDestinationForType(
+ const cmInstallCommandArguments* args, const std::string& type)
+{
+ if (args && !args->GetDestination().empty()) {
+ return args->GetDestination();
+ }
+ if (type == "BIN") {
+ return this->GetRuntimeDestination(nullptr);
+ }
+ if (type == "SBIN") {
+ return this->GetSbinDestination(nullptr);
+ }
+ if (type == "SYSCONF") {
+ return this->GetSysconfDestination(nullptr);
+ }
+ if (type == "SHAREDSTATE") {
+ return this->GetSharedStateDestination(nullptr);
+ }
+ if (type == "LOCALSTATE") {
+ return this->GetLocalStateDestination(nullptr);
+ }
+ if (type == "RUNSTATE") {
+ return this->GetRunStateDestination(nullptr);
+ }
+ if (type == "LIB") {
+ return this->GetLibraryDestination(nullptr);
+ }
+ if (type == "INCLUDE") {
+ return this->GetIncludeDestination(nullptr);
+ }
+ if (type == "DATA") {
+ return this->GetDataDestination(nullptr);
+ }
+ if (type == "INFO") {
+ return this->GetInfoDestination(nullptr);
+ }
+ if (type == "LOCALE") {
+ return this->GetLocaleDestination(nullptr);
+ }
+ if (type == "MAN") {
+ return this->GetManDestination(nullptr);
+ }
+ if (type == "DOC") {
+ return this->GetDocDestination(nullptr);
+ }
+ return "";
+}
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 8bd015933..202c43810 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -11,6 +11,7 @@
#include "cmCommand.h"
class cmExecutionStatus;
+class cmInstallCommandArguments;
/** \class cmInstallCommand
* \brief Specifies where to install some files
@@ -45,6 +46,27 @@ private:
std::vector<std::string>& absFiles);
bool CheckCMP0006(bool& failure);
+ std::string GetDestination(const cmInstallCommandArguments* args,
+ const std::string& varName,
+ const std::string& guess);
+ std::string GetRuntimeDestination(const cmInstallCommandArguments* args);
+ std::string GetSbinDestination(const cmInstallCommandArguments* args);
+ std::string GetArchiveDestination(const cmInstallCommandArguments* args);
+ std::string GetLibraryDestination(const cmInstallCommandArguments* args);
+ std::string GetIncludeDestination(const cmInstallCommandArguments* args);
+ std::string GetSysconfDestination(const cmInstallCommandArguments* args);
+ std::string GetSharedStateDestination(const cmInstallCommandArguments* args);
+ std::string GetLocalStateDestination(const cmInstallCommandArguments* args);
+ std::string GetRunStateDestination(const cmInstallCommandArguments* args);
+ std::string GetDataRootDestination(const cmInstallCommandArguments* args);
+ std::string GetDataDestination(const cmInstallCommandArguments* args);
+ std::string GetInfoDestination(const cmInstallCommandArguments* args);
+ std::string GetLocaleDestination(const cmInstallCommandArguments* args);
+ std::string GetManDestination(const cmInstallCommandArguments* args);
+ std::string GetDocDestination(const cmInstallCommandArguments* args);
+ std::string GetDestinationForType(const cmInstallCommandArguments* args,
+ const std::string& type);
+
std::string DefaultComponentName;
};
diff --git a/Source/cmInstallCommandArguments.cxx b/Source/cmInstallCommandArguments.cxx
index 2d6dc1295..155f0559b 100644
--- a/Source/cmInstallCommandArguments.cxx
+++ b/Source/cmInstallCommandArguments.cxx
@@ -16,10 +16,8 @@ const char* cmInstallCommandArguments::PermissionsTable[] = {
const std::string cmInstallCommandArguments::EmptyString;
cmInstallCommandArguments::cmInstallCommandArguments(
- const std::string& defaultComponent)
- : Parser()
- , ArgumentGroup()
- , Destination(&Parser, "DESTINATION", &ArgumentGroup)
+ std::string defaultComponent)
+ : Destination(&Parser, "DESTINATION", &ArgumentGroup)
, Component(&Parser, "COMPONENT", &ArgumentGroup)
, NamelinkComponent(&Parser, "NAMELINK_COMPONENT", &ArgumentGroup)
, ExcludeFromAll(&Parser, "EXCLUDE_FROM_ALL", &ArgumentGroup)
@@ -29,8 +27,9 @@ cmInstallCommandArguments::cmInstallCommandArguments(
, Optional(&Parser, "OPTIONAL", &ArgumentGroup)
, NamelinkOnly(&Parser, "NAMELINK_ONLY", &ArgumentGroup)
, NamelinkSkip(&Parser, "NAMELINK_SKIP", &ArgumentGroup)
+ , Type(&Parser, "TYPE", &ArgumentGroup)
, GenericArguments(nullptr)
- , DefaultComponentName(defaultComponent)
+ , DefaultComponentName(std::move(defaultComponent))
{
}
@@ -145,6 +144,11 @@ bool cmInstallCommandArguments::HasNamelinkComponent() const
return false;
}
+const std::string& cmInstallCommandArguments::GetType() const
+{
+ return this->Type.GetString();
+}
+
const std::vector<std::string>& cmInstallCommandArguments::GetConfigurations()
const
{
@@ -177,7 +181,8 @@ bool cmInstallCommandArguments::CheckPermissions()
{
this->PermissionsString.clear();
for (std::string const& perm : this->Permissions.GetVector()) {
- if (!this->CheckPermissions(perm, this->PermissionsString)) {
+ if (!cmInstallCommandArguments::CheckPermissions(
+ perm, this->PermissionsString)) {
return false;
}
}
@@ -201,9 +206,7 @@ bool cmInstallCommandArguments::CheckPermissions(
return false;
}
-cmInstallCommandIncludesArgument::cmInstallCommandIncludesArgument()
-{
-}
+cmInstallCommandIncludesArgument::cmInstallCommandIncludesArgument() = default;
const std::vector<std::string>&
cmInstallCommandIncludesArgument::GetIncludeDirs() const
diff --git a/Source/cmInstallCommandArguments.h b/Source/cmInstallCommandArguments.h
index ee6e86597..9c0d41763 100644
--- a/Source/cmInstallCommandArguments.h
+++ b/Source/cmInstallCommandArguments.h
@@ -13,7 +13,7 @@
class cmInstallCommandArguments
{
public:
- cmInstallCommandArguments(const std::string& defaultComponent);
+ cmInstallCommandArguments(std::string defaultComponent);
void SetGenericArguments(cmInstallCommandArguments* args)
{
this->GenericArguments = args;
@@ -35,6 +35,7 @@ public:
bool GetNamelinkOnly() const;
bool GetNamelinkSkip() const;
bool HasNamelinkComponent() const;
+ const std::string& GetType() const;
// once HandleDirectoryMode() is also switched to using
// cmInstallCommandArguments then these two functions can become non-static
@@ -44,7 +45,6 @@ public:
cmCommandArgumentGroup ArgumentGroup;
private:
- cmInstallCommandArguments(); // disabled
cmCAString Destination;
cmCAString Component;
cmCAString NamelinkComponent;
@@ -55,6 +55,7 @@ private:
cmCAEnabler Optional;
cmCAEnabler NamelinkOnly;
cmCAEnabler NamelinkSkip;
+ cmCAString Type;
std::string DestinationString;
std::string PermissionsString;
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index c9b50a3b6..a88c7af3b 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -39,9 +39,7 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator(
}
}
-cmInstallDirectoryGenerator::~cmInstallDirectoryGenerator()
-{
-}
+cmInstallDirectoryGenerator::~cmInstallDirectoryGenerator() = default;
void cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg)
{
diff --git a/Source/cmInstallExportAndroidMKGenerator.cxx b/Source/cmInstallExportAndroidMKGenerator.cxx
index dd85b8843..85b702142 100644
--- a/Source/cmInstallExportAndroidMKGenerator.cxx
+++ b/Source/cmInstallExportAndroidMKGenerator.cxx
@@ -13,7 +13,7 @@
#include "cmInstallTargetGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
-#include "cmake.h"
+#include "cmMessageType.h"
cmInstallExportAndroidMKGenerator::cmInstallExportAndroidMKGenerator(
cmExportSet* exportSet, const char* destination,
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index d441e4138..47b9785e5 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -3,6 +3,7 @@
#include "cmInstallExportGenerator.h"
#include <algorithm>
+#include <map>
#include <sstream>
#include <utility>
@@ -14,7 +15,6 @@
#include "cmInstallType.h"
#include "cmLocalGenerator.h"
#include "cmSystemTools.h"
-#include "cmake.h"
cmInstallExportGenerator::cmInstallExportGenerator(
cmExportSet* exportSet, const char* destination,
@@ -56,7 +56,7 @@ void cmInstallExportGenerator::ComputeTempDir()
// Choose a temporary directory in which to generate the import
// files to be installed.
this->TempDir = this->LocalGenerator->GetCurrentBinaryDirectory();
- this->TempDir += cmake::GetCMakeFilesDirectory();
+ this->TempDir += "/CMakeFiles";
this->TempDir += "/Export";
if (this->Destination.empty()) {
return;
@@ -126,7 +126,7 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
std::ostringstream e;
e << "INSTALL(EXPORT) given unknown export \"" << ExportSet->GetName()
<< "\"";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return;
}
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 68e3f86d1..07094cb68 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -38,9 +38,7 @@ cmInstallFilesGenerator::cmInstallFilesGenerator(
}
}
-cmInstallFilesGenerator::~cmInstallFilesGenerator()
-{
-}
+cmInstallFilesGenerator::~cmInstallFilesGenerator() = default;
void cmInstallFilesGenerator::Compute(cmLocalGenerator* lg)
{
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx
index 53ac71622..d139190a4 100644
--- a/Source/cmInstallGenerator.cxx
+++ b/Source/cmInstallGenerator.cxx
@@ -18,8 +18,19 @@ cmInstallGenerator::cmInstallGenerator(
{
}
-cmInstallGenerator::~cmInstallGenerator()
+cmInstallGenerator::~cmInstallGenerator() = default;
+
+bool cmInstallGenerator::HaveInstall()
{
+ return true;
+}
+
+void cmInstallGenerator::CheckCMP0082(bool& haveSubdirectoryInstall,
+ bool& haveInstallAfterSubdirectory)
+{
+ if (haveSubdirectoryInstall) {
+ haveInstallAfterSubdirectory = true;
+ }
}
void cmInstallGenerator::AddInstallRule(
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index fc1ce864f..9bd7ac318 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -21,8 +21,6 @@ class cmMakefile;
*/
class cmInstallGenerator : public cmScriptGenerator
{
- CM_DISABLE_COPY(cmInstallGenerator)
-
public:
enum MessageLevel
{
@@ -38,6 +36,13 @@ public:
bool exclude_from_all);
~cmInstallGenerator() override;
+ cmInstallGenerator(cmInstallGenerator const&) = delete;
+ cmInstallGenerator& operator=(cmInstallGenerator const&) = delete;
+
+ virtual bool HaveInstall();
+ virtual void CheckCMP0082(bool& haveSubdirectoryInstall,
+ bool& haveInstallAfterSubdirectory);
+
void AddInstallRule(
std::ostream& os, std::string const& dest, cmInstallType type,
std::vector<std::string> const& files, bool optional = false,
diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx
index f7e6e44a3..a513958ed 100644
--- a/Source/cmInstallScriptGenerator.cxx
+++ b/Source/cmInstallScriptGenerator.cxx
@@ -2,11 +2,15 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmInstallScriptGenerator.h"
-#include "cmScriptGenerator.h"
-
#include <ostream>
#include <vector>
+#include "cmGeneratorExpression.h"
+#include "cmLocalGenerator.h"
+#include "cmMessageType.h"
+#include "cmPolicies.h"
+#include "cmScriptGenerator.h"
+
cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script,
bool code,
const char* component,
@@ -15,25 +19,69 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script,
MessageDefault, exclude_from_all)
, Script(script)
, Code(code)
+ , AllowGenex(false)
{
+ // We need per-config actions if the script has generator expressions.
+ if (cmGeneratorExpression::Find(Script) != std::string::npos) {
+ this->ActionsPerConfig = true;
+ }
}
-cmInstallScriptGenerator::~cmInstallScriptGenerator()
+cmInstallScriptGenerator::~cmInstallScriptGenerator() = default;
+
+void cmInstallScriptGenerator::Compute(cmLocalGenerator* lg)
{
+ this->LocalGenerator = lg;
+
+ if (this->ActionsPerConfig) {
+ switch (this->LocalGenerator->GetPolicyStatus(cmPolicies::CMP0087)) {
+ case cmPolicies::WARN:
+ this->LocalGenerator->IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0087));
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD:
+ break;
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::REQUIRED_IF_USED:
+ this->AllowGenex = true;
+ break;
+ }
+ }
}
-void cmInstallScriptGenerator::GenerateScript(std::ostream& os)
+void cmInstallScriptGenerator::AddScriptInstallRule(std::ostream& os,
+ Indent indent,
+ std::string const& script)
{
- Indent indent;
- std::string component_test =
- this->CreateComponentTest(this->Component.c_str(), this->ExcludeFromAll);
- os << indent << "if(" << component_test << ")\n";
-
if (this->Code) {
- os << indent.Next() << this->Script << "\n";
+ os << indent << script << "\n";
} else {
- os << indent.Next() << "include(\"" << this->Script << "\")\n";
+ os << indent << "include(\"" << script << "\")\n";
}
+}
- os << indent << "endif()\n\n";
+void cmInstallScriptGenerator::GenerateScriptActions(std::ostream& os,
+ Indent indent)
+{
+ if (this->AllowGenex && this->ActionsPerConfig) {
+ this->cmInstallGenerator::GenerateScriptActions(os, indent);
+ } else {
+ this->AddScriptInstallRule(os, indent, this->Script);
+ }
+}
+
+void cmInstallScriptGenerator::GenerateScriptForConfig(
+ std::ostream& os, const std::string& config, Indent indent)
+{
+ if (this->AllowGenex) {
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(this->Script);
+ this->AddScriptInstallRule(os, indent,
+ cge->Evaluate(this->LocalGenerator, config));
+ } else {
+ this->AddScriptInstallRule(os, indent, this->Script);
+ }
}
diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h
index fe0f7c6f1..05199d790 100644
--- a/Source/cmInstallScriptGenerator.h
+++ b/Source/cmInstallScriptGenerator.h
@@ -6,10 +6,13 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
+#include "cmScriptGenerator.h"
#include <iosfwd>
#include <string>
+class cmLocalGenerator;
+
/** \class cmInstallScriptGenerator
* \brief Generate target installation rules.
*/
@@ -20,10 +23,19 @@ public:
const char* component, bool exclude_from_all);
~cmInstallScriptGenerator() override;
+ void Compute(cmLocalGenerator* lg) override;
+
protected:
- void GenerateScript(std::ostream& os) override;
+ void GenerateScriptActions(std::ostream& os, Indent indent) override;
+ void GenerateScriptForConfig(std::ostream& os, const std::string& config,
+ Indent indent) override;
+ void AddScriptInstallRule(std::ostream& os, Indent indent,
+ std::string const& script);
+
std::string Script;
bool Code;
+ cmLocalGenerator* LocalGenerator;
+ bool AllowGenex;
};
#endif
diff --git a/Source/cmInstallSubdirectoryGenerator.cxx b/Source/cmInstallSubdirectoryGenerator.cxx
new file mode 100644
index 000000000..ad7121f2e
--- /dev/null
+++ b/Source/cmInstallSubdirectoryGenerator.cxx
@@ -0,0 +1,75 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmInstallSubdirectoryGenerator.h"
+
+#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
+#include "cmPolicies.h"
+#include "cmScriptGenerator.h"
+#include "cmSystemTools.h"
+
+#include <sstream>
+#include <vector>
+
+cmInstallSubdirectoryGenerator::cmInstallSubdirectoryGenerator(
+ cmMakefile* makefile, const char* binaryDirectory, bool excludeFromAll)
+ : cmInstallGenerator(nullptr, std::vector<std::string>(), nullptr,
+ MessageDefault, excludeFromAll)
+ , Makefile(makefile)
+ , BinaryDirectory(binaryDirectory)
+{
+}
+
+cmInstallSubdirectoryGenerator::~cmInstallSubdirectoryGenerator() = default;
+
+bool cmInstallSubdirectoryGenerator::HaveInstall()
+{
+ for (auto generator : this->Makefile->GetInstallGenerators()) {
+ if (generator->HaveInstall()) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void cmInstallSubdirectoryGenerator::CheckCMP0082(
+ bool& haveSubdirectoryInstall, bool& /*unused*/)
+{
+ if (this->HaveInstall()) {
+ haveSubdirectoryInstall = true;
+ }
+}
+
+void cmInstallSubdirectoryGenerator::Compute(cmLocalGenerator* lg)
+{
+ this->LocalGenerator = lg;
+}
+
+void cmInstallSubdirectoryGenerator::GenerateScript(std::ostream& os)
+{
+ if (!this->ExcludeFromAll) {
+ cmPolicies::PolicyStatus status =
+ this->LocalGenerator->GetPolicyStatus(cmPolicies::CMP0082);
+ switch (status) {
+ case cmPolicies::WARN:
+ case cmPolicies::OLD:
+ // OLD behavior is handled in cmLocalGenerator::GenerateInstallRules()
+ break;
+
+ case cmPolicies::NEW:
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS: {
+ Indent indent;
+ std::string odir = this->BinaryDirectory;
+ cmSystemTools::ConvertToUnixSlashes(odir);
+ os << indent << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n"
+ << indent.Next()
+ << "# Include the install script for the subdirectory.\n"
+ << indent.Next() << "include(\"" << odir
+ << "/cmake_install.cmake\")\n"
+ << indent << "endif()\n\n";
+ } break;
+ }
+ }
+}
diff --git a/Source/cmInstallSubdirectoryGenerator.h b/Source/cmInstallSubdirectoryGenerator.h
new file mode 100644
index 000000000..35471dda0
--- /dev/null
+++ b/Source/cmInstallSubdirectoryGenerator.h
@@ -0,0 +1,41 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmInstallSubdirectoryGenerator_h
+#define cmInstallSubdirectoryGenerator_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cmInstallGenerator.h"
+
+#include <iosfwd>
+#include <string>
+
+class cmLocalGenerator;
+class cmMakefile;
+
+/** \class cmInstallSubdirectoryGenerator
+ * \brief Generate target installation rules.
+ */
+class cmInstallSubdirectoryGenerator : public cmInstallGenerator
+{
+public:
+ cmInstallSubdirectoryGenerator(cmMakefile* makefile,
+ const char* binaryDirectory,
+ bool excludeFromAll);
+ ~cmInstallSubdirectoryGenerator() override;
+
+ bool HaveInstall() override;
+ void CheckCMP0082(bool& haveSubdirectoryInstall,
+ bool& haveInstallAfterSubdirectory) override;
+
+ void Compute(cmLocalGenerator* lg) override;
+
+protected:
+ void GenerateScript(std::ostream& os) override;
+
+ cmMakefile* Makefile;
+ std::string BinaryDirectory;
+ cmLocalGenerator* LocalGenerator;
+};
+
+#endif
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index bf0217a6e..9d3a6bb60 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -15,47 +15,31 @@
#include "cmInstallType.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
cmInstallTargetGenerator::cmInstallTargetGenerator(
- const std::string& targetName, const char* dest, bool implib,
+ std::string targetName, const char* dest, bool implib,
const char* file_permissions, std::vector<std::string> const& configurations,
const char* component, MessageLevel message, bool exclude_from_all,
- bool optional)
+ bool optional, cmListFileBacktrace backtrace)
: cmInstallGenerator(dest, configurations, component, message,
exclude_from_all)
- , TargetName(targetName)
+ , TargetName(std::move(targetName))
, Target(nullptr)
, FilePermissions(file_permissions)
, ImportLibrary(implib)
, Optional(optional)
+ , Backtrace(std::move(backtrace))
{
this->ActionsPerConfig = true;
this->NamelinkMode = NamelinkModeNone;
}
-cmInstallTargetGenerator::~cmInstallTargetGenerator()
-{
-}
-
-void cmInstallTargetGenerator::GenerateScript(std::ostream& os)
-{
- // Warn if installing an exclude-from-all target.
- if (this->Target->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
- std::ostringstream msg;
- msg << "WARNING: Target \"" << this->Target->GetName()
- << "\" has EXCLUDE_FROM_ALL set and will not be built by default "
- << "but an install rule has been provided for it. CMake does "
- << "not define behavior for this case.";
- cmSystemTools::Message(msg.str().c_str(), "Warning");
- }
-
- // Perform the main install script generation.
- this->cmInstallGenerator::GenerateScript(os);
-}
+cmInstallTargetGenerator::~cmInstallTargetGenerator() = default;
void cmInstallTargetGenerator::GenerateScriptForConfig(
std::ostream& os, const std::string& config, Indent indent)
@@ -90,7 +74,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
case cmStateEnums::GLOBAL_TARGET:
case cmStateEnums::UNKNOWN_LIBRARY:
this->Target->GetLocalGenerator()->IssueMessage(
- cmake::INTERNAL_ERROR,
+ MessageType::INTERNAL_ERROR,
"cmInstallTargetGenerator created with non-installable target.");
return;
}
@@ -100,7 +84,7 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
if (this->Target->NeedRelinkBeforeInstall(config)) {
fromDirConfig =
this->Target->GetLocalGenerator()->GetCurrentBinaryDirectory();
- fromDirConfig += cmake::GetCMakeFilesDirectory();
+ fromDirConfig += "/CMakeFiles";
fromDirConfig += "/CMakeRelink.dir/";
} else {
cmStateEnums::ArtifactType artifact = this->ImportLibrary
@@ -221,16 +205,21 @@ void cmInstallTargetGenerator::GenerateScriptForConfig(
// and one for the primary artifact component (NamelinkModeSkip).
// Historically this was not diagnosed and resulted in silent
// installation of a framework to the LIBRARY destination.
- // Retain that behavior.
+ // Retain that behavior and warn about the case.
switch (this->NamelinkMode) {
case NamelinkModeNone:
// Normal case.
break;
case NamelinkModeOnly:
- // Assume the NamelinkModeSkip instance will install.
+ // Assume the NamelinkModeSkip instance will warn and install.
return;
case NamelinkModeSkip: {
- // Proceed to install in the LIBRARY destination for compatibility.
+ std::string e = "Target '" + this->Target->GetName() +
+ "' was changed to a FRAMEWORK sometime after install(). "
+ "This may result in the wrong install DESTINATION. "
+ "Set the FRAMEWORK property earlier.";
+ this->Target->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage(
+ MessageType::AUTHOR_WARNING, e, this->GetBacktrace());
} break;
}
@@ -715,7 +704,7 @@ void cmInstallTargetGenerator::AddChrpathPatchRule(
<< "Therefore, runtime paths will not be changed when installing. "
<< "CMAKE_BUILD_WITH_INSTALL_RPATH may be used to work around"
" this limitation.";
- mf->IssueMessage(cmake::WARNING, msg.str());
+ mf->IssueMessage(MessageType::WARNING, msg.str());
} else {
// Note: These paths are kept unique to avoid
// install_name_tool corruption.
@@ -787,10 +776,22 @@ void cmInstallTargetGenerator::AddStripRule(std::ostream& os, Indent indent,
return;
}
+ std::string stripArgs;
+
+ // macOS 'strip' is picky, executables need '-u -r' and dylibs need '-x'.
+ if (this->Target->Target->GetMakefile()->IsOn("APPLE")) {
+ if (this->Target->GetType() == cmStateEnums::SHARED_LIBRARY ||
+ this->Target->GetType() == cmStateEnums::MODULE_LIBRARY) {
+ stripArgs = "-x ";
+ } else if (this->Target->GetType() == cmStateEnums::EXECUTABLE) {
+ stripArgs = "-u -r ";
+ }
+ }
+
os << indent << "if(CMAKE_INSTALL_DO_STRIP)\n";
os << indent << " execute_process(COMMAND \""
<< this->Target->Target->GetMakefile()->GetDefinition("CMAKE_STRIP")
- << "\" \"" << toDestDirPath << "\")\n";
+ << "\" " << stripArgs << "\"" << toDestDirPath << "\")\n";
os << indent << "endif()\n";
}
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index f6bec20b3..6df5b1a50 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmInstallGenerator.h"
+#include "cmListFileCache.h"
#include "cmScriptGenerator.h"
#include <iosfwd>
@@ -21,11 +22,12 @@ class cmLocalGenerator;
class cmInstallTargetGenerator : public cmInstallGenerator
{
public:
- cmInstallTargetGenerator(std::string const& targetName, const char* dest,
- bool implib, const char* file_permissions,
- std::vector<std::string> const& configurations,
- const char* component, MessageLevel message,
- bool exclude_from_all, bool optional);
+ cmInstallTargetGenerator(
+ std::string targetName, const char* dest, bool implib,
+ const char* file_permissions,
+ std::vector<std::string> const& configurations, const char* component,
+ MessageLevel message, bool exclude_from_all, bool optional,
+ cmListFileBacktrace backtrace = cmListFileBacktrace());
~cmInstallTargetGenerator() override;
/** Select the policy for installing shared library linkable name
@@ -64,8 +66,9 @@ public:
std::string GetDestination(std::string const& config) const;
+ cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
+
protected:
- void GenerateScript(std::ostream& os) override;
void GenerateScriptForConfig(std::ostream& os, const std::string& config,
Indent indent) override;
void GenerateScriptForConfigObjectLibrary(std::ostream& os,
@@ -108,6 +111,7 @@ protected:
NamelinkModeType NamelinkMode;
bool ImportLibrary;
bool Optional;
+ cmListFileBacktrace Backtrace;
};
#endif
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index 0e0602981..537b4ecec 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -9,19 +9,14 @@
#include <utility>
-cmInstalledFile::cmInstalledFile()
- : NameExpression(nullptr)
-{
-}
+cmInstalledFile::cmInstalledFile() = default;
cmInstalledFile::~cmInstalledFile()
{
delete NameExpression;
}
-cmInstalledFile::Property::Property()
-{
-}
+cmInstalledFile::Property::Property() = default;
cmInstalledFile::Property::~Property()
{
diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h
index 47a49590d..070b954e6 100644
--- a/Source/cmInstalledFile.h
+++ b/Source/cmInstalledFile.h
@@ -68,7 +68,7 @@ public:
private:
std::string Name;
- cmCompiledGeneratorExpression* NameExpression;
+ cmCompiledGeneratorExpression* NameExpression = nullptr;
PropertyMapType Properties;
};
diff --git a/Source/cmJsonObjects.cxx b/Source/cmJsonObjects.cxx
index 4148894f3..d723cedb5 100644
--- a/Source/cmJsonObjects.cxx
+++ b/Source/cmJsonObjects.cxx
@@ -6,6 +6,7 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmInstallGenerator.h"
+#include "cmInstallSubdirectoryGenerator.h"
#include "cmInstallTargetGenerator.h"
#include "cmJsonObjectDictionary.h"
#include "cmJsonObjects.h"
@@ -13,6 +14,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmProperty.h"
+#include "cmPropertyMap.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmStateDirectory.h"
@@ -47,7 +49,7 @@ std::vector<std::string> getConfigurations(const cmake* cm)
makefiles[0]->GetConfigurations(configurations);
if (configurations.empty()) {
- configurations.push_back("");
+ configurations.emplace_back();
}
return configurations;
}
@@ -290,10 +292,10 @@ static Json::Value DumpSourceFilesList(
lg->AppendIncludeDirectories(includes, evaluatedIncludes, *file);
for (const auto& include : includes) {
- fileData.IncludePathList.push_back(
- std::make_pair(include,
- target->IsSystemIncludeDirectory(
- include, config, fileData.Language)));
+ fileData.IncludePathList.emplace_back(
+ include,
+ target->IsSystemIncludeDirectory(include, config,
+ fileData.Language));
}
}
@@ -321,7 +323,7 @@ static Json::Value DumpSourceFilesList(
fileData.SetDefines(defines);
}
- fileData.IsGenerated = file->GetPropertyAsBool("GENERATED");
+ fileData.IsGenerated = file->GetIsGenerated();
std::vector<std::string>& groupFileList = fileGroups[fileData];
groupFileList.push_back(file->GetFullPath());
}
@@ -450,10 +452,9 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
const std::string& config)
{
cmLocalGenerator* lg = target->GetLocalGenerator();
- const cmState* state = lg->GetState();
const cmStateEnums::TargetType type = target->GetType();
- const std::string typeName = state->GetTargetTypeName(type);
+ const std::string typeName = cmState::GetTargetTypeName(type);
Json::Value ttl = Json::arrayValue;
ttl.append("EXECUTABLE");
@@ -577,10 +578,10 @@ static Json::Value DumpTarget(cmGeneratorTarget* target,
lg->GetTargetDefines(target, config, lang, defines);
ld.SetDefines(defines);
std::vector<std::string> includePathList;
- lg->GetIncludeDirectories(includePathList, target, lang, config, true);
+ lg->GetIncludeDirectories(includePathList, target, lang, config);
for (std::string const& i : includePathList) {
- ld.IncludePathList.push_back(
- std::make_pair(i, target->IsSystemIncludeDirectory(i, config, lang)));
+ ld.IncludePathList.emplace_back(
+ i, target->IsSystemIncludeDirectory(i, config, lang));
}
}
@@ -641,8 +642,13 @@ static Json::Value DumpProjectList(const cmake* cm, std::string const& config)
// associated generators.
bool hasInstallRule = false;
for (const auto generator : projectIt.second) {
- hasInstallRule =
- generator->GetMakefile()->GetInstallGenerators().empty() == false;
+ for (const auto installGen :
+ generator->GetMakefile()->GetInstallGenerators()) {
+ if (!dynamic_cast<cmInstallSubdirectoryGenerator*>(installGen)) {
+ hasInstallRule = true;
+ break;
+ }
+ }
if (hasInstallRule) {
break;
diff --git a/Source/cmLinkDirectoriesCommand.cxx b/Source/cmLinkDirectoriesCommand.cxx
index 10425fdb7..785097745 100644
--- a/Source/cmLinkDirectoriesCommand.cxx
+++ b/Source/cmLinkDirectoriesCommand.cxx
@@ -7,9 +7,9 @@
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -59,7 +59,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0015)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0015);
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
break;
case cmPolicies::OLD:
// OLD behavior does not convert
@@ -67,7 +67,7 @@ void cmLinkDirectoriesCommand::AddLinkDir(
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
e << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0015);
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior converts
diff --git a/Source/cmLinkItem.cxx b/Source/cmLinkItem.cxx
index 69b6821c1..9b03ad011 100644
--- a/Source/cmLinkItem.cxx
+++ b/Source/cmLinkItem.cxx
@@ -6,21 +6,17 @@
#include <utility> // IWYU pragma: keep
-cmLinkItem::cmLinkItem()
- : String()
- , Target(nullptr)
-{
-}
+cmLinkItem::cmLinkItem() = default;
-cmLinkItem::cmLinkItem(std::string const& n)
- : String(n)
- , Target(nullptr)
+cmLinkItem::cmLinkItem(std::string n, cmListFileBacktrace bt)
+ : String(std::move(n))
+ , Backtrace(std::move(bt))
{
}
-cmLinkItem::cmLinkItem(cmGeneratorTarget const* t)
- : String()
- , Target(t)
+cmLinkItem::cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace bt)
+ : Target(t)
+ , Backtrace(std::move(bt))
{
}
@@ -58,15 +54,11 @@ std::ostream& operator<<(std::ostream& os, cmLinkItem const& item)
cmLinkImplItem::cmLinkImplItem()
: cmLinkItem()
- , Backtrace()
- , FromGenex(false)
{
}
-cmLinkImplItem::cmLinkImplItem(cmLinkItem item, cmListFileBacktrace const& bt,
- bool fromGenex)
+cmLinkImplItem::cmLinkImplItem(cmLinkItem item, bool fromGenex)
: cmLinkItem(std::move(item))
- , Backtrace(bt)
, FromGenex(fromGenex)
{
}
diff --git a/Source/cmLinkItem.h b/Source/cmLinkItem.h
index 74fd298e4..5b635b5b3 100644
--- a/Source/cmLinkItem.h
+++ b/Source/cmLinkItem.h
@@ -24,10 +24,11 @@ class cmLinkItem
public:
cmLinkItem();
- explicit cmLinkItem(std::string const& s);
- explicit cmLinkItem(cmGeneratorTarget const* t);
+ cmLinkItem(std::string s, cmListFileBacktrace bt);
+ cmLinkItem(cmGeneratorTarget const* t, cmListFileBacktrace bt);
std::string const& AsStr() const;
- cmGeneratorTarget const* Target;
+ cmGeneratorTarget const* Target = nullptr;
+ cmListFileBacktrace Backtrace;
friend bool operator<(cmLinkItem const& l, cmLinkItem const& r);
friend bool operator==(cmLinkItem const& l, cmLinkItem const& r);
friend std::ostream& operator<<(std::ostream& os, cmLinkItem const& item);
@@ -37,10 +38,8 @@ class cmLinkImplItem : public cmLinkItem
{
public:
cmLinkImplItem();
- cmLinkImplItem(cmLinkItem item, cmListFileBacktrace const& bt,
- bool fromGenex);
- cmListFileBacktrace Backtrace;
- bool FromGenex;
+ cmLinkImplItem(cmLinkItem item, bool fromGenex);
+ bool FromGenex = false;
};
/** The link implementation specifies the direct library
@@ -71,36 +70,22 @@ struct cmLinkInterface : public cmLinkInterfaceLibraries
// Number of repetitions of a strongly connected component of two
// or more static libraries.
- unsigned int Multiplicity;
+ unsigned int Multiplicity = 0;
// Libraries listed for other configurations.
// Needed only for OLD behavior of CMP0003.
std::vector<cmLinkItem> WrongConfigLibraries;
- bool ImplementationIsInterface;
-
- cmLinkInterface()
- : Multiplicity(0)
- , ImplementationIsInterface(false)
- {
- }
+ bool ImplementationIsInterface = false;
};
struct cmOptionalLinkInterface : public cmLinkInterface
{
- cmOptionalLinkInterface()
- : LibrariesDone(false)
- , AllDone(false)
- , Exists(false)
- , HadHeadSensitiveCondition(false)
- , ExplicitLibraries(nullptr)
- {
- }
- bool LibrariesDone;
- bool AllDone;
- bool Exists;
- bool HadHeadSensitiveCondition;
- const char* ExplicitLibraries;
+ bool LibrariesDone = false;
+ bool AllDone = false;
+ bool Exists = false;
+ bool HadHeadSensitiveCondition = false;
+ const char* ExplicitLibraries = nullptr;
};
struct cmHeadToLinkInterfaceMap
@@ -117,15 +102,9 @@ struct cmLinkImplementation : public cmLinkImplementationLibraries
// Cache link implementation computation from each configuration.
struct cmOptionalLinkImplementation : public cmLinkImplementation
{
- cmOptionalLinkImplementation()
- : LibrariesDone(false)
- , LanguagesDone(false)
- , HadHeadSensitiveCondition(false)
- {
- }
- bool LibrariesDone;
- bool LanguagesDone;
- bool HadHeadSensitiveCondition;
+ bool LibrariesDone = false;
+ bool LanguagesDone = false;
+ bool HadHeadSensitiveCondition = false;
};
/** Compute the link type to use for the given configuration. */
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index 7511fd21b..2a8bee6e5 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -11,6 +11,7 @@
#include "cmOutputConverter.h"
#include "cmStateDirectory.h"
#include "cmStateTypes.h"
+#include "cmSystemTools.h"
cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir)
@@ -22,9 +23,7 @@ cmLinkLineComputer::cmLinkLineComputer(cmOutputConverter* outputConverter,
{
}
-cmLinkLineComputer::~cmLinkLineComputer()
-{
-}
+cmLinkLineComputer::~cmLinkLineComputer() = default;
void cmLinkLineComputer::SetUseWatcomQuote(bool useWatcomQuote)
{
@@ -46,9 +45,8 @@ std::string cmLinkLineComputer::ConvertToLinkReference(
{
std::string relLib = lib;
- if (cmOutputConverter::ContainedInDirectory(
- this->StateDir.GetCurrentBinary(), lib, this->StateDir)) {
- relLib = cmOutputConverter::ForceToRelativePath(
+ if (this->StateDir.ContainsBoth(this->StateDir.GetCurrentBinary(), lib)) {
+ relLib = cmSystemTools::ForceToRelativePath(
this->StateDir.GetCurrentBinary(), lib);
}
return relLib;
diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h
index a016358fa..2355c3270 100644
--- a/Source/cmLinkLineComputer.h
+++ b/Source/cmLinkLineComputer.h
@@ -16,13 +16,14 @@ class cmOutputConverter;
class cmLinkLineComputer
{
- CM_DISABLE_COPY(cmLinkLineComputer)
-
public:
cmLinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir);
virtual ~cmLinkLineComputer();
+ cmLinkLineComputer(cmLinkLineComputer const&) = delete;
+ cmLinkLineComputer& operator=(cmLinkLineComputer const&) = delete;
+
void SetUseWatcomQuote(bool useWatcomQuote);
void SetForResponse(bool forResponse);
void SetRelink(bool relink);
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index a93ec1271..211d03bd8 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -21,9 +21,7 @@ cmLinkLineDeviceComputer::cmLinkLineDeviceComputer(
{
}
-cmLinkLineDeviceComputer::~cmLinkLineDeviceComputer()
-{
-}
+cmLinkLineDeviceComputer::~cmLinkLineDeviceComputer() = default;
static bool cmLinkItemValidForDevice(std::string const& item)
{
@@ -36,6 +34,7 @@ static bool cmLinkItemValidForDevice(std::string const& item)
// * '-lpthread' => pass-along
// * '-pthread' => drop
// * '-a' => drop
+ // * '-framework Name' (as one string) => drop
return (!cmHasLiteralPrefix(item, "-") || //
cmHasLiteralPrefix(item, "-l") || //
cmHasLiteralPrefix(item, "-L") || //
@@ -56,7 +55,13 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries(
typedef cmComputeLinkInformation::ItemVector ItemVector;
ItemVector const& items = cli.GetItems();
std::string config = cli.GetConfig();
+ bool skipItemAfterFramework = false;
for (auto const& item : items) {
+ if (skipItemAfterFramework) {
+ skipItemAfterFramework = false;
+ continue;
+ }
+
if (item.Target) {
bool skip = false;
switch (item.Target->GetType()) {
@@ -86,6 +91,11 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries(
out += this->ConvertToOutputFormat(
this->ConvertToLinkReference(item.Value));
}
+ } else if (item.Value == "-framework") {
+ // This is the first part of '-framework Name' where the framework
+ // name is specified as a following item. Ignore both.
+ skipItemAfterFramework = true;
+ continue;
} else if (cmLinkItemValidForDevice(item.Value)) {
out += item.Value;
}
diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h
index 81b48b3d4..cf66f6475 100644
--- a/Source/cmLinkLineDeviceComputer.h
+++ b/Source/cmLinkLineDeviceComputer.h
@@ -18,13 +18,15 @@ class cmStateDirectory;
class cmLinkLineDeviceComputer : public cmLinkLineComputer
{
- CM_DISABLE_COPY(cmLinkLineDeviceComputer)
-
public:
cmLinkLineDeviceComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir);
~cmLinkLineDeviceComputer() override;
+ cmLinkLineDeviceComputer(cmLinkLineDeviceComputer const&) = delete;
+ cmLinkLineDeviceComputer& operator=(cmLinkLineDeviceComputer const&) =
+ delete;
+
std::string ComputeLinkLibraries(cmComputeLinkInformation& cli,
std::string const& stdLibString) override;
@@ -34,13 +36,15 @@ public:
class cmNinjaLinkLineDeviceComputer : public cmLinkLineDeviceComputer
{
- CM_DISABLE_COPY(cmNinjaLinkLineDeviceComputer)
-
public:
cmNinjaLinkLineDeviceComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg);
+ cmNinjaLinkLineDeviceComputer(cmNinjaLinkLineDeviceComputer const&) = delete;
+ cmNinjaLinkLineDeviceComputer& operator=(
+ cmNinjaLinkLineDeviceComputer const&) = delete;
+
std::string ConvertToLinkReference(std::string const& input) const override;
private:
diff --git a/Source/cmLinkedTree.h b/Source/cmLinkedTree.h
index 975f05240..099fb6d11 100644
--- a/Source/cmLinkedTree.h
+++ b/Source/cmLinkedTree.h
@@ -6,7 +6,6 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <assert.h>
-#include <iterator>
#include <vector>
/**
@@ -33,7 +32,7 @@ class cmLinkedTree
typedef T& ReferenceType;
public:
- class iterator : public std::iterator<std::forward_iterator_tag, T>
+ class iterator
{
friend class cmLinkedTree;
cmLinkedTree* Tree;
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index d7de2fa5b..297babfd8 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -12,14 +12,15 @@
#include <stdexcept>
#include <stdio.h>
#include <stdlib.h> // required for atoi
+#include <utility>
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmStringReplaceHelper.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -122,7 +123,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
warn += " List has value = [";
warn += listString;
warn += "].";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, warn);
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, warn);
return true;
}
case cmPolicies::OLD:
@@ -137,7 +138,7 @@ bool cmListCommand::GetList(std::vector<std::string>& list,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0007));
return false;
}
@@ -152,7 +153,7 @@ bool cmListCommand::HandleLengthCommand(std::vector<std::string> const& args)
}
const std::string& listName = args[1];
- const std::string& variableName = args[args.size() - 1];
+ const std::string& variableName = args.back();
std::vector<std::string> varArgsExpanded;
// do not check the return value here
// if the list var is not found varArgsExpanded will have size 0
@@ -174,7 +175,7 @@ bool cmListCommand::HandleGetCommand(std::vector<std::string> const& args)
}
const std::string& listName = args[1];
- const std::string& variableName = args[args.size() - 1];
+ const std::string& variableName = args.back();
// expand the variable
std::vector<std::string> varArgsExpanded;
if (!this->GetList(varArgsExpanded, listName)) {
@@ -243,7 +244,7 @@ bool cmListCommand::HandleFindCommand(std::vector<std::string> const& args)
}
const std::string& listName = args[1];
- const std::string& variableName = args[args.size() - 1];
+ const std::string& variableName = args.back();
// expand the variable
std::vector<std::string> varArgsExpanded;
if (!this->GetList(varArgsExpanded, listName)) {
@@ -346,8 +347,7 @@ bool cmListCommand::HandleRemoveItemCommand(
// expand the variable
std::vector<std::string> varArgsExpanded;
if (!this->GetList(varArgsExpanded, listName)) {
- this->SetError("sub-command REMOVE_ITEM requires list to be present.");
- return false;
+ return true;
}
std::vector<std::string> remove(args.begin() + 2, args.end());
@@ -376,8 +376,7 @@ bool cmListCommand::HandleReverseCommand(std::vector<std::string> const& args)
// expand the variable
std::vector<std::string> varArgsExpanded;
if (!this->GetList(varArgsExpanded, listName)) {
- this->SetError("sub-command REVERSE requires list to be present.");
- return false;
+ return true;
}
std::string value = cmJoin(cmReverseRange(varArgsExpanded), ";");
@@ -399,9 +398,7 @@ bool cmListCommand::HandleRemoveDuplicatesCommand(
// expand the variable
std::vector<std::string> varArgsExpanded;
if (!this->GetList(varArgsExpanded, listName)) {
- this->SetError(
- "sub-command REMOVE_DUPLICATES requires list to be present.");
- return false;
+ return true;
}
std::vector<std::string>::const_iterator argsEnd =
@@ -429,7 +426,7 @@ public:
class TransformSelector
{
public:
- virtual ~TransformSelector() {}
+ virtual ~TransformSelector() = default;
std::string Tag;
@@ -583,7 +580,7 @@ private:
class TransformAction
{
public:
- virtual ~TransformAction() {}
+ virtual ~TransformAction() = default;
virtual std::string Transform(const std::string& input) = 0;
};
@@ -662,15 +659,19 @@ bool cmListCommand::HandleTransformCommand(
// Transform: lambda function implementing the action
struct ActionDescriptor
{
- ActionDescriptor(const std::string& name)
- : Name(name)
+ ActionDescriptor(std::string name)
+ : Name(std::move(name))
{
}
- ActionDescriptor(const std::string& name, int arity,
- const transform_type& transform)
- : Name(name)
+ ActionDescriptor(std::string name, int arity, transform_type transform)
+ : Name(std::move(name))
, Arity(arity)
+#if defined(__GNUC__) && __GNUC__ == 6 && defined(__aarch64__)
+ // std::function move constructor miscompiles on this architecture
, Transform(transform)
+#else
+ , Transform(std::move(transform))
+#endif
{
}
@@ -1152,8 +1153,7 @@ bool cmListCommand::HandleSortCommand(std::vector<std::string> const& args)
// expand the variable
std::vector<std::string> varArgsExpanded;
if (!this->GetList(varArgsExpanded, listName)) {
- this->SetError("sub-command SORT requires list to be present.");
- return false;
+ return true;
}
if ((sortCompare == cmStringSorter::Compare::STRING) &&
@@ -1181,7 +1181,7 @@ bool cmListCommand::HandleSublistCommand(std::vector<std::string> const& args)
}
const std::string& listName = args[1];
- const std::string& variableName = args[args.size() - 1];
+ const std::string& variableName = args.back();
// expand the variable
std::vector<std::string> varArgsExpanded;
@@ -1230,13 +1230,17 @@ bool cmListCommand::HandleRemoveAtCommand(std::vector<std::string> const& args)
const std::string& listName = args[1];
// expand the variable
std::vector<std::string> varArgsExpanded;
- if (!this->GetList(varArgsExpanded, listName)) {
- this->SetError("sub-command REMOVE_AT requires list to be present.");
- return false;
- }
- // FIXME: Add policy to make non-existing lists an error like empty lists.
- if (varArgsExpanded.empty()) {
- this->SetError("REMOVE_AT given empty list");
+ if (!this->GetList(varArgsExpanded, listName) || varArgsExpanded.empty()) {
+ std::ostringstream str;
+ str << "index: ";
+ for (size_t i = 1; i < args.size(); ++i) {
+ str << args[i];
+ if (i != args.size() - 1) {
+ str << ", ";
+ }
+ }
+ str << " out of range (0, 0)";
+ this->SetError(str.str());
return false;
}
@@ -1289,14 +1293,6 @@ bool cmListCommand::HandleFilterCommand(std::vector<std::string> const& args)
return false;
}
- const std::string& listName = args[1];
- // expand the variable
- std::vector<std::string> varArgsExpanded;
- if (!this->GetList(varArgsExpanded, listName)) {
- this->SetError("sub-command FILTER requires list to be present.");
- return false;
- }
-
const std::string& op = args[2];
bool includeMatches;
if (op == "INCLUDE") {
@@ -1308,6 +1304,13 @@ bool cmListCommand::HandleFilterCommand(std::vector<std::string> const& args)
return false;
}
+ const std::string& listName = args[1];
+ // expand the variable
+ std::vector<std::string> varArgsExpanded;
+ if (!this->GetList(varArgsExpanded, listName)) {
+ return true;
+ }
+
const std::string& mode = args[3];
if (mode == "REGEX") {
if (args.size() != 5) {
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 4d7e1e2ad..f85511964 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -3,16 +3,16 @@
#include "cmListFileCache.h"
#include "cmListFileLexer.h"
+#include "cmMessageType.h"
#include "cmMessenger.h"
-#include "cmOutputConverter.h"
#include "cmState.h"
+#include "cmStateDirectory.h"
#include "cmSystemTools.h"
-#include "cmake.h"
-#include <algorithm>
#include <assert.h>
#include <memory>
#include <sstream>
+#include <utility>
cmCommandContext::cmCommandName& cmCommandContext::cmCommandName::operator=(
std::string const& name)
@@ -24,7 +24,7 @@ cmCommandContext::cmCommandName& cmCommandContext::cmCommandName::operator=(
struct cmListFileParser
{
- cmListFileParser(cmListFile* lf, cmListFileBacktrace const& lfbt,
+ cmListFileParser(cmListFile* lf, cmListFileBacktrace lfbt,
cmMessenger* messenger, const char* filename);
~cmListFileParser();
void IssueFileOpenError(std::string const& text) const;
@@ -47,12 +47,11 @@ struct cmListFileParser
} Separation;
};
-cmListFileParser::cmListFileParser(cmListFile* lf,
- cmListFileBacktrace const& lfbt,
+cmListFileParser::cmListFileParser(cmListFile* lf, cmListFileBacktrace lfbt,
cmMessenger* messenger,
const char* filename)
: ListFile(lf)
- , Backtrace(lfbt)
+ , Backtrace(std::move(lfbt))
, Messenger(messenger)
, FileName(filename)
, Lexer(cmListFileLexer_New())
@@ -66,7 +65,8 @@ cmListFileParser::~cmListFileParser()
void cmListFileParser::IssueFileOpenError(const std::string& text) const
{
- this->Messenger->IssueMessage(cmake::FATAL_ERROR, text, this->Backtrace);
+ this->Messenger->IssueMessage(MessageType::FATAL_ERROR, text,
+ this->Backtrace);
}
void cmListFileParser::IssueError(const std::string& text) const
@@ -76,7 +76,7 @@ void cmListFileParser::IssueError(const std::string& text) const
lfc.Line = cmListFileLexer_GetCurrentLine(this->Lexer);
cmListFileBacktrace lfbt = this->Backtrace;
lfbt = lfbt.Push(lfc);
- this->Messenger->IssueMessage(cmake::FATAL_ERROR, text, lfbt);
+ this->Messenger->IssueMessage(MessageType::FATAL_ERROR, text, lfbt);
cmSystemTools::SetFatalErrorOccured();
}
@@ -193,8 +193,9 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
unsigned long lastLine;
unsigned long parenDepth = 0;
this->Separation = SeparationOkay;
- while ((lastLine = cmListFileLexer_GetCurrentLine(this->Lexer),
- token = cmListFileLexer_Scan(this->Lexer))) {
+ while (
+ (static_cast<void>(lastLine = cmListFileLexer_GetCurrentLine(this->Lexer)),
+ token = cmListFileLexer_Scan(this->Lexer))) {
if (token->type == cmListFileLexer_Token_Space ||
token->type == cmListFileLexer_Token_Newline) {
this->Separation = SeparationOkay;
@@ -254,7 +255,7 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
lfbt = lfbt.Push(lfc);
error << "Parse error. Function missing ending \")\". "
<< "End of file reached.";
- this->Messenger->IssueMessage(cmake::FATAL_ERROR, error.str(), lfbt);
+ this->Messenger->IssueMessage(MessageType::FATAL_ERROR, error.str(), lfbt);
return false;
}
@@ -279,10 +280,10 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
<< "Argument not separated from preceding token by whitespace.";
/* clang-format on */
if (isError) {
- this->Messenger->IssueMessage(cmake::FATAL_ERROR, m.str(), lfbt);
+ this->Messenger->IssueMessage(MessageType::FATAL_ERROR, m.str(), lfbt);
return false;
}
- this->Messenger->IssueMessage(cmake::AUTHOR_WARNING, m.str(), lfbt);
+ this->Messenger->IssueMessage(MessageType::AUTHOR_WARNING, m.str(), lfbt);
return true;
}
@@ -389,9 +390,8 @@ void cmListFileBacktrace::PrintTitle(std::ostream& out) const
}
cmListFileContext lfc = this->TopEntry->Context;
cmStateSnapshot bottom = this->GetBottom();
- cmOutputConverter converter(bottom);
if (!bottom.GetState()->GetIsInTryCompile()) {
- lfc.FilePath = converter.ConvertToRelativePath(
+ lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfNotContained(
bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
}
out << (lfc.Line ? " at " : " in ") << lfc;
@@ -408,7 +408,6 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
bool first = true;
cmStateSnapshot bottom = this->GetBottom();
- cmOutputConverter converter(bottom);
for (Entry const* cur = this->TopEntry->Parent.get(); !cur->IsBottom();
cur = cur->Parent.get()) {
if (cur->Context.Name.empty()) {
@@ -422,7 +421,7 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const
}
cmListFileContext lfc = cur->Context;
if (!bottom.GetState()->GetIsInTryCompile()) {
- lfc.FilePath = converter.ConvertToRelativePath(
+ lfc.FilePath = bottom.GetDirectory().ConvertToRelPathIfNotContained(
bottom.GetState()->GetSourceDirectory(), lfc.FilePath);
}
out << " " << lfc << "\n";
@@ -474,3 +473,21 @@ bool operator!=(const cmListFileContext& lhs, const cmListFileContext& rhs)
{
return !(lhs == rhs);
}
+
+std::ostream& operator<<(std::ostream& os, BT<std::string> const& s)
+{
+ return os << s.Value;
+}
+
+std::vector<BT<std::string>> ExpandListWithBacktrace(
+ std::string const& list, cmListFileBacktrace const& bt)
+{
+ std::vector<BT<std::string>> result;
+ std::vector<std::string> tmp;
+ cmSystemTools::ExpandListArgument(list, tmp);
+ result.reserve(tmp.size());
+ for (std::string& i : tmp) {
+ result.emplace_back(std::move(i), bt);
+ }
+ return result;
+}
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 3d3afdf9b..945741540 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -9,6 +9,7 @@
#include <memory> // IWYU pragma: keep
#include <stddef.h>
#include <string>
+#include <utility>
#include <vector>
#include "cmStateSnapshot.h"
@@ -28,15 +29,12 @@ struct cmCommandContext
{
std::string Lower;
std::string Original;
- cmCommandName() {}
+ cmCommandName() = default;
cmCommandName(std::string const& name) { *this = name; }
cmCommandName& operator=(std::string const& name);
} Name;
- long Line;
- cmCommandContext()
- : Line(0)
- {
- }
+ long Line = 0;
+ cmCommandContext() = default;
cmCommandContext(const char* name, int line)
: Name(name)
, Line(line)
@@ -52,14 +50,9 @@ struct cmListFileArgument
Quoted,
Bracket
};
- cmListFileArgument()
- : Value()
- , Delim(Unquoted)
- , Line(0)
- {
- }
- cmListFileArgument(const std::string& v, Delimiter d, long line)
- : Value(v)
+ cmListFileArgument() = default;
+ cmListFileArgument(std::string v, Delimiter d, long line)
+ : Value(std::move(v))
, Delim(d)
, Line(line)
{
@@ -70,8 +63,8 @@ struct cmListFileArgument
}
bool operator!=(const cmListFileArgument& r) const { return !(*this == r); }
std::string Value;
- Delimiter Delim;
- long Line;
+ Delimiter Delim = Unquoted;
+ long Line = 0;
};
class cmListFileContext
@@ -79,13 +72,7 @@ class cmListFileContext
public:
std::string Name;
std::string FilePath;
- long Line;
- cmListFileContext()
- : Name()
- , FilePath()
- , Line(0)
- {
- }
+ long Line = 0;
static cmListFileContext FromCommandContext(cmCommandContext const& lfcc,
std::string const& fileName)
@@ -122,15 +109,6 @@ public:
// indicated by the given valid snapshot.
cmListFileBacktrace(cmStateSnapshot const& snapshot);
- // Backtraces may be copied, moved, and assigned as values.
- cmListFileBacktrace(cmListFileBacktrace const&) = default;
- cmListFileBacktrace(cmListFileBacktrace&&) // NOLINT(clang-tidy)
- noexcept = default;
- cmListFileBacktrace& operator=(cmListFileBacktrace const&) = default;
- cmListFileBacktrace& operator=(cmListFileBacktrace&&) // NOLINT(clang-tidy)
- noexcept = default;
- ~cmListFileBacktrace() = default;
-
cmStateSnapshot GetBottom() const;
// Get a backtrace with the given file scope added to the top.
@@ -169,6 +147,38 @@ private:
cmListFileBacktrace(std::shared_ptr<Entry const> top);
};
+// Wrap type T as a value with a backtrace. For purposes of
+// ordering and equality comparison, only the original value is
+// used. The backtrace is considered incidental.
+template <typename T>
+class BT
+{
+public:
+ BT(T v = T(), cmListFileBacktrace bt = cmListFileBacktrace())
+ : Value(std::move(v))
+ , Backtrace(std::move(bt))
+ {
+ }
+ T Value;
+ cmListFileBacktrace Backtrace;
+ friend bool operator==(BT<T> const& l, BT<T> const& r)
+ {
+ return l.Value == r.Value;
+ }
+ friend bool operator<(BT<T> const& l, BT<T> const& r)
+ {
+ return l.Value < r.Value;
+ }
+ friend bool operator==(BT<T> const& l, T const& r) { return l.Value == r; }
+ friend bool operator==(T const& l, BT<T> const& r) { return l == r.Value; }
+};
+
+std::ostream& operator<<(std::ostream& os, BT<std::string> const& s);
+
+std::vector<BT<std::string>> ExpandListWithBacktrace(
+ std::string const& list,
+ cmListFileBacktrace const& bt = cmListFileBacktrace());
+
struct cmListFile
{
bool ParseFile(const char* path, cmMessenger* messenger,
diff --git a/Source/cmLocalCommonGenerator.cxx b/Source/cmLocalCommonGenerator.cxx
index 7ce2c828f..75ad2a658 100644
--- a/Source/cmLocalCommonGenerator.cxx
+++ b/Source/cmLocalCommonGenerator.cxx
@@ -12,10 +12,9 @@
class cmGlobalGenerator;
cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
- cmMakefile* mf,
- std::string const& wd)
+ cmMakefile* mf, std::string wd)
: cmLocalGenerator(gg, mf)
- , WorkingDirectory(wd)
+ , WorkingDirectory(std::move(wd))
{
// Store the configuration name that will be generated.
if (const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) {
@@ -27,9 +26,7 @@ cmLocalCommonGenerator::cmLocalCommonGenerator(cmGlobalGenerator* gg,
}
}
-cmLocalCommonGenerator::~cmLocalCommonGenerator()
-{
-}
+cmLocalCommonGenerator::~cmLocalCommonGenerator() = default;
std::string cmLocalCommonGenerator::GetTargetFortranFlags(
cmGeneratorTarget const* target, std::string const& config)
@@ -47,7 +44,7 @@ std::string cmLocalCommonGenerator::GetTargetFortranFlags(
target->GetFortranModuleDirectory(this->WorkingDirectory);
if (!mod_dir.empty()) {
mod_dir = this->ConvertToOutputFormat(
- this->ConvertToRelativePath(this->WorkingDirectory, mod_dir),
+ this->MaybeConvertToRelativePath(this->WorkingDirectory, mod_dir),
cmOutputConverter::SHELL);
} else {
mod_dir =
diff --git a/Source/cmLocalCommonGenerator.h b/Source/cmLocalCommonGenerator.h
index 7b8e6fe8a..abebbc2a7 100644
--- a/Source/cmLocalCommonGenerator.h
+++ b/Source/cmLocalCommonGenerator.h
@@ -22,7 +22,7 @@ class cmLocalCommonGenerator : public cmLocalGenerator
{
public:
cmLocalCommonGenerator(cmGlobalGenerator* gg, cmMakefile* mf,
- std::string const& wd);
+ std::string wd);
~cmLocalCommonGenerator() override;
std::string const& GetConfigName() { return this->ConfigName; }
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 70307252e..7e1523456 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -65,6 +65,7 @@ static const char* ruleReplaceVars[] = {
"CMAKE_CURRENT_BINARY_DIR",
"CMAKE_RANLIB",
"CMAKE_LINKER",
+ "CMAKE_MT",
"CMAKE_CUDA_HOST_COMPILER",
"CMAKE_CUDA_HOST_LINK_LAUNCHER",
"CMAKE_CL_SHOWINCLUDES_PREFIX"
@@ -164,7 +165,7 @@ cmLocalGenerator::~cmLocalGenerator()
cmDeleteAll(this->OwnedImportedGeneratorTargets);
}
-void cmLocalGenerator::IssueMessage(cmake::MessageType t,
+void cmLocalGenerator::IssueMessage(MessageType t,
std::string const& text) const
{
this->GetCMakeInstance()->IssueMessage(t, text, this->DirectoryBacktrace);
@@ -189,22 +190,23 @@ void cmLocalGenerator::ComputeObjectMaxPath()
w << "CMAKE_OBJECT_PATH_MAX is set to " << pmax
<< ", which is less than the minimum of 128. "
<< "The value will be ignored.";
- this->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
} else {
std::ostringstream w;
w << "CMAKE_OBJECT_PATH_MAX is set to \"" << plen
<< "\", which fails to parse as a positive integer. "
<< "The value will be ignored.";
- this->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
}
this->ObjectMaxPathViolations.clear();
}
-void cmLocalGenerator::MoveSystemIncludesToEnd(
- std::vector<std::string>& includeDirs, const std::string& config,
- const std::string& lang, const cmGeneratorTarget* target) const
+static void MoveSystemIncludesToEnd(std::vector<std::string>& includeDirs,
+ const std::string& config,
+ const std::string& lang,
+ const cmGeneratorTarget* target)
{
if (!target) {
return;
@@ -218,6 +220,24 @@ void cmLocalGenerator::MoveSystemIncludesToEnd(
});
}
+static void MoveSystemIncludesToEnd(std::vector<BT<std::string>>& includeDirs,
+ const std::string& config,
+ const std::string& lang,
+ const cmGeneratorTarget* target)
+{
+ if (!target) {
+ return;
+ }
+
+ std::stable_sort(includeDirs.begin(), includeDirs.end(),
+ [target, &config, &lang](BT<std::string> const& a,
+ BT<std::string> const& b) {
+ return !target->IsSystemIncludeDirectory(a.Value, config,
+ lang) &&
+ target->IsSystemIncludeDirectory(b.Value, config, lang);
+ });
+}
+
void cmLocalGenerator::TraceDependencies()
{
std::vector<std::string> configs;
@@ -296,7 +316,7 @@ void cmLocalGenerator::GenerateTestFiles()
for (cmStateSnapshot const& i : children) {
// TODO: Use add_subdirectory instead?
std::string outP = i.GetDirectory().GetCurrentBinary();
- outP = this->ConvertToRelativePath(parentBinDir, outP);
+ outP = this->MaybeConvertToRelativePath(parentBinDir, outP);
outP = cmOutputConverter::EscapeForCMake(outP);
fout << "subdirs(" << outP << ")" << std::endl;
}
@@ -517,31 +537,62 @@ void cmLocalGenerator::GenerateInstallRules()
}
// Ask each install generator to write its code.
+ cmPolicies::PolicyStatus status = this->GetPolicyStatus(cmPolicies::CMP0082);
std::vector<cmInstallGenerator*> const& installers =
this->Makefile->GetInstallGenerators();
- for (cmInstallGenerator* installer : installers) {
- installer->Generate(fout, config, configurationTypes);
+ bool haveSubdirectoryInstall = false;
+ bool haveInstallAfterSubdirectory = false;
+ if (status == cmPolicies::WARN) {
+ for (cmInstallGenerator* installer : installers) {
+ installer->CheckCMP0082(haveSubdirectoryInstall,
+ haveInstallAfterSubdirectory);
+ installer->Generate(fout, config, configurationTypes);
+ }
+ } else {
+ for (cmInstallGenerator* installer : installers) {
+ installer->Generate(fout, config, configurationTypes);
+ }
}
// Write rules from old-style specification stored in targets.
this->GenerateTargetInstallRules(fout, config, configurationTypes);
// Include install scripts from subdirectories.
- std::vector<cmStateSnapshot> children =
- this->Makefile->GetStateSnapshot().GetChildren();
- if (!children.empty()) {
- fout << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n";
- fout << " # Include the install script for each subdirectory.\n";
- for (cmStateSnapshot const& c : children) {
- if (!c.GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
- std::string odir = c.GetDirectory().GetCurrentBinary();
- cmSystemTools::ConvertToUnixSlashes(odir);
- fout << " include(\"" << odir << "/cmake_install.cmake\")"
- << std::endl;
+ switch (status) {
+ case cmPolicies::WARN:
+ if (haveInstallAfterSubdirectory &&
+ this->Makefile->PolicyOptionalWarningEnabled(
+ "CMAKE_POLICY_WARNING_CMP0082")) {
+ std::ostringstream e;
+ e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0082) << "\n";
+ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
- }
- fout << "\n";
- fout << "endif()\n\n";
+ CM_FALLTHROUGH;
+ case cmPolicies::OLD: {
+ std::vector<cmStateSnapshot> children =
+ this->Makefile->GetStateSnapshot().GetChildren();
+ if (!children.empty()) {
+ fout << "if(NOT CMAKE_INSTALL_LOCAL_ONLY)\n";
+ fout << " # Include the install script for each subdirectory.\n";
+ for (cmStateSnapshot const& c : children) {
+ if (!c.GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
+ std::string odir = c.GetDirectory().GetCurrentBinary();
+ cmSystemTools::ConvertToUnixSlashes(odir);
+ fout << " include(\"" << odir << "/cmake_install.cmake\")"
+ << std::endl;
+ }
+ }
+ fout << "\n";
+ fout << "endif()\n\n";
+ }
+ } break;
+
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ case cmPolicies::NEW:
+ // NEW behavior is handled in
+ // cmInstallSubdirectoryGenerator::GenerateScript()
+ break;
}
// Record the install manifest.
@@ -676,7 +727,7 @@ std::string cmLocalGenerator::GetIncludeFlags(
}
std::vector<std::string> includes = includeDirs;
- this->MoveSystemIncludesToEnd(includes, config, lang, target);
+ MoveSystemIncludesToEnd(includes, config, lang, target);
OutputFormat shellFormat = forResponseFile ? RESPONSE : SHELL;
std::ostringstream includeFlags;
@@ -756,33 +807,23 @@ std::string cmLocalGenerator::GetIncludeFlags(
}
std::string includePath =
this->ConvertToIncludeReference(i, shellFormat, forceFullPaths);
- if (quotePaths && !includePath.empty() && includePath[0] != '\"') {
+ if (quotePaths && !includePath.empty() && includePath.front() != '\"') {
includeFlags << "\"";
}
includeFlags << includePath;
- if (quotePaths && !includePath.empty() && includePath[0] != '\"') {
+ if (quotePaths && !includePath.empty() && includePath.front() != '\"') {
includeFlags << "\"";
}
includeFlags << sep;
}
std::string flags = includeFlags.str();
// remove trailing separators
- if ((sep[0] != ' ') && !flags.empty() && flags[flags.size() - 1] == sep[0]) {
- flags[flags.size() - 1] = ' ';
+ if ((sep[0] != ' ') && !flags.empty() && flags.back() == sep[0]) {
+ flags.back() = ' ';
}
return flags;
}
-void cmLocalGenerator::AddCompileDefinitions(std::set<std::string>& defines,
- cmGeneratorTarget const* target,
- const std::string& config,
- const std::string& lang) const
-{
- std::vector<std::string> targetDefines;
- target->GetCompileDefinitions(targetDefines, config, lang);
- this->AppendDefines(defines, targetDefines);
-}
-
void cmLocalGenerator::AddCompileOptions(std::string& flags,
cmGeneratorTarget* target,
const std::string& lang,
@@ -833,23 +874,34 @@ void cmLocalGenerator::AddCompileOptions(std::string& flags,
"on "
"and be depended on by the link implementation."
<< std::endl;
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
}
this->AddCompilerRequirementFlag(flags, target, lang);
}
-void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
- cmGeneratorTarget const* target,
- const std::string& lang,
- const std::string& config,
- bool stripImplicitDirs,
- bool appendAllImplicitDirs) const
+std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectoriesImplicit(
+ cmGeneratorTarget const* target, std::string const& lang,
+ std::string const& config, bool stripImplicitDirs,
+ bool appendAllImplicitDirs) const
{
+ std::vector<BT<std::string>> result;
// Do not repeat an include path.
std::set<std::string> emitted;
+ auto emitDir = [&result, &emitted](std::string const& dir) {
+ if (emitted.insert(dir).second) {
+ result.emplace_back(dir);
+ }
+ };
+
+ auto emitBT = [&result, &emitted](BT<std::string> const& dir) {
+ if (emitted.insert(dir.Value).second) {
+ result.emplace_back(dir);
+ }
+ };
+
// When automatic include directories are requested for a build then
// include the source and binary directories at the beginning of the
// include path to approximate include file behavior for an
@@ -859,58 +911,90 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
// per-source-file include paths.
if (this->Makefile->IsOn("CMAKE_INCLUDE_CURRENT_DIR")) {
// Current binary directory
- {
- std::string binDir =
- this->StateSnapshot.GetDirectory().GetCurrentBinary();
- if (emitted.insert(binDir).second) {
- dirs.push_back(std::move(binDir));
- }
- }
+ emitDir(this->StateSnapshot.GetDirectory().GetCurrentBinary());
// Current source directory
- {
- std::string srcDir =
- this->StateSnapshot.GetDirectory().GetCurrentSource();
- if (emitted.insert(srcDir).second) {
- dirs.push_back(std::move(srcDir));
- }
- }
+ emitDir(this->StateSnapshot.GetDirectory().GetCurrentSource());
}
if (!target) {
- return;
+ return result;
+ }
+
+ // Standard include directories to be added unconditionally at the end.
+ // These are intended to simulate additional implicit include directories.
+ std::vector<std::string> userStandardDirs;
+ {
+ std::string key = "CMAKE_";
+ key += lang;
+ key += "_STANDARD_INCLUDE_DIRECTORIES";
+ std::string const value = this->Makefile->GetSafeDefinition(key);
+ cmSystemTools::ExpandListArgument(value, userStandardDirs);
+ for (std::string& usd : userStandardDirs) {
+ cmSystemTools::ConvertToUnixSlashes(usd);
+ }
}
// Implicit include directories
std::vector<std::string> implicitDirs;
+ std::set<std::string> implicitSet;
+ // Include directories to be excluded as if they were implicit.
+ std::set<std::string> implicitExclude;
{
- std::string rootPath;
- if (const char* sysrootCompile =
- this->Makefile->GetDefinition("CMAKE_SYSROOT_COMPILE")) {
- rootPath = sysrootCompile;
- } else {
- rootPath = this->Makefile->GetSafeDefinition("CMAKE_SYSROOT");
- }
+ // Raw list of implicit include directories
+ // Start with "standard" directories that we unconditionally add below.
+ std::vector<std::string> impDirVec = userStandardDirs;
// Load implicit include directories for this language.
- std::string key = "CMAKE_";
- key += lang;
- key += "_IMPLICIT_INCLUDE_DIRECTORIES";
- if (const char* value = this->Makefile->GetDefinition(key)) {
- std::vector<std::string> impDirVec;
- cmSystemTools::ExpandListArgument(value, impDirVec);
- for (std::string const& i : impDirVec) {
- {
- std::string d = rootPath + i;
- cmSystemTools::ConvertToUnixSlashes(d);
- emitted.insert(std::move(d));
+ // We ignore this for Fortran because:
+ // * There are no standard library headers to avoid overriding.
+ // * Compilers like gfortran do not search their own implicit include
+ // directories for modules ('.mod' files).
+ if (lang != "Fortran") {
+ std::string key = "CMAKE_";
+ key += lang;
+ key += "_IMPLICIT_INCLUDE_DIRECTORIES";
+ if (const char* value = this->Makefile->GetDefinition(key)) {
+ size_t const impDirVecOldSize = impDirVec.size();
+ cmSystemTools::ExpandListArgument(value, impDirVec);
+ // FIXME: Use cmRange with 'advance()' when it supports non-const.
+ for (size_t i = impDirVecOldSize; i < impDirVec.size(); ++i) {
+ cmSystemTools::ConvertToUnixSlashes(impDirVec[i]);
}
- implicitDirs.push_back(i);
+ }
+ }
+
+ // The Platform/UnixPaths module used to hard-code /usr/include for C, CXX,
+ // and CUDA in CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES, but those
+ // variables are now computed. On macOS the /usr/include directory is
+ // inside the platform SDK so the computed value does not contain it
+ // directly. In this case adding -I/usr/include can hide SDK headers so we
+ // must still exclude it.
+ if ((lang == "C" || lang == "CXX" || lang == "CUDA") &&
+ std::find(impDirVec.begin(), impDirVec.end(), "/usr/include") ==
+ impDirVec.end() &&
+ std::find_if(impDirVec.begin(), impDirVec.end(),
+ [](std::string const& d) {
+ return cmHasLiteralSuffix(d, "/usr/include");
+ }) != impDirVec.end()) {
+ // Only exclude this hard coded path for backwards compatibility.
+ implicitExclude.emplace("/usr/include");
+ }
+
+ for (std::string const& i : impDirVec) {
+ if (implicitSet.insert(i).second) {
+ implicitDirs.emplace_back(i);
}
}
}
+ // Checks if this is not an excluded (implicit) include directory.
+ auto notExcluded = [&implicitSet, &implicitExclude](std::string const& dir) {
+ return ((implicitSet.find(dir) == implicitSet.end()) &&
+ (implicitExclude.find(dir) == implicitExclude.end()));
+ };
+
// Get the target-specific include directories.
- std::vector<std::string> userDirs =
+ std::vector<BT<std::string>> userDirs =
target->GetIncludeDirectories(config, lang);
// Support putting all the in-project include directories first if
@@ -918,63 +1002,82 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
if (this->Makefile->IsOn("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE")) {
std::string const &topSourceDir = this->GetState()->GetSourceDirectory(),
&topBinaryDir = this->GetState()->GetBinaryDirectory();
- for (std::string const& i : userDirs) {
+ for (BT<std::string> const& udr : userDirs) {
// Emit this directory only if it is a subdirectory of the
// top-level source or binary tree.
- if (cmSystemTools::ComparePath(i, topSourceDir) ||
- cmSystemTools::ComparePath(i, topBinaryDir) ||
- cmSystemTools::IsSubDirectory(i, topSourceDir) ||
- cmSystemTools::IsSubDirectory(i, topBinaryDir)) {
- if (emitted.insert(i).second) {
- dirs.push_back(i);
+ if (cmSystemTools::ComparePath(udr.Value, topSourceDir) ||
+ cmSystemTools::ComparePath(udr.Value, topBinaryDir) ||
+ cmSystemTools::IsSubDirectory(udr.Value, topSourceDir) ||
+ cmSystemTools::IsSubDirectory(udr.Value, topBinaryDir)) {
+ if (notExcluded(udr.Value)) {
+ emitBT(udr);
}
}
}
}
- // Construct the final ordered include directory list.
- for (std::string const& i : userDirs) {
- if (emitted.insert(i).second) {
- dirs.push_back(i);
+ // Emit remaining non implicit user direcories.
+ for (BT<std::string> const& udr : userDirs) {
+ if (notExcluded(udr.Value)) {
+ emitBT(udr);
}
}
- this->MoveSystemIncludesToEnd(dirs, config, lang, target);
+ // Sort result
+ MoveSystemIncludesToEnd(result, config, lang, target);
- // Add standard include directories for this language.
- {
- std::vector<std::string>::size_type const before = userDirs.size();
- {
- std::string key = "CMAKE_";
- key += lang;
- key += "_STANDARD_INCLUDE_DIRECTORIES";
- std::string const value = this->Makefile->GetSafeDefinition(key);
- cmSystemTools::ExpandListArgument(value, userDirs);
- }
- for (std::vector<std::string>::iterator i = userDirs.begin() + before,
- ie = userDirs.end();
- i != ie; ++i) {
- cmSystemTools::ConvertToUnixSlashes(*i);
- dirs.push_back(*i);
- }
+ // Append standard include directories for this language.
+ userDirs.reserve(userDirs.size() + userStandardDirs.size());
+ for (std::string& usd : userStandardDirs) {
+ emitDir(usd);
+ userDirs.emplace_back(std::move(usd));
}
+ // Append compiler implicit include directories
if (!stripImplicitDirs) {
- // Append only implicit directories that were requested by the user
- for (std::string const& i : implicitDirs) {
- if (std::find(userDirs.begin(), userDirs.end(), i) != userDirs.end()) {
- dirs.push_back(i);
+ // Append implicit directories that were requested by the user only
+ for (BT<std::string> const& udr : userDirs) {
+ if (implicitSet.find(udr.Value) != implicitSet.end()) {
+ emitBT(udr);
}
}
- // Append remaining implicit directories on demand
+ // Append remaining implicit directories (on demand)
if (appendAllImplicitDirs) {
- for (std::string const& i : implicitDirs) {
- if (std::find(dirs.begin(), dirs.end(), i) == dirs.end()) {
- dirs.push_back(i);
- }
+ for (std::string& imd : implicitDirs) {
+ emitDir(imd);
}
}
}
+
+ return result;
+}
+
+void cmLocalGenerator::GetIncludeDirectoriesImplicit(
+ std::vector<std::string>& dirs, cmGeneratorTarget const* target,
+ const std::string& lang, const std::string& config, bool stripImplicitDirs,
+ bool appendAllImplicitDirs) const
+{
+ std::vector<BT<std::string>> tmp = this->GetIncludeDirectoriesImplicit(
+ target, lang, config, stripImplicitDirs, appendAllImplicitDirs);
+ dirs.reserve(dirs.size() + tmp.size());
+ for (BT<std::string>& v : tmp) {
+ dirs.emplace_back(std::move(v.Value));
+ }
+}
+
+std::vector<BT<std::string>> cmLocalGenerator::GetIncludeDirectories(
+ cmGeneratorTarget const* target, std::string const& lang,
+ std::string const& config) const
+{
+ return this->GetIncludeDirectoriesImplicit(target, lang, config);
+}
+
+void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
+ cmGeneratorTarget const* target,
+ const std::string& lang,
+ const std::string& config) const
+{
+ this->GetIncludeDirectoriesImplicit(dirs, target, lang, config);
}
void cmLocalGenerator::GetStaticLibraryFlags(std::string& flags,
@@ -1143,6 +1246,8 @@ void cmLocalGenerator::GetTargetFlags(
break;
}
+ this->AppendPositionIndependentLinkerFlags(linkFlags, target, config,
+ linkLanguage);
this->AppendIPOLinkerFlags(linkFlags, target, config, linkLanguage);
}
@@ -1231,13 +1336,29 @@ void cmLocalGenerator::GetTargetDefines(cmGeneratorTarget const* target,
std::string const& lang,
std::set<std::string>& defines) const
{
+ std::set<BT<std::string>> tmp = this->GetTargetDefines(target, config, lang);
+ for (BT<std::string> const& v : tmp) {
+ defines.emplace(v.Value);
+ }
+}
+
+std::set<BT<std::string>> cmLocalGenerator::GetTargetDefines(
+ cmGeneratorTarget const* target, std::string const& config,
+ std::string const& lang) const
+{
+ std::set<BT<std::string>> defines;
+
// Add the export symbol definition for shared library objects.
- if (const char* exportMacro = target->GetExportMacro()) {
- this->AppendDefines(defines, exportMacro);
+ if (const std::string* exportMacro = target->GetExportMacro()) {
+ this->AppendDefines(defines, *exportMacro);
}
// Add preprocessor definitions for this target and configuration.
- this->AddCompileDefinitions(defines, target, config, lang);
+ std::vector<BT<std::string>> targetDefines =
+ target->GetCompileDefinitions(config, lang);
+ this->AppendDefines(defines, targetDefines);
+
+ return defines;
}
std::string cmLocalGenerator::GetTargetFortranFlags(
@@ -1311,7 +1432,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
"additional flags may be added to export symbols on all "
"executables regardless of their ENABLE_EXPORTS property.";
/* clang-format on */
- this->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
CM_FALLTHROUGH;
case cmPolicies::OLD:
@@ -1321,7 +1442,7 @@ std::string cmLocalGenerator::GetLinkLibsCMP0065(
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0065));
CM_FALLTHROUGH;
case cmPolicies::NEW:
@@ -1594,7 +1715,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
<< (ext ? "(with compiler extensions)" : "")
<< ", but CMake "
"does not know the compile flags to use to enable it.";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
} else {
std::vector<std::string> optVec;
cmSystemTools::ExpandListArgument(opt, optVec);
@@ -1608,19 +1729,19 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
static std::map<std::string, std::vector<std::string>> langStdMap;
if (langStdMap.empty()) {
// Maintain sorted order, most recent first.
- langStdMap["CXX"].push_back("20");
- langStdMap["CXX"].push_back("17");
- langStdMap["CXX"].push_back("14");
- langStdMap["CXX"].push_back("11");
- langStdMap["CXX"].push_back("98");
+ langStdMap["CXX"].emplace_back("20");
+ langStdMap["CXX"].emplace_back("17");
+ langStdMap["CXX"].emplace_back("14");
+ langStdMap["CXX"].emplace_back("11");
+ langStdMap["CXX"].emplace_back("98");
- langStdMap["C"].push_back("11");
- langStdMap["C"].push_back("99");
- langStdMap["C"].push_back("90");
+ langStdMap["C"].emplace_back("11");
+ langStdMap["C"].emplace_back("99");
+ langStdMap["C"].emplace_back("90");
- langStdMap["CUDA"].push_back("14");
- langStdMap["CUDA"].push_back("11");
- langStdMap["CUDA"].push_back("98");
+ langStdMap["CUDA"].emplace_back("14");
+ langStdMap["CUDA"].emplace_back("11");
+ langStdMap["CUDA"].emplace_back("98");
}
std::string standard(standardProp);
@@ -1633,7 +1754,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
std::string e =
lang + "_STANDARD is set to invalid value '" + standard + "'";
this->GetGlobalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR, e, target->GetBacktrace());
+ MessageType::FATAL_ERROR, e, target->GetBacktrace());
return;
}
@@ -1643,7 +1764,7 @@ void cmLocalGenerator::AddCompilerRequirementFlag(
std::string e = "CMAKE_" + lang +
"_STANDARD_DEFAULT is set to invalid value '" + std::string(defaultStd) +
"'";
- this->IssueMessage(cmake::INTERNAL_ERROR, e);
+ this->IssueMessage(MessageType::INTERNAL_ERROR, e);
return;
}
@@ -1710,7 +1831,7 @@ static void AddVisibilityCompileOption(std::string& flags,
std::ostringstream e;
e << "Target " << target->GetName() << " uses unsupported value \"" << prop
<< "\" for " << flagDefine << ".";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return;
}
std::string option = std::string(opt) + prop;
@@ -1781,7 +1902,7 @@ void cmLocalGenerator::AddVisibilityPresetFlags(
"For compatibility CMake is not honoring them for this target.";
/* clang-format on */
target->GetLocalGenerator()->GetCMakeInstance()->IssueMessage(
- cmake::AUTHOR_WARNING, w.str(), target->GetBacktrace());
+ MessageType::AUTHOR_WARNING, w.str(), target->GetBacktrace());
}
}
@@ -1840,7 +1961,7 @@ bool cmLocalGenerator::GetShouldUseOldFlags(bool shared,
<< flagsVar << " was removed.\n"
<< cmPolicies::GetPolicyWarning(cmPolicies::CMP0018);
- this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
CM_FALLTHROUGH;
}
case cmPolicies::OLD:
@@ -1953,6 +2074,42 @@ void cmLocalGenerator::AppendIPOLinkerFlags(std::string& flags,
}
}
+void cmLocalGenerator::AppendPositionIndependentLinkerFlags(
+ std::string& flags, cmGeneratorTarget* target, const std::string& config,
+ const std::string& lang)
+{
+ // For now, only EXECUTABLE is concerned
+ if (target->GetType() != cmStateEnums::EXECUTABLE) {
+ return;
+ }
+
+ const char* PICValue = target->GetLinkPIEProperty(config);
+ if (PICValue == nullptr) {
+ // POSITION_INDEPENDENT_CODE is not set
+ return;
+ }
+
+ const std::string mode = cmSystemTools::IsOn(PICValue) ? "PIE" : "NO_PIE";
+
+ std::string supported = "CMAKE_" + lang + "_LINK_" + mode + "_SUPPORTED";
+ if (cmSystemTools::IsOff(this->Makefile->GetDefinition(supported))) {
+ return;
+ }
+
+ std::string name = "CMAKE_" + lang + "_LINK_OPTIONS_" + mode;
+
+ auto pieFlags = this->Makefile->GetSafeDefinition(name);
+ if (pieFlags.empty()) {
+ return;
+ }
+
+ std::vector<std::string> flagsList;
+ cmSystemTools::ExpandListArgument(pieFlags, flagsList);
+ for (const auto& flag : flagsList) {
+ this->AppendFlagEscape(flags, flag);
+ }
+}
+
void cmLocalGenerator::AppendCompileOptions(std::string& options,
const char* options_list,
const char* regex) const
@@ -2018,7 +2175,7 @@ void cmLocalGenerator::AppendIncludeDirectories(
<< sourceFile.GetLocation().GetName() << "\":\n \"" << include
<< "\"\n";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -2035,26 +2192,34 @@ void cmLocalGenerator::AppendIncludeDirectories(
}
void cmLocalGenerator::AppendDefines(std::set<std::string>& defines,
- const char* defines_list) const
+ std::string const& defines_list) const
+{
+ std::set<BT<std::string>> tmp;
+ this->AppendDefines(tmp, ExpandListWithBacktrace(defines_list));
+ for (BT<std::string> const& i : tmp) {
+ defines.emplace(i.Value);
+ }
+}
+
+void cmLocalGenerator::AppendDefines(std::set<BT<std::string>>& defines,
+ std::string const& defines_list) const
{
// Short-circuit if there are no definitions.
- if (!defines_list) {
+ if (defines_list.empty()) {
return;
}
// Expand the list of definitions.
- std::vector<std::string> defines_vec;
- cmSystemTools::ExpandListArgument(defines_list, defines_vec);
- this->AppendDefines(defines, defines_vec);
+ this->AppendDefines(defines, ExpandListWithBacktrace(defines_list));
}
void cmLocalGenerator::AppendDefines(
- std::set<std::string>& defines,
- const std::vector<std::string>& defines_vec) const
+ std::set<BT<std::string>>& defines,
+ const std::vector<BT<std::string>>& defines_vec) const
{
- for (std::string const& d : defines_vec) {
+ for (BT<std::string> const& d : defines_vec) {
// Skip unsupported definitions.
- if (!this->CheckDefinition(d)) {
+ if (!this->CheckDefinition(d.Value)) {
continue;
}
defines.insert(d);
@@ -2174,7 +2339,7 @@ std::string cmLocalGenerator::ConstructComment(
std::string currentBinaryDir = this->GetCurrentBinaryDirectory();
for (std::string const& o : ccg.GetOutputs()) {
comment += sep;
- comment += this->ConvertToRelativePath(currentBinaryDir, o);
+ comment += this->MaybeConvertToRelativePath(currentBinaryDir, o);
sep = ", ";
}
return comment;
@@ -2380,7 +2545,7 @@ std::string& cmLocalGenerator::CreateSafeUniqueObjectFileName(
<< "cannot be safely placed under this directory. "
<< "The build may not work correctly.";
/* clang-format on */
- this->IssueMessage(cmake::WARNING, m.str());
+ this->IssueMessage(MessageType::WARNING, m.str());
}
}
#else
@@ -2431,15 +2596,15 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
std::string const& fullPath = source.GetFullPath();
// Try referencing the source relative to the source tree.
- std::string relFromSource =
- this->ConvertToRelativePath(this->GetCurrentSourceDirectory(), fullPath);
+ std::string relFromSource = this->MaybeConvertToRelativePath(
+ this->GetCurrentSourceDirectory(), fullPath);
assert(!relFromSource.empty());
bool relSource = !cmSystemTools::FileIsFullPath(relFromSource);
bool subSource = relSource && relFromSource[0] != '.';
// Try referencing the source relative to the binary tree.
- std::string relFromBinary =
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), fullPath);
+ std::string relFromBinary = this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), fullPath);
assert(!relFromBinary.empty());
bool relBinary = !cmSystemTools::FileIsFullPath(relFromBinary);
bool subBinary = relBinary && relFromBinary[0] != '.';
@@ -2538,6 +2703,13 @@ std::string const& cmLocalGenerator::GetCurrentSourceDirectory() const
return this->StateSnapshot.GetDirectory().GetCurrentSource();
}
+std::string cmLocalGenerator::MaybeConvertToRelativePath(
+ std::string const& local_path, std::string const& remote_path) const
+{
+ return this->StateSnapshot.GetDirectory().ConvertToRelPathIfNotContained(
+ local_path, remote_path);
+}
+
std::string cmLocalGenerator::GetTargetDirectory(
const cmGeneratorTarget* /*unused*/) const
{
@@ -2624,7 +2796,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
<< "CMake is dropping a preprocessor definition: " << define << "\n"
<< "Consider defining the macro in a (configured) header file.\n";
/* clang-format on */
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
return false;
}
}
@@ -2639,7 +2811,7 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
<< "CMake is dropping a preprocessor definition: " << define << "\n"
<< "Consider defining the macro in a (configured) header file.\n";
/* clang-format on */
- cmSystemTools::Message(e.str().c_str());
+ cmSystemTools::Message(e.str());
return false;
}
@@ -2663,7 +2835,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target,
const char* in = target->GetProperty("MACOSX_BUNDLE_INFO_PLIST");
std::string inFile = (in && *in) ? in : "MacOSXBundleInfo.plist.in";
if (!cmSystemTools::FileIsFullPath(inFile)) {
- std::string inMod = this->Makefile->GetModulesFile(inFile.c_str());
+ std::string inMod = this->Makefile->GetModulesFile(inFile);
if (!inMod.empty()) {
inFile = inMod;
}
@@ -2672,7 +2844,7 @@ void cmLocalGenerator::GenerateAppleInfoPList(cmGeneratorTarget* target,
std::ostringstream e;
e << "Target " << target->GetName() << " Info.plist template \"" << inFile
<< "\" could not be found.";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return;
}
@@ -2701,7 +2873,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(
const char* in = target->GetProperty("MACOSX_FRAMEWORK_INFO_PLIST");
std::string inFile = (in && *in) ? in : "MacOSXFrameworkInfo.plist.in";
if (!cmSystemTools::FileIsFullPath(inFile)) {
- std::string inMod = this->Makefile->GetModulesFile(inFile.c_str());
+ std::string inMod = this->Makefile->GetModulesFile(inFile);
if (!inMod.empty()) {
inFile = inMod;
}
@@ -2710,7 +2882,7 @@ void cmLocalGenerator::GenerateFrameworkInfoPList(
std::ostringstream e;
e << "Target " << target->GetName() << " Info.plist template \"" << inFile
<< "\" could not be found.";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return;
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 58b776225..f9839f6c1 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -14,10 +14,10 @@
#include <vector>
#include "cmListFileCache.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmStateSnapshot.h"
-#include "cmake.h"
class cmComputeLinkInformation;
class cmCustomCommandGenerator;
@@ -28,6 +28,7 @@ class cmMakefile;
class cmRulePlaceholderExpander;
class cmSourceFile;
class cmState;
+class cmake;
/** \class cmLocalGenerator
* \brief Create required build files for a directory.
@@ -126,6 +127,10 @@ public:
void AppendIPOLinkerFlags(std::string& flags, cmGeneratorTarget* target,
const std::string& config,
const std::string& lang);
+ void AppendPositionIndependentLinkerFlags(std::string& flags,
+ cmGeneratorTarget* target,
+ const std::string& config,
+ const std::string& lang);
///! Get the include flags for the current makefile and language
std::string GetIncludeFlags(const std::vector<std::string>& includes,
cmGeneratorTarget* target,
@@ -169,14 +174,11 @@ public:
* command line.
*/
void AppendDefines(std::set<std::string>& defines,
- const char* defines_list) const;
- void AppendDefines(std::set<std::string>& defines,
- std::string const& defines_list) const
- {
- this->AppendDefines(defines, defines_list.c_str());
- }
- void AppendDefines(std::set<std::string>& defines,
- const std::vector<std::string>& defines_vec) const;
+ std::string const& defines_list) const;
+ void AppendDefines(std::set<BT<std::string>>& defines,
+ std::string const& defines_list) const;
+ void AppendDefines(std::set<BT<std::string>>& defines,
+ const std::vector<BT<std::string>>& defines_vec) const;
/**
* Encode a list of compile options for the compiler
@@ -231,30 +233,54 @@ public:
virtual void ClearDependencies(cmMakefile* /* mf */, bool /* verbose */) {}
/** Called from command-line hook to update dependencies. */
- virtual bool UpdateDependencies(const char* /* tgtInfo */, bool /*verbose*/,
- bool /*color*/)
+ virtual bool UpdateDependencies(const std::string& /* tgtInfo */,
+ bool /*verbose*/, bool /*color*/)
{
return true;
}
- /** @brief Get the include directories for the current makefile and language.
+ /** @brief Get the include directories for the current makefile and language
+ * and optional the compiler implicit include directories.
+ *
* @arg stripImplicitDirs Strip all directories found in
* CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES from the result.
* @arg appendAllImplicitDirs Append all directories found in
* CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES to the result.
*/
+ std::vector<BT<std::string>> GetIncludeDirectoriesImplicit(
+ cmGeneratorTarget const* target, std::string const& lang = "C",
+ std::string const& config = "", bool stripImplicitDirs = true,
+ bool appendAllImplicitDirs = false) const;
+
+ /** @brief Get the include directories for the current makefile and language
+ * and optional the compiler implicit include directories.
+ *
+ * @arg dirs Directories are appended to this list
+ */
+ void GetIncludeDirectoriesImplicit(std::vector<std::string>& dirs,
+ cmGeneratorTarget const* target,
+ const std::string& lang = "C",
+ const std::string& config = "",
+ bool stripImplicitDirs = true,
+ bool appendAllImplicitDirs = false) const;
+
+ /** @brief Get the include directories for the current makefile and language.
+ * @arg dirs Include directories are appended to this list
+ */
void GetIncludeDirectories(std::vector<std::string>& dirs,
cmGeneratorTarget const* target,
const std::string& lang = "C",
- const std::string& config = "",
- bool stripImplicitDirs = true,
- bool appendAllImplicitDirs = false) const;
+ const std::string& config = "") const;
+
+ /** @brief Get the include directories for the current makefile and language.
+ * @return The include directory list
+ */
+ std::vector<BT<std::string>> GetIncludeDirectories(
+ cmGeneratorTarget const* target, std::string const& lang = "C",
+ std::string const& config = "") const;
+
void AddCompileOptions(std::string& flags, cmGeneratorTarget* target,
const std::string& lang, const std::string& config);
- void AddCompileDefinitions(std::set<std::string>& defines,
- cmGeneratorTarget const* target,
- const std::string& config,
- const std::string& lang) const;
std::string GetProjectName() const;
@@ -300,6 +326,16 @@ public:
std::string const& GetCurrentSourceDirectory() const;
/**
+ * Convert the given remote path to a relative path with respect to
+ * the given local path. Both paths must use forward slashes and not
+ * already be escaped or quoted.
+ * The conversion is skipped if the paths are not both in the source
+ * or both in the binary tree.
+ */
+ std::string MaybeConvertToRelativePath(std::string const& local_path,
+ std::string const& remote_path) const;
+
+ /**
* Generate a macOS application bundle Info.plist file.
*/
void GenerateAppleInfoPList(cmGeneratorTarget* target,
@@ -336,6 +372,9 @@ public:
void GetTargetDefines(cmGeneratorTarget const* target,
std::string const& config, std::string const& lang,
std::set<std::string>& defines) const;
+ std::set<BT<std::string>> GetTargetDefines(cmGeneratorTarget const* target,
+ std::string const& config,
+ std::string const& lang) const;
void GetTargetCompileFlags(cmGeneratorTarget* target,
std::string const& config,
std::string const& lang, std::string& flags);
@@ -355,7 +394,7 @@ public:
bool IsMinGWMake() const;
bool IsNMake() const;
- void IssueMessage(cmake::MessageType t, std::string const& text) const;
+ void IssueMessage(MessageType t, std::string const& text) const;
void CreateEvaluationFileOutputs(const std::string& config);
void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
@@ -418,10 +457,6 @@ private:
int targetType);
void ComputeObjectMaxPath();
- void MoveSystemIncludesToEnd(std::vector<std::string>& includeDirs,
- const std::string& config,
- const std::string& lang,
- cmGeneratorTarget const* target) const;
};
#if defined(CMAKE_BUILD_WITH_CMAKE)
diff --git a/Source/cmLocalGhsMultiGenerator.cxx b/Source/cmLocalGhsMultiGenerator.cxx
index ab6774e00..125e8b530 100644
--- a/Source/cmLocalGhsMultiGenerator.cxx
+++ b/Source/cmLocalGhsMultiGenerator.cxx
@@ -7,6 +7,7 @@
#include "cmGhsMultiTargetGenerator.h"
#include "cmGlobalGhsMultiGenerator.h"
#include "cmMakefile.h"
+#include "cmSourceFile.h"
cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator(cmGlobalGenerator* gg,
cmMakefile* mf)
@@ -18,16 +19,82 @@ cmLocalGhsMultiGenerator::~cmLocalGhsMultiGenerator()
{
}
+std::string cmLocalGhsMultiGenerator::GetTargetDirectory(
+ cmGeneratorTarget const* target) const
+{
+ std::string dir;
+ dir += target->GetName();
+ dir += ".dir";
+ return dir;
+}
+
+void cmLocalGhsMultiGenerator::GenerateTargetsDepthFirst(
+ cmGeneratorTarget* target, std::vector<cmGeneratorTarget*>& remaining)
+{
+ if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ return;
+ }
+ // Find this target in the list of remaining targets.
+ auto it = std::find(remaining.begin(), remaining.end(), target);
+ if (it == remaining.end()) {
+ // This target was already handled.
+ return;
+ }
+ // Remove this target from the list of remaining targets because
+ // we are handling it now.
+ *it = nullptr;
+
+ cmGhsMultiTargetGenerator tg(target);
+ tg.Generate();
+}
+
void cmLocalGhsMultiGenerator::Generate()
{
- const std::vector<cmGeneratorTarget*>& tgts = this->GetGeneratorTargets();
+ std::vector<cmGeneratorTarget*> remaining = this->GetGeneratorTargets();
+ for (auto& t : remaining) {
+ if (t) {
+ GenerateTargetsDepthFirst(t, remaining);
+ }
+ }
+}
+
+void cmLocalGhsMultiGenerator::ComputeObjectFilenames(
+ std::map<cmSourceFile const*, std::string>& mapping,
+ cmGeneratorTarget const* gt)
+{
+ std::string dir_max;
+ dir_max += this->GetCurrentBinaryDirectory();
+ dir_max += "/";
+ dir_max += this->GetTargetDirectory(gt);
+ dir_max += "/";
+
+ // Count the number of object files with each name. Note that
+ // filesystem may not be case sensitive.
+ std::map<std::string, int> counts;
+
+ for (auto const& si : mapping) {
+ cmSourceFile const* sf = si.first;
+ std::string objectNameLower = cmSystemTools::LowerCase(
+ cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()));
+ objectNameLower += this->GlobalGenerator->GetLanguageOutputExtension(*sf);
+ counts[objectNameLower] += 1;
+ }
+
+ // For all source files producing duplicate names we need unique
+ // object name computation.
+ for (auto& si : mapping) {
+ cmSourceFile const* sf = si.first;
+ std::string objectName =
+ cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
+ objectName += this->GlobalGenerator->GetLanguageOutputExtension(*sf);
- for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
- l != tgts.end(); ++l) {
- if ((*l)->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
- continue;
+ if (counts[cmSystemTools::LowerCase(objectName)] > 1) {
+ const_cast<cmGeneratorTarget*>(gt)->AddExplicitObjectName(sf);
+ bool keptSourceExtension;
+ objectName = this->GetObjectFileNameWithoutTarget(*sf, dir_max,
+ &keptSourceExtension);
+ cmsys::SystemTools::ReplaceString(objectName, "/", "_");
}
- cmGhsMultiTargetGenerator tg(*l);
- tg.Generate();
+ si.second = objectName;
}
}
diff --git a/Source/cmLocalGhsMultiGenerator.h b/Source/cmLocalGhsMultiGenerator.h
index aa842d74b..d5bec4200 100644
--- a/Source/cmLocalGhsMultiGenerator.h
+++ b/Source/cmLocalGhsMultiGenerator.h
@@ -24,6 +24,17 @@ public:
* Generate the makefile for this directory.
*/
virtual void Generate();
+
+ std::string GetTargetDirectory(
+ cmGeneratorTarget const* target) const override;
+
+ void ComputeObjectFilenames(
+ std::map<cmSourceFile const*, std::string>& mapping,
+ cmGeneratorTarget const* gt = nullptr) override;
+
+private:
+ void GenerateTargetsDepthFirst(cmGeneratorTarget* target,
+ std::vector<cmGeneratorTarget*>& remaining);
};
#endif
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index eb3147880..c0afc2542 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -17,6 +17,7 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmGlobalNinjaGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmNinjaTargetGenerator.h"
#include "cmRulePlaceholderExpander.h"
@@ -40,21 +41,18 @@ cmRulePlaceholderExpander*
cmLocalNinjaGenerator::CreateRulePlaceholderExpander() const
{
cmRulePlaceholderExpander* ret =
- new cmRulePlaceholderExpander(this->Compilers, this->VariableMappings,
- this->CompilerSysroot, this->LinkerSysroot);
+ this->cmLocalGenerator::CreateRulePlaceholderExpander();
ret->SetTargetImpLib("$TARGET_IMPLIB");
return ret;
}
-cmLocalNinjaGenerator::~cmLocalNinjaGenerator()
-{
-}
+cmLocalNinjaGenerator::~cmLocalNinjaGenerator() = default;
void cmLocalNinjaGenerator::Generate()
{
// Compute the path to use when referencing the current output
// directory from the top output directory.
- this->HomeRelativeOutputPath = this->ConvertToRelativePath(
+ this->HomeRelativeOutputPath = this->MaybeConvertToRelativePath(
this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory());
if (this->HomeRelativeOutputPath == ".") {
this->HomeRelativeOutputPath.clear();
@@ -90,9 +88,7 @@ void cmLocalNinjaGenerator::Generate()
if (tg) {
tg->Generate();
// Add the target to "all" if required.
- if (!this->GetGlobalNinjaGenerator()->IsExcluded(
- this->GetGlobalNinjaGenerator()->GetLocalGenerators()[0],
- target)) {
+ if (!this->GetGlobalNinjaGenerator()->IsExcluded(target)) {
this->GetGlobalNinjaGenerator()->AddDependencyToAll(target);
}
delete tg;
@@ -106,7 +102,7 @@ void cmLocalNinjaGenerator::Generate()
std::string cmLocalNinjaGenerator::GetTargetDirectory(
cmGeneratorTarget const* target) const
{
- std::string dir = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string dir = "CMakeFiles/";
dir += target->GetName();
#if defined(__VMS)
dir += "_dir";
@@ -141,7 +137,8 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference(
format);
}
return this->ConvertToOutputFormat(
- this->ConvertToRelativePath(this->GetBinaryDirectory(), path), format);
+ this->MaybeConvertToRelativePath(this->GetBinaryDirectory(), path),
+ format);
}
// Private methods.
@@ -188,13 +185,12 @@ void cmLocalNinjaGenerator::WriteProjectHeader(std::ostream& os)
void cmLocalNinjaGenerator::WriteNinjaRequiredVersion(std::ostream& os)
{
// Default required version
- std::string requiredVersion =
- this->GetGlobalNinjaGenerator()->RequiredNinjaVersion();
+ std::string requiredVersion = cmGlobalNinjaGenerator::RequiredNinjaVersion();
// Ninja generator uses the 'console' pool if available (>= 1.5)
if (this->GetGlobalNinjaGenerator()->SupportsConsolePool()) {
requiredVersion =
- this->GetGlobalNinjaGenerator()->RequiredNinjaVersionForConsolePool();
+ cmGlobalNinjaGenerator::RequiredNinjaVersionForConsolePool();
}
// The Ninja generator writes rules which require support for restat
@@ -204,7 +200,7 @@ void cmLocalNinjaGenerator::WriteNinjaRequiredVersion(std::ostream& os)
!this->GetGlobalNinjaGenerator()->GlobalSettingIsOn(
"CMAKE_SUPPRESS_REGENERATION")) {
requiredVersion =
- this->GetGlobalNinjaGenerator()->RequiredNinjaVersionForManifestRestat();
+ cmGlobalNinjaGenerator::RequiredNinjaVersionForManifestRestat();
}
cmGlobalNinjaGenerator::WriteComment(
@@ -306,7 +302,7 @@ std::string cmLocalNinjaGenerator::WriteCommandScript(
scriptPath = target->GetSupportDirectory();
} else {
scriptPath = this->GetCurrentBinaryDirectory();
- scriptPath += cmake::GetCMakeFilesDirectory();
+ scriptPath += "/CMakeFiles";
}
cmSystemTools::MakeDirectory(scriptPath);
scriptPath += '/';
@@ -319,7 +315,10 @@ std::string cmLocalNinjaGenerator::WriteCommandScript(
cmsys::ofstream script(scriptPath.c_str());
-#ifndef _WIN32
+#ifdef _WIN32
+ script << "@echo off\n";
+ int line = 1;
+#else
script << "set -e\n\n";
#endif
@@ -330,12 +329,22 @@ std::string cmLocalNinjaGenerator::WriteCommandScript(
// for the raw shell script.
cmSystemTools::ReplaceString(cmd, "$$", "$");
#ifdef _WIN32
- script << cmd << " || exit /b" << '\n';
+ script << cmd << " || (set FAIL_LINE=" << ++line << "& goto :ABORT)"
+ << '\n';
#else
script << cmd << '\n';
#endif
}
+#ifdef _WIN32
+ script << "goto :EOF\n\n"
+ ":ABORT\n"
+ "set ERROR_CODE=%ERRORLEVEL%\n"
+ "echo Batch file failed at line %FAIL_LINE% "
+ "with errorcode %ERRORLEVEL%\n"
+ "exit /b %ERROR_CODE%";
+#endif
+
return scriptPath;
}
@@ -572,8 +581,8 @@ std::string cmLocalNinjaGenerator::MakeCustomLauncher(
if (!outputs.empty()) {
output = outputs[0];
if (ccg.GetWorkingDirectory().empty()) {
- output =
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), output);
+ output = this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), output);
}
output = this->ConvertToOutputFormat(output, cmOutputConverter::SHELL);
}
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 4d19b3acb..7eb4a03d5 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -17,6 +17,7 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmGlobalUnixMakefileGenerator3.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmMakefileTargetGenerator.h"
@@ -97,9 +98,7 @@ cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3(
this->BorlandMakeCurlyHack = false;
}
-cmLocalUnixMakefileGenerator3::~cmLocalUnixMakefileGenerator3()
-{
-}
+cmLocalUnixMakefileGenerator3::~cmLocalUnixMakefileGenerator3() = default;
void cmLocalUnixMakefileGenerator3::Generate()
{
@@ -247,8 +246,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
for (auto& localObjectFile : localObjectFiles) {
// Add a convenience rule for building the object file.
this->WriteObjectConvenienceRule(
- ruleFileStream, "target to build an object file",
- localObjectFile.first.c_str(), localObjectFile.second);
+ ruleFileStream, "target to build an object file", localObjectFile.first,
+ localObjectFile.second);
// Check whether preprocessing and assembly rules make sense.
// They make sense only for C and C++ sources.
@@ -270,9 +269,9 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
if (lang_has_preprocessor && do_preprocess_rules) {
std::string::size_type dot_pos = localObjectFile.first.rfind(".");
std::string base = localObjectFile.first.substr(0, dot_pos);
- this->WriteObjectConvenienceRule(
- ruleFileStream, "target to preprocess a source file",
- (base + ".i").c_str(), localObjectFile.second);
+ this->WriteObjectConvenienceRule(ruleFileStream,
+ "target to preprocess a source file",
+ (base + ".i"), localObjectFile.second);
localObjectFile.second.HasPreprocessRule = true;
}
@@ -281,7 +280,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
std::string base = localObjectFile.first.substr(0, dot_pos);
this->WriteObjectConvenienceRule(
ruleFileStream, "target to generate assembly for a file",
- (base + ".s").c_str(), localObjectFile.second);
+ (base + ".s"), localObjectFile.second);
localObjectFile.second.HasAssembleRule = true;
}
}
@@ -297,7 +296,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile()
}
void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule(
- std::ostream& ruleFileStream, const char* comment, const char* output,
+ std::ostream& ruleFileStream, const char* comment, const std::string& output,
LocalObjectInfo const& info)
{
// If the rule includes the source file extension then create a
@@ -317,7 +316,7 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule(
// Add a rule to drive the rule below.
std::vector<std::string> depends;
- depends.push_back(output);
+ depends.emplace_back(output);
std::vector<std::string> no_commands;
this->WriteMakeRule(ruleFileStream, nullptr, outNoExt, depends,
no_commands, true, true);
@@ -333,7 +332,7 @@ void cmLocalUnixMakefileGenerator3::WriteObjectConvenienceRule(
targetName += "/";
targetName += output;
commands.push_back(
- this->GetRecursiveMakeCall(tgtMakefileName.c_str(), targetName));
+ this->GetRecursiveMakeCall(tgtMakefileName, targetName));
}
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
@@ -370,10 +369,9 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
depends.clear();
// Build the target for this pass.
- std::string makefile2 = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string makefile2 = "CMakeFiles/";
makefile2 += "Makefile2";
- commands.push_back(
- this->GetRecursiveMakeCall(makefile2.c_str(), localName));
+ commands.push_back(this->GetRecursiveMakeCall(makefile2, localName));
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
this->WriteMakeRule(ruleFileStream, "Convenience name for target.",
@@ -398,7 +396,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
depends.clear();
commands.clear();
commands.push_back(
- this->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName));
+ this->GetRecursiveMakeCall(makefileName, makeTargetName));
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
this->WriteMakeRule(ruleFileStream, "fast build rule for target.",
@@ -414,7 +412,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
depends.clear();
commands.clear();
commands.push_back(
- this->GetRecursiveMakeCall(makefile2.c_str(), makeTargetName));
+ this->GetRecursiveMakeCall(makefile2, makeTargetName));
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
this->WriteMakeRule(ruleFileStream,
@@ -428,7 +426,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefileTargets(
void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
{
std::string infoFileName = this->GetCurrentBinaryDirectory();
- infoFileName += cmake::GetCMakeFilesDirectory();
+ infoFileName += "/CMakeFiles";
infoFileName += "/CMakeDirectoryInformation.cmake";
// Open the output file.
@@ -469,12 +467,12 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
<< "# The C and CXX include file regular expressions for "
<< "this directory.\n";
infoFileStream << "set(CMAKE_C_INCLUDE_REGEX_SCAN ";
- this->WriteCMakeArgument(infoFileStream,
- this->Makefile->GetIncludeRegularExpression());
+ cmLocalUnixMakefileGenerator3::WriteCMakeArgument(
+ infoFileStream, this->Makefile->GetIncludeRegularExpression());
infoFileStream << ")\n";
infoFileStream << "set(CMAKE_C_INCLUDE_REGEX_COMPLAIN ";
- this->WriteCMakeArgument(infoFileStream,
- this->Makefile->GetComplainRegularExpression());
+ cmLocalUnixMakefileGenerator3::WriteCMakeArgument(
+ infoFileStream, this->Makefile->GetComplainRegularExpression());
infoFileStream << ")\n";
infoFileStream
<< "set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})\n";
@@ -684,7 +682,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsTop(
}
// Add a fake suffix to keep HP happy. Must be max 32 chars for SGI make.
std::vector<std::string> depends;
- depends.push_back(".hpux_make_needs_suffix_list");
+ depends.emplace_back(".hpux_make_needs_suffix_list");
this->WriteMakeRule(makefileStream, nullptr, ".SUFFIXES", depends,
no_commands, false);
if (this->IsWatcomWMake()) {
@@ -770,7 +768,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
cmOutputConverter::SHELL);
commands.push_back(rescanRule);
}
- std::string cmakefileName = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string cmakefileName = "CMakeFiles/";
cmakefileName += "Makefile.cmake";
std::string runRule =
"$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
@@ -851,7 +849,7 @@ void cmLocalUnixMakefileGenerator3::AppendRuleDepend(
const char* nodep =
this->Makefile->GetDefinition("CMAKE_SKIP_RULE_DEPENDENCY");
if (!nodep || cmSystemTools::IsOff(nodep)) {
- depends.push_back(ruleFileName);
+ depends.emplace_back(ruleFileName);
}
}
@@ -1253,9 +1251,8 @@ std::string cmLocalUnixMakefileGenerator3::CreateMakeVariable(
return ret;
}
-bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
- bool verbose,
- bool color)
+bool cmLocalUnixMakefileGenerator3::UpdateDependencies(
+ const std::string& tgtInfo, bool verbose, bool color)
{
// read in the target info file
if (!this->Makefile->ReadListFile(tgtInfo) ||
@@ -1279,13 +1276,13 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
this->GlobalGenerator->GetCMakeInstance()->GetFileComparison();
{
int result;
- if (!ftc->FileTimeCompare(internalDependFile.c_str(), tgtInfo, &result) ||
+ if (!ftc->FileTimeCompare(internalDependFile, tgtInfo, &result) ||
result < 0) {
if (verbose) {
std::ostringstream msg;
msg << "Dependee \"" << tgtInfo << "\" is newer than depender \""
<< internalDependFile << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
needRescanDependInfo = true;
}
@@ -1295,18 +1292,17 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
// may have changed. In this case discard all old dependencies.
bool needRescanDirInfo = false;
std::string dirInfoFile = this->GetCurrentBinaryDirectory();
- dirInfoFile += cmake::GetCMakeFilesDirectory();
+ dirInfoFile += "/CMakeFiles";
dirInfoFile += "/CMakeDirectoryInformation.cmake";
{
int result;
- if (!ftc->FileTimeCompare(internalDependFile.c_str(), dirInfoFile.c_str(),
- &result) ||
+ if (!ftc->FileTimeCompare(internalDependFile, dirInfoFile, &result) ||
result < 0) {
if (verbose) {
std::ostringstream msg;
msg << "Dependee \"" << dirInfoFile << "\" is newer than depender \""
<< internalDependFile << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
needRescanDirInfo = true;
}
@@ -1332,8 +1328,8 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
// dependency vector. This means that in the normal case, when only
// few or one file have been edited, then also only this one file is
// actually scanned again, instead of all files for this target.
- needRescanDependencies = !checker.Check(
- dependFile.c_str(), internalDependFile.c_str(), validDependencies);
+ needRescanDependencies =
+ !checker.Check(dependFile, internalDependFile, validDependencies);
}
if (needRescanDependInfo || needRescanDirInfo || needRescanDependencies) {
@@ -1346,7 +1342,7 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
cmsysTerminal_Color_ForegroundBold,
message.c_str(), true, color);
- return this->ScanDependencies(dir.c_str(), validDependencies);
+ return this->ScanDependencies(dir, validDependencies);
}
// The dependencies are already up-to-date.
@@ -1354,17 +1350,16 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(const char* tgtInfo,
}
bool cmLocalUnixMakefileGenerator3::ScanDependencies(
- const char* targetDir,
+ const std::string& targetDir,
std::map<std::string, cmDepends::DependencyVector>& validDeps)
{
// Read the directory information file.
cmMakefile* mf = this->Makefile;
bool haveDirectoryInfo = false;
std::string dirInfoFile = this->GetCurrentBinaryDirectory();
- dirInfoFile += cmake::GetCMakeFilesDirectory();
+ dirInfoFile += "/CMakeFiles";
dirInfoFile += "/CMakeDirectoryInformation.cmake";
- if (mf->ReadListFile(dirInfoFile.c_str()) &&
- !cmSystemTools::GetErrorOccuredFlag()) {
+ if (mf->ReadListFile(dirInfoFile) && !cmSystemTools::GetErrorOccuredFlag()) {
haveDirectoryInfo = true;
}
@@ -1392,12 +1387,9 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
cmSystemTools::Error("Directory Information file not found");
}
- // create the file stream for the depends file
- std::string dir = targetDir;
-
// Open the make depends file. This should be copy-if-different
// because the make tool may try to reload it needlessly otherwise.
- std::string ruleFileNameFull = dir;
+ std::string ruleFileNameFull = targetDir;
ruleFileNameFull += "/depend.make";
cmGeneratedFileStream ruleFileStream(
ruleFileNameFull, false, this->GlobalGenerator->GetMakefileEncoding());
@@ -1409,7 +1401,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
// Open the cmake dependency tracking file. This should not be
// copy-if-different because dependencies are re-scanned when it is
// older than the DependInfo.cmake.
- std::string internalRuleFileNameFull = dir;
+ std::string internalRuleFileNameFull = targetDir;
internalRuleFileNameFull += "/depend.internal";
cmGeneratedFileStream internalRuleFileStream(
internalRuleFileNameFull, false,
@@ -1450,7 +1442,7 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
scanner->SetFileComparison(
this->GlobalGenerator->GetCMakeInstance()->GetFileComparison());
scanner->SetLanguage(lang);
- scanner->SetTargetDirectory(dir.c_str());
+ scanner->SetTargetDirectory(targetDir);
scanner->Write(ruleFileStream, internalRuleFileStream);
// free the scanner for this language
@@ -1488,7 +1480,7 @@ void cmLocalUnixMakefileGenerator3::CheckMultipleOutputs(bool verbose)
msg << "Deleting primary custom command output \"" << dependee
<< "\" because another output \"" << depender
<< "\" does not exist." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
cmSystemTools::RemoveFile(dependee);
}
@@ -1506,7 +1498,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
// Just depend on the all target to drive the build.
std::vector<std::string> depends;
std::vector<std::string> no_commands;
- depends.push_back("all");
+ depends.emplace_back("all");
// Write the rule.
this->WriteMakeRule(ruleFileStream,
@@ -1546,8 +1538,10 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
if (!text) {
text = "Running external command ...";
}
- depends.insert(depends.end(), gt->GetUtilities().begin(),
- gt->GetUtilities().end());
+ depends.reserve(gt->GetUtilities().size());
+ for (BT<std::string> const& u : gt->GetUtilities()) {
+ depends.push_back(u.Value);
+ }
this->AppendEcho(commands, text,
cmLocalUnixMakefileGenerator3::EchoGlobal);
@@ -1568,7 +1562,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
(targetName == "install/strip")) {
// Provide a fast install target that does not depend on all
// but has the same command.
- depends.push_back("preinstall/fast");
+ depends.emplace_back("preinstall/fast");
} else {
// Just forward to the real target so at least it will work.
depends.push_back(targetName);
@@ -1590,18 +1584,18 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
bool regenerate =
!this->GlobalGenerator->GlobalSettingIsOn("CMAKE_SUPPRESS_REGENERATION");
if (regenerate) {
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
std::string progressDir = this->GetBinaryDirectory();
- progressDir += cmake::GetCMakeFilesDirectory();
+ progressDir += "/CMakeFiles";
{
std::ostringstream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
progCmd << this->ConvertToOutputFormat(
cmSystemTools::CollapseFullPath(progressDir), cmOutputConverter::SHELL);
- std::string progressFile = cmake::GetCMakeFilesDirectory();
+ std::string progressFile = "/CMakeFiles";
progressFile += "/progress.marks";
std::string progressFileNameFull = this->ConvertToFullPath(progressFile);
progCmd << " "
@@ -1610,10 +1604,9 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
cmOutputConverter::SHELL);
commands.push_back(progCmd.str());
}
- std::string mf2Dir = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string mf2Dir = "CMakeFiles/";
mf2Dir += "Makefile2";
- commands.push_back(
- this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
+ commands.push_back(this->GetRecursiveMakeCall(mf2Dir, recursiveTarget));
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
{
@@ -1632,15 +1625,14 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
recursiveTarget += "/clean";
commands.clear();
depends.clear();
- commands.push_back(
- this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
+ commands.push_back(this->GetRecursiveMakeCall(mf2Dir, recursiveTarget));
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
this->WriteMakeRule(ruleFileStream, "The main clean target", "clean",
depends, commands, true);
commands.clear();
depends.clear();
- depends.push_back("clean");
+ depends.emplace_back("clean");
this->WriteMakeRule(ruleFileStream, "The main clean target", "clean/fast",
depends, commands, true);
@@ -1653,13 +1645,12 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
this->Makefile->GetDefinition("CMAKE_SKIP_INSTALL_ALL_DEPENDENCY");
if (!noall || cmSystemTools::IsOff(noall)) {
// Drive the build before installing.
- depends.push_back("all");
+ depends.emplace_back("all");
} else if (regenerate) {
// At least make sure the build system is up to date.
- depends.push_back("cmake_check_build_system");
+ depends.emplace_back("cmake_check_build_system");
}
- commands.push_back(
- this->GetRecursiveMakeCall(mf2Dir.c_str(), recursiveTarget));
+ commands.push_back(this->GetRecursiveMakeCall(mf2Dir, recursiveTarget));
this->CreateCDCommand(commands, this->GetBinaryDirectory(),
this->GetCurrentBinaryDirectory());
this->WriteMakeRule(ruleFileStream, "Prepare targets for installation.",
@@ -1679,7 +1670,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
cmOutputConverter::SHELL);
commands.push_back(rescanRule);
}
- std::string cmakefileName = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string cmakefileName = "CMakeFiles/";
cmakefileName += "Makefile.cmake";
{
std::string runRule =
@@ -1717,7 +1708,7 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf,
// Clear the implicit dependency makefile.
std::string dependFile = dir + "/depend.make";
- clearer.Clear(dependFile.c_str());
+ clearer.Clear(dependFile);
// Remove the internal dependency check file to force
// regeneration.
@@ -1734,9 +1725,9 @@ class NotInProjectDir
{
public:
// Constructor with the source and binary directory's path
- NotInProjectDir(const std::string& sourceDir, const std::string& binaryDir)
- : SourceDir(sourceDir)
- , BinaryDir(binaryDir)
+ NotInProjectDir(std::string sourceDir, std::string binaryDir)
+ : SourceDir(std::move(sourceDir))
+ , BinaryDir(std::move(binaryDir))
{
}
@@ -1817,10 +1808,21 @@ void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
<< "_COMPILER_ID \"" << cid << "\")\n";
}
+ if (implicitLang.first == "Fortran") {
+ std::string smodSep =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
+ std::string smodExt =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
+ cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_SEP \"" << smodSep
+ << "\")\n";
+ cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_EXT \"" << smodExt
+ << "\")\n";
+ }
+
// Build a list of preprocessor definitions for the target.
std::set<std::string> defines;
- this->AddCompileDefinitions(defines, target, this->ConfigName,
- implicitLang.first);
+ this->GetTargetDefines(target, this->ConfigName, implicitLang.first,
+ defines);
if (!defines.empty()) {
/* clang-format off */
cmakefileStream
@@ -1887,7 +1889,7 @@ void cmLocalUnixMakefileGenerator3::WriteDisclaimer(std::ostream& os)
}
std::string cmLocalUnixMakefileGenerator3::GetRecursiveMakeCall(
- const char* makefile, const std::string& tgt)
+ const std::string& makefile, const std::string& tgt)
{
// Call make on the given file.
std::string cmd;
@@ -1957,7 +1959,7 @@ void cmLocalUnixMakefileGenerator3::WriteCMakeArgument(std::ostream& os,
}
std::string cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
- const char* p, bool useWatcomQuote)
+ const std::string& p, bool useWatcomQuote)
{
// Split the path into its components.
std::vector<std::string> components;
@@ -2024,7 +2026,7 @@ std::string cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
std::string cmLocalUnixMakefileGenerator3::GetTargetDirectory(
cmGeneratorTarget const* target) const
{
- std::string dir = cmake::GetCMakeFilesDirectoryPostSlash();
+ std::string dir = "CMakeFiles/";
dir += target->GetName();
#if defined(__VMS)
dir += "_dir";
@@ -2041,8 +2043,8 @@ cmLocalUnixMakefileGenerator3::GetImplicitDepends(const cmGeneratorTarget* tgt)
}
void cmLocalUnixMakefileGenerator3::AddImplicitDepends(
- const cmGeneratorTarget* tgt, const std::string& lang, const char* obj,
- const char* src)
+ const cmGeneratorTarget* tgt, const std::string& lang,
+ const std::string& obj, const std::string& src)
{
this->ImplicitDepends[tgt->GetName()][lang][obj].push_back(src);
}
@@ -2086,13 +2088,3 @@ void cmLocalUnixMakefileGenerator3::CreateCDCommand(
[&prefix](std::string const& s) { return prefix + s; });
}
}
-
-std::string cmLocalUnixMakefileGenerator3::MaybeConvertToRelativePath(
- std::string const& base, std::string const& path)
-{
- if (!cmOutputConverter::ContainedInDirectory(
- base, path, this->GetStateSnapshot().GetDirectory())) {
- return path;
- }
- return cmOutputConverter::ForceToRelativePath(base, path);
-}
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 869ef1ee9..ced2dbd46 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -12,6 +12,7 @@
#include <map>
#include <set>
#include <string>
+#include <utility>
#include <vector>
class cmCustomCommand;
@@ -83,7 +84,7 @@ public:
void WriteDivider(std::ostream& os);
/** used to create a recursive make call */
- std::string GetRecursiveMakeCall(const char* makefile,
+ std::string GetRecursiveMakeCall(const std::string& makefile,
const std::string& tgt);
// append flags to a string
@@ -120,7 +121,7 @@ public:
std::string const& targetDir,
std::string const& relDir);
- static std::string ConvertToQuotedOutputPath(const char* p,
+ static std::string ConvertToQuotedOutputPath(const std::string& p,
bool useWatcomQuote);
std::string CreateMakeVariable(const std::string& sin,
@@ -128,7 +129,7 @@ public:
/** Called from command-line hook to bring dependencies up to date
for a target. */
- bool UpdateDependencies(const char* tgtInfo, bool verbose,
+ bool UpdateDependencies(const std::string& tgtInfo, bool verbose,
bool color) override;
/** Called from command-line hook to clear dependencies. */
@@ -158,8 +159,8 @@ public:
cmGeneratorTarget const* tgt);
void AddImplicitDepends(cmGeneratorTarget const* tgt,
- const std::string& lang, const char* obj,
- const char* src);
+ const std::string& lang, const std::string& obj,
+ const std::string& src);
// write the target rules for the local Makefile into the stream
void WriteLocalAllRules(std::ostream& ruleFileStream);
@@ -183,9 +184,6 @@ public:
// Eclipse generator.
void GetIndividualFileTargets(std::vector<std::string>& targets);
- std::string MaybeConvertToRelativePath(std::string const& base,
- std::string const& path);
-
protected:
void WriteLocalMakefile();
@@ -200,9 +198,6 @@ protected:
void WriteDependLanguageInfo(std::ostream& cmakefileStream,
cmGeneratorTarget* tgt);
- // write the local help rule
- void WriteHelpRule(std::ostream& ruleFileStream);
-
// this converts a file name that is relative to the StartOuputDirectory
// into a full path
std::string ConvertToFullPath(const std::string& localPath);
@@ -211,15 +206,6 @@ protected:
const std::string& realTarget,
const std::string& helpTarget);
- void WriteTargetDependRule(std::ostream& ruleFileStream,
- cmGeneratorTarget* target);
- void WriteTargetCleanRule(std::ostream& ruleFileStream,
- cmGeneratorTarget* target,
- const std::vector<std::string>& files);
- void WriteTargetRequiresRule(std::ostream& ruleFileStream,
- cmGeneratorTarget* target,
- const std::vector<std::string>& objects);
-
void AppendRuleDepend(std::vector<std::string>& depends,
const char* ruleFileName);
void AppendRuleDepends(std::vector<std::string>& depends,
@@ -245,7 +231,7 @@ protected:
// Helper methods for dependency updates.
bool ScanDependencies(
- const char* targetDir,
+ const std::string& targetDir,
std::map<std::string, cmDepends::DependencyVector>& validDeps);
void CheckMultipleOutputs(bool verbose);
@@ -264,36 +250,27 @@ private:
struct LocalObjectEntry
{
- cmGeneratorTarget* Target;
+ cmGeneratorTarget* Target = nullptr;
std::string Language;
- LocalObjectEntry()
- : Target(nullptr)
- , Language()
- {
- }
- LocalObjectEntry(cmGeneratorTarget* t, const std::string& lang)
+ LocalObjectEntry() = default;
+ LocalObjectEntry(cmGeneratorTarget* t, std::string lang)
: Target(t)
- , Language(lang)
+ , Language(std::move(lang))
{
}
};
struct LocalObjectInfo : public std::vector<LocalObjectEntry>
{
- bool HasSourceExtension;
- bool HasPreprocessRule;
- bool HasAssembleRule;
- LocalObjectInfo()
- : HasSourceExtension(false)
- , HasPreprocessRule(false)
- , HasAssembleRule(false)
- {
- }
+ bool HasSourceExtension = false;
+ bool HasPreprocessRule = false;
+ bool HasAssembleRule = false;
};
void GetLocalObjectFiles(
std::map<std::string, LocalObjectInfo>& localObjectFiles);
void WriteObjectConvenienceRule(std::ostream& ruleFileStream,
- const char* comment, const char* output,
+ const char* comment,
+ const std::string& output,
LocalObjectInfo const& info);
std::vector<std::string> LocalHelp;
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 0c2c64eb6..d45c3356d 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -7,6 +7,7 @@
#include "cmMakefile.h"
#include "cmVisualStudio10TargetGenerator.h"
#include "cmXMLParser.h"
+#include "cmake.h"
#include "cm_expat.h"
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 842867264..7019552c3 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -6,6 +6,7 @@
#include "cmGeneratorTarget.h"
#include "cmGlobalVisualStudio7Generator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSourceFile.h"
#include "cmSystemTools.h"
#include "cmXMLParser.h"
@@ -96,7 +97,7 @@ void cmLocalVisualStudio7Generator::FixGlobalTargets()
force_commands.push_back(force_command);
std::string no_main_dependency;
std::string force = this->GetCurrentBinaryDirectory();
- force += cmake::GetCMakeFilesDirectory();
+ force += "/CMakeFiles";
force += "/";
force += l->GetName();
force += "_force";
@@ -143,7 +144,7 @@ void cmLocalVisualStudio7Generator::WriteStampFiles()
// Touch a timestamp file used to determine when the project file is
// out of date.
std::string stampName = this->GetCurrentBinaryDirectory();
- stampName += cmake::GetCMakeFilesDirectory();
+ stampName += "/CMakeFiles";
cmSystemTools::MakeDirectory(stampName.c_str());
stampName += "/";
stampName += "generate.stamp";
@@ -253,7 +254,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
std::string stampName = this->GetCurrentBinaryDirectory();
stampName += "/";
- stampName += cmake::GetCMakeFilesDirectoryPostSlash();
+ stampName += "CMakeFiles/";
stampName += "generate.stamp";
cmCustomCommandLine commandLine;
commandLine.push_back(cmSystemTools::GetCMakeCommand());
@@ -362,7 +363,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranFlagTable[] = {
{ "EnableRecursion", "recursive", "", "true", 0 },
{ "ReentrantCode", "reentrancy", "", "true", 0 },
// done up to Language
- { 0, 0, 0, 0, 0 }
+ { "", "", "", "", 0 }
};
// fill the table here currently the comment field is not used for
// anything other than documentation NOTE: Make sure the longer
@@ -472,7 +473,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] = {
{ "WarnAsError", "WX", "Treat warnings as errors", "true", 0 },
{ "BrowseInformation", "FR", "Generate browse information", "1", 0 },
{ "StringPooling", "GF", "Enable StringPooling", "true", 0 },
- { 0, 0, 0, 0, 0 }
+ { "", "", "", "", 0 }
};
cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {
@@ -537,7 +538,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {
{ "ModuleDefinitionFile", "DEF:", "add an export def file", "",
cmVS7FlagTable::UserValue },
{ "GenerateMapFile", "MAP", "enable generation of map file", "true", 0 },
- { 0, 0, 0, 0, 0 }
+ { "", "", "", "", 0 }
};
cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranLinkFlagTable[] = {
@@ -545,7 +546,7 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFortranLinkFlagTable[] = {
"linkIncrementalNo", 0 },
{ "LinkIncremental", "INCREMENTAL:YES", "link incremental",
"linkIncrementalYes", 0 },
- { 0, 0, 0, 0, 0 }
+ { "", "", "", "", 0 }
};
// Helper class to write build event <Tool .../> elements.
@@ -735,8 +736,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
targetOptions.AddDefine(configDefine);
// Add the export symbol definition for shared library objects.
- if (const char* exportMacro = target->GetExportMacro()) {
- targetOptions.AddDefine(exportMacro);
+ if (const std::string* exportMacro = target->GetExportMacro()) {
+ targetOptions.AddDefine(*exportMacro);
}
// The intermediate directory name consists of a directory for the
@@ -802,8 +803,8 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(
target->GetProperty("Fortran_MODULE_DIRECTORY");
std::string modDir;
if (target_mod_dir) {
- modDir = this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(),
- target_mod_dir);
+ modDir = this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), target_mod_dir);
} else {
modDir = ".";
}
@@ -1305,7 +1306,7 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries(
for (ItemVector::const_iterator l = libs.begin(); l != libs.end(); ++l) {
if (l->IsPath) {
std::string rel =
- lg->ConvertToRelativePath(currentBinDir, l->Value.c_str());
+ lg->MaybeConvertToRelativePath(currentBinDir, l->Value.c_str());
fout << lg->ConvertToXMLOutputPath(rel.c_str()) << " ";
} else if (!l->Target ||
l->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
@@ -1331,7 +1332,7 @@ void cmLocalVisualStudio7GeneratorInternals::OutputObjects(
i != objs.end(); ++i) {
if (!(*i)->GetObjectLibrary().empty()) {
std::string const& objFile = (*i)->GetFullPath();
- std::string rel = lg->ConvertToRelativePath(currentBinDir, objFile);
+ std::string rel = lg->MaybeConvertToRelativePath(currentBinDir, objFile);
fout << sep << lg->ConvertToXMLOutputPath(rel.c_str());
sep = " ";
}
@@ -1347,7 +1348,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
d != dirs.end(); ++d) {
// Remove any trailing slash and skip empty paths.
std::string dir = *d;
- if (dir[dir.size() - 1] == '/') {
+ if (dir.back() == '/') {
dir = dir.substr(0, dir.size() - 1);
}
if (dir.empty()) {
@@ -1357,7 +1358,7 @@ void cmLocalVisualStudio7Generator::OutputLibraryDirectories(
// Switch to a relative path specification if it is shorter.
if (cmSystemTools::FileIsFullPath(dir.c_str())) {
std::string rel =
- this->ConvertToRelativePath(currentBinDir, dir.c_str());
+ this->MaybeConvertToRelativePath(currentBinDir, dir.c_str());
if (rel.size() < dir.size()) {
dir = rel;
}
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index 2237da75f..660729c3a 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -210,9 +210,10 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
}
if (workingDirectory.empty()) {
- script += this->ConvertToOutputFormat(
- this->ConvertToRelativePath(this->GetCurrentBinaryDirectory(), cmd),
- cmOutputConverter::SHELL);
+ script +=
+ this->ConvertToOutputFormat(this->MaybeConvertToRelativePath(
+ this->GetCurrentBinaryDirectory(), cmd),
+ cmOutputConverter::SHELL);
} else {
script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
}
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 92c958d05..9c36627b5 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -19,9 +19,7 @@ cmLocalXCodeGenerator::cmLocalXCodeGenerator(cmGlobalGenerator* gg,
this->EmitUniversalBinaryFlags = false;
}
-cmLocalXCodeGenerator::~cmLocalXCodeGenerator()
-{
-}
+cmLocalXCodeGenerator::~cmLocalXCodeGenerator() = default;
std::string cmLocalXCodeGenerator::GetTargetDirectory(
cmGeneratorTarget const*) const
diff --git a/Source/cmLocale.h b/Source/cmLocale.h
index 174f0f0f2..3580ec812 100644
--- a/Source/cmLocale.h
+++ b/Source/cmLocale.h
@@ -10,16 +10,18 @@
class cmLocaleRAII
{
- CM_DISABLE_COPY(cmLocaleRAII)
-
public:
cmLocaleRAII()
: OldLocale(setlocale(LC_CTYPE, nullptr))
{
setlocale(LC_CTYPE, "");
}
+
~cmLocaleRAII() { setlocale(LC_CTYPE, this->OldLocale.c_str()); }
+ cmLocaleRAII(cmLocaleRAII const&) = delete;
+ cmLocaleRAII& operator=(cmLocaleRAII const&) = delete;
+
private:
std::string OldLocale;
};
diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h
index 31223ecd4..d767914b9 100644
--- a/Source/cmMSVC60LinkLineComputer.h
+++ b/Source/cmMSVC60LinkLineComputer.h
@@ -15,12 +15,14 @@ class cmStateDirectory;
class cmMSVC60LinkLineComputer : public cmLinkLineComputer
{
- CM_DISABLE_COPY(cmMSVC60LinkLineComputer)
-
public:
cmMSVC60LinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir);
+ cmMSVC60LinkLineComputer(cmMSVC60LinkLineComputer const&) = delete;
+ cmMSVC60LinkLineComputer& operator=(cmMSVC60LinkLineComputer const&) =
+ delete;
+
std::string ConvertToLinkReference(std::string const& input) const override;
};
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx
index 7294c1cbf..d4af1e0f3 100644
--- a/Source/cmMachO.cxx
+++ b/Source/cmMachO.cxx
@@ -52,10 +52,7 @@ bool peek(cmsys::ifstream& fin, T& v)
template <typename T>
bool read(cmsys::ifstream& fin, T& v)
{
- if (!fin.read(reinterpret_cast<char*>(&v), sizeof(T))) {
- return false;
- }
- return true;
+ return !!fin.read(reinterpret_cast<char*>(&v), sizeof(T));
}
// read from the file and fill multiple data structures where
@@ -67,10 +64,7 @@ bool read(cmsys::ifstream& fin, std::vector<T>& v)
if (v.empty()) {
return true;
}
- if (!fin.read(reinterpret_cast<char*>(&v[0]), sizeof(T) * v.size())) {
- return false;
- }
- return true;
+ return !!fin.read(reinterpret_cast<char*>(&v[0]), sizeof(T) * v.size());
}
}
@@ -97,7 +91,7 @@ public:
: Swap(_swap)
{
}
- virtual ~cmMachOHeaderAndLoadCommands() {}
+ virtual ~cmMachOHeaderAndLoadCommands() = default;
virtual bool read_mach_o(cmsys::ifstream& fin) = 0;
diff --git a/Source/cmMachO.h b/Source/cmMachO.h
index 5886d7626..5482465d3 100644
--- a/Source/cmMachO.h
+++ b/Source/cmMachO.h
@@ -30,7 +30,7 @@ public:
std::string const& GetErrorMessage() const;
/** Boolean conversion. True if the Mach-O file is valid. */
- operator bool() const { return this->Valid(); }
+ explicit operator bool() const { return this->Valid(); }
/** Get Install name from binary **/
bool GetInstallName(std::string& install_name);
diff --git a/Source/cmMacroCommand.cxx b/Source/cmMacroCommand.cxx
index 23d93a381..7279d5fcf 100644
--- a/Source/cmMacroCommand.cxx
+++ b/Source/cmMacroCommand.cxx
@@ -17,11 +17,6 @@
class cmMacroHelperCommand : public cmCommand
{
public:
- cmMacroHelperCommand() {}
-
- ///! clean up any memory allocated by the macro
- ~cmMacroHelperCommand() override {}
-
/**
* This is a virtual constructor for the command.
*/
@@ -94,7 +89,7 @@ bool cmMacroHelperCommand::InvokeInitialPass(
char argvName[60];
for (unsigned int j = 0; j < expandedArgs.size(); ++j) {
sprintf(argvName, "${ARGV%u}", j);
- argVs.push_back(argvName);
+ argVs.emplace_back(argvName);
}
// Invoke all the functions that were collected in the block.
cmListFileFunction newLFF;
diff --git a/Source/cmMacroCommand.h b/Source/cmMacroCommand.h
index d967388bf..b54ed6605 100644
--- a/Source/cmMacroCommand.h
+++ b/Source/cmMacroCommand.h
@@ -18,15 +18,13 @@ class cmMakefile;
class cmMacroFunctionBlocker : public cmFunctionBlocker
{
public:
- cmMacroFunctionBlocker() { this->Depth = 0; }
- ~cmMacroFunctionBlocker() override {}
bool IsFunctionBlocked(const cmListFileFunction&, cmMakefile& mf,
cmExecutionStatus&) override;
bool ShouldRemove(const cmListFileFunction&, cmMakefile& mf) override;
std::vector<std::string> Args;
std::vector<cmListFileFunction> Functions;
- int Depth;
+ int Depth = 0;
};
/// Starts macro() ... endmacro() block
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8d163b77d..7e33bda27 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -28,7 +28,9 @@
#include "cmGeneratorExpressionEvaluationFile.h"
#include "cmGlobalGenerator.h"
#include "cmInstallGenerator.h" // IWYU pragma: keep
+#include "cmInstallSubdirectoryGenerator.h"
#include "cmListFileCache.h"
+#include "cmMessageType.h"
#include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
#include "cmState.h"
@@ -43,6 +45,8 @@
#include "cm_sys_stat.h"
#include "cmake.h"
+#include "cmConfigure.h" // IWYU pragma: keep
+
#ifdef CMAKE_BUILD_WITH_CMAKE
# include "cmVariableWatch.h"
#endif
@@ -66,7 +70,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
- this->SuppressWatches = false;
+ this->SuppressSideEffects = false;
// Setup the default include complaint regular expression (match nothing).
this->ComplainFileRegularExpression = "^$";
@@ -81,6 +85,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
this->StateSnapshot =
this->StateSnapshot.GetState()->CreatePolicyScopeSnapshot(
this->StateSnapshot);
+ this->RecursionDepth = 0;
// Enter a policy level for this directory.
this->PushPolicy();
@@ -128,11 +133,11 @@ cmDirectoryId cmMakefile::GetDirectoryId() const
return std::string(buf);
}
-void cmMakefile::IssueMessage(cmake::MessageType t,
- std::string const& text) const
+void cmMakefile::IssueMessage(MessageType t, std::string const& text) const
{
if (!this->ExecutionStatusStack.empty()) {
- if ((t == cmake::FATAL_ERROR) || (t == cmake::INTERNAL_ERROR)) {
+ if ((t == MessageType::FATAL_ERROR) ||
+ (t == MessageType::INTERNAL_ERROR)) {
this->ExecutionStatusStack.back()->SetNestedError();
}
}
@@ -142,7 +147,7 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
bool cmMakefile::CheckCMP0037(std::string const& targetName,
cmStateEnums::TargetType targetType) const
{
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
std::ostringstream e;
bool issueMessage = false;
switch (this->GetPolicyStatus(cmPolicies::CMP0037)) {
@@ -158,7 +163,7 @@ bool cmMakefile::CheckCMP0037(std::string const& targetName,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
issueMessage = true;
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
break;
}
if (issueMessage) {
@@ -168,7 +173,7 @@ bool cmMakefile::CheckCMP0037(std::string const& targetName,
"in undefined behavior.";
this->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
@@ -197,7 +202,7 @@ void cmMakefile::MaybeWarnCMP0074(std::string const& pkg)
<< " " << env << "\n";
}
w << "For compatibility, CMake is ignoring the variable.";
- this->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
}
@@ -317,7 +322,7 @@ void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
msg << " ";
}
msg << ")";
- cmSystemTools::Message(msg.str().c_str());
+ cmSystemTools::Message(msg.str());
}
// Helper class to make sure the call stack is valid.
@@ -331,12 +336,14 @@ public:
cmListFileContext const& lfc = cmListFileContext::FromCommandContext(
cc, this->Makefile->StateSnapshot.GetExecutionListFile());
this->Makefile->Backtrace = this->Makefile->Backtrace.Push(lfc);
+ ++this->Makefile->RecursionDepth;
this->Makefile->ExecutionStatusStack.push_back(&status);
}
~cmMakefileCall()
{
this->Makefile->ExecutionStatusStack.pop_back();
+ --this->Makefile->RecursionDepth;
this->Makefile->Backtrace = this->Makefile->Backtrace.Pop();
}
@@ -359,6 +366,24 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
cmMakefileCall stack_manager(this, lff, status);
static_cast<void>(stack_manager);
+ // Check for maximum recursion depth.
+ int depth = CMake_DEFAULT_RECURSION_LIMIT;
+ const char* depthStr = this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH");
+ if (depthStr) {
+ std::istringstream s(depthStr);
+ int d;
+ if (s >> d) {
+ depth = d;
+ }
+ }
+ if (this->RecursionDepth > depth) {
+ std::ostringstream e;
+ e << "Maximum recursion depth of " << depth << " exceeded";
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
+ cmSystemTools::SetFatalErrorOccured();
+ return false;
+ }
+
// Lookup the command prototype.
if (cmCommand* proto =
this->GetState()->GetCommandByExactName(lff.Name.Lower)) {
@@ -380,7 +405,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
// The command invocation requested that we report an error.
std::string const error =
std::string(lff.Name.Original) + " " + pcmd->GetError();
- this->IssueMessage(cmake::FATAL_ERROR, error);
+ this->IssueMessage(MessageType::FATAL_ERROR, error);
}
result = false;
if (this->GetCMakeInstance()->GetWorkingMode() != cmake::NORMAL_MODE) {
@@ -396,7 +421,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
std::string error = "Unknown CMake command \"";
error += lff.Name.Original;
error += "\".";
- this->IssueMessage(cmake::FATAL_ERROR, error);
+ this->IssueMessage(MessageType::FATAL_ERROR, error);
result = false;
cmSystemTools::SetFatalErrorOccured();
}
@@ -508,7 +533,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
<< "affects policy settings. "
<< "CMake is implying the NO_POLICY_SCOPE option for compatibility, "
<< "so the effects are applied to the including context.";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
break;
case cmPolicies::REQUIRED_IF_USED:
@@ -520,7 +545,7 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
<< this->Makefile->GetExecutionFilePath() << "\n"
<< "affects policy settings, so it requires this policy to be set.";
/* clang-format on */
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
} break;
case cmPolicies::OLD:
case cmPolicies::NEW:
@@ -531,7 +556,8 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
}
}
-bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
+bool cmMakefile::ReadDependentFile(const std::string& filename,
+ bool noPolicyScope)
{
this->AddDefinition("CMAKE_PARENT_LIST_FILE",
this->GetDefinition("CMAKE_CURRENT_LIST_FILE"));
@@ -584,7 +610,7 @@ private:
bool ReportError;
};
-bool cmMakefile::ReadListFile(const char* filename)
+bool cmMakefile::ReadListFile(const std::string& filename)
{
std::string filenametoread = cmSystemTools::CollapseFullPath(
filename, this->GetCurrentSourceDirectory());
@@ -664,7 +690,7 @@ void cmMakefile::EnforceDirectoryLevelRules() const
case cmPolicies::WARN:
// Warn because the user did not provide a minimum required
// version.
- this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+ this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
msg.str(), this->Backtrace);
case cmPolicies::OLD:
// OLD behavior is to use policy version 2.4 set in
@@ -674,8 +700,8 @@ void cmMakefile::EnforceDirectoryLevelRules() const
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
// NEW behavior is to issue an error.
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, msg.str(),
- this->Backtrace);
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ msg.str(), this->Backtrace);
cmSystemTools::SetFatalErrorOccured();
return;
}
@@ -763,7 +789,7 @@ void cmMakefile::ConfigureFinalPass()
if (oldValue &&
cmSystemTools::VersionCompare(cmSystemTools::OP_LESS, oldValue, "2.4")) {
this->GetCMakeInstance()->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"You have set CMAKE_BACKWARDS_COMPATIBILITY to a CMake version less "
"than 2.4. This version of CMake only supports backwards compatibility "
"with CMake 2.4 or later. For compatibility with older versions please "
@@ -784,7 +810,7 @@ void cmMakefile::AddCustomCommandToTarget(
cmTargets::iterator ti = this->Targets.find(target);
if (ti == this->Targets.end()) {
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
bool issueMessage = false;
std::ostringstream e;
switch (this->GetPolicyStatus(cmPolicies::CMP0040)) {
@@ -797,7 +823,7 @@ void cmMakefile::AddCustomCommandToTarget(
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
issueMessage = true;
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (issueMessage) {
@@ -825,7 +851,7 @@ void cmMakefile::AddCustomCommandToTarget(
e << "Target \"" << target
<< "\" is an OBJECT library "
"that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (t.GetType() == cmStateEnums::INTERFACE_LIBRARY) {
@@ -833,7 +859,7 @@ void cmMakefile::AddCustomCommandToTarget(
e << "Target \"" << target
<< "\" is an INTERFACE library "
"that may not have PRE_BUILD, PRE_LINK, or POST_BUILD commands.";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -885,7 +911,7 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
if (!cl.empty() && !cl[0].empty() && cl[0][0] == '"') {
std::ostringstream e;
e << "COMMAND may not contain literal quotes:\n " << cl[0] << "\n";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return nullptr;
}
}
@@ -1125,7 +1151,7 @@ cmTarget* cmMakefile::AddUtilityCommand(
// Create a target instance for this utility.
cmTarget* target = this->AddNewTarget(cmStateEnums::UTILITY, utilityName);
target->SetIsGeneratorProvided(origin == TargetOrigin::Generator);
- if (excludeFromAll) {
+ if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
}
if (!comment) {
@@ -1136,7 +1162,7 @@ cmTarget* cmMakefile::AddUtilityCommand(
// Store the custom command in the target.
if (!commandLines.empty() || !depends.empty()) {
std::string force = this->GetCurrentBinaryDirectory();
- force += cmake::GetCMakeFilesDirectory();
+ force += "/CMakeFiles";
force += "/";
force += utilityName;
std::vector<std::string> forced;
@@ -1277,7 +1303,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
// This definition has a non-trivial value.
switch (this->GetPolicyStatus(cmPolicies::CMP0005)) {
case cmPolicies::WARN:
- this->IssueMessage(cmake::AUTHOR_WARNING,
+ this->IssueMessage(MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0005));
CM_FALLTHROUGH;
case cmPolicies::OLD:
@@ -1287,7 +1313,7 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0005));
return false;
case cmPolicies::NEW:
@@ -1366,6 +1392,9 @@ void cmMakefile::InitializeFromParent(cmMakefile* parent)
// Imported targets.
this->ImportedTargets = parent->ImportedTargets;
+
+ // Recursion depth.
+ this->RecursionDepth = parent->RecursionDepth;
}
void cmMakefile::PushFunctionScope(std::string const& fileName,
@@ -1490,7 +1519,7 @@ void cmMakefile::Configure()
// make sure the CMakeFiles dir is there
std::string filesDir = this->StateSnapshot.GetDirectory().GetCurrentBinary();
- filesDir += cmake::GetCMakeFilesDirectory();
+ filesDir += "/CMakeFiles";
cmSystemTools::MakeDirectory(filesDir);
assert(cmSystemTools::FileExists(currentStart, true));
@@ -1593,7 +1622,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
if (this->GetCMakeInstance()->GetDebugOutput()) {
std::string msg = " Entering ";
msg += currentStart;
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
}
std::string const currentStartFile = currentStart + "/CMakeLists.txt";
@@ -1616,7 +1645,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
<< "\n"
<< cmPolicies::GetPolicyWarning(cmPolicies::CMP0014);
/* clang-format on */
- this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
case cmPolicies::OLD:
// OLD behavior does not warn.
break;
@@ -1626,7 +1655,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
CM_FALLTHROUGH;
case cmPolicies::NEW:
// NEW behavior prints the error.
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
return;
}
@@ -1636,7 +1665,7 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
if (this->GetCMakeInstance()->GetDebugOutput()) {
std::string msg = " Returning to ";
msg += this->GetCurrentSourceDirectory();
- cmSystemTools::Message(msg.c_str());
+ cmSystemTools::Message(msg);
}
}
@@ -1660,7 +1689,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
this->GetGlobalGenerator()->AddMakefile(subMf);
- if (excludeFromAll) {
+ if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
subMf->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
}
@@ -1669,6 +1698,9 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
} else {
this->UnConfiguredDirectories.push_back(subMf);
}
+
+ this->AddInstallGenerator(new cmInstallSubdirectoryGenerator(
+ subMf, binPath.c_str(), excludeFromAll));
}
const std::string& cmMakefile::GetCurrentSourceDirectory() const
@@ -1833,6 +1865,23 @@ bool cmMakefile::VariableInitialized(const std::string& var) const
return this->StateSnapshot.IsInitialized(var);
}
+void cmMakefile::MaybeWarnUninitialized(std::string const& variable,
+ const char* sourceFilename) const
+{
+ // check to see if we need to print a warning
+ // if strict mode is on and the variable has
+ // not been "cleared"/initialized with a set(foo ) call
+ if (this->GetCMakeInstance()->GetWarnUninitialized() &&
+ !this->VariableInitialized(variable)) {
+ if (this->CheckSystemVars ||
+ (sourceFilename && this->IsProjectFile(sourceFilename))) {
+ std::ostringstream msg;
+ msg << "uninitialized variable \'" << variable << "\'";
+ this->IssueMessage(MessageType::AUTHOR_WARNING, msg.str());
+ }
+ }
+}
+
void cmMakefile::LogUnused(const char* reason, const std::string& name) const
{
if (this->WarnUnused) {
@@ -1844,14 +1893,10 @@ void cmMakefile::LogUnused(const char* reason, const std::string& name) const
path += "/CMakeLists.txt";
}
- if (this->CheckSystemVars ||
- cmSystemTools::IsSubDirectory(path, this->GetHomeDirectory()) ||
- (cmSystemTools::IsSubDirectory(path, this->GetHomeOutputDirectory()) &&
- !cmSystemTools::IsSubDirectory(path,
- cmake::GetCMakeFilesDirectory()))) {
+ if (this->CheckSystemVars || this->IsProjectFile(path.c_str())) {
std::ostringstream msg;
msg << "unused variable (" << reason << ") \'" << name << "\'";
- this->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, msg.str());
}
}
}
@@ -1940,7 +1985,9 @@ cmTarget* cmMakefile::AddLibrary(const std::string& lname,
// over changes in CMakeLists.txt, making the information stale and
// hence useless.
target->ClearDependencyInformation(*this);
- if (excludeFromAll) {
+ if (excludeFromAll ||
+ (type != cmStateEnums::INTERFACE_LIBRARY &&
+ this->GetPropertyAsBool("EXCLUDE_FROM_ALL"))) {
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
}
target->AddSources(srcs);
@@ -1953,7 +2000,7 @@ cmTarget* cmMakefile::AddExecutable(const std::string& exeName,
bool excludeFromAll)
{
cmTarget* target = this->AddNewTarget(cmStateEnums::EXECUTABLE, exeName);
- if (excludeFromAll) {
+ if (excludeFromAll || this->GetPropertyAsBool("EXCLUDE_FROM_ALL")) {
target->SetProperty("EXCLUDE_FROM_ALL", "TRUE");
}
target->AddSources(srcs);
@@ -2081,7 +2128,7 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
if (i == -1) {
// group does not exist nor belong to any existing group
// add its first component
- this->SourceGroups.push_back(cmSourceGroup(name[0], regex));
+ this->SourceGroups.emplace_back(name[0], regex);
sg = this->GetSourceGroup(currentName);
i = 0; // last component found
}
@@ -2257,8 +2304,8 @@ void cmMakefile::ExpandVariablesCMP0019()
<< "The following variable evaluations were encountered:\n"
<< w.str();
/* clang-format on */
- this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, m.str(),
- this->Backtrace);
+ this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING,
+ m.str(), this->Backtrace);
}
}
@@ -2338,7 +2385,7 @@ cmMakefile::AppleSDK cmMakefile::GetAppleSDKType() const
{ "watchsimulator", AppleSDK::WatchSimulator },
};
- for (auto entry : sdkDatabase) {
+ for (auto const& entry : sdkDatabase) {
if (sdkRoot.find(entry.name) == 0 ||
sdkRoot.find(std::string("/") + entry.name) != std::string::npos) {
return entry.sdk;
@@ -2417,7 +2464,7 @@ const std::string* cmMakefile::GetDef(const std::string& name) const
}
#ifdef CMAKE_BUILD_WITH_CMAKE
cmVariableWatch* vv = this->GetVariableWatch();
- if (vv && !this->SuppressWatches) {
+ if (vv && !this->SuppressSideEffects) {
bool const watch_function_executed =
vv->VariableAccessed(name,
def ? cmVariableWatch::VARIABLE_READ_ACCESS
@@ -2477,7 +2524,7 @@ const std::string& cmMakefile::ExpandVariablesInString(
const char* filename, long line, bool removeEmpty, bool replaceAt) const
{
bool compareResults = false;
- cmake::MessageType mtype = cmake::LOG;
+ MessageType mtype = MessageType::LOG;
std::string errorstr;
std::string original;
@@ -2485,7 +2532,7 @@ const std::string& cmMakefile::ExpandVariablesInString(
if (atOnly && (!noEscapes || !removeEmpty)) {
// This case should never be called. At-only is for
// configure-file/string which always does no escapes.
- this->IssueMessage(cmake::INTERNAL_ERROR,
+ this->IssueMessage(MessageType::INTERNAL_ERROR,
"ExpandVariablesInString @ONLY called "
"on something with escapes.");
return source;
@@ -2494,7 +2541,7 @@ const std::string& cmMakefile::ExpandVariablesInString(
// Variables used in the WARN case.
std::string newResult;
std::string newErrorstr;
- cmake::MessageType newError = cmake::LOG;
+ MessageType newError = MessageType::LOG;
switch (this->GetPolicyStatus(cmPolicies::CMP0053)) {
case cmPolicies::WARN: {
@@ -2504,11 +2551,11 @@ const std::string& cmMakefile::ExpandVariablesInString(
compareResults = true;
// Suppress variable watches to avoid calling hooks twice. Suppress new
// dereferences since the OLD behavior is still what is actually used.
- this->SuppressWatches = true;
- newError = ExpandVariablesInStringNew(
- newErrorstr, newResult, escapeQuotes, noEscapes, atOnly, filename,
- line, removeEmpty, replaceAt);
- this->SuppressWatches = false;
+ this->SuppressSideEffects = true;
+ newError = ExpandVariablesInStringNew(newErrorstr, newResult,
+ escapeQuotes, noEscapes, atOnly,
+ filename, line, replaceAt);
+ this->SuppressSideEffects = false;
CM_FALLTHROUGH;
}
case cmPolicies::OLD:
@@ -2520,15 +2567,15 @@ const std::string& cmMakefile::ExpandVariablesInString(
case cmPolicies::REQUIRED_ALWAYS:
// Messaging here would be *very* verbose.
case cmPolicies::NEW:
- mtype = ExpandVariablesInStringNew(errorstr, source, escapeQuotes,
- noEscapes, atOnly, filename, line,
- removeEmpty, replaceAt);
+ mtype =
+ ExpandVariablesInStringNew(errorstr, source, escapeQuotes, noEscapes,
+ atOnly, filename, line, replaceAt);
break;
}
// If it's an error in either case, just report the error...
- if (mtype != cmake::LOG) {
- if (mtype == cmake::FATAL_ERROR) {
+ if (mtype != MessageType::LOG) {
+ if (mtype == MessageType::FATAL_ERROR) {
cmSystemTools::SetFatalErrorOccured();
}
this->IssueMessage(mtype, errorstr);
@@ -2567,20 +2614,20 @@ const std::string& cmMakefile::ExpandVariablesInString(
msg +=
"Using the old result for compatibility since the policy is not set.";
- this->IssueMessage(cmake::AUTHOR_WARNING, msg);
+ this->IssueMessage(MessageType::AUTHOR_WARNING, msg);
}
return source;
}
-cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
+MessageType cmMakefile::ExpandVariablesInStringOld(
std::string& errorstr, std::string& source, bool escapeQuotes,
bool noEscapes, bool atOnly, const char* filename, long line,
bool removeEmpty, bool replaceAt) const
{
// Fast path strings without any special characters.
if (source.find_first_of("$@\\") == std::string::npos) {
- return cmake::LOG;
+ return MessageType::LOG;
}
// Special-case the @ONLY mode.
@@ -2619,7 +2666,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
// Append the rest of the unchanged part of the string.
source.append(in);
- return cmake::LOG;
+ return MessageType::LOG;
}
// This method replaces ${VAR} and @VAR@ where VAR is looked up
@@ -2636,7 +2683,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
parser.SetRemoveEmpty(removeEmpty);
int res = parser.ParseString(source.c_str(), 0);
const char* emsg = parser.GetError();
- cmake::MessageType mtype = cmake::LOG;
+ MessageType mtype = MessageType::LOG;
if (res && !emsg[0]) {
source = parser.GetResult();
} else {
@@ -2659,7 +2706,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
// parser reported an error message without failing because the
// helper implementation is unhappy, which has always reported an
// error.
- mtype = cmake::FATAL_ERROR;
+ mtype = MessageType::FATAL_ERROR;
if (!res) {
// This is a real argument parsing error. Use policy CMP0010 to
// decide whether it is an error.
@@ -2669,7 +2716,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior is to just warn and continue.
- mtype = cmake::AUTHOR_WARNING;
+ mtype = MessageType::AUTHOR_WARNING;
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
@@ -2693,19 +2740,31 @@ typedef enum
} t_domain;
struct t_lookup
{
- t_lookup()
- : domain(NORMAL)
- , loc(0)
- {
- }
- t_domain domain;
- size_t loc;
+ t_domain domain = NORMAL;
+ size_t loc = 0;
};
-cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
+bool cmMakefile::IsProjectFile(const char* filename) const
+{
+ return cmSystemTools::IsSubDirectory(filename, this->GetHomeDirectory()) ||
+ (cmSystemTools::IsSubDirectory(filename, this->GetHomeOutputDirectory()) &&
+ !cmSystemTools::IsSubDirectory(filename, "/CMakeFiles"));
+}
+
+int cmMakefile::GetRecursionDepth() const
+{
+ return this->RecursionDepth;
+}
+
+void cmMakefile::SetRecursionDepth(int recursionDepth)
+{
+ this->RecursionDepth = recursionDepth;
+}
+
+MessageType cmMakefile::ExpandVariablesInStringNew(
std::string& errorstr, std::string& source, bool escapeQuotes,
bool noEscapes, bool atOnly, const char* filename, long line,
- bool removeEmpty, bool replaceAt) const
+ bool replaceAt) const
{
// This method replaces ${VAR} and @VAR@ where VAR is looked up
// with GetDefinition(), if not found in the map, nothing is expanded.
@@ -2719,10 +2778,11 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
std::vector<t_lookup> openstack;
bool error = false;
bool done = false;
- cmake::MessageType mtype = cmake::LOG;
+ MessageType mtype = MessageType::LOG;
cmState* state = this->GetCMakeInstance()->GetState();
+ static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE";
do {
char inc = *in;
switch (inc) {
@@ -2735,7 +2795,6 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
const char* value = nullptr;
std::string varresult;
std::string svalue;
- static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE";
switch (var.domain) {
case NORMAL:
if (filename && lookup == lineVar) {
@@ -2762,23 +2821,8 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
} else {
varresult = value;
}
- } else if (!removeEmpty) {
- // check to see if we need to print a warning
- // if strict mode is on and the variable has
- // not been "cleared"/initialized with a set(foo ) call
- if (this->GetCMakeInstance()->GetWarnUninitialized() &&
- !this->VariableInitialized(lookup)) {
- if (this->CheckSystemVars ||
- (filename &&
- (cmSystemTools::IsSubDirectory(filename,
- this->GetHomeDirectory()) ||
- cmSystemTools::IsSubDirectory(
- filename, this->GetHomeOutputDirectory())))) {
- std::ostringstream msg;
- msg << "uninitialized variable \'" << lookup << "\'";
- this->IssueMessage(cmake::AUTHOR_WARNING, msg.str());
- }
- }
+ } else if (!this->SuppressSideEffects) {
+ this->MaybeWarnUninitialized(lookup, filename);
}
result.replace(var.loc, result.size() - var.loc, varresult);
// Start looking from here on out.
@@ -2813,7 +2857,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
std::string(next, this->cmNamedCurly.end()) +
"{} is not supported. Only ${}, $ENV{}, "
"and $CACHE{} are allowed.";
- mtype = cmake::FATAL_ERROR;
+ mtype = MessageType::FATAL_ERROR;
error = true;
}
}
@@ -2885,7 +2929,19 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
"abcdefghijklmnopqrstuvwxyz"
"0123456789/_.+-")) {
std::string variable(in + 1, nextAt - in - 1);
- std::string varresult = this->GetSafeDefinition(variable);
+
+ std::string varresult;
+ if (filename && variable == lineVar) {
+ varresult = std::to_string(line);
+ } else {
+ const std::string* def = this->GetDef(variable);
+ if (def) {
+ varresult = *def;
+ } else if (!this->SuppressSideEffects) {
+ this->MaybeWarnUninitialized(variable, filename);
+ }
+ }
+
if (escapeQuotes) {
varresult = cmSystemTools::EscapeQuotes(varresult);
}
@@ -2909,7 +2965,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
errorstr += "\') in a variable name: "
"'" +
result.substr(openstack.back().loc) + "'";
- mtype = cmake::FATAL_ERROR;
+ mtype = MessageType::FATAL_ERROR;
error = true;
}
break;
@@ -2940,7 +2996,7 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
emsg << "when parsing string\n"
<< " " << source << "\n";
emsg << errorstr;
- mtype = cmake::FATAL_ERROR;
+ mtype = MessageType::FATAL_ERROR;
errorstr = emsg.str();
} else {
// Append the rest of the unchanged part of the string.
@@ -3034,7 +3090,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError)
<< " " << lfc << "\n"
<< "is not closed.";
/* clang-format on */
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
reportError = false;
}
}
@@ -3187,7 +3243,7 @@ std::unique_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker(
<< " " << closingContext << "\n"
<< "with mis-matching arguments.";
/* clang-format on */
- this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
cmFunctionBlocker* b = *pos;
this->FunctionBlockers.erase(pos);
@@ -3344,7 +3400,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
// use the cmake object instead of calling cmake
cmWorkingDirectory workdir(bindir);
if (workdir.Failed()) {
- this->IssueMessage(cmake::FATAL_ERROR,
+ this->IssueMessage(MessageType::FATAL_ERROR,
"Failed to set working directory to " + bindir + " : " +
std::strerror(workdir.GetLastResult()));
cmSystemTools::SetFatalErrorOccured();
@@ -3355,12 +3411,12 @@ int cmMakefile::TryCompile(const std::string& srcdir,
// make sure the same generator is used
// use this program as the cmake to be run, it should not
// be run that way but the cmake object requires a vailid path
- cmake cm(cmake::RoleProject);
+ cmake cm(cmake::RoleProject, cmState::Project);
cm.SetIsInTryCompile(true);
cmGlobalGenerator* gg =
cm.CreateGlobalGenerator(this->GetGlobalGenerator()->GetName());
if (!gg) {
- this->IssueMessage(cmake::INTERNAL_ERROR,
+ this->IssueMessage(MessageType::INTERNAL_ERROR,
"Global generator '" +
this->GetGlobalGenerator()->GetName() +
"' could not be created.");
@@ -3368,6 +3424,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
this->IsSourceFileTryCompile = false;
return 1;
}
+ gg->RecursionDepth = this->RecursionDepth;
cm.SetGlobalGenerator(gg);
// do a configure
@@ -3387,6 +3444,12 @@ int cmMakefile::TryCompile(const std::string& srcdir,
cmStateEnums::STRING);
}
}
+ const char* recursionDepth =
+ this->GetDefinition("CMAKE_MAXIMUM_RECURSION_DEPTH");
+ if (recursionDepth) {
+ cm.AddCacheEntry("CMAKE_MAXIMUM_RECURSION_DEPTH", recursionDepth,
+ "Maximum recursion depth", cmStateEnums::STRING);
+ }
// if cmake args were provided then pass them in
if (cmakeArgs) {
// FIXME: Workaround to ignore unused CLI variables in try-compile.
@@ -3426,7 +3489,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
cmStateEnums::INTERNAL);
}
if (cm.Configure() != 0) {
- this->IssueMessage(cmake::FATAL_ERROR,
+ this->IssueMessage(MessageType::FATAL_ERROR,
"Failed to configure test project build system.");
cmSystemTools::SetFatalErrorOccured();
this->IsSourceFileTryCompile = false;
@@ -3434,7 +3497,7 @@ int cmMakefile::TryCompile(const std::string& srcdir,
}
if (cm.Generate() != 0) {
- this->IssueMessage(cmake::FATAL_ERROR,
+ this->IssueMessage(MessageType::FATAL_ERROR,
"Failed to generate test project build system.");
cmSystemTools::SetFatalErrorOccured();
this->IsSourceFileTryCompile = false;
@@ -3496,7 +3559,8 @@ void cmMakefile::DisplayStatus(const char* message, float s) const
cm->UpdateProgress(message, s);
}
-std::string cmMakefile::GetModulesFile(const char* filename) const
+std::string cmMakefile::GetModulesFile(const std::string& filename,
+ bool& system) const
{
std::string result;
@@ -3543,8 +3607,10 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
// Normally, prefer the files found in CMAKE_MODULE_PATH. Only when the file
// from which we are being called is located itself in CMAKE_ROOT, then
// prefer results from CMAKE_ROOT depending on the policy setting.
+ system = false;
result = moduleInCMakeModulePath;
if (result.empty()) {
+ system = true;
result = moduleInCMakeRoot;
}
@@ -3563,15 +3629,17 @@ std::string cmMakefile::GetModulesFile(const char* filename) const
<< cmPolicies::GetPolicyWarning(cmPolicies::CMP0017);
/* clang-format on */
- this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
CM_FALLTHROUGH;
}
case cmPolicies::OLD:
+ system = false;
result = moduleInCMakeModulePath;
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::NEW:
+ system = true;
result = moduleInCMakeRoot;
break;
}
@@ -3639,8 +3707,15 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
}
// Perform variable replacements.
- this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, nullptr,
- -1, true, true);
+ const char* filename = nullptr;
+ long lineNumber = -1;
+ if (!this->Backtrace.Empty()) {
+ const auto& currentTrace = this->Backtrace.Top();
+ filename = currentTrace.FilePath.c_str();
+ lineNumber = currentTrace.Line;
+ }
+ this->ExpandVariablesInString(output, escapeQuotes, true, atOnly, filename,
+ lineNumber, true, true);
}
int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
@@ -3676,8 +3751,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
}
if (copyonly) {
- if (!cmSystemTools::CopyFileIfDifferent(sinfile.c_str(),
- soutfile.c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(sinfile, soutfile)) {
return 0;
}
} else {
@@ -3710,7 +3784,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
std::ostringstream e;
e << "File starts with a Byte-Order-Mark that is not UTF-8:\n "
<< sinfile;
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return 0;
}
// rewind to copy BOM to output file
@@ -3728,8 +3802,7 @@ int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
// close the files before attempting to copy
fin.close();
fout.close();
- if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(),
- soutfile.c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(tempOutputFile, soutfile)) {
res = 0;
} else {
cmSystemTools::SetPermissions(soutfile, perm);
@@ -3907,7 +3980,7 @@ void cmMakefile::RaiseScope(const std::string& var, const char* varDef)
if (!this->StateSnapshot.RaiseScope(var, varDef)) {
std::ostringstream m;
m << "Cannot set \"" << var << "\": current scope has no parent.";
- this->IssueMessage(cmake::AUTHOR_WARNING, m.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, m.str());
return;
}
@@ -3992,7 +4065,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
// target names must be globally unique
switch (this->GetPolicyStatus(cmPolicies::CMP0002)) {
case cmPolicies::WARN:
- this->IssueMessage(cmake::AUTHOR_WARNING,
+ this->IssueMessage(MessageType::AUTHOR_WARNING,
cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
CM_FALLTHROUGH;
case cmPolicies::OLD:
@@ -4000,7 +4073,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
this->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0002));
return true;
case cmPolicies::NEW:
@@ -4079,7 +4152,7 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
<< "to work accidentally and is being allowed for "
<< "compatibility.";
/* clang-format on */
- this->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
CM_FALLTHROUGH;
case cmPolicies::OLD:
// OLD behavior does not warn.
@@ -4098,7 +4171,7 @@ bool cmMakefile::EnforceUniqueDir(const std::string& srcPath,
<< " " << srcPath << "\n"
<< "Specify a unique binary directory name.";
/* clang-format on */
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
break;
}
@@ -4183,7 +4256,7 @@ bool cmMakefile::SetPolicy(const char* id, cmPolicies::PolicyStatus status)
if (!cmPolicies::GetPolicyID(id, /* out */ pid)) {
std::ostringstream e;
e << "Policy \"" << id << "\" is not known to this version of CMake.";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
return this->SetPolicy(pid, status);
@@ -4196,14 +4269,18 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
if (status != cmPolicies::NEW &&
cmPolicies::GetPolicyStatus(id) == cmPolicies::REQUIRED_ALWAYS) {
std::string msg = cmPolicies::GetRequiredAlwaysPolicyError(id);
- this->IssueMessage(cmake::FATAL_ERROR, msg);
+ this->IssueMessage(MessageType::FATAL_ERROR, msg);
return false;
}
// Deprecate old policies, especially those that require a lot
// of code to maintain the old behavior.
- if (status == cmPolicies::OLD && id <= cmPolicies::CMP0063) {
- this->IssueMessage(cmake::DEPRECATION_WARNING,
+ if (status == cmPolicies::OLD && id <= cmPolicies::CMP0065 &&
+ !(this->GetCMakeInstance()->GetIsInTryCompile() &&
+ (
+ // Policies set by cmCoreTryCompile::TryCompileCode.
+ id == cmPolicies::CMP0065))) {
+ this->IssueMessage(MessageType::DEPRECATION_WARNING,
cmPolicies::GetPolicyDeprecatedWarning(id));
}
@@ -4230,7 +4307,7 @@ void cmMakefile::PushPolicy(bool weak, cmPolicies::PolicyMap const& pm)
void cmMakefile::PopPolicy()
{
if (!this->StateSnapshot.PopPolicy()) {
- this->IssueMessage(cmake::FATAL_ERROR,
+ this->IssueMessage(MessageType::FATAL_ERROR,
"cmake_policy POP without matching PUSH");
}
}
@@ -4242,7 +4319,7 @@ void cmMakefile::PopSnapshot(bool reportError)
// reject any still-open nested policy scopes with an error.
while (!this->StateSnapshot.CanPopPolicyScope()) {
if (reportError) {
- this->IssueMessage(cmake::FATAL_ERROR,
+ this->IssueMessage(MessageType::FATAL_ERROR,
"cmake_policy PUSH without matching POP");
reportError = false;
}
@@ -4335,7 +4412,7 @@ bool cmMakefile::AddRequiredTargetFeature(cmTarget* target,
if (error) {
*error = e.str();
} else {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Backtrace);
}
return false;
@@ -4382,7 +4459,7 @@ bool cmMakefile::CompileFeatureKnown(cmTarget const* target,
if (error) {
*error = e.str();
} else {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Backtrace);
}
return false;
@@ -4402,7 +4479,7 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
if (error) {
*error = e.str();
} else {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Backtrace);
}
return nullptr;
@@ -4425,7 +4502,7 @@ const char* cmMakefile::CompileFeaturesAvailable(const std::string& lang,
if (error) {
*error = e.str();
} else {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e.str(),
this->Backtrace);
}
return nullptr;
@@ -4450,7 +4527,7 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
std::ostringstream e;
e << "CMAKE_C_STANDARD_DEFAULT is not set. COMPILE_FEATURES support "
"not fully configured for this compiler.";
- this->IssueMessage(cmake::INTERNAL_ERROR, e.str());
+ this->IssueMessage(MessageType::INTERNAL_ERROR, e.str());
// Return true so the caller does not try to lookup the default standard.
return true;
}
@@ -4460,7 +4537,7 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
e << "The CMAKE_C_STANDARD_DEFAULT variable contains an "
"invalid value: \""
<< defaultCStandard << "\".";
- this->IssueMessage(cmake::INTERNAL_ERROR, e.str());
+ this->IssueMessage(MessageType::INTERNAL_ERROR, e.str());
return false;
}
@@ -4480,7 +4557,7 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
std::ostringstream e;
e << "The C_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCStandard << "\".";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -4534,7 +4611,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
std::ostringstream e;
e << "CMAKE_CXX_STANDARD_DEFAULT is not set. COMPILE_FEATURES support "
"not fully configured for this compiler.";
- this->IssueMessage(cmake::INTERNAL_ERROR, e.str());
+ this->IssueMessage(MessageType::INTERNAL_ERROR, e.str());
// Return true so the caller does not try to lookup the default standard.
return true;
}
@@ -4544,7 +4621,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
e << "The CMAKE_CXX_STANDARD_DEFAULT variable contains an "
"invalid value: \""
<< defaultCxxStandard << "\".";
- this->IssueMessage(cmake::INTERNAL_ERROR, e.str());
+ this->IssueMessage(MessageType::INTERNAL_ERROR, e.str());
return false;
}
@@ -4568,7 +4645,7 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
std::ostringstream e;
e << "The CXX_STANDARD property on target \"" << target->GetName()
<< "\" contained an invalid value: \"" << existingCxxStandard << "\".";
- this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -4648,8 +4725,8 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
if (error) {
*error = e.str();
} else {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- this->Backtrace);
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str(), this->Backtrace);
}
return false;
}
@@ -4669,8 +4746,8 @@ bool cmMakefile::AddRequiredTargetCxxFeature(cmTarget* target,
if (error) {
*error = e.str();
} else {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- this->Backtrace);
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str(), this->Backtrace);
}
return false;
}
@@ -4747,8 +4824,8 @@ bool cmMakefile::AddRequiredTargetCFeature(cmTarget* target,
if (error) {
*error = e.str();
} else {
- this->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, e.str(),
- this->Backtrace);
+ this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR,
+ e.str(), this->Backtrace);
}
return false;
}
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index b30f281b5..70a5689e1 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -18,13 +18,13 @@
#include "cmAlgorithms.h"
#include "cmListFileCache.h"
+#include "cmMessageType.h"
#include "cmNewLineStyle.h"
#include "cmPolicies.h"
#include "cmSourceFileLocationKind.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmTarget.h"
-#include "cmake.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cmSourceGroup.h"
@@ -46,6 +46,7 @@ class cmState;
class cmTest;
class cmTestGenerator;
class cmVariableWatch;
+class cmake;
/** A type-safe wrapper for a string representing a directory id. */
class cmDirectoryId
@@ -64,8 +65,6 @@ public:
*/
class cmMakefile
{
- CM_DISABLE_COPY(cmMakefile)
-
public:
/* Mark a variable as used */
void MarkVariableAsUsed(const std::string& var);
@@ -83,13 +82,15 @@ public:
*/
~cmMakefile();
- cmDirectoryId GetDirectoryId() const;
+ cmMakefile(cmMakefile const&) = delete;
+ cmMakefile& operator=(cmMakefile const&) = delete;
- bool ReadListFile(const char* filename);
+ cmDirectoryId GetDirectoryId() const;
- bool ReadDependentFile(const char* filename, bool noPolicyScope = true);
+ bool ReadListFile(const std::string& filename);
- bool ProcessBuildsystemFile(const char* filename);
+ bool ReadDependentFile(const std::string& filename,
+ bool noPolicyScope = true);
/**
* Add a function blocker to this makefile
@@ -689,7 +690,13 @@ public:
/**
* Return a location of a file in cmake or custom modules directory
*/
- std::string GetModulesFile(const char* name) const;
+ std::string GetModulesFile(const std::string& name) const
+ {
+ bool system;
+ return this->GetModulesFile(name, system);
+ }
+
+ std::string GetModulesFile(const std::string& name, bool& system) const;
///! Set/Get a property of this directory
void SetProperty(const std::string& prop, const char* value);
@@ -774,20 +781,23 @@ public:
/** Helper class to push and pop scopes automatically. */
class ScopePushPop
{
- CM_DISABLE_COPY(ScopePushPop)
public:
ScopePushPop(cmMakefile* m)
: Makefile(m)
{
this->Makefile->PushScope();
}
+
~ScopePushPop() { this->Makefile->PopScope(); }
+ ScopePushPop(ScopePushPop const&) = delete;
+ ScopePushPop& operator=(ScopePushPop const&) = delete;
+
private:
cmMakefile* Makefile;
};
- void IssueMessage(cmake::MessageType t, std::string const& text) const;
+ void IssueMessage(MessageType t, std::string const& text) const;
/** Set whether or not to report a CMP0000 violation. */
void SetCheckCMP0000(bool b) { this->CheckCMP0000 = b; }
@@ -860,6 +870,12 @@ public:
std::deque<std::vector<std::string>> FindPackageRootPathStack;
void MaybeWarnCMP0074(std::string const& pkg);
+ void MaybeWarnUninitialized(std::string const& variable,
+ const char* sourceFilename) const;
+ bool IsProjectFile(const char* filename) const;
+
+ int GetRecursionDepth() const;
+ void SetRecursionDepth(int recursionDepth);
protected:
// add link libraries and directories to the target
@@ -921,6 +937,7 @@ protected:
private:
cmStateSnapshot StateSnapshot;
cmListFileBacktrace Backtrace;
+ int RecursionDepth;
void ReadListFile(cmListFile const& listFile,
const std::string& filenametoread);
@@ -973,15 +990,18 @@ private:
friend class BuildsystemFileScope;
// CMP0053 == old
- cmake::MessageType ExpandVariablesInStringOld(
- std::string& errorstr, std::string& source, bool escapeQuotes,
- bool noEscapes, bool atOnly, const char* filename, long line,
- bool removeEmpty, bool replaceAt) const;
+ MessageType ExpandVariablesInStringOld(std::string& errorstr,
+ std::string& source,
+ bool escapeQuotes, bool noEscapes,
+ bool atOnly, const char* filename,
+ long line, bool removeEmpty,
+ bool replaceAt) const;
// CMP0053 == new
- cmake::MessageType ExpandVariablesInStringNew(
- std::string& errorstr, std::string& source, bool escapeQuotes,
- bool noEscapes, bool atOnly, const char* filename, long line,
- bool removeEmpty, bool replaceAt) const;
+ MessageType ExpandVariablesInStringNew(std::string& errorstr,
+ std::string& source,
+ bool escapeQuotes, bool noEscapes,
+ bool atOnly, const char* filename,
+ long line, bool replaceAt) const;
/**
* Old version of GetSourceFileWithOutput(const std::string&) kept for
* backward-compatibility. It implements a linear search and support
@@ -1025,7 +1045,7 @@ private:
bool CheckCMP0000;
std::set<std::string> WarnedCMP0074;
bool IsSourceFileTryCompile;
- mutable bool SuppressWatches;
+ mutable bool SuppressSideEffects;
};
#endif
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index 846b12ce1..e8ae5ae36 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -6,6 +6,7 @@
#include <memory> // IWYU pragma: keep
#include <sstream>
#include <string>
+#include <utility>
#include <vector>
#include "cmGeneratedFileStream.h"
@@ -24,7 +25,6 @@
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
cmMakefileExecutableTargetGenerator::cmMakefileExecutableTargetGenerator(
cmGeneratorTarget* target)
@@ -95,7 +95,13 @@ void cmMakefileExecutableTargetGenerator::WriteDeviceExecutableRule(
const bool hasCUDA =
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- if (!hasCUDA) {
+
+ bool doDeviceLinking = true;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (!hasCUDA || !doDeviceLinking) {
return;
}
@@ -316,7 +322,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
std::string outpathImp;
if (relink) {
outpath = this->Makefile->GetCurrentBinaryDirectory();
- outpath += cmake::GetCMakeFilesDirectory();
+ outpath += "/CMakeFiles";
outpath += "/CMakeRelink.dir";
cmSystemTools::MakeDirectory(outpath);
outpath += "/";
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 2d2915c21..5a1ef4efe 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -6,6 +6,7 @@
#include <memory> // IWYU pragma: keep
#include <sstream>
#include <stddef.h>
+#include <utility>
#include <vector>
#include "cmGeneratedFileStream.h"
@@ -24,7 +25,6 @@
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
cmMakefileLibraryTargetGenerator::cmMakefileLibraryTargetGenerator(
cmGeneratorTarget* target)
@@ -133,9 +133,12 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- const bool resolveDeviceSymbols =
- this->GeneratorTarget->GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
- if (hasCUDA && resolveDeviceSymbols) {
+ bool doDeviceLinking = false;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (hasCUDA && doDeviceLinking) {
std::string linkRuleVar = "CMAKE_CUDA_DEVICE_LINK_LIBRARY";
this->WriteDeviceLibraryRules(linkRuleVar, false);
}
@@ -168,7 +171,12 @@ void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
const bool hasCUDA =
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- if (hasCUDA) {
+ bool doDeviceLinking = true;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (hasCUDA && doDeviceLinking) {
std::string linkRuleVar = "CMAKE_CUDA_DEVICE_LINK_LIBRARY";
this->WriteDeviceLibraryRules(linkRuleVar, relink);
}
@@ -209,7 +217,12 @@ void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
const bool hasCUDA =
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- if (hasCUDA) {
+ bool doDeviceLinking = true;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ }
+ if (hasCUDA && doDeviceLinking) {
std::string linkRuleVar = "CMAKE_CUDA_DEVICE_LINK_LIBRARY";
this->WriteDeviceLibraryRules(linkRuleVar, relink);
}
@@ -498,7 +511,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules(
outpath += "/";
} else if (relink) {
outpath = this->Makefile->GetCurrentBinaryDirectory();
- outpath += cmake::GetCMakeFilesDirectory();
+ outpath += "/CMakeFiles";
outpath += "/CMakeRelink.dir";
cmSystemTools::MakeDirectory(outpath);
outpath += "/";
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index f423560eb..af34169c3 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -97,6 +97,9 @@ void cmMakefileTargetGenerator::GetTargetLinkFlags(
this->GeneratorTarget->GetLinkOptions(opts, this->ConfigName, linkLanguage);
// LINK_OPTIONS are escaped.
this->LocalGenerator->AppendCompileOptions(flags, opts);
+
+ this->LocalGenerator->AppendPositionIndependentLinkerFlags(
+ flags, this->GeneratorTarget, this->ConfigName, linkLanguage);
}
void cmMakefileTargetGenerator::CreateRuleFile()
@@ -400,7 +403,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
err << "Warning: Source file \"" << source.GetFullPath()
<< "\" is listed multiple times for target \""
<< this->GeneratorTarget->GetName() << "\".";
- cmSystemTools::Message(err.str().c_str(), "Warning");
+ cmSystemTools::Message(err.str(), "Warning");
return;
}
@@ -432,8 +435,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
objFullPath = cmSystemTools::CollapseFullPath(objFullPath);
std::string srcFullPath =
cmSystemTools::CollapseFullPath(source.GetFullPath());
- this->LocalGenerator->AddImplicitDepends(
- this->GeneratorTarget, lang, objFullPath.c_str(), srcFullPath.c_str());
+ this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, lang,
+ objFullPath, srcFullPath);
}
void cmMakefileTargetGenerator::WriteObjectBuildFile(
@@ -590,7 +593,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
// mingw32-make incorrectly interprets 'a\ b c' as 'a b' and 'c'
// (but 'a\ b "c"' as 'a\', 'b', and 'c'!). Workaround this by
// avoiding a trailing backslash in the argument.
- targetOutPathCompilePDB[targetOutPathCompilePDB.size() - 1] = '/';
+ targetOutPathCompilePDB.back() = '/';
}
}
cmRulePlaceholderExpander::RuleVariables vars;
@@ -684,6 +687,17 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
std::string langIncludes = std::string("$(") + lang + "_INCLUDES)";
compileCommand.replace(compileCommand.find(langIncludes),
langIncludes.size(), this->GetIncludes(lang));
+
+ const char* eliminate[] = {
+ this->Makefile->GetDefinition("CMAKE_START_TEMP_FILE"),
+ this->Makefile->GetDefinition("CMAKE_END_TEMP_FILE")
+ };
+ for (const char* el : eliminate) {
+ if (el) {
+ cmSystemTools::ReplaceString(compileCommand, el, "");
+ }
+ }
+
this->GlobalGenerator->AddCXXCompileCommand(
source.GetFullPath(), workingDirectory, compileCommand);
}
@@ -802,7 +816,7 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile(
lang_has_assembly && this->LocalGenerator->GetCreateAssemblySourceRules();
if (do_preprocess_rules || do_assembly_rules) {
std::vector<std::string> force_depends;
- force_depends.push_back("cmake_force");
+ force_depends.emplace_back("cmake_force");
std::string::size_type dot_pos = relativeObj.rfind('.');
std::string relativeObjBase = relativeObj.substr(0, dot_pos);
dot_pos = obj.rfind('.');
@@ -1199,8 +1213,7 @@ void cmMakefileTargetGenerator::GenerateCustomRuleFile(
std::string objFullPath = cmSystemTools::CollapseFullPath(outputs[0]);
std::string srcFullPath = cmSystemTools::CollapseFullPath(idi.second);
this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, idi.first,
- objFullPath.c_str(),
- srcFullPath.c_str());
+ objFullPath, srcFullPath);
}
}
@@ -1208,7 +1221,7 @@ void cmMakefileTargetGenerator::MakeEchoProgress(
cmLocalUnixMakefileGenerator3::EchoProgress& progress) const
{
progress.Dir = this->LocalGenerator->GetBinaryDirectory();
- progress.Dir += cmake::GetCMakeFilesDirectory();
+ progress.Dir += "/CMakeFiles";
std::ostringstream progressArg;
progressArg << "$(CMAKE_PROGRESS_" << this->NumberOfProgressActions << ")";
progress.Arg = progressArg.str();
@@ -1233,8 +1246,9 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
}
for (std::string const& obj : this->Objects) {
*this->BuildFileStream << " " << lineContinue << "\n";
- *this->BuildFileStream << this->LocalGenerator->ConvertToQuotedOutputPath(
- obj.c_str(), useWatcomQuote);
+ *this->BuildFileStream
+ << cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
+ obj, useWatcomQuote);
}
*this->BuildFileStream << "\n";
@@ -1255,8 +1269,9 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
object =
this->LocalGenerator->MaybeConvertToRelativePath(currentBinDir, obj);
*this->BuildFileStream << " " << lineContinue << "\n";
- *this->BuildFileStream << this->LocalGenerator->ConvertToQuotedOutputPath(
- obj.c_str(), useWatcomQuote);
+ *this->BuildFileStream
+ << cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
+ obj, useWatcomQuote);
}
*this->BuildFileStream << "\n"
<< "\n";
@@ -1303,11 +1318,10 @@ public:
private:
std::string MaybeConvertToRelativePath(std::string const& obj)
{
- if (!cmOutputConverter::ContainedInDirectory(
- this->StateDir.GetCurrentBinary(), obj, this->StateDir)) {
+ if (!this->StateDir.ContainsBoth(this->StateDir.GetCurrentBinary(), obj)) {
return obj;
}
- return cmOutputConverter::ForceToRelativePath(
+ return cmSystemTools::ForceToRelativePath(
this->StateDir.GetCurrentBinary(), obj);
}
diff --git a/Source/cmMathCommand.cxx b/Source/cmMathCommand.cxx
index a50e5fc33..48b9a27ad 100644
--- a/Source/cmMathCommand.cxx
+++ b/Source/cmMathCommand.cxx
@@ -4,8 +4,8 @@
#include "cmExprParserHelper.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cm_kwiml.h"
-#include "cmake.h"
#include <stdio.h>
@@ -104,7 +104,7 @@ bool cmMathCommand::HandleExprCommand(std::vector<std::string> const& args)
std::string const& w = helper.GetWarning();
if (!w.empty()) {
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w);
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w);
}
this->Makefile->AddDefinition(outputVariable, buffer);
diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx
index 5a341bd2b..95f5fcbbe 100644
--- a/Source/cmMessageCommand.cxx
+++ b/Source/cmMessageCommand.cxx
@@ -4,9 +4,9 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmMessenger.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -20,26 +20,26 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
}
std::vector<std::string>::const_iterator i = args.begin();
- cmake::MessageType type = cmake::MESSAGE;
+ MessageType type = MessageType::MESSAGE;
bool status = false;
bool fatal = false;
if (*i == "SEND_ERROR") {
- type = cmake::FATAL_ERROR;
+ type = MessageType::FATAL_ERROR;
++i;
} else if (*i == "FATAL_ERROR") {
fatal = true;
- type = cmake::FATAL_ERROR;
+ type = MessageType::FATAL_ERROR;
++i;
} else if (*i == "WARNING") {
- type = cmake::WARNING;
+ type = MessageType::WARNING;
++i;
} else if (*i == "AUTHOR_WARNING") {
if (this->Makefile->IsSet("CMAKE_SUPPRESS_DEVELOPER_ERRORS") &&
!this->Makefile->IsOn("CMAKE_SUPPRESS_DEVELOPER_ERRORS")) {
fatal = true;
- type = cmake::AUTHOR_ERROR;
+ type = MessageType::AUTHOR_ERROR;
} else if (!this->Makefile->IsOn("CMAKE_SUPPRESS_DEVELOPER_WARNINGS")) {
- type = cmake::AUTHOR_WARNING;
+ type = MessageType::AUTHOR_WARNING;
} else {
return true;
}
@@ -50,10 +50,10 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
} else if (*i == "DEPRECATION") {
if (this->Makefile->IsOn("CMAKE_ERROR_DEPRECATED")) {
fatal = true;
- type = cmake::DEPRECATION_ERROR;
+ type = MessageType::DEPRECATION_ERROR;
} else if ((!this->Makefile->IsSet("CMAKE_WARN_DEPRECATED") ||
this->Makefile->IsOn("CMAKE_WARN_DEPRECATED"))) {
- type = cmake::DEPRECATION_WARNING;
+ type = MessageType::DEPRECATION_WARNING;
} else {
return true;
}
@@ -62,7 +62,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
std::string message = cmJoin(cmMakeRange(i, args.end()), std::string());
- if (type != cmake::MESSAGE) {
+ if (type != MessageType::MESSAGE) {
// we've overridden the message type, above, so display it directly
cmMessenger* m = this->Makefile->GetMessenger();
m->DisplayMessage(type, message, this->Makefile->GetBacktrace());
@@ -70,7 +70,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,
if (status) {
this->Makefile->DisplayStatus(message.c_str(), -1);
} else {
- cmSystemTools::Message(message.c_str());
+ cmSystemTools::Message(message);
}
}
if (fatal) {
diff --git a/Source/cmMessageType.h b/Source/cmMessageType.h
new file mode 100644
index 000000000..b57b86bee
--- /dev/null
+++ b/Source/cmMessageType.h
@@ -0,0 +1,21 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmMessageType_h
+#define cmMessageType_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+enum class MessageType
+{
+ AUTHOR_WARNING,
+ AUTHOR_ERROR,
+ FATAL_ERROR,
+ INTERNAL_ERROR,
+ MESSAGE,
+ WARNING,
+ LOG,
+ DEPRECATION_ERROR,
+ DEPRECATION_WARNING
+};
+
+#endif
diff --git a/Source/cmMessenger.cxx b/Source/cmMessenger.cxx
index a81428aed..1d790e2e8 100644
--- a/Source/cmMessenger.cxx
+++ b/Source/cmMessenger.cxx
@@ -4,7 +4,6 @@
#include "cmAlgorithms.h"
#include "cmDocumentationFormatter.h"
-#include "cmState.h"
#include "cmSystemTools.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -13,47 +12,47 @@
#include <sstream>
-cmake::MessageType cmMessenger::ConvertMessageType(cmake::MessageType t) const
+MessageType cmMessenger::ConvertMessageType(MessageType t) const
{
bool warningsAsErrors;
- if (t == cmake::AUTHOR_WARNING || t == cmake::AUTHOR_ERROR) {
+ if (t == MessageType::AUTHOR_WARNING || t == MessageType::AUTHOR_ERROR) {
warningsAsErrors = this->GetDevWarningsAsErrors();
- if (warningsAsErrors && t == cmake::AUTHOR_WARNING) {
- t = cmake::AUTHOR_ERROR;
- } else if (!warningsAsErrors && t == cmake::AUTHOR_ERROR) {
- t = cmake::AUTHOR_WARNING;
+ if (warningsAsErrors && t == MessageType::AUTHOR_WARNING) {
+ t = MessageType::AUTHOR_ERROR;
+ } else if (!warningsAsErrors && t == MessageType::AUTHOR_ERROR) {
+ t = MessageType::AUTHOR_WARNING;
}
- } else if (t == cmake::DEPRECATION_WARNING ||
- t == cmake::DEPRECATION_ERROR) {
+ } else if (t == MessageType::DEPRECATION_WARNING ||
+ t == MessageType::DEPRECATION_ERROR) {
warningsAsErrors = this->GetDeprecatedWarningsAsErrors();
- if (warningsAsErrors && t == cmake::DEPRECATION_WARNING) {
- t = cmake::DEPRECATION_ERROR;
- } else if (!warningsAsErrors && t == cmake::DEPRECATION_ERROR) {
- t = cmake::DEPRECATION_WARNING;
+ if (warningsAsErrors && t == MessageType::DEPRECATION_WARNING) {
+ t = MessageType::DEPRECATION_ERROR;
+ } else if (!warningsAsErrors && t == MessageType::DEPRECATION_ERROR) {
+ t = MessageType::DEPRECATION_WARNING;
}
}
return t;
}
-bool cmMessenger::IsMessageTypeVisible(cmake::MessageType t) const
+bool cmMessenger::IsMessageTypeVisible(MessageType t) const
{
bool isVisible = true;
- if (t == cmake::DEPRECATION_ERROR) {
+ if (t == MessageType::DEPRECATION_ERROR) {
if (!this->GetDeprecatedWarningsAsErrors()) {
isVisible = false;
}
- } else if (t == cmake::DEPRECATION_WARNING) {
+ } else if (t == MessageType::DEPRECATION_WARNING) {
if (this->GetSuppressDeprecatedWarnings()) {
isVisible = false;
}
- } else if (t == cmake::AUTHOR_ERROR) {
+ } else if (t == MessageType::AUTHOR_ERROR) {
if (!this->GetDevWarningsAsErrors()) {
isVisible = false;
}
- } else if (t == cmake::AUTHOR_WARNING) {
+ } else if (t == MessageType::AUTHOR_WARNING) {
if (this->GetSuppressDevWarnings()) {
isVisible = false;
}
@@ -62,22 +61,22 @@ bool cmMessenger::IsMessageTypeVisible(cmake::MessageType t) const
return isVisible;
}
-static bool printMessagePreamble(cmake::MessageType t, std::ostream& msg)
+static bool printMessagePreamble(MessageType t, std::ostream& msg)
{
// Construct the message header.
- if (t == cmake::FATAL_ERROR) {
+ if (t == MessageType::FATAL_ERROR) {
msg << "CMake Error";
- } else if (t == cmake::INTERNAL_ERROR) {
+ } else if (t == MessageType::INTERNAL_ERROR) {
msg << "CMake Internal Error (please report a bug)";
- } else if (t == cmake::LOG) {
+ } else if (t == MessageType::LOG) {
msg << "CMake Debug Log";
- } else if (t == cmake::DEPRECATION_ERROR) {
+ } else if (t == MessageType::DEPRECATION_ERROR) {
msg << "CMake Deprecation Error";
- } else if (t == cmake::DEPRECATION_WARNING) {
+ } else if (t == MessageType::DEPRECATION_WARNING) {
msg << "CMake Deprecation Warning";
- } else if (t == cmake::AUTHOR_WARNING) {
+ } else if (t == MessageType::AUTHOR_WARNING) {
msg << "CMake Warning (dev)";
- } else if (t == cmake::AUTHOR_ERROR) {
+ } else if (t == MessageType::AUTHOR_ERROR) {
msg << "CMake Error (dev)";
} else {
msg << "CMake Warning";
@@ -93,13 +92,13 @@ void printMessageText(std::ostream& msg, std::string const& text)
formatter.PrintFormatted(msg, text.c_str());
}
-void displayMessage(cmake::MessageType t, std::ostringstream& msg)
+void displayMessage(MessageType t, std::ostringstream& msg)
{
// Add a note about warning suppression.
- if (t == cmake::AUTHOR_WARNING) {
+ if (t == MessageType::AUTHOR_WARNING) {
msg << "This warning is for project developers. Use -Wno-dev to suppress "
"it.";
- } else if (t == cmake::AUTHOR_ERROR) {
+ } else if (t == MessageType::AUTHOR_ERROR) {
msg << "This error is for project developers. Use -Wno-error=dev to "
"suppress "
"it.";
@@ -110,7 +109,7 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg)
#if defined(CMAKE_BUILD_WITH_CMAKE)
// Add a C++ stack trace to internal errors.
- if (t == cmake::INTERNAL_ERROR) {
+ if (t == MessageType::INTERNAL_ERROR) {
std::string stack = cmsys::SystemInformation::GetProgramStack(0, 0);
if (!stack.empty()) {
if (cmHasLiteralPrefix(stack, "WARNING:")) {
@@ -122,27 +121,22 @@ void displayMessage(cmake::MessageType t, std::ostringstream& msg)
#endif
// Output the message.
- if (t == cmake::FATAL_ERROR || t == cmake::INTERNAL_ERROR ||
- t == cmake::DEPRECATION_ERROR || t == cmake::AUTHOR_ERROR) {
+ if (t == MessageType::FATAL_ERROR || t == MessageType::INTERNAL_ERROR ||
+ t == MessageType::DEPRECATION_ERROR || t == MessageType::AUTHOR_ERROR) {
cmSystemTools::SetErrorOccured();
- cmSystemTools::Message(msg.str().c_str(), "Error");
+ cmSystemTools::Message(msg.str(), "Error");
} else {
- cmSystemTools::Message(msg.str().c_str(), "Warning");
+ cmSystemTools::Message(msg.str(), "Warning");
}
}
-cmMessenger::cmMessenger(cmState* state)
- : State(state)
-{
-}
-
-void cmMessenger::IssueMessage(cmake::MessageType t, const std::string& text,
+void cmMessenger::IssueMessage(MessageType t, const std::string& text,
const cmListFileBacktrace& backtrace) const
{
bool force = false;
if (!force) {
// override the message type, if needed, for warnings and errors
- cmake::MessageType override = this->ConvertMessageType(t);
+ MessageType override = this->ConvertMessageType(t);
if (override != t) {
t = override;
force = true;
@@ -155,7 +149,7 @@ void cmMessenger::IssueMessage(cmake::MessageType t, const std::string& text,
this->DisplayMessage(t, text, backtrace);
}
-void cmMessenger::DisplayMessage(cmake::MessageType t, const std::string& text,
+void cmMessenger::DisplayMessage(MessageType t, const std::string& text,
const cmListFileBacktrace& backtrace) const
{
std::ostringstream msg;
@@ -173,31 +167,3 @@ void cmMessenger::DisplayMessage(cmake::MessageType t, const std::string& text,
displayMessage(t, msg);
}
-
-bool cmMessenger::GetSuppressDevWarnings() const
-{
- const char* cacheEntryValue =
- this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
- return cmSystemTools::IsOn(cacheEntryValue);
-}
-
-bool cmMessenger::GetSuppressDeprecatedWarnings() const
-{
- const char* cacheEntryValue =
- this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
- return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue);
-}
-
-bool cmMessenger::GetDevWarningsAsErrors() const
-{
- const char* cacheEntryValue =
- this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS");
- return cacheEntryValue && cmSystemTools::IsOff(cacheEntryValue);
-}
-
-bool cmMessenger::GetDeprecatedWarningsAsErrors() const
-{
- const char* cacheEntryValue =
- this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
- return cmSystemTools::IsOn(cacheEntryValue);
-}
diff --git a/Source/cmMessenger.h b/Source/cmMessenger.h
index 4aafbd40b..cf15adfc1 100644
--- a/Source/cmMessenger.h
+++ b/Source/cmMessenger.h
@@ -6,34 +6,56 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include "cmListFileCache.h"
-#include "cmake.h"
+#include "cmMessageType.h"
#include <string>
-class cmState;
-
class cmMessenger
{
public:
- cmMessenger(cmState* state);
-
void IssueMessage(
- cmake::MessageType t, std::string const& text,
+ MessageType t, std::string const& text,
cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const;
- void DisplayMessage(cmake::MessageType t, std::string const& text,
+ void DisplayMessage(MessageType t, std::string const& text,
cmListFileBacktrace const& backtrace) const;
- bool GetSuppressDevWarnings() const;
- bool GetSuppressDeprecatedWarnings() const;
- bool GetDevWarningsAsErrors() const;
- bool GetDeprecatedWarningsAsErrors() const;
+ void SetSuppressDevWarnings(bool suppress)
+ {
+ this->SuppressDevWarnings = suppress;
+ }
+ void SetSuppressDeprecatedWarnings(bool suppress)
+ {
+ this->SuppressDeprecatedWarnings = suppress;
+ }
+ void SetDevWarningsAsErrors(bool error)
+ {
+ this->DevWarningsAsErrors = error;
+ }
+ void SetDeprecatedWarningsAsErrors(bool error)
+ {
+ this->DeprecatedWarningsAsErrors = error;
+ }
+
+ bool GetSuppressDevWarnings() const { return this->SuppressDevWarnings; }
+ bool GetSuppressDeprecatedWarnings() const
+ {
+ return this->SuppressDeprecatedWarnings;
+ }
+ bool GetDevWarningsAsErrors() const { return this->DevWarningsAsErrors; }
+ bool GetDeprecatedWarningsAsErrors() const
+ {
+ return this->DeprecatedWarningsAsErrors;
+ }
private:
- bool IsMessageTypeVisible(cmake::MessageType t) const;
- cmake::MessageType ConvertMessageType(cmake::MessageType t) const;
+ bool IsMessageTypeVisible(MessageType t) const;
+ MessageType ConvertMessageType(MessageType t) const;
- cmState* State;
+ bool SuppressDevWarnings = false;
+ bool SuppressDeprecatedWarnings = false;
+ bool DevWarningsAsErrors = false;
+ bool DeprecatedWarningsAsErrors = false;
};
#endif
diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx
index 5500eba65..3f6523e09 100644
--- a/Source/cmNewLineStyle.cxx
+++ b/Source/cmNewLineStyle.cxx
@@ -4,10 +4,7 @@
#include <stddef.h>
-cmNewLineStyle::cmNewLineStyle()
- : NewLineStyle(Invalid)
-{
-}
+cmNewLineStyle::cmNewLineStyle() = default;
bool cmNewLineStyle::IsValid() const
{
diff --git a/Source/cmNewLineStyle.h b/Source/cmNewLineStyle.h
index 397cd2c50..f1a7bc6e0 100644
--- a/Source/cmNewLineStyle.h
+++ b/Source/cmNewLineStyle.h
@@ -33,7 +33,7 @@ public:
const std::string GetCharacters() const;
private:
- Style NewLineStyle;
+ Style NewLineStyle = Invalid;
};
#endif
diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h
index 0ed53f45a..b2b2e84e1 100644
--- a/Source/cmNinjaLinkLineComputer.h
+++ b/Source/cmNinjaLinkLineComputer.h
@@ -16,13 +16,14 @@ class cmStateDirectory;
class cmNinjaLinkLineComputer : public cmLinkLineComputer
{
- CM_DISABLE_COPY(cmNinjaLinkLineComputer)
-
public:
cmNinjaLinkLineComputer(cmOutputConverter* outputConverter,
cmStateDirectory const& stateDir,
cmGlobalNinjaGenerator const* gg);
+ cmNinjaLinkLineComputer(cmNinjaLinkLineComputer const&) = delete;
+ cmNinjaLinkLineComputer& operator=(cmNinjaLinkLineComputer const&) = delete;
+
std::string ConvertToLinkReference(std::string const& input) const override;
private:
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 8909e0663..cbc01035f 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -9,6 +9,7 @@
#include <memory> // IWYU pragma: keep
#include <set>
#include <sstream>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmCustomCommandGenerator.h"
@@ -30,20 +31,13 @@
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmCustomCommand;
cmNinjaNormalTargetGenerator::cmNinjaNormalTargetGenerator(
cmGeneratorTarget* target)
: cmNinjaTargetGenerator(target)
- , TargetNameOut()
- , TargetNameSO()
- , TargetNameReal()
- , TargetNameImport()
- , TargetNamePDB()
, TargetLinkLanguage("")
- , DeviceLinkObject()
{
this->TargetLinkLanguage = target->GetLinkerLanguage(this->GetConfigName());
if (target->GetType() == cmStateEnums::EXECUTABLE) {
@@ -382,7 +376,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
cmEraseIf(linkCmds, cmNinjaRemoveNoOpCommands());
linkCmds.insert(linkCmds.begin(), "$PRE_LINK");
- linkCmds.push_back("$POST_BUILD");
+ linkCmds.emplace_back("$POST_BUILD");
std::string linkCmd =
this->GetLocalGenerator()->BuildCommandLine(linkCmds);
@@ -410,7 +404,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
std::vector<std::string> commandLines;
commandLines.push_back(cmakeCommand +
" -E cmake_symlink_executable $in $out");
- commandLines.push_back("$POST_BUILD");
+ commandLines.emplace_back("$POST_BUILD");
this->GetGlobalGenerator()->AddRule(
"CMAKE_SYMLINK_EXECUTABLE",
@@ -428,7 +422,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile)
std::vector<std::string> commandLines;
commandLines.push_back(cmakeCommand +
" -E cmake_symlink_library $in $SONAME $out");
- commandLines.push_back("$POST_BUILD");
+ commandLines.emplace_back("$POST_BUILD");
this->GetGlobalGenerator()->AddRule(
"CMAKE_SYMLINK_LIBRARY",
@@ -506,7 +500,6 @@ std::vector<std::string> cmNinjaNormalTargetGenerator::ComputeLinkCmd()
gt.GetFullPath(cfgName, cmStateEnums::RuntimeBinaryArtifact,
/*realname=*/true));
cmakeCommand += targetOutputReal;
- cmakeCommand += " || true";
linkCmds.push_back(std::move(cmakeCommand));
}
return linkCmds;
@@ -573,22 +566,23 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
(std::find(closure->Languages.begin(), closure->Languages.end(),
cuda_lang) != closure->Languages.end());
- bool shouldHaveDeviceLinking = false;
- switch (genTarget.GetType()) {
- case cmStateEnums::SHARED_LIBRARY:
- case cmStateEnums::MODULE_LIBRARY:
- case cmStateEnums::EXECUTABLE:
- shouldHaveDeviceLinking = true;
- break;
- case cmStateEnums::STATIC_LIBRARY:
- shouldHaveDeviceLinking =
- genTarget.GetPropertyAsBool("CUDA_RESOLVE_DEVICE_SYMBOLS");
- break;
- default:
- break;
+ bool doDeviceLinking = false;
+ if (const char* resolveDeviceSymbols =
+ genTarget.GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ } else {
+ switch (genTarget.GetType()) {
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::EXECUTABLE:
+ doDeviceLinking = true;
+ break;
+ default:
+ break;
+ }
}
- if (!(shouldHaveDeviceLinking && hasCUDA)) {
+ if (!(doDeviceLinking && hasCUDA)) {
return;
}
@@ -724,8 +718,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkStatement()
globalGen.GetRuleCmdLength(this->LanguageLinkerDeviceRule());
const std::string rspfile = this->ConvertToNinjaPath(
- std::string(cmake::GetCMakeFilesDirectoryPostSlash()) +
- genTarget.GetName() + ".rsp");
+ std::string("CMakeFiles/") + genTarget.GetName() + ".rsp");
// Gather order-only dependencies.
cmNinjaDeps orderOnlyDeps;
@@ -1010,8 +1003,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
const std::string rspfile = this->ConvertToNinjaPath(
- std::string(cmake::GetCMakeFilesDirectoryPostSlash()) + gt.GetName() +
- ".rsp");
+ std::string("CMakeFiles/") + gt.GetName() + ".rsp");
// Gather order-only dependencies.
cmNinjaDeps orderOnlyDeps;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 7ac8d1b91..82bc5f204 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -10,6 +10,7 @@
#include <map>
#include <memory> // IWYU pragma: keep
#include <sstream>
+#include <utility>
#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
@@ -18,6 +19,7 @@
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalNinjaGenerator.h"
+#include "cmListFileCache.h" // for BT
#include "cmLocalGenerator.h"
#include "cmLocalNinjaGenerator.h"
#include "cmMakefile.h"
@@ -54,10 +56,8 @@ cmNinjaTargetGenerator::cmNinjaTargetGenerator(cmGeneratorTarget* target)
: cmCommonTargetGenerator(target)
, MacOSXContentGenerator(nullptr)
, OSXBundleGenerator(nullptr)
- , MacContentFolders()
, LocalGenerator(
static_cast<cmLocalNinjaGenerator*>(target->GetLocalGenerator()))
- , Objects()
{
MacOSXContentGenerator = new MacOSXContentGeneratorType(this);
}
@@ -173,8 +173,28 @@ void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags,
bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const
{
- return (this->GetMakefile()->GetSafeDefinition("CMAKE_NINJA_DEPTYPE_" +
- lang) == "msvc");
+ std::string const& deptype =
+ this->GetMakefile()->GetSafeDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
+ if (deptype == "msvc") {
+ return true;
+ }
+ if (deptype == "intel") {
+ // Ninja does not really define "intel", but we use it to switch based
+ // on whether this environment supports "gcc" or "msvc" deptype.
+ if (!this->GetGlobalGenerator()->SupportsMultilineDepfile()) {
+ // This ninja version is too old to support the Intel depfile format.
+ // Fall back to msvc deptype.
+ return true;
+ }
+ if ((this->Makefile->GetHomeDirectory().find(' ') != std::string::npos) ||
+ (this->Makefile->GetHomeOutputDirectory().find(' ') !=
+ std::string::npos)) {
+ // The Intel compiler does not properly escape spaces in a depfile.
+ // Fall back to msvc deptype.
+ return true;
+ }
+ }
+ return false;
}
// TODO: Refactor with
@@ -431,6 +451,10 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
vars.TargetCompilePDB = "$TARGET_COMPILE_PDB";
vars.ObjectDir = "$OBJECT_DIR";
vars.ObjectFileDir = "$OBJECT_FILE_DIR";
+ if (lang == "Swift") {
+ vars.SwiftAuxiliarySources = "$SWIFT_AUXILIARY_SOURCES";
+ vars.SwiftModuleName = "$SWIFT_MODULE_NAME";
+ }
// For some cases we do an explicit preprocessor invocation.
bool const explicitPP = this->NeedExplicitPreprocessing(lang);
@@ -626,10 +650,6 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
}
} else {
deptype = "gcc";
- const char* langdeptype = mf->GetDefinition("CMAKE_NINJA_DEPTYPE_" + lang);
- if (langdeptype) {
- deptype = langdeptype;
- }
depfile = "$DEP_FILE";
const std::string flagsName = "CMAKE_DEPFILE_FLAGS_" + lang;
std::string depfileFlags = mf->GetSafeDefinition(flagsName);
@@ -901,6 +921,27 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
vars["FLAGS"] = this->ComputeFlagsForObject(source, language);
vars["DEFINES"] = this->ComputeDefines(source, language);
vars["INCLUDES"] = this->ComputeIncludes(source, language);
+ if (language == "Swift") {
+ // The swift compiler needs all the sources besides the one being compiled
+ // in order to do the type checking. List all these "auxiliary" sources.
+ std::string aux_sources;
+ cmGeneratorTarget::KindedSources const& sources =
+ this->GeneratorTarget->GetKindedSources(this->GetConfigName());
+ for (cmGeneratorTarget::SourceAndKind const& src : sources.Sources) {
+ if (src.Source.Value == source) {
+ continue;
+ }
+ aux_sources += " " + this->GetSourceFilePath(src.Source.Value);
+ }
+ vars["SWIFT_AUXILIARY_SOURCES"] = aux_sources;
+
+ if (const char* name =
+ this->GeneratorTarget->GetProperty("SWIFT_MODULE_NAME")) {
+ vars["SWIFT_MODULE_NAME"] = name;
+ } else {
+ vars["SWIFT_MODULE_NAME"] = this->GeneratorTarget->GetName();
+ }
+ }
if (!this->NeedDepTypeMSVC(language)) {
bool replaceExt(false);
@@ -959,7 +1000,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// (either attached to this source file or another one), assume that one of
// the target dependencies, OBJECT_DEPENDS or header file custom commands
// will rebuild the file.
- if (source->GetPropertyAsBool("GENERATED") &&
+ if (source->GetIsGenerated() &&
!source->GetPropertyAsBool("__CMAKE_GENERATED_BY_CMAKE") &&
!source->GetCustomCommand() &&
!this->GetGlobalGenerator()->HasCustomCommandOutput(sourceFileName)) {
@@ -1103,6 +1144,10 @@ void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang)
mod_dir = this->Makefile->GetCurrentBinaryDirectory();
}
tdi["module-dir"] = mod_dir;
+ tdi["submodule-sep"] =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
+ tdi["submodule-ext"] =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
}
tdi["dir-cur-bld"] = this->Makefile->GetCurrentBinaryDirectory();
diff --git a/Source/cmNinjaUtilityTargetGenerator.cxx b/Source/cmNinjaUtilityTargetGenerator.cxx
index cc6d4b988..95fcf66f4 100644
--- a/Source/cmNinjaUtilityTargetGenerator.cxx
+++ b/Source/cmNinjaUtilityTargetGenerator.cxx
@@ -14,7 +14,6 @@
#include "cmSourceFile.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
#include <algorithm>
#include <iterator>
@@ -27,15 +26,13 @@ cmNinjaUtilityTargetGenerator::cmNinjaUtilityTargetGenerator(
{
}
-cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator()
-{
-}
+cmNinjaUtilityTargetGenerator::~cmNinjaUtilityTargetGenerator() = default;
void cmNinjaUtilityTargetGenerator::Generate()
{
std::string utilCommandName =
this->GetLocalGenerator()->GetCurrentBinaryDirectory();
- utilCommandName += cmake::GetCMakeFilesDirectory();
+ utilCommandName += "/CMakeFiles";
utilCommandName += "/";
utilCommandName += this->GetTargetName() + ".util";
utilCommandName = this->ConvertToNinjaPath(utilCommandName);
diff --git a/Source/cmOSXBundleGenerator.cxx b/Source/cmOSXBundleGenerator.cxx
index 2b9678596..6857d5a27 100644
--- a/Source/cmOSXBundleGenerator.cxx
+++ b/Source/cmOSXBundleGenerator.cxx
@@ -10,15 +10,16 @@
#include "cmTarget.h"
#include <cassert>
+#include <utility>
class cmSourceFile;
cmOSXBundleGenerator::cmOSXBundleGenerator(cmGeneratorTarget* target,
- const std::string& configName)
+ std::string configName)
: GT(target)
, Makefile(target->Target->GetMakefile())
, LocalGenerator(target->GetLocalGenerator())
- , ConfigName(configName)
+ , ConfigName(std::move(configName))
, MacContentFolders(nullptr)
{
if (this->MustSkip()) {
diff --git a/Source/cmOSXBundleGenerator.h b/Source/cmOSXBundleGenerator.h
index be7e932f9..3dea6cc8a 100644
--- a/Source/cmOSXBundleGenerator.h
+++ b/Source/cmOSXBundleGenerator.h
@@ -17,8 +17,7 @@ class cmSourceFile;
class cmOSXBundleGenerator
{
public:
- cmOSXBundleGenerator(cmGeneratorTarget* target,
- const std::string& configName);
+ cmOSXBundleGenerator(cmGeneratorTarget* target, std::string configName);
// create an app bundle at a given root, and return
// the directory within the bundle that contains the executable
@@ -32,7 +31,7 @@ public:
struct MacOSXContentGeneratorType
{
- virtual ~MacOSXContentGeneratorType() {}
+ virtual ~MacOSXContentGeneratorType() = default;
virtual void operator()(cmSourceFile const& source,
const char* pkgloc) = 0;
};
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index 006211ddc..52f63a379 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -6,12 +6,12 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -81,7 +81,7 @@ bool cmOptionCommand::InitialPass(std::vector<std::string> const& args,
"For compatibility with older versions of CMake, option "
"is clearing the normal variable '"
<< args[0] << "'.";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
}
return true;
diff --git a/Source/cmOrderDirectories.cxx b/Source/cmOrderDirectories.cxx
index 04a931854..2c28fc0b7 100644
--- a/Source/cmOrderDirectories.cxx
+++ b/Source/cmOrderDirectories.cxx
@@ -5,6 +5,7 @@
#include "cmAlgorithms.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -47,7 +48,7 @@ public:
this->FileName = cmSystemTools::GetFilenameName(file);
}
}
- virtual ~cmOrderDirectoriesConstraint() {}
+ virtual ~cmOrderDirectoriesConstraint() = default;
void AddDirectory()
{
@@ -186,7 +187,7 @@ bool cmOrderDirectoriesConstraintSOName::FindConflict(std::string const& dir)
// file name. Usually the soname starts with the library name.
std::string base = this->FileName;
std::set<std::string>::const_iterator first = files.lower_bound(base);
- ++base[base.size() - 1];
+ ++base.back();
std::set<std::string>::const_iterator last = files.upper_bound(base);
if (first != last) {
return true;
@@ -475,7 +476,7 @@ void cmOrderDirectories::FindImplicitConflicts()
<< " libraries in implicit directories:\n"
<< text << "Some of these libraries may not be found correctly.";
this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::WARNING, w.str(), this->Target->GetBacktrace());
+ MessageType::WARNING, w.str(), this->Target->GetBacktrace());
}
void cmOrderDirectories::OrderDirectories()
@@ -544,7 +545,7 @@ void cmOrderDirectories::DiagnoseCycle()
}
e << "Some of these libraries may not be found correctly.";
this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
- cmake::WARNING, e.str(), this->Target->GetBacktrace());
+ MessageType::WARNING, e.str(), this->Target->GetBacktrace());
}
bool cmOrderDirectories::IsSameDirectory(std::string const& l,
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index dbe6fa1c8..7d88b088e 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -9,9 +9,7 @@
#include <string.h>
#include <vector>
-#include "cmAlgorithms.h"
#include "cmState.h"
-#include "cmStateDirectory.h"
#include "cmSystemTools.h"
cmOutputConverter::cmOutputConverter(cmStateSnapshot const& snapshot)
@@ -73,121 +71,6 @@ std::string cmOutputConverter::ConvertDirectorySeparatorsForShell(
return result;
}
-static bool cmOutputConverterNotAbove(const char* a, const char* b)
-{
- return (cmSystemTools::ComparePath(a, b) ||
- cmSystemTools::IsSubDirectory(a, b));
-}
-
-bool cmOutputConverter::ContainedInDirectory(std::string const& local_path,
- std::string const& remote_path,
- cmStateDirectory const& directory)
-{
- const std::string& relativePathTopBinary =
- directory.GetRelativePathTopBinary();
- const std::string& relativePathTopSource =
- directory.GetRelativePathTopSource();
-
- const bool bothInBinary =
- cmOutputConverterNotAbove(local_path.c_str(),
- relativePathTopBinary.c_str()) &&
- cmOutputConverterNotAbove(remote_path.c_str(),
- relativePathTopBinary.c_str());
-
- const bool bothInSource =
- cmOutputConverterNotAbove(local_path.c_str(),
- relativePathTopSource.c_str()) &&
- cmOutputConverterNotAbove(remote_path.c_str(),
- relativePathTopSource.c_str());
-
- return bothInSource || bothInBinary;
-}
-
-std::string cmOutputConverter::ConvertToRelativePath(
- std::string const& local_path, std::string const& remote_path) const
-{
- if (!ContainedInDirectory(local_path, remote_path,
- this->StateSnapshot.GetDirectory())) {
- return remote_path;
- }
-
- return this->ForceToRelativePath(local_path, remote_path);
-}
-
-std::string cmOutputConverter::ForceToRelativePath(
- std::string const& local_path, std::string const& remote_path)
-{
- // The paths should never be quoted.
- assert(local_path[0] != '\"');
- assert(remote_path[0] != '\"');
-
- // The local path should never have a trailing slash.
- assert(local_path.empty() || local_path[local_path.size() - 1] != '/');
-
- // If the path is already relative then just return the path.
- if (!cmSystemTools::FileIsFullPath(remote_path)) {
- return remote_path;
- }
-
- // Identify the longest shared path component between the remote
- // path and the local path.
- std::vector<std::string> local;
- cmSystemTools::SplitPath(local_path, local);
- std::vector<std::string> remote;
- cmSystemTools::SplitPath(remote_path, remote);
- unsigned int common = 0;
- while (common < remote.size() && common < local.size() &&
- cmSystemTools::ComparePath(remote[common], local[common])) {
- ++common;
- }
-
- // If no part of the path is in common then return the full path.
- if (common == 0) {
- return remote_path;
- }
-
- // If the entire path is in common then just return a ".".
- if (common == remote.size() && common == local.size()) {
- return ".";
- }
-
- // If the entire path is in common except for a trailing slash then
- // just return a "./".
- if (common + 1 == remote.size() && remote[common].empty() &&
- common == local.size()) {
- return "./";
- }
-
- // Construct the relative path.
- std::string relative;
-
- // First add enough ../ to get up to the level of the shared portion
- // of the path. Leave off the trailing slash. Note that the last
- // component of local will never be empty because local should never
- // have a trailing slash.
- for (unsigned int i = common; i < local.size(); ++i) {
- relative += "..";
- if (i < local.size() - 1) {
- relative += "/";
- }
- }
-
- // Now add the portion of the destination path that is not included
- // in the shared portion of the path. Add a slash the first time
- // only if there was already something in the path. If there was a
- // trailing slash in the input then the last iteration of the loop
- // will add a slash followed by an empty string which will preserve
- // the trailing slash in the output.
-
- if (!relative.empty() && !remote.empty()) {
- relative += "/";
- }
- relative += cmJoin(cmMakeRange(remote).advance(common), "/");
-
- // Finally return the path.
- return relative;
-}
-
static bool cmOutputConverterIsShellOperator(const std::string& str)
{
static std::set<std::string> shellOperators;
diff --git a/Source/cmOutputConverter.h b/Source/cmOutputConverter.h
index ed7143c43..6438c7bad 100644
--- a/Source/cmOutputConverter.h
+++ b/Source/cmOutputConverter.h
@@ -10,7 +10,6 @@
#include "cmStateSnapshot.h"
class cmState;
-class cmStateDirectory;
class cmOutputConverter
{
@@ -92,28 +91,6 @@ public:
};
static FortranFormat GetFortranFormat(const char* value);
- static bool ContainedInDirectory(std::string const& local_path,
- std::string const& remote_path,
- cmStateDirectory const& directory);
-
- /**
- * Convert the given remote path to a relative path with respect to
- * the given local path. Both paths must use forward slashes and not
- * already be escaped or quoted.
- * The conversion is skipped if the paths are not both in the source
- * or both in the binary tree.
- */
- std::string ConvertToRelativePath(std::string const& local_path,
- std::string const& remote_path) const;
-
- /**
- * Convert the given remote path to a relative path with respect to
- * the given local path. Both paths must use forward slashes and not
- * already be escaped or quoted.
- */
- static std::string ForceToRelativePath(std::string const& local_path,
- std::string const& remote_path);
-
private:
cmState* GetState() const;
diff --git a/Source/cmOutputRequiredFilesCommand.cxx b/Source/cmOutputRequiredFilesCommand.cxx
index e2de3f98e..46d04a65f 100644
--- a/Source/cmOutputRequiredFilesCommand.cxx
+++ b/Source/cmOutputRequiredFilesCommand.cxx
@@ -28,11 +28,7 @@ public:
* Construct with dependency generation marked not done; instance
* not placed in cmMakefile's list.
*/
- cmDependInformation()
- : DependDone(false)
- , SourceFile(nullptr)
- {
- }
+ cmDependInformation() = default;
/**
* The set of files on which this one depends.
@@ -44,13 +40,13 @@ public:
* This flag indicates whether dependency checking has been
* performed for this file.
*/
- bool DependDone;
+ bool DependDone = false;
/**
* If this object corresponds to a cmSourceFile instance, this points
* to it.
*/
- const cmSourceFile* SourceFile;
+ const cmSourceFile* SourceFile = nullptr;
/**
* Full path to this file.
@@ -198,7 +194,7 @@ protected:
message += includeFile;
message += " for file ";
message += info->FullPath;
- cmSystemTools::Error(message.c_str(), nullptr);
+ cmSystemTools::Error(message);
}
continue;
}
@@ -340,7 +336,7 @@ protected:
} else {
// try to guess which include path to use
for (std::string incpath : this->IncludeDirectories) {
- if (!incpath.empty() && incpath[incpath.size() - 1] != '/') {
+ if (!incpath.empty() && incpath.back() != '/') {
incpath = incpath + "/";
}
incpath = incpath + path;
@@ -421,7 +417,7 @@ protected:
}
for (std::string path : this->IncludeDirectories) {
- if (!path.empty() && path[path.size() - 1] != '/') {
+ if (!path.empty() && path.back() != '/') {
path = path + "/";
}
path = path + fname;
@@ -435,7 +431,7 @@ protected:
if (extraPath) {
std::string path = extraPath;
- if (!path.empty() && path[path.size() - 1] != '/') {
+ if (!path.empty() && path.back() != '/') {
path = path + "/";
}
path = path + fname;
diff --git a/Source/cmParseArgumentsCommand.cxx b/Source/cmParseArgumentsCommand.cxx
index 2d61cc355..796974cb3 100644
--- a/Source/cmParseArgumentsCommand.cxx
+++ b/Source/cmParseArgumentsCommand.cxx
@@ -9,8 +9,8 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -46,7 +46,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
if (*argIter == "PARSE_ARGV") {
if (args.size() != 6) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"PARSE_ARGV must be called with exactly 6 arguments.");
cmSystemTools::SetFatalErrorOccured();
return true;
@@ -54,7 +54,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
parseFromArgV = true;
argIter++; // move past PARSE_ARGV
if (!cmSystemTools::StringToULong(argIter->c_str(), &argvStart)) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"PARSE_ARGV index '" + *argIter +
"' is not an unsigned integer");
cmSystemTools::SetFatalErrorOccured();
@@ -86,7 +86,8 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
cmSystemTools::ExpandListArgument(*argIter++, list);
for (std::string const& iter : list) {
if (!used_keywords.insert(iter).second) {
- this->GetMakefile()->IssueMessage(cmake::WARNING, dup_warning + iter);
+ this->GetMakefile()->IssueMessage(MessageType::WARNING,
+ dup_warning + iter);
}
options[iter]; // default initialize
}
@@ -96,7 +97,8 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
cmSystemTools::ExpandListArgument(*argIter++, list);
for (std::string const& iter : list) {
if (!used_keywords.insert(iter).second) {
- this->GetMakefile()->IssueMessage(cmake::WARNING, dup_warning + iter);
+ this->GetMakefile()->IssueMessage(MessageType::WARNING,
+ dup_warning + iter);
}
singleValArgs[iter]; // default initialize
}
@@ -106,7 +108,8 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
cmSystemTools::ExpandListArgument(*argIter++, list);
for (std::string const& iter : list) {
if (!used_keywords.insert(iter).second) {
- this->GetMakefile()->IssueMessage(cmake::WARNING, dup_warning + iter);
+ this->GetMakefile()->IssueMessage(MessageType::WARNING,
+ dup_warning + iter);
}
multiValArgs[iter]; // default initialize
}
@@ -131,7 +134,7 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
std::string argc = this->Makefile->GetSafeDefinition("ARGC");
unsigned long count;
if (!cmSystemTools::StringToULong(argc.c_str(), &count)) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"PARSE_ARGV called with ARGC='" + argc +
"' that is not an unsigned integer");
cmSystemTools::SetFatalErrorOccured();
@@ -142,13 +145,13 @@ bool cmParseArgumentsCommand::InitialPass(std::vector<std::string> const& args,
argName << "ARGV" << i;
const char* arg = this->Makefile->GetDefinition(argName.str());
if (!arg) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"PARSE_ARGV called with " +
argName.str() + " not set");
cmSystemTools::SetFatalErrorOccured();
return true;
}
- list.push_back(arg);
+ list.emplace_back(arg);
}
}
diff --git a/Source/cmPathLabel.cxx b/Source/cmPathLabel.cxx
index 4793206f9..fb8135101 100644
--- a/Source/cmPathLabel.cxx
+++ b/Source/cmPathLabel.cxx
@@ -2,8 +2,10 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmPathLabel.h"
-cmPathLabel::cmPathLabel(const std::string& label)
- : Label(label)
+#include <utility>
+
+cmPathLabel::cmPathLabel(std::string label)
+ : Label(std::move(label))
, Hash(0)
{
// Use a Jenkins one-at-a-time hash with under/over-flow protection
diff --git a/Source/cmPathLabel.h b/Source/cmPathLabel.h
index 97551fb46..55dffabe0 100644
--- a/Source/cmPathLabel.h
+++ b/Source/cmPathLabel.h
@@ -17,7 +17,7 @@
class cmPathLabel
{
public:
- cmPathLabel(const std::string& label);
+ cmPathLabel(std::string label);
// The comparison operators are only for quick sorting and searching and
// in no way imply any lexicographical order of the label
diff --git a/Source/cmPipeConnection.cxx b/Source/cmPipeConnection.cxx
index 3dab2f075..1eede13e0 100644
--- a/Source/cmPipeConnection.cxx
+++ b/Source/cmPipeConnection.cxx
@@ -2,14 +2,14 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmPipeConnection.h"
-#include <algorithm>
+#include <utility>
#include "cmServer.h"
-cmPipeConnection::cmPipeConnection(const std::string& name,
+cmPipeConnection::cmPipeConnection(std::string name,
cmConnectionBufferStrategy* bufferStrategy)
: cmEventBasedConnection(bufferStrategy)
- , PipeName(name)
+ , PipeName(std::move(name))
{
}
diff --git a/Source/cmPipeConnection.h b/Source/cmPipeConnection.h
index 49f9fdf8a..e67f15c57 100644
--- a/Source/cmPipeConnection.h
+++ b/Source/cmPipeConnection.h
@@ -13,7 +13,7 @@
class cmPipeConnection : public cmEventBasedConnection
{
public:
- cmPipeConnection(const std::string& name,
+ cmPipeConnection(std::string name,
cmConnectionBufferStrategy* bufferStrategy = nullptr);
bool OnServeStart(std::string* pString) override;
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 5caea7d1f..0a234c52e 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -2,11 +2,11 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmVersion.h"
-#include "cmake.h"
#include <assert.h>
#include <ctype.h>
@@ -128,7 +128,7 @@ static void DiagnoseAncientPolicies(
<< "Please either update your CMakeLists.txt files to conform to "
<< "the new behavior or use an older version of CMake that still "
<< "supports the old behavior.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
@@ -146,7 +146,7 @@ static bool GetPolicyDefault(cmMakefile* mf, std::string const& policy,
std::ostringstream e;
e << defaultVar << " has value \"" << defaultValue
<< "\" but must be \"OLD\", \"NEW\", or \"\" (empty).";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -167,14 +167,14 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
std::ostringstream e;
e << "Invalid policy version value \"" << version_min << "\". "
<< "A numeric major.minor[.patch[.tweak]] must be given.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
// it is an error if the policy version is less than 2.4
if (minMajor < 2 || (minMajor == 2 && minMinor < 4)) {
mf->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"Compatibility with CMake < 2.4 is not supported by CMake >= 3.0. "
"For compatibility with older versions please use any CMake 2.8.x "
"release or lower.");
@@ -199,7 +199,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
<< "This is not allowed because the greater version may have new "
<< "policies not known to this CMake. "
<< "You may need a newer CMake version to build this project.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -218,7 +218,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
std::ostringstream e;
e << "Invalid policy max version value \"" << version_max << "\". "
<< "A numeric major.minor[.patch[.tweak]] must be given.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -232,7 +232,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile* mf,
e << "Policy VERSION range \"" << version_min << "..." << version_max
<< "\""
<< " specifies a larger minimum than maximum.";
- mf->IssueMessage(cmake::FATAL_ERROR, e.str());
+ mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index a367e47dd..314f27dc5 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -236,11 +236,32 @@ class cmMakefile;
"target_link_libraries allows use with targets in other directories.", 3, \
13, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0080, \
- "BundleUtilities cannot be included at configure time", 3, 13, 0, \
+ "BundleUtilities cannot be included at configure time.", 3, 13, 0, \
cmPolicies::WARN) \
SELECT(POLICY, CMP0081, \
"Relative paths not allowed in LINK_DIRECTORIES target property.", \
- 3, 13, 0, cmPolicies::WARN)
+ 3, 13, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0082, \
+ "Install rules from add_subdirectory() are interleaved with those " \
+ "in caller.", \
+ 3, 14, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0083, "Add PIE options when linking executable.", 3, 14, \
+ 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0084, \
+ "The FindQt module does not exist for find_package().", 3, 14, 0, \
+ cmPolicies::WARN) \
+ SELECT(POLICY, CMP0085, "$<IN_LIST:...> handles empty list items.", 3, 14, \
+ 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0086, \
+ "UseSWIG honors SWIG_MODULE_NAME via -module flag.", 3, 14, 0, \
+ cmPolicies::WARN) \
+ SELECT(POLICY, CMP0087, \
+ "Install CODE|SCRIPT allow the use of generator " \
+ "expressions.", \
+ 3, 14, 0, cmPolicies::WARN) \
+ SELECT(POLICY, CMP0088, \
+ "FindBISON runs bison in CMAKE_CURRENT_BINARY_DIR when executing.", \
+ 3, 14, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
@@ -267,7 +288,8 @@ class cmMakefile;
F(CMP0069) \
F(CMP0073) \
F(CMP0076) \
- F(CMP0081)
+ F(CMP0081) \
+ F(CMP0083)
/** \class cmPolicies
* \brief Handles changes in CMake behavior and policies
diff --git a/Source/cmProcessOutput.cxx b/Source/cmProcessOutput.cxx
index e4ca426cc..e80ea5c8d 100644
--- a/Source/cmProcessOutput.cxx
+++ b/Source/cmProcessOutput.cxx
@@ -48,9 +48,7 @@ cmProcessOutput::cmProcessOutput(Encoding encoding, unsigned int maxSize)
#endif
}
-cmProcessOutput::~cmProcessOutput()
-{
-}
+cmProcessOutput::~cmProcessOutput() = default;
bool cmProcessOutput::DecodeText(std::string raw, std::string& decoded,
size_t id)
diff --git a/Source/cmProcessTools.cxx b/Source/cmProcessTools.cxx
index 7ab1fa3fc..a2bc16ffb 100644
--- a/Source/cmProcessTools.cxx
+++ b/Source/cmProcessTools.cxx
@@ -16,7 +16,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
cmProcessOutput processOutput(encoding);
std::string strdata;
while ((out || err) &&
- (p = cmsysProcess_WaitForData(cp, &data, &length, nullptr), p)) {
+ (p = cmsysProcess_WaitForData(cp, &data, &length, nullptr))) {
if (out && p == cmsysProcess_Pipe_STDOUT) {
processOutput.DecodeText(data, length, strdata, 1);
if (!out->Process(strdata.c_str(), int(strdata.size()))) {
@@ -45,10 +45,7 @@ void cmProcessTools::RunProcess(struct cmsysProcess_s* cp, OutputParser* out,
}
cmProcessTools::LineParser::LineParser(char sep, bool ignoreCR)
- : Log(nullptr)
- , Prefix(nullptr)
- , Separator(sep)
- , LineEnd('\0')
+ : Separator(sep)
, IgnoreCR(ignoreCR)
{
}
diff --git a/Source/cmProcessTools.h b/Source/cmProcessTools.h
index f1c2a228e..76163167a 100644
--- a/Source/cmProcessTools.h
+++ b/Source/cmProcessTools.h
@@ -34,7 +34,7 @@ public:
return this->Process(data, static_cast<int>(strlen(data)));
}
- virtual ~OutputParser() {}
+ virtual ~OutputParser() = default;
protected:
/** Implement in a subclass to process a chunk of data. It should
@@ -54,11 +54,11 @@ public:
void SetLog(std::ostream* log, const char* prefix);
protected:
- std::ostream* Log;
- const char* Prefix;
+ std::ostream* Log = nullptr;
+ const char* Prefix = nullptr;
std::string Line;
char Separator;
- char LineEnd;
+ char LineEnd = '\0';
bool IgnoreCR;
bool ProcessChunk(const char* data, int length) override;
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 8f565c815..2fe9fe8b9 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -9,10 +9,10 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -90,7 +90,8 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
if (args[i] == "LANGUAGES") {
if (haveLanguages) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR, "LANGUAGES may be specified at most once.");
+ MessageType::FATAL_ERROR,
+ "LANGUAGES may be specified at most once.");
cmSystemTools::SetFatalErrorOccured();
return true;
}
@@ -105,11 +106,11 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
"keyword: ";
msg += cmJoin(languages, ", ");
msg += '.';
- this->Makefile->IssueMessage(cmake::WARNING, msg);
+ this->Makefile->IssueMessage(MessageType::WARNING, msg);
}
} else if (args[i] == "VERSION") {
if (haveVersion) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
"VERSION may be specified at most once.");
cmSystemTools::SetFatalErrorOccured();
return true;
@@ -121,7 +122,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
doing = DoingVersion;
missedValueReporter = [this, &resetReporter]() {
this->Makefile->IssueMessage(
- cmake::WARNING,
+ MessageType::WARNING,
"VERSION keyword not followed by a value or was followed by a "
"value that expanded to nothing.");
resetReporter();
@@ -129,7 +130,8 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
} else if (args[i] == "DESCRIPTION") {
if (haveDescription) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR, "DESCRIPTION may be specified at most once.");
+ MessageType::FATAL_ERROR,
+ "DESCRIPTION may be specified at most once.");
cmSystemTools::SetFatalErrorOccured();
return true;
}
@@ -140,7 +142,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
doing = DoingDescription;
missedValueReporter = [this, &resetReporter]() {
this->Makefile->IssueMessage(
- cmake::WARNING,
+ MessageType::WARNING,
"DESCRIPTION keyword not followed by a value or was followed "
"by a value that expanded to nothing.");
resetReporter();
@@ -148,7 +150,8 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
} else if (args[i] == "HOMEPAGE_URL") {
if (haveHomepage) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR, "HOMEPAGE_URL may be specified at most once.");
+ MessageType::FATAL_ERROR,
+ "HOMEPAGE_URL may be specified at most once.");
cmSystemTools::SetFatalErrorOccured();
return true;
}
@@ -156,7 +159,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
doing = DoingHomepage;
missedValueReporter = [this, &resetReporter]() {
this->Makefile->IssueMessage(
- cmake::WARNING,
+ MessageType::WARNING,
"HOMEPAGE_URL keyword not followed by a value or was followed "
"by a value that expanded to nothing.");
resetReporter();
@@ -188,14 +191,14 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
if ((haveVersion || haveDescription || haveHomepage) && !haveLanguages &&
!languages.empty()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"project with VERSION, DESCRIPTION or HOMEPAGE_URL must "
"use LANGUAGES before language names.");
cmSystemTools::SetFatalErrorOccured();
return true;
}
if (haveLanguages && languages.empty()) {
- languages.push_back("NONE");
+ languages.emplace_back("NONE");
}
cmPolicies::PolicyStatus cmp0048 =
@@ -204,7 +207,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
// Set project VERSION variables to given values
if (cmp0048 == cmPolicies::OLD || cmp0048 == cmPolicies::WARN) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"VERSION not allowed unless CMP0048 is set to NEW");
cmSystemTools::SetFatalErrorOccured();
return true;
@@ -214,7 +217,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
"^([0-9]+(\\.[0-9]+(\\.[0-9]+(\\.[0-9]+)?)?)?)?$");
if (!vx.find(version)) {
std::string e = "VERSION \"" + version + "\" format invalid.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e);
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e);
cmSystemTools::SetFatalErrorOccured();
return true;
}
@@ -261,22 +264,22 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
} else if (cmp0048 != cmPolicies::OLD) {
// Set project VERSION variables to empty
std::vector<std::string> vv;
- vv.push_back("PROJECT_VERSION");
- vv.push_back("PROJECT_VERSION_MAJOR");
- vv.push_back("PROJECT_VERSION_MINOR");
- vv.push_back("PROJECT_VERSION_PATCH");
- vv.push_back("PROJECT_VERSION_TWEAK");
+ vv.emplace_back("PROJECT_VERSION");
+ vv.emplace_back("PROJECT_VERSION_MAJOR");
+ vv.emplace_back("PROJECT_VERSION_MINOR");
+ vv.emplace_back("PROJECT_VERSION_PATCH");
+ vv.emplace_back("PROJECT_VERSION_TWEAK");
vv.push_back(projectName + "_VERSION");
vv.push_back(projectName + "_VERSION_MAJOR");
vv.push_back(projectName + "_VERSION_MINOR");
vv.push_back(projectName + "_VERSION_PATCH");
vv.push_back(projectName + "_VERSION_TWEAK");
if (this->Makefile->IsRootMakefile()) {
- vv.push_back("CMAKE_PROJECT_VERSION");
- vv.push_back("CMAKE_PROJECT_VERSION_MAJOR");
- vv.push_back("CMAKE_PROJECT_VERSION_MINOR");
- vv.push_back("CMAKE_PROJECT_VERSION_PATCH");
- vv.push_back("CMAKE_PROJECT_VERSION_TWEAK");
+ vv.emplace_back("CMAKE_PROJECT_VERSION");
+ vv.emplace_back("CMAKE_PROJECT_VERSION_MAJOR");
+ vv.emplace_back("CMAKE_PROJECT_VERSION_MINOR");
+ vv.emplace_back("CMAKE_PROJECT_VERSION_PATCH");
+ vv.emplace_back("CMAKE_PROJECT_VERSION_TWEAK");
}
std::string vw;
for (std::string const& i : vv) {
@@ -296,7 +299,7 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
std::ostringstream w;
w << cmPolicies::GetPolicyWarning(cmPolicies::CMP0048)
<< "\nThe following variable(s) would be set to empty:" << vw;
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
}
@@ -312,8 +315,8 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
if (languages.empty()) {
// if no language is specified do c and c++
- languages.push_back("C");
- languages.push_back("CXX");
+ languages.emplace_back("C");
+ languages.emplace_back("CXX");
}
this->Makefile->EnableLanguage(languages, false);
std::string extraInclude = "CMAKE_PROJECT_" + projectName + "_INCLUDE";
diff --git a/Source/cmQTWrapCPPCommand.cxx b/Source/cmQTWrapCPPCommand.cxx
index d2133ed79..6acc7ef86 100644
--- a/Source/cmQTWrapCPPCommand.cxx
+++ b/Source/cmQTWrapCPPCommand.cxx
@@ -50,7 +50,7 @@ bool cmQTWrapCPPCommand::InitialPass(std::vector<std::string> const& args,
if (cmSystemTools::FileIsFullPath(*j)) {
hname = *j;
} else {
- if (curr && curr->GetPropertyAsBool("GENERATED")) {
+ if (curr && curr->GetIsGenerated()) {
hname = this->Makefile->GetCurrentBinaryDirectory();
} else {
hname = this->Makefile->GetCurrentSourceDirectory();
diff --git a/Source/cmQTWrapUICommand.cxx b/Source/cmQTWrapUICommand.cxx
index 25dcd1a64..43b1fb9b6 100644
--- a/Source/cmQTWrapUICommand.cxx
+++ b/Source/cmQTWrapUICommand.cxx
@@ -58,7 +58,7 @@ bool cmQTWrapUICommand::InitialPass(std::vector<std::string> const& args,
if (cmSystemTools::FileIsFullPath(*j)) {
uiName = *j;
} else {
- if (curr && curr->GetPropertyAsBool("GENERATED")) {
+ if (curr && curr->GetIsGenerated()) {
uiName = this->Makefile->GetCurrentBinaryDirectory();
} else {
uiName = this->Makefile->GetCurrentSourceDirectory();
diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index 000529d36..653caf75b 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -9,6 +9,7 @@
#include <algorithm>
#include <iterator>
#include <sstream>
+#include <utility>
// - Static variables
@@ -99,6 +100,41 @@ std::string cmQtAutoGen::GeneratorNameUpper(GeneratorT genType)
return cmSystemTools::UpperCase(cmQtAutoGen::GeneratorName(genType));
}
+std::string cmQtAutoGen::Tools(bool moc, bool uic, bool rcc)
+{
+ std::string res;
+ std::vector<std::string> lst;
+ if (moc) {
+ lst.emplace_back("AUTOMOC");
+ }
+ if (uic) {
+ lst.emplace_back("AUTOUIC");
+ }
+ if (rcc) {
+ lst.emplace_back("AUTORCC");
+ }
+ switch (lst.size()) {
+ case 1:
+ res += lst.at(0);
+ break;
+ case 2:
+ res += lst.at(0);
+ res += " and ";
+ res += lst.at(1);
+ break;
+ case 3:
+ res += lst.at(0);
+ res += ", ";
+ res += lst.at(1);
+ res += " and ";
+ res += lst.at(2);
+ break;
+ default:
+ break;
+ }
+ return res;
+}
+
std::string cmQtAutoGen::Quoted(std::string const& text)
{
static const char* rep[18] = { "\\", "\\\\", "\"", "\\\"", "\a", "\\a",
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h
index 4118dc79c..96d1946f0 100644
--- a/Source/cmQtAutoGen.h
+++ b/Source/cmQtAutoGen.h
@@ -60,6 +60,9 @@ public:
/// @brief Returns the generator name in upper case
static std::string GeneratorNameUpper(GeneratorT genType);
+ /// @brief Returns a string with the requested tool names
+ static std::string Tools(bool moc, bool uic, bool rcc);
+
/// @brief Returns the string escaped and enclosed in quotes
static std::string Quoted(std::string const& text);
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
new file mode 100644
index 000000000..3ad91eec6
--- /dev/null
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -0,0 +1,288 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#include "cmQtAutoGenGlobalInitializer.h"
+#include "cmQtAutoGen.h"
+#include "cmQtAutoGenInitializer.h"
+
+#include "cmAlgorithms.h"
+#include "cmCustomCommandLines.h"
+#include "cmDuration.h"
+#include "cmGeneratorTarget.h"
+#include "cmLocalGenerator.h"
+#include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmProcessOutput.h"
+#include "cmState.h"
+#include "cmStateTypes.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
+
+#include <memory>
+#include <utility>
+
+cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
+ std::vector<cmLocalGenerator*> const& localGenerators)
+{
+ for (cmLocalGenerator* localGen : localGenerators) {
+ // Detect global autogen and autorcc target names
+ bool globalAutoGenTarget = false;
+ bool globalAutoRccTarget = false;
+ {
+ cmMakefile* makefile = localGen->GetMakefile();
+ // Detect global autogen target name
+ if (cmSystemTools::IsOn(
+ makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET"))) {
+ std::string targetName =
+ makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTOGEN_TARGET_NAME");
+ if (targetName.empty()) {
+ targetName = "autogen";
+ }
+ GlobalAutoGenTargets_.emplace(localGen, std::move(targetName));
+ globalAutoGenTarget = true;
+ }
+
+ // Detect global autorcc target name
+ if (cmSystemTools::IsOn(
+ makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET"))) {
+ std::string targetName =
+ makefile->GetSafeDefinition("CMAKE_GLOBAL_AUTORCC_TARGET_NAME");
+ if (targetName.empty()) {
+ targetName = "autorcc";
+ }
+ GlobalAutoRccTargets_.emplace(localGen, std::move(targetName));
+ globalAutoRccTarget = true;
+ }
+ }
+
+ // Find targets that require AUTOMOC/UIC/RCC processing
+ for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) {
+ // Process only certain target types
+ switch (target->GetType()) {
+ case cmStateEnums::EXECUTABLE:
+ case cmStateEnums::STATIC_LIBRARY:
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::OBJECT_LIBRARY:
+ // Process target
+ break;
+ default:
+ // Don't process target
+ continue;
+ }
+ if (target->IsImported()) {
+ // Don't process target
+ continue;
+ }
+
+ bool const moc = target->GetPropertyAsBool("AUTOMOC");
+ bool const uic = target->GetPropertyAsBool("AUTOUIC");
+ bool const rcc = target->GetPropertyAsBool("AUTORCC");
+ if (moc || uic || rcc) {
+ std::string const mocExec =
+ target->GetSafeProperty("AUTOMOC_EXECUTABLE");
+ std::string const uicExec =
+ target->GetSafeProperty("AUTOUIC_EXECUTABLE");
+ std::string const rccExec =
+ target->GetSafeProperty("AUTORCC_EXECUTABLE");
+
+ // We support Qt4, Qt5 and Qt6
+ auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
+ bool const validQt = (qtVersion.first.Major == 4) ||
+ (qtVersion.first.Major == 5) || (qtVersion.first.Major == 6);
+
+ bool const mocAvailable = (validQt || !mocExec.empty());
+ bool const uicAvailable = (validQt || !uicExec.empty());
+ bool const rccAvailable = (validQt || !rccExec.empty());
+ bool const mocIsValid = (moc && mocAvailable);
+ bool const uicIsValid = (uic && uicAvailable);
+ bool const rccIsValid = (rcc && rccAvailable);
+ // Disabled AUTOMOC/UIC/RCC warning
+ bool const mocDisabled = (moc && !mocAvailable);
+ bool const uicDisabled = (uic && !uicAvailable);
+ bool const rccDisabled = (rcc && !rccAvailable);
+ if (mocDisabled || uicDisabled || rccDisabled) {
+ std::string msg = "AUTOGEN: No valid Qt version found for target ";
+ msg += target->GetName();
+ msg += ". ";
+ msg += cmQtAutoGen::Tools(mocDisabled, uicDisabled, rccDisabled);
+ msg += " disabled. Consider adding:\n";
+ {
+ std::string version = (qtVersion.second == 0)
+ ? std::string("<QTVERSION>")
+ : std::to_string(qtVersion.second);
+ std::string comp = uicDisabled ? "Widgets" : "Core";
+ msg += " find_package(Qt";
+ msg += version;
+ msg += " COMPONENTS ";
+ msg += comp;
+ msg += ")\n";
+ }
+ msg += "to your CMakeLists.txt file.";
+ target->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, msg);
+ }
+ if (mocIsValid || uicIsValid || rccIsValid) {
+ // Create autogen target initializer
+ Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
+ this, target, qtVersion.first, mocIsValid, uicIsValid, rccIsValid,
+ globalAutoGenTarget, globalAutoRccTarget));
+ }
+ }
+ }
+ }
+}
+
+cmQtAutoGenGlobalInitializer::~cmQtAutoGenGlobalInitializer() = default;
+
+void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
+ cmLocalGenerator* localGen, std::string const& name,
+ std::string const& comment)
+{
+ // Test if the target already exists
+ if (localGen->FindGeneratorTargetToUse(name) == nullptr) {
+ cmMakefile* makefile = localGen->GetMakefile();
+
+ // Create utility target
+ cmTarget* target = makefile->AddUtilityCommand(
+ name, cmMakefile::TargetOrigin::Generator, true,
+ makefile->GetHomeOutputDirectory().c_str() /*work dir*/,
+ std::vector<std::string>() /*output*/,
+ std::vector<std::string>() /*depends*/, cmCustomCommandLines(), false,
+ comment.c_str());
+ localGen->AddGeneratorTarget(new cmGeneratorTarget(target, localGen));
+
+ // Set FOLDER property in the target
+ {
+ char const* folder =
+ makefile->GetState()->GetGlobalProperty("AUTOGEN_TARGETS_FOLDER");
+ if (folder != nullptr) {
+ target->SetProperty("FOLDER", folder);
+ }
+ }
+ }
+}
+
+void cmQtAutoGenGlobalInitializer::AddToGlobalAutoGen(
+ cmLocalGenerator* localGen, std::string const& targetName)
+{
+ auto it = GlobalAutoGenTargets_.find(localGen);
+ if (it != GlobalAutoGenTargets_.end()) {
+ cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+ if (target != nullptr) {
+ target->Target->AddUtility(targetName, localGen->GetMakefile());
+ }
+ }
+}
+
+void cmQtAutoGenGlobalInitializer::AddToGlobalAutoRcc(
+ cmLocalGenerator* localGen, std::string const& targetName)
+{
+ auto it = GlobalAutoRccTargets_.find(localGen);
+ if (it != GlobalAutoRccTargets_.end()) {
+ cmGeneratorTarget* target = localGen->FindGeneratorTargetToUse(it->second);
+ if (target != nullptr) {
+ target->Target->AddUtility(targetName, localGen->GetMakefile());
+ }
+ }
+}
+
+bool cmQtAutoGenGlobalInitializer::GetExecutableTestOutput(
+ std::string const& generator, std::string const& executable,
+ std::string& error, std::string* output)
+{
+ // Check if we have cached output
+ {
+ auto it = this->ExecutableTestOutputs_.find(executable);
+ if (it != this->ExecutableTestOutputs_.end()) {
+ // Return output on demand
+ if (output != nullptr) {
+ *output = it->second;
+ }
+ return true;
+ }
+ }
+
+ // Check if the executable exists
+ if (!cmSystemTools::FileExists(executable, true)) {
+ error = "The \"";
+ error += generator;
+ error += "\" executable ";
+ error += cmQtAutoGen::Quoted(executable);
+ error += " does not exist.";
+ return false;
+ }
+
+ // Test the executable
+ std::string stdOut;
+ {
+ std::string stdErr;
+ std::vector<std::string> command;
+ command.push_back(executable);
+ command.emplace_back("-h");
+ int retVal = 0;
+ const bool runResult = cmSystemTools::RunSingleCommand(
+ command, &stdOut, &stdErr, &retVal, nullptr, cmSystemTools::OUTPUT_NONE,
+ cmDuration::zero(), cmProcessOutput::Auto);
+ if (!runResult) {
+ error = "Test run of \"";
+ error += generator;
+ error += "\" executable ";
+ error += cmQtAutoGen::Quoted(executable) + " failed.\n";
+ error += cmQtAutoGen::QuotedCommand(command);
+ error += "\n";
+ error += stdOut;
+ error += "\n";
+ error += stdErr;
+ return false;
+ }
+ }
+
+ // Return executable output on demand
+ if (output != nullptr) {
+ *output = stdOut;
+ }
+
+ // Register executable and output
+ this->ExecutableTestOutputs_.emplace(executable, std::move(stdOut));
+
+ return true;
+}
+
+bool cmQtAutoGenGlobalInitializer::generate()
+{
+ return (InitializeCustomTargets() && SetupCustomTargets());
+}
+
+bool cmQtAutoGenGlobalInitializer::InitializeCustomTargets()
+{
+ // Initialize global autogen targets
+ {
+ std::string const comment = "Global AUTOGEN target";
+ for (auto const& pair : GlobalAutoGenTargets_) {
+ GetOrCreateGlobalTarget(pair.first, pair.second, comment);
+ }
+ }
+ // Initialize global autorcc targets
+ {
+ std::string const comment = "Global AUTORCC target";
+ for (auto const& pair : GlobalAutoRccTargets_) {
+ GetOrCreateGlobalTarget(pair.first, pair.second, comment);
+ }
+ }
+ // Initialize per target autogen targets
+ for (auto& initializer : Initializers_) {
+ if (!initializer->InitCustomTargets()) {
+ return false;
+ }
+ }
+ return true;
+}
+
+bool cmQtAutoGenGlobalInitializer::SetupCustomTargets()
+{
+ for (auto& initializer : Initializers_) {
+ if (!initializer->SetupCustomTargets()) {
+ return false;
+ }
+ }
+ return true;
+}
diff --git a/Source/cmQtAutoGenGlobalInitializer.h b/Source/cmQtAutoGenGlobalInitializer.h
new file mode 100644
index 000000000..74184a0d5
--- /dev/null
+++ b/Source/cmQtAutoGenGlobalInitializer.h
@@ -0,0 +1,53 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmQtAutoGenGlobalInitializer_h
+#define cmQtAutoGenGlobalInitializer_h
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <map>
+#include <memory> // IWYU pragma: keep
+#include <string>
+#include <unordered_map>
+#include <vector>
+
+class cmLocalGenerator;
+class cmQtAutoGenInitializer;
+
+/// @brief Initializes the QtAutoGen generators
+class cmQtAutoGenGlobalInitializer
+{
+public:
+ cmQtAutoGenGlobalInitializer(
+ std::vector<cmLocalGenerator*> const& localGenerators);
+ ~cmQtAutoGenGlobalInitializer();
+
+ bool generate();
+
+private:
+ friend class cmQtAutoGenInitializer;
+
+ bool InitializeCustomTargets();
+ bool SetupCustomTargets();
+
+ void GetOrCreateGlobalTarget(cmLocalGenerator* localGen,
+ std::string const& name,
+ std::string const& comment);
+
+ void AddToGlobalAutoGen(cmLocalGenerator* localGen,
+ std::string const& targetName);
+ void AddToGlobalAutoRcc(cmLocalGenerator* localGen,
+ std::string const& targetName);
+
+ bool GetExecutableTestOutput(std::string const& generator,
+ std::string const& executable,
+ std::string& error, std::string* output);
+
+private:
+ std::vector<std::unique_ptr<cmQtAutoGenInitializer>> Initializers_;
+ std::map<cmLocalGenerator*, std::string> GlobalAutoGenTargets_;
+ std::map<cmLocalGenerator*, std::string> GlobalAutoRccTargets_;
+ std::unordered_map<std::string, std::string> ExecutableTestOutputs_;
+};
+
+#endif
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index 90111801d..614a88bde 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -2,18 +2,21 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQtAutoGenInitializer.h"
#include "cmQtAutoGen.h"
+#include "cmQtAutoGenGlobalInitializer.h"
#include "cmAlgorithms.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandLines.h"
#include "cmDuration.h"
#include "cmFilePathChecksum.h"
-#include "cmGeneratedFileStream.h"
+#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmLinkItem.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmOutputConverter.h"
#include "cmPolicies.h"
#include "cmProcessOutput.h"
@@ -23,7 +26,6 @@
#include "cmStateTypes.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
#include "cmsys/FStream.hxx"
#include "cmsys/SystemInformation.hxx"
@@ -34,9 +36,25 @@
#include <set>
#include <sstream>
#include <string>
+#include <type_traits>
#include <utility>
#include <vector>
+std::string GetQtExecutableTargetName(
+ const cmQtAutoGen::IntegerVersion& qtVersion, std::string const& executable)
+{
+ if (qtVersion.Major == 6) {
+ return ("Qt6::" + executable);
+ }
+ if (qtVersion.Major == 5) {
+ return ("Qt5::" + executable);
+ }
+ if (qtVersion.Major == 4) {
+ return ("Qt4::" + executable);
+ }
+ return ("");
+}
+
static std::size_t GetParallelCPUCount()
{
static std::size_t count = 0;
@@ -92,7 +110,7 @@ static bool AddToSourceGroup(cmMakefile* makefile, std::string const& fileName,
ost << ": " << property;
ost << ": Could not find or create the source group ";
ost << cmQtAutoGen::Quoted(groupName);
- cmSystemTools::Error(ost.str().c_str());
+ cmSystemTools::Error(ost.str());
return false;
}
}
@@ -173,17 +191,116 @@ static bool StaticLibraryCycle(cmGeneratorTarget const* targetOrigin,
return cycle;
}
-cmQtAutoGenInitializer::cmQtAutoGenInitializer(cmGeneratorTarget* target,
- bool mocEnabled,
- bool uicEnabled,
- bool rccEnabled,
- IntegerVersion const& qtVersion)
- : Target(target)
+cmQtAutoGenInitializer::InfoWriter::InfoWriter(std::string const& filename)
+{
+ Ofs_.SetCopyIfDifferent(true);
+ Ofs_.Open(filename, false, true);
+}
+
+template <class IT>
+std::string cmQtAutoGenInitializer::InfoWriter::ListJoin(IT it_begin,
+ IT it_end)
+{
+ std::string res;
+ for (IT it = it_begin; it != it_end; ++it) {
+ if (it != it_begin) {
+ res += ';';
+ }
+ for (const char* c = it->c_str(); *c; ++c) {
+ if (*c == '"') {
+ // Escape the double quote to avoid ending the argument.
+ res += "\\\"";
+ } else if (*c == '$') {
+ // Escape the dollar to avoid expanding variables.
+ res += "\\$";
+ } else if (*c == '\\') {
+ // Escape the backslash to avoid other escapes.
+ res += "\\\\";
+ } else if (*c == ';') {
+ // Escape the semicolon to avoid list expansion.
+ res += "\\;";
+ } else {
+ // Other characters will be parsed correctly.
+ res += *c;
+ }
+ }
+ }
+ return res;
+}
+
+std::string cmQtAutoGenInitializer::InfoWriter::ConfigKey(
+ const char* key, std::string const& config)
+{
+ std::string ckey = key;
+ ckey += '_';
+ ckey += config;
+ return ckey;
+}
+
+void cmQtAutoGenInitializer::InfoWriter::Write(const char* key,
+ std::string const& value)
+{
+ Ofs_ << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value)
+ << ")\n";
+};
+
+void cmQtAutoGenInitializer::InfoWriter::WriteUInt(const char* key,
+ unsigned int value)
+{
+ Ofs_ << "set(" << key << " " << value << ")\n";
+};
+
+template <class C>
+void cmQtAutoGenInitializer::InfoWriter::WriteStrings(const char* key,
+ C const& container)
+{
+ Ofs_ << "set(" << key << " \""
+ << ListJoin(container.begin(), container.end()) << "\")\n";
+}
+
+void cmQtAutoGenInitializer::InfoWriter::WriteConfig(
+ const char* key, std::map<std::string, std::string> const& map)
+{
+ for (auto const& item : map) {
+ Write(ConfigKey(key, item.first).c_str(), item.second);
+ }
+};
+
+template <class C>
+void cmQtAutoGenInitializer::InfoWriter::WriteConfigStrings(
+ const char* key, std::map<std::string, C> const& map)
+{
+ for (auto const& item : map) {
+ WriteStrings(ConfigKey(key, item.first).c_str(), item.second);
+ }
+}
+
+void cmQtAutoGenInitializer::InfoWriter::WriteNestedLists(
+ const char* key, std::vector<std::vector<std::string>> const& lists)
+{
+ std::vector<std::string> seplist;
+ for (const std::vector<std::string>& list : lists) {
+ std::string blist = "{";
+ blist += ListJoin(list.begin(), list.end());
+ blist += "}";
+ seplist.push_back(std::move(blist));
+ }
+ Write(key, cmJoin(seplist, cmQtAutoGen::ListSep));
+};
+
+cmQtAutoGenInitializer::cmQtAutoGenInitializer(
+ cmQtAutoGenGlobalInitializer* globalInitializer, cmGeneratorTarget* target,
+ IntegerVersion const& qtVersion, bool mocEnabled, bool uicEnabled,
+ bool rccEnabled, bool globalAutogenTarget, bool globalAutoRccTarget)
+ : GlobalInitializer(globalInitializer)
+ , Target(target)
, QtVersion(qtVersion)
{
+ AutogenTarget.GlobalTarget = globalAutogenTarget;
Moc.Enabled = mocEnabled;
Uic.Enabled = uicEnabled;
Rcc.Enabled = rccEnabled;
+ Rcc.GlobalTarget = globalAutoRccTarget;
}
bool cmQtAutoGenInitializer::InitCustomTargets()
@@ -234,7 +351,7 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
// Info directory
this->Dir.Info = cbd;
- this->Dir.Info += makefile->GetCMakeInstance()->GetCMakeFilesDirectory();
+ this->Dir.Info += "/CMakeFiles";
this->Dir.Info += '/';
this->Dir.Info += this->Target->GetName();
this->Dir.Info += "_autogen";
@@ -282,8 +399,16 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
}
// Init uic specific settings
- if (this->Uic.Enabled && !InitUic()) {
- return false;
+ if (this->Uic.Enabled) {
+ if (InitUic()) {
+ auto* uicTarget = makefile->FindTargetToUse(
+ GetQtExecutableTargetName(this->QtVersion, "uic"));
+ if (uicTarget != nullptr) {
+ this->AutogenTarget.DependTargets.insert(uicTarget);
+ }
+ } else {
+ return false;
+ }
}
// Autogen target name
@@ -321,6 +446,15 @@ bool cmQtAutoGenInitializer::InitCustomTargets()
// Autogen target: Compute user defined dependencies
{
+ this->AutogenTarget.DependOrigin =
+ this->Target->GetPropertyAsBool("AUTOGEN_ORIGIN_DEPENDS");
+
+ auto* mocTarget = makefile->FindTargetToUse(
+ GetQtExecutableTargetName(this->QtVersion, "moc"));
+ if (mocTarget != nullptr) {
+ this->AutogenTarget.DependTargets.insert(mocTarget);
+ }
+
std::string const deps =
this->Target->GetSafeProperty("AUTOGEN_TARGET_DEPENDS");
if (!deps.empty()) {
@@ -386,20 +520,17 @@ bool cmQtAutoGenInitializer::InitMoc()
// Moc includes
{
- // We need to disable this until we have all implicit includes available.
- // See issue #18669.
- // bool const appendImplicit = (this->QtVersion.Major == 5);
-
- auto GetIncludeDirs = [this,
- localGen](std::string const& cfg) -> std::string {
- bool const appendImplicit = false;
+ bool const appendImplicit = (this->QtVersion.Major >= 5);
+ auto GetIncludeDirs =
+ [this, localGen,
+ appendImplicit](std::string const& cfg) -> std::vector<std::string> {
// Get the include dirs for this target, without stripping the implicit
// include dirs off, see
// https://gitlab.kitware.com/cmake/cmake/issues/13667
std::vector<std::string> dirs;
- localGen->GetIncludeDirectories(dirs, this->Target, "CXX", cfg, false,
- appendImplicit);
- return cmJoin(dirs, ";");
+ localGen->GetIncludeDirectoriesImplicit(dirs, this->Target, "CXX", cfg,
+ false, appendImplicit);
+ return dirs;
};
// Default configuration include directories
@@ -407,7 +538,7 @@ bool cmQtAutoGenInitializer::InitMoc()
// Other configuration settings
if (this->MultiConfig) {
for (std::string const& cfg : this->ConfigsList) {
- std::string dirs = GetIncludeDirs(cfg);
+ std::vector<std::string> dirs = GetIncludeDirs(cfg);
if (dirs != this->Moc.Includes) {
this->Moc.ConfigIncludes[cfg] = std::move(dirs);
}
@@ -418,10 +549,16 @@ bool cmQtAutoGenInitializer::InitMoc()
// Moc compile definitions
{
auto GetCompileDefinitions =
- [this, localGen](std::string const& cfg) -> std::string {
+ [this, localGen](std::string const& cfg) -> std::set<std::string> {
std::set<std::string> defines;
- localGen->AddCompileDefinitions(defines, this->Target, cfg, "CXX");
- return cmJoin(defines, ";");
+ localGen->GetTargetDefines(this->Target, cfg, "CXX", defines);
+#ifdef _WIN32
+ if (this->Moc.PredefsCmd.empty()) {
+ // Add WIN32 definition if we don't have a moc_predefs.h
+ defines.insert("WIN32");
+ }
+#endif
+ return defines;
};
// Default configuration defines
@@ -429,7 +566,7 @@ bool cmQtAutoGenInitializer::InitMoc()
// Other configuration defines
if (this->MultiConfig) {
for (std::string const& cfg : this->ConfigsList) {
- std::string defines = GetCompileDefinitions(cfg);
+ std::set<std::string> defines = GetCompileDefinitions(cfg);
if (defines != this->Moc.Defines) {
this->Moc.ConfigDefines[cfg] = std::move(defines);
}
@@ -438,11 +575,7 @@ bool cmQtAutoGenInitializer::InitMoc()
}
// Moc executable
- if (!GetMocExecutable()) {
- return false;
- }
-
- return true;
+ return GetMocExecutable();
}
bool cmQtAutoGenInitializer::InitUic()
@@ -463,10 +596,11 @@ bool cmQtAutoGenInitializer::InitUic()
}
// Uic target options
{
- auto UicGetOpts = [this](std::string const& cfg) -> std::string {
+ auto UicGetOpts =
+ [this](std::string const& cfg) -> std::vector<std::string> {
std::vector<std::string> opts;
this->Target->GetAutoUicOptions(opts, cfg);
- return cmJoin(opts, ";");
+ return opts;
};
// Default settings
@@ -475,91 +609,64 @@ bool cmQtAutoGenInitializer::InitUic()
// Configuration specific settings
if (this->MultiConfig) {
for (std::string const& cfg : this->ConfigsList) {
- std::string options = UicGetOpts(cfg);
+ std::vector<std::string> options = UicGetOpts(cfg);
if (options != this->Uic.Options) {
this->Uic.ConfigOptions[cfg] = std::move(options);
}
}
}
}
- // .ui files skip and options
- {
- std::string const uiExt = "ui";
- std::string pathError;
- for (cmSourceFile* sf : makefile->GetSourceFiles()) {
- // sf->GetExtension() is only valid after sf->GetFullPath() ...
- // Since we're iterating over source files that might be not in the
- // target we need to check for path errors (not existing files).
- std::string const& fPath = sf->GetFullPath(&pathError);
- if (!pathError.empty()) {
- pathError.clear();
- continue;
- }
- if (sf->GetExtension() == uiExt) {
- std::string const absFile = cmSystemTools::GetRealPath(fPath);
- // Check if the .ui file should be skipped
- if (sf->GetPropertyAsBool("SKIP_AUTOUIC") ||
- sf->GetPropertyAsBool("SKIP_AUTOGEN")) {
- this->Uic.Skip.insert(absFile);
- }
- // Check if the .ui file has uic options
- std::string const uicOpts = sf->GetSafeProperty("AUTOUIC_OPTIONS");
- if (!uicOpts.empty()) {
- // Check if file isn't skipped
- if (this->Uic.Skip.count(absFile) == 0) {
- this->Uic.FileFiles.push_back(absFile);
- std::vector<std::string> optsVec;
- cmSystemTools::ExpandListArgument(uicOpts, optsVec);
- this->Uic.FileOptions.push_back(std::move(optsVec));
- }
- }
- }
- }
- }
// Uic executable
- if (!GetUicExecutable()) {
- return false;
- }
-
- return true;
+ return GetUicExecutable();
}
bool cmQtAutoGenInitializer::InitRcc()
{
- if (!GetRccExecutable()) {
- return false;
- }
- return true;
+ return GetRccExecutable();
}
bool cmQtAutoGenInitializer::InitScanFiles()
{
cmMakefile* makefile = this->Target->Target->GetMakefile();
+ // String constants
+ std::string const SKIP_AUTOGEN_str = "SKIP_AUTOGEN";
+ std::string const SKIP_AUTOMOC_str = "SKIP_AUTOMOC";
+ std::string const SKIP_AUTOUIC_str = "SKIP_AUTOUIC";
+
// Scan through target files
{
- std::string const qrcExt = "qrc";
+ // String constants
+ std::string const qrc_str = "qrc";
+ std::string const SKIP_AUTORCC_str = "SKIP_AUTORCC";
+ std::string const AUTORCC_OPTIONS_str = "AUTORCC_OPTIONS";
+
+ // Scan through target files
std::vector<cmSourceFile*> srcFiles;
this->Target->GetConfigCommonSourceFiles(srcFiles);
for (cmSourceFile* sf : srcFiles) {
- if (sf->GetPropertyAsBool("SKIP_AUTOGEN")) {
+ if (sf->GetPropertyAsBool(SKIP_AUTOGEN_str)) {
continue;
}
+
// sf->GetExtension() is only valid after sf->GetFullPath() ...
std::string const& fPath = sf->GetFullPath();
std::string const& ext = sf->GetExtension();
+
// Register generated files that will be scanned by moc or uic
if (this->Moc.Enabled || this->Uic.Enabled) {
cmSystemTools::FileFormat const fileType =
- cmSystemTools::GetFileFormat(ext.c_str());
+ cmSystemTools::GetFileFormat(ext);
if ((fileType == cmSystemTools::CXX_FILE_FORMAT) ||
(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
std::string const absPath = cmSystemTools::GetRealPath(fPath);
- if ((this->Moc.Enabled && !sf->GetPropertyAsBool("SKIP_AUTOMOC")) ||
- (this->Uic.Enabled && !sf->GetPropertyAsBool("SKIP_AUTOUIC"))) {
+ if ((this->Moc.Enabled &&
+ !sf->GetPropertyAsBool(SKIP_AUTOMOC_str)) ||
+ (this->Uic.Enabled &&
+ !sf->GetPropertyAsBool(SKIP_AUTOUIC_str))) {
// Register source
- const bool generated = sf->GetPropertyAsBool("GENERATED");
+ const bool generated = sf->GetIsGenerated();
if (fileType == cmSystemTools::HEADER_FILE_FORMAT) {
if (generated) {
this->AutogenTarget.HeadersGenerated.push_back(absPath);
@@ -577,18 +684,17 @@ bool cmQtAutoGenInitializer::InitScanFiles()
}
}
// Register rcc enabled files
- if (this->Rcc.Enabled && (ext == qrcExt) &&
- !sf->GetPropertyAsBool("SKIP_AUTORCC")) {
- // Register qrc file
- {
+ if (this->Rcc.Enabled) {
+ if ((ext == qrc_str) && !sf->GetPropertyAsBool(SKIP_AUTORCC_str)) {
+ // Register qrc file
Qrc qrc;
qrc.QrcFile = cmSystemTools::GetRealPath(fPath);
qrc.QrcName =
cmSystemTools::GetFilenameWithoutLastExtension(qrc.QrcFile);
- qrc.Generated = sf->GetPropertyAsBool("GENERATED");
+ qrc.Generated = sf->GetIsGenerated();
// RCC options
{
- std::string const opts = sf->GetSafeProperty("AUTORCC_OPTIONS");
+ std::string const opts = sf->GetSafeProperty(AUTORCC_OPTIONS_str);
if (!opts.empty()) {
cmSystemTools::ExpandListArgument(opts, qrc.Options);
}
@@ -604,43 +710,65 @@ bool cmQtAutoGenInitializer::InitScanFiles()
// mocs_compilation.cpp source acknowledged by this target.
this->Target->ClearSourcesCache();
+ // Scan through all source files in the makefile to extract moc and uic
+ // parameters. Historically we support non target source file parameters.
+ // The reason is that their file names might be discovered from source files
+ // at generation time.
if (this->Moc.Enabled || this->Uic.Enabled) {
- // Read skip files from makefile sources
- {
+ // String constants
+ std::string const ui_str = "ui";
+ std::string const AUTOUIC_OPTIONS_str = "AUTOUIC_OPTIONS";
+
+ for (cmSourceFile* sf : makefile->GetSourceFiles()) {
+ // sf->GetExtension() is only valid after sf->GetFullPath() ...
+ // Since we're iterating over source files that might be not in the
+ // target we need to check for path errors (not existing files).
std::string pathError;
- for (cmSourceFile* sf : makefile->GetSourceFiles()) {
- // sf->GetExtension() is only valid after sf->GetFullPath() ...
- // Since we're iterating over source files that might be not in the
- // target we need to check for path errors (not existing files).
- std::string const& fPath = sf->GetFullPath(&pathError);
- if (!pathError.empty()) {
- pathError.clear();
- continue;
+ std::string const& fullPath = sf->GetFullPath(&pathError);
+ if (!pathError.empty() || fullPath.empty()) {
+ continue;
+ }
+
+ // Check file type
+ auto const fileType = cmSystemTools::GetFileFormat(sf->GetExtension());
+ bool const isSource = (fileType == cmSystemTools::CXX_FILE_FORMAT) ||
+ (fileType == cmSystemTools::HEADER_FILE_FORMAT);
+ bool const isUi = (this->Moc.Enabled && sf->GetExtension() == ui_str);
+
+ // Process only certain file types
+ if (isSource || isUi) {
+ std::string const absFile = cmSystemTools::GetRealPath(fullPath);
+ // Acquire file properties
+ bool const skipAUTOGEN = sf->GetPropertyAsBool(SKIP_AUTOGEN_str);
+ bool const skipMoc = (this->Moc.Enabled && isSource) &&
+ (skipAUTOGEN || sf->GetPropertyAsBool(SKIP_AUTOMOC_str));
+ bool const skipUic = this->Uic.Enabled &&
+ (skipAUTOGEN || sf->GetPropertyAsBool(SKIP_AUTOUIC_str));
+
+ // Register moc and uic skipped file
+ if (skipMoc) {
+ this->Moc.Skip.insert(absFile);
}
- cmSystemTools::FileFormat const fileType =
- cmSystemTools::GetFileFormat(sf->GetExtension().c_str());
- if (!(fileType == cmSystemTools::CXX_FILE_FORMAT) &&
- !(fileType == cmSystemTools::HEADER_FILE_FORMAT)) {
- continue;
+ if (skipUic) {
+ this->Uic.Skip.insert(absFile);
}
- const bool skipAll = sf->GetPropertyAsBool("SKIP_AUTOGEN");
- const bool mocSkip = this->Moc.Enabled &&
- (skipAll || sf->GetPropertyAsBool("SKIP_AUTOMOC"));
- const bool uicSkip = this->Uic.Enabled &&
- (skipAll || sf->GetPropertyAsBool("SKIP_AUTOUIC"));
- if (mocSkip || uicSkip) {
- std::string const absFile = cmSystemTools::GetRealPath(fPath);
- if (mocSkip) {
- this->Moc.Skip.insert(absFile);
- }
- if (uicSkip) {
- this->Uic.Skip.insert(absFile);
+
+ // Check if the .ui file has uic options
+ if (isUi && !skipUic) {
+ std::string const uicOpts = sf->GetSafeProperty(AUTOUIC_OPTIONS_str);
+ if (!uicOpts.empty()) {
+ this->Uic.FileFiles.push_back(absFile);
+ std::vector<std::string> optsVec;
+ cmSystemTools::ExpandListArgument(uicOpts, optsVec);
+ this->Uic.FileOptions.push_back(std::move(optsVec));
}
}
}
}
+ }
- // Process GENERATED sources and headers
+ // Process GENERATED sources and headers
+ if (this->Moc.Enabled || this->Uic.Enabled) {
if (!this->AutogenTarget.SourcesGenerated.empty() ||
!this->AutogenTarget.HeadersGenerated.empty()) {
// Check status of policy CMP0071
@@ -712,22 +840,23 @@ bool cmQtAutoGenInitializer::InitScanFiles()
msg += ":\n set_property(SOURCE file.h PROPERTY ";
msg += property;
msg += " ON)\n";
- makefile->IssueMessage(cmake::AUTHOR_WARNING, msg);
+ makefile->IssueMessage(MessageType::AUTHOR_WARNING, msg);
}
}
}
- // Sort headers and sources
- if (this->Moc.Enabled || this->Uic.Enabled) {
- std::sort(this->AutogenTarget.Headers.begin(),
- this->AutogenTarget.Headers.end());
- std::sort(this->AutogenTarget.Sources.begin(),
- this->AutogenTarget.Sources.end());
- }
+ }
+
+ // Sort headers and sources
+ if (this->Moc.Enabled || this->Uic.Enabled) {
+ std::sort(this->AutogenTarget.Headers.begin(),
+ this->AutogenTarget.Headers.end());
+ std::sort(this->AutogenTarget.Sources.begin(),
+ this->AutogenTarget.Sources.end());
}
// Process qrc files
if (!this->Rcc.Qrcs.empty()) {
- const bool QtV5 = (this->QtVersion.Major == 5);
+ const bool modernQt = (this->QtVersion.Major >= 5);
// Target rcc options
std::vector<std::string> optionsTarget;
cmSystemTools::ExpandListArgument(
@@ -799,10 +928,10 @@ bool cmQtAutoGenInitializer::InitScanFiles()
std::vector<std::string> nameOpts;
nameOpts.emplace_back("-name");
nameOpts.emplace_back(std::move(name));
- RccMergeOptions(opts, nameOpts, QtV5);
+ RccMergeOptions(opts, nameOpts, modernQt);
}
// Merge file option
- RccMergeOptions(opts, qrc.Options, QtV5);
+ RccMergeOptions(opts, qrc.Options, modernQt);
qrc.Options = std::move(opts);
}
// RCC resources
@@ -810,7 +939,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
if (!qrc.Generated) {
std::string error;
if (!RccListInputs(qrc.QrcFile, qrc.Resources, error)) {
- cmSystemTools::Error(error.c_str());
+ cmSystemTools::Error(error);
return false;
}
}
@@ -832,7 +961,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
// Files provided by the autogen target
std::vector<std::string> autogenProvides;
if (this->Moc.Enabled) {
- this->AddGeneratedSource(this->Moc.MocsCompilation, GeneratorT::MOC);
+ this->AddGeneratedSource(this->Moc.MocsCompilation, GeneratorT::MOC, true);
autogenProvides.push_back(this->Moc.MocsCompilation);
}
@@ -882,6 +1011,10 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
if (!this->AutogenTarget.DependFiles.empty()) {
usePRE_BUILD = false;
}
+ // Cannot use PRE_BUILD when a global autogen target is in place
+ if (AutogenTarget.GlobalTarget) {
+ usePRE_BUILD = false;
+ }
}
// Create the autogen target/command
if (usePRE_BUILD) {
@@ -907,7 +1040,7 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
// Add link library target dependencies to the autogen target
// dependencies
- {
+ if (this->AutogenTarget.DependOrigin) {
// add_dependencies/addUtility do not support generator expressions.
// We depend only on the libraries found in all configs therefore.
std::map<cmGeneratorTarget const*, std::size_t> commonTargets;
@@ -944,8 +1077,10 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
new cmGeneratorTarget(autogenTarget, localGen));
// Forward origin utilities to autogen target
- for (std::string const& depName : this->Target->Target->GetUtilities()) {
- autogenTarget->AddUtility(depName, makefile);
+ if (this->AutogenTarget.DependOrigin) {
+ for (BT<std::string> const& depName : this->Target->GetUtilities()) {
+ autogenTarget->AddUtility(depName.Value, makefile);
+ }
}
// Add additional autogen target dependencies to autogen target
for (cmTarget* depTarget : this->AutogenTarget.DependTargets) {
@@ -959,6 +1094,12 @@ bool cmQtAutoGenInitializer::InitAutogenTarget()
// Add autogen target to the origin target dependencies
this->Target->Target->AddUtility(this->AutogenTarget.Name, makefile);
+
+ // Add autogen target to the global autogen target dependencies
+ if (this->AutogenTarget.GlobalTarget) {
+ this->GlobalInitializer->AddToGlobalAutoGen(localGen,
+ this->AutogenTarget.Name);
+ }
}
return true;
@@ -968,6 +1109,7 @@ bool cmQtAutoGenInitializer::InitRccTargets()
{
cmMakefile* makefile = this->Target->Target->GetMakefile();
cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
+ auto rccTargetName = GetQtExecutableTargetName(this->QtVersion, "rcc");
for (Qrc const& qrc : this->Rcc.Qrcs) {
// Register info file as generated by CMake
@@ -978,6 +1120,11 @@ bool cmQtAutoGenInitializer::InitRccTargets()
std::vector<std::string> ccOutput;
ccOutput.push_back(qrc.RccFile);
+ std::vector<std::string> ccDepends;
+ // Add the .qrc and info file to the custom command dependencies
+ ccDepends.push_back(qrc.QrcFile);
+ ccDepends.push_back(qrc.InfoFile);
+
cmCustomCommandLines commandLines;
if (this->MultiConfig) {
// Build for all configurations
@@ -1002,7 +1149,7 @@ bool cmQtAutoGenInitializer::InitRccTargets()
std::string ccComment = "Automatic RCC for ";
ccComment += FileProjectRelativePath(makefile, qrc.QrcFile);
- if (qrc.Generated) {
+ if (qrc.Generated || this->Rcc.GlobalTarget) {
// Create custom rcc target
std::string ccName;
{
@@ -1013,15 +1160,12 @@ bool cmQtAutoGenInitializer::InitRccTargets()
ccName += "_";
ccName += qrc.PathChecksum;
}
- std::vector<std::string> ccDepends;
- // Add the .qrc and info file to the custom target dependencies
- ccDepends.push_back(qrc.QrcFile);
- ccDepends.push_back(qrc.InfoFile);
cmTarget* autoRccTarget = makefile->AddUtilityCommand(
ccName, cmMakefile::TargetOrigin::Generator, true,
this->Dir.Work.c_str(), ccOutput, ccDepends, commandLines, false,
ccComment.c_str());
+
// Create autogen generator target
localGen->AddGeneratorTarget(
new cmGeneratorTarget(autoRccTarget, localGen));
@@ -1030,23 +1174,30 @@ bool cmQtAutoGenInitializer::InitRccTargets()
if (!this->TargetsFolder.empty()) {
autoRccTarget->SetProperty("FOLDER", this->TargetsFolder.c_str());
}
+ if (!rccTargetName.empty()) {
+ autoRccTarget->AddUtility(rccTargetName, makefile);
+ }
}
// Add autogen target to the origin target dependencies
this->Target->Target->AddUtility(ccName, makefile);
+
+ // Add autogen target to the global autogen target dependencies
+ if (this->Rcc.GlobalTarget) {
+ this->GlobalInitializer->AddToGlobalAutoRcc(localGen, ccName);
+ }
} else {
// Create custom rcc command
{
std::vector<std::string> ccByproducts;
- std::vector<std::string> ccDepends;
- // Add the .qrc and info file to the custom command dependencies
- ccDepends.push_back(qrc.QrcFile);
- ccDepends.push_back(qrc.InfoFile);
// Add the resource files to the dependencies
for (std::string const& fileName : qrc.Resources) {
// Add resource file to the custom command dependencies
ccDepends.push_back(fileName);
}
+ if (!rccTargetName.empty()) {
+ ccDepends.push_back(rccTargetName);
+ }
makefile->AddCustomCommandToOutput(ccOutput, ccByproducts, ccDepends,
/*main_dependency*/ std::string(),
commandLines, ccComment.c_str(),
@@ -1066,7 +1217,7 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
if (!cmSystemTools::MakeDirectory(this->Dir.Info)) {
std::string emsg = ("AutoGen: Could not create directory: ");
emsg += Quoted(this->Dir.Info);
- cmSystemTools::Error(emsg.c_str());
+ cmSystemTools::Error(emsg);
return false;
}
@@ -1079,118 +1230,82 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
}
// Write AUTORCC info files
- if (this->Rcc.Enabled && !this->SetupWriteRccInfo()) {
- return false;
- }
-
- return true;
+ return !this->Rcc.Enabled || this->SetupWriteRccInfo();
}
bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
{
- cmMakefile* makefile = this->Target->Target->GetMakefile();
-
- cmGeneratedFileStream ofs;
- ofs.SetCopyIfDifferent(true);
- ofs.Open(this->AutogenTarget.InfoFile, false, true);
+ InfoWriter ofs(this->AutogenTarget.InfoFile);
if (ofs) {
// Utility lambdas
- auto CWrite = [&ofs](const char* key, std::string const& value) {
- ofs << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value)
- << ")\n";
- };
- auto CWriteUInt = [&ofs](const char* key, unsigned int value) {
- ofs << "set(" << key << " " << value << ")\n";
- };
- auto CWriteList = [&CWrite](const char* key,
- std::vector<std::string> const& list) {
- CWrite(key, cmJoin(list, ";"));
- };
- auto CWriteNestedLists =
- [&CWrite](const char* key,
- std::vector<std::vector<std::string>> const& lists) {
- std::vector<std::string> seplist;
- for (const std::vector<std::string>& list : lists) {
- std::string blist = "{";
- blist += cmJoin(list, ";");
- blist += "}";
- seplist.push_back(std::move(blist));
- }
- CWrite(key, cmJoin(seplist, cmQtAutoGen::ListSep));
- };
- auto CWriteSet = [&CWrite](const char* key,
- std::set<std::string> const& list) {
- CWrite(key, cmJoin(list, ";"));
- };
- auto CWriteMap = [&ofs](const char* key,
- std::map<std::string, std::string> const& map) {
- for (auto const& item : map) {
- ofs << "set(" << key << "_" << item.first << " "
- << cmOutputConverter::EscapeForCMake(item.second) << ")\n";
- }
- };
+ cmMakefile* makefile = this->Target->Target->GetMakefile();
auto MfDef = [makefile](const char* key) {
return makefile->GetSafeDefinition(key);
};
- // Write
- ofs << "# Meta\n";
- CWrite("AM_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
- CWrite("AM_PARALLEL", this->AutogenTarget.Parallel);
- CWrite("AM_VERBOSITY", this->Verbosity);
-
- ofs << "# Directories\n";
- CWrite("AM_CMAKE_SOURCE_DIR", MfDef("CMAKE_SOURCE_DIR"));
- CWrite("AM_CMAKE_BINARY_DIR", MfDef("CMAKE_BINARY_DIR"));
- CWrite("AM_CMAKE_CURRENT_SOURCE_DIR", MfDef("CMAKE_CURRENT_SOURCE_DIR"));
- CWrite("AM_CMAKE_CURRENT_BINARY_DIR", MfDef("CMAKE_CURRENT_BINARY_DIR"));
- CWrite("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE",
- MfDef("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE"));
- CWrite("AM_BUILD_DIR", this->Dir.Build);
- CWrite("AM_INCLUDE_DIR", this->Dir.Include);
- CWriteMap("AM_INCLUDE_DIR", this->Dir.ConfigInclude);
-
- ofs << "# Files\n";
- CWriteList("AM_SOURCES", this->AutogenTarget.Sources);
- CWriteList("AM_HEADERS", this->AutogenTarget.Headers);
- CWrite("AM_SETTINGS_FILE", this->AutogenTarget.SettingsFile);
- CWriteMap("AM_SETTINGS_FILE", this->AutogenTarget.ConfigSettingsFile);
-
- ofs << "# Qt\n";
- CWriteUInt("AM_QT_VERSION_MAJOR", this->QtVersion.Major);
- CWrite("AM_QT_MOC_EXECUTABLE", this->Moc.Executable);
- CWrite("AM_QT_UIC_EXECUTABLE", this->Uic.Executable);
-
+ // Write common settings
+ ofs.Write("# Meta\n");
+ ofs.Write("AM_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
+ ofs.Write("AM_PARALLEL", this->AutogenTarget.Parallel);
+ ofs.Write("AM_VERBOSITY", this->Verbosity);
+
+ ofs.Write("# Directories\n");
+ ofs.Write("AM_CMAKE_SOURCE_DIR", MfDef("CMAKE_SOURCE_DIR"));
+ ofs.Write("AM_CMAKE_BINARY_DIR", MfDef("CMAKE_BINARY_DIR"));
+ ofs.Write("AM_CMAKE_CURRENT_SOURCE_DIR",
+ MfDef("CMAKE_CURRENT_SOURCE_DIR"));
+ ofs.Write("AM_CMAKE_CURRENT_BINARY_DIR",
+ MfDef("CMAKE_CURRENT_BINARY_DIR"));
+ ofs.Write("AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE",
+ MfDef("CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE"));
+ ofs.Write("AM_BUILD_DIR", this->Dir.Build);
+ ofs.Write("AM_INCLUDE_DIR", this->Dir.Include);
+ ofs.WriteConfig("AM_INCLUDE_DIR", this->Dir.ConfigInclude);
+
+ ofs.Write("# Files\n");
+ ofs.WriteStrings("AM_SOURCES", this->AutogenTarget.Sources);
+ ofs.WriteStrings("AM_HEADERS", this->AutogenTarget.Headers);
+ ofs.Write("AM_SETTINGS_FILE", this->AutogenTarget.SettingsFile);
+ ofs.WriteConfig("AM_SETTINGS_FILE",
+ this->AutogenTarget.ConfigSettingsFile);
+
+ ofs.Write("# Qt\n");
+ ofs.WriteUInt("AM_QT_VERSION_MAJOR", this->QtVersion.Major);
+ ofs.Write("AM_QT_MOC_EXECUTABLE", this->Moc.Executable);
+ ofs.Write("AM_QT_UIC_EXECUTABLE", this->Uic.Executable);
+
+ // Write moc settings
if (this->Moc.Enabled) {
- ofs << "# MOC settings\n";
- CWriteSet("AM_MOC_SKIP", this->Moc.Skip);
- CWrite("AM_MOC_DEFINITIONS", this->Moc.Defines);
- CWriteMap("AM_MOC_DEFINITIONS", this->Moc.ConfigDefines);
- CWrite("AM_MOC_INCLUDES", this->Moc.Includes);
- CWriteMap("AM_MOC_INCLUDES", this->Moc.ConfigIncludes);
- CWrite("AM_MOC_OPTIONS",
- this->Target->GetSafeProperty("AUTOMOC_MOC_OPTIONS"));
- CWrite("AM_MOC_RELAXED_MODE", MfDef("CMAKE_AUTOMOC_RELAXED_MODE"));
- CWrite("AM_MOC_MACRO_NAMES",
- this->Target->GetSafeProperty("AUTOMOC_MACRO_NAMES"));
- CWrite("AM_MOC_DEPEND_FILTERS",
- this->Target->GetSafeProperty("AUTOMOC_DEPEND_FILTERS"));
- CWrite("AM_MOC_PREDEFS_CMD", this->Moc.PredefsCmd);
+ ofs.Write("# MOC settings\n");
+ ofs.WriteStrings("AM_MOC_SKIP", this->Moc.Skip);
+ ofs.WriteStrings("AM_MOC_DEFINITIONS", this->Moc.Defines);
+ ofs.WriteConfigStrings("AM_MOC_DEFINITIONS", this->Moc.ConfigDefines);
+ ofs.WriteStrings("AM_MOC_INCLUDES", this->Moc.Includes);
+ ofs.WriteConfigStrings("AM_MOC_INCLUDES", this->Moc.ConfigIncludes);
+ ofs.Write("AM_MOC_OPTIONS",
+ this->Target->GetSafeProperty("AUTOMOC_MOC_OPTIONS"));
+ ofs.Write("AM_MOC_RELAXED_MODE", MfDef("CMAKE_AUTOMOC_RELAXED_MODE"));
+ ofs.Write("AM_MOC_MACRO_NAMES",
+ this->Target->GetSafeProperty("AUTOMOC_MACRO_NAMES"));
+ ofs.Write("AM_MOC_DEPEND_FILTERS",
+ this->Target->GetSafeProperty("AUTOMOC_DEPEND_FILTERS"));
+ ofs.Write("AM_MOC_PREDEFS_CMD", this->Moc.PredefsCmd);
}
+ // Write uic settings
if (this->Uic.Enabled) {
- ofs << "# UIC settings\n";
- CWriteSet("AM_UIC_SKIP", this->Uic.Skip);
- CWrite("AM_UIC_TARGET_OPTIONS", this->Uic.Options);
- CWriteMap("AM_UIC_TARGET_OPTIONS", this->Uic.ConfigOptions);
- CWriteList("AM_UIC_OPTIONS_FILES", this->Uic.FileFiles);
- CWriteNestedLists("AM_UIC_OPTIONS_OPTIONS", this->Uic.FileOptions);
- CWriteList("AM_UIC_SEARCH_PATHS", this->Uic.SearchPaths);
+ ofs.Write("# UIC settings\n");
+ ofs.WriteStrings("AM_UIC_SKIP", this->Uic.Skip);
+ ofs.WriteStrings("AM_UIC_TARGET_OPTIONS", this->Uic.Options);
+ ofs.WriteConfigStrings("AM_UIC_TARGET_OPTIONS", this->Uic.ConfigOptions);
+ ofs.WriteStrings("AM_UIC_OPTIONS_FILES", this->Uic.FileFiles);
+ ofs.WriteNestedLists("AM_UIC_OPTIONS_OPTIONS", this->Uic.FileOptions);
+ ofs.WriteStrings("AM_UIC_SEARCH_PATHS", this->Uic.SearchPaths);
}
} else {
std::string err = "AutoGen: Could not write file ";
err += this->AutogenTarget.InfoFile;
- cmSystemTools::Error(err.c_str());
+ cmSystemTools::Error(err);
return false;
}
@@ -1200,51 +1315,37 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
bool cmQtAutoGenInitializer::SetupWriteRccInfo()
{
for (Qrc const& qrc : this->Rcc.Qrcs) {
- cmGeneratedFileStream ofs;
- ofs.SetCopyIfDifferent(true);
- ofs.Open(qrc.InfoFile, false, true);
+ InfoWriter ofs(qrc.InfoFile);
if (ofs) {
- // Utility lambdas
- auto CWrite = [&ofs](const char* key, std::string const& value) {
- ofs << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value)
- << ")\n";
- };
- auto CWriteMap = [&ofs](const char* key,
- std::map<std::string, std::string> const& map) {
- for (auto const& item : map) {
- ofs << "set(" << key << "_" << item.first << " "
- << cmOutputConverter::EscapeForCMake(item.second) << ")\n";
- }
- };
-
// Write
- ofs << "# Configurations\n";
- CWrite("ARCC_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
- CWrite("ARCC_VERBOSITY", this->Verbosity);
- ofs << "# Settings file\n";
- CWrite("ARCC_SETTINGS_FILE", qrc.SettingsFile);
- CWriteMap("ARCC_SETTINGS_FILE", qrc.ConfigSettingsFile);
-
- ofs << "# Directories\n";
- CWrite("ARCC_BUILD_DIR", this->Dir.Build);
- CWrite("ARCC_INCLUDE_DIR", this->Dir.Include);
- CWriteMap("ARCC_INCLUDE_DIR", this->Dir.ConfigInclude);
-
- ofs << "# Rcc executable\n";
- CWrite("ARCC_RCC_EXECUTABLE", this->Rcc.Executable);
- CWrite("ARCC_RCC_LIST_OPTIONS", cmJoin(this->Rcc.ListOptions, ";"));
-
- ofs << "# Rcc job\n";
- CWrite("ARCC_LOCK_FILE", qrc.LockFile);
- CWrite("ARCC_SOURCE", qrc.QrcFile);
- CWrite("ARCC_OUTPUT_CHECKSUM", qrc.PathChecksum);
- CWrite("ARCC_OUTPUT_NAME", cmSystemTools::GetFilenameName(qrc.RccFile));
- CWrite("ARCC_OPTIONS", cmJoin(qrc.Options, ";"));
- CWrite("ARCC_INPUTS", cmJoin(qrc.Resources, ";"));
+ ofs.Write("# Configurations\n");
+ ofs.Write("ARCC_MULTI_CONFIG", this->MultiConfig ? "TRUE" : "FALSE");
+ ofs.Write("ARCC_VERBOSITY", this->Verbosity);
+ ofs.Write("# Settings file\n");
+ ofs.Write("ARCC_SETTINGS_FILE", qrc.SettingsFile);
+ ofs.WriteConfig("ARCC_SETTINGS_FILE", qrc.ConfigSettingsFile);
+
+ ofs.Write("# Directories\n");
+ ofs.Write("ARCC_BUILD_DIR", this->Dir.Build);
+ ofs.Write("ARCC_INCLUDE_DIR", this->Dir.Include);
+ ofs.WriteConfig("ARCC_INCLUDE_DIR", this->Dir.ConfigInclude);
+
+ ofs.Write("# Rcc executable\n");
+ ofs.Write("ARCC_RCC_EXECUTABLE", this->Rcc.Executable);
+ ofs.WriteStrings("ARCC_RCC_LIST_OPTIONS", this->Rcc.ListOptions);
+
+ ofs.Write("# Rcc job\n");
+ ofs.Write("ARCC_LOCK_FILE", qrc.LockFile);
+ ofs.Write("ARCC_SOURCE", qrc.QrcFile);
+ ofs.Write("ARCC_OUTPUT_CHECKSUM", qrc.PathChecksum);
+ ofs.Write("ARCC_OUTPUT_NAME",
+ cmSystemTools::GetFilenameName(qrc.RccFile));
+ ofs.WriteStrings("ARCC_OPTIONS", qrc.Options);
+ ofs.WriteStrings("ARCC_INPUTS", qrc.Resources);
} else {
std::string err = "AutoRcc: Could not write file ";
err += qrc.InfoFile;
- cmSystemTools::Error(err.c_str());
+ cmSystemTools::Error(err);
return false;
}
}
@@ -1253,7 +1354,8 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
}
void cmQtAutoGenInitializer::AddGeneratedSource(std::string const& filename,
- GeneratorT genType)
+ GeneratorT genType,
+ bool prepend)
{
// Register source file in makefile
cmMakefile* makefile = this->Target->Target->GetMakefile();
@@ -1267,266 +1369,169 @@ void cmQtAutoGenInitializer::AddGeneratedSource(std::string const& filename,
AddToSourceGroup(makefile, filename, genType);
// Add source file to target
- this->Target->AddSource(filename);
+ this->Target->AddSource(filename, prepend);
+}
+
+static unsigned int CharPtrToUInt(const char* const input)
+{
+ unsigned long tmp = 0;
+ if (input != nullptr && cmSystemTools::StringToULong(input, &tmp)) {
+ return static_cast<unsigned int>(tmp);
+ }
+ return 0;
}
-cmQtAutoGenInitializer::IntegerVersion cmQtAutoGenInitializer::GetQtVersion(
+static std::vector<cmQtAutoGen::IntegerVersion> GetKnownQtVersions(
cmGeneratorTarget const* target)
{
- cmQtAutoGenInitializer::IntegerVersion res;
cmMakefile* makefile = target->Target->GetMakefile();
-
- // -- Major version
- std::string qtMajor = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
- if (qtMajor.empty()) {
- qtMajor = makefile->GetSafeDefinition("Qt5Core_VERSION_MAJOR");
- }
- if (qtMajor.empty()) {
- const char* dirprop = makefile->GetProperty("Qt5Core_VERSION_MAJOR");
- if (dirprop) {
- qtMajor = dirprop;
+ std::vector<cmQtAutoGen::IntegerVersion> result;
+ // Adds a version to the result (nullptr safe)
+ auto addVersion = [&result](const char* major, const char* minor) {
+ cmQtAutoGen::IntegerVersion ver(CharPtrToUInt(major),
+ CharPtrToUInt(minor));
+ if (ver.Major != 0) {
+ result.emplace_back(ver);
}
+ };
+ // Qt version variable prefixes
+ std::array<std::string, 3> const prefixes{ { "Qt6Core", "Qt5Core", "QT" } };
+
+ // Read versions from variables
+ for (const std::string& prefix : prefixes) {
+ addVersion(makefile->GetDefinition(prefix + "_VERSION_MAJOR"),
+ makefile->GetDefinition(prefix + "_VERSION_MINOR"));
}
- {
- const char* targetQtVersion =
- target->GetLinkInterfaceDependentStringProperty("QT_MAJOR_VERSION", "");
- if (targetQtVersion != nullptr) {
- qtMajor = targetQtVersion;
- }
+
+ // Read versions from directory properties
+ for (const std::string& prefix : prefixes) {
+ addVersion(makefile->GetProperty(prefix + "_VERSION_MAJOR"),
+ makefile->GetProperty(prefix + "_VERSION_MINOR"));
}
- // -- Minor version
- std::string qtMinor;
- if (!qtMajor.empty()) {
- if (qtMajor == "5") {
- qtMinor = makefile->GetSafeDefinition("Qt5Core_VERSION_MINOR");
- if (qtMinor.empty()) {
- const char* dirprop = makefile->GetProperty("Qt5Core_VERSION_MINOR");
- if (dirprop) {
- qtMinor = dirprop;
+ return result;
+}
+
+std::pair<cmQtAutoGen::IntegerVersion, unsigned int>
+cmQtAutoGenInitializer::GetQtVersion(cmGeneratorTarget const* target)
+{
+ std::pair<IntegerVersion, unsigned int> res(
+ IntegerVersion(),
+ CharPtrToUInt(target->GetLinkInterfaceDependentStringProperty(
+ "QT_MAJOR_VERSION", "")));
+
+ auto knownQtVersions = GetKnownQtVersions(target);
+ if (!knownQtVersions.empty()) {
+ if (res.second == 0) {
+ // No specific version was requested by the target:
+ // Use highest known Qt version.
+ res.first = knownQtVersions.at(0);
+ } else {
+ // Pick a version from the known versions:
+ for (auto it : knownQtVersions) {
+ if (it.Major == res.second) {
+ res.first = it;
+ break;
}
}
}
- if (qtMinor.empty()) {
- qtMinor = makefile->GetSafeDefinition("QT_VERSION_MINOR");
- }
- {
- const char* targetQtVersion =
- target->GetLinkInterfaceDependentStringProperty("QT_MINOR_VERSION",
- "");
- if (targetQtVersion != nullptr) {
- qtMinor = targetQtVersion;
- }
- }
}
-
- // -- Convert to integer
- if (!qtMajor.empty() && !qtMinor.empty()) {
- unsigned long majorUL(0);
- unsigned long minorUL(0);
- if (cmSystemTools::StringToULong(qtMajor.c_str(), &majorUL) &&
- cmSystemTools::StringToULong(qtMinor.c_str(), &minorUL)) {
- res.Major = static_cast<unsigned int>(majorUL);
- res.Minor = static_cast<unsigned int>(minorUL);
- }
- }
-
return res;
}
-bool cmQtAutoGenInitializer::GetMocExecutable()
+std::pair<bool, std::string> cmQtAutoGenInitializer::GetQtExecutable(
+ const std::string& executable, bool ignoreMissingTarget, std::string* output)
{
+ const std::string upperExecutable = cmSystemTools::UpperCase(executable);
+ std::string result = this->Target->Target->GetSafeProperty(
+ "AUTO" + upperExecutable + "_EXECUTABLE");
+ if (!result.empty()) {
+ cmListFileBacktrace lfbt =
+ this->Target->Target->GetMakefile()->GetBacktrace();
+ cmGeneratorExpression ge(lfbt);
+ std::unique_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(result);
+ result = cge->Evaluate(this->Target->GetLocalGenerator(), "");
+
+ return std::make_pair(true, result);
+ }
+
std::string err;
- // Find moc executable
+ // Find executable
{
- std::string targetName;
- if (this->QtVersion.Major == 5) {
- targetName = "Qt5::moc";
- } else if (this->QtVersion.Major == 4) {
- targetName = "Qt4::moc";
+ const std::string targetName =
+ GetQtExecutableTargetName(this->QtVersion, executable);
+ if (targetName.empty()) {
+ err = "The AUTO" + upperExecutable + " feature ";
+ err += "supports only Qt 4, Qt 5 and Qt 6.";
} else {
- err = "The AUTOMOC feature supports only Qt 4 and Qt 5";
- }
- if (!targetName.empty()) {
cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
if (tgt != nullptr) {
- this->Moc.Executable = tgt->ImportedGetLocation("");
+ if (tgt->IsImported()) {
+ result = tgt->ImportedGetLocation("");
+ } else {
+ result = tgt->GetLocation("");
+ }
} else {
+ if (ignoreMissingTarget) {
+ return std::make_pair(true, "");
+ }
+
err = "Could not find target " + targetName;
}
}
}
- // Test moc command
+ // Test executable
if (err.empty()) {
- if (cmSystemTools::FileExists(this->Moc.Executable, true)) {
- std::vector<std::string> command;
- command.push_back(this->Moc.Executable);
- command.push_back("-h");
- std::string stdOut;
- std::string stdErr;
- int retVal = 0;
- bool result = cmSystemTools::RunSingleCommand(
- command, &stdOut, &stdErr, &retVal, nullptr,
- cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto);
- if (!result) {
- err = "The moc test command failed: ";
- err += QuotedCommand(command);
- }
- } else {
- err = "The moc executable ";
- err += Quoted(this->Moc.Executable);
- err += " does not exist";
- }
+ this->GlobalInitializer->GetExecutableTestOutput(executable, result, err,
+ output);
}
// Print error
if (!err.empty()) {
- std::string msg = "AutoMoc (";
+ std::string msg = "AutoGen (";
msg += this->Target->GetName();
msg += "): ";
msg += err;
- cmSystemTools::Error(msg.c_str());
- return false;
+ cmSystemTools::Error(msg);
+ return std::make_pair(false, "");
}
- return true;
+ return std::make_pair(true, result);
}
-bool cmQtAutoGenInitializer::GetUicExecutable()
+bool cmQtAutoGenInitializer::GetMocExecutable()
{
- std::string err;
-
- // Find uic executable
- {
- std::string targetName;
- if (this->QtVersion.Major == 5) {
- targetName = "Qt5::uic";
- } else if (this->QtVersion.Major == 4) {
- targetName = "Qt4::uic";
- } else {
- err = "The AUTOUIC feature supports only Qt 4 and Qt 5";
- }
- if (!targetName.empty()) {
- cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
- cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
- if (tgt != nullptr) {
- this->Uic.Executable = tgt->ImportedGetLocation("");
- } else {
- if (this->QtVersion.Major == 5) {
- // Project does not use Qt5Widgets, but has AUTOUIC ON anyway
- } else {
- err = "Could not find target " + targetName;
- }
- }
- }
- }
-
- // Test uic command
- if (err.empty() && !this->Uic.Executable.empty()) {
- if (cmSystemTools::FileExists(this->Uic.Executable, true)) {
- std::vector<std::string> command;
- command.push_back(this->Uic.Executable);
- command.push_back("-h");
- std::string stdOut;
- std::string stdErr;
- int retVal = 0;
- bool result = cmSystemTools::RunSingleCommand(
- command, &stdOut, &stdErr, &retVal, nullptr,
- cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto);
- if (!result) {
- err = "The uic test command failed: ";
- err += QuotedCommand(command);
- }
- } else {
- err = "The uic executable ";
- err += Quoted(this->Uic.Executable);
- err += " does not exist";
- }
- }
-
- // Print error
- if (!err.empty()) {
- std::string msg = "AutoUic (";
- msg += this->Target->GetName();
- msg += "): ";
- msg += err;
- cmSystemTools::Error(msg.c_str());
- return false;
- }
+ const auto result = this->GetQtExecutable("moc", false, nullptr);
+ this->Moc.Executable = result.second;
+ return result.first;
+}
- return true;
+bool cmQtAutoGenInitializer::GetUicExecutable()
+{
+ const auto result = this->GetQtExecutable("uic", true, nullptr);
+ this->Uic.Executable = result.second;
+ return result.first;
}
bool cmQtAutoGenInitializer::GetRccExecutable()
{
- std::string err;
-
- // Find rcc executable
- {
- std::string targetName;
- if (this->QtVersion.Major == 5) {
- targetName = "Qt5::rcc";
- } else if (this->QtVersion.Major == 4) {
- targetName = "Qt4::rcc";
- } else {
- err = "The AUTORCC feature supports only Qt 4 and Qt 5";
- }
- if (!targetName.empty()) {
- cmLocalGenerator* localGen = this->Target->GetLocalGenerator();
- cmGeneratorTarget* tgt = localGen->FindGeneratorTargetToUse(targetName);
- if (tgt != nullptr) {
- this->Rcc.Executable = tgt->ImportedGetLocation("");
- } else {
- err = "Could not find target " + targetName;
- }
- }
+ std::string stdOut;
+ const auto result = this->GetQtExecutable("rcc", false, &stdOut);
+ this->Rcc.Executable = result.second;
+ if (!result.first) {
+ return false;
}
- // Test rcc command
- if (err.empty()) {
- if (cmSystemTools::FileExists(this->Rcc.Executable, true)) {
- std::vector<std::string> command;
- command.push_back(this->Rcc.Executable);
- command.push_back("-h");
- std::string stdOut;
- std::string stdErr;
- int retVal = 0;
- bool result = cmSystemTools::RunSingleCommand(
- command, &stdOut, &stdErr, &retVal, nullptr,
- cmSystemTools::OUTPUT_NONE, cmDuration::zero(), cmProcessOutput::Auto);
- if (result) {
- // Detect if rcc supports (-)-list
- if (this->QtVersion.Major == 5) {
- if (stdOut.find("--list") != std::string::npos) {
- this->Rcc.ListOptions.push_back("--list");
- } else {
- this->Rcc.ListOptions.push_back("-list");
- }
- }
- } else {
- err = "The rcc test command failed: ";
- err += QuotedCommand(command);
- }
+ if (this->QtVersion.Major == 5 || this->QtVersion.Major == 6) {
+ if (stdOut.find("--list") != std::string::npos) {
+ this->Rcc.ListOptions.emplace_back("--list");
} else {
- err = "The rcc executable ";
- err += Quoted(this->Rcc.Executable);
- err += " does not exist";
+ this->Rcc.ListOptions.emplace_back("-list");
}
}
-
- // Print error
- if (!err.empty()) {
- std::string msg = "AutoRcc (";
- msg += this->Target->GetName();
- msg += "): ";
- msg += err;
- cmSystemTools::Error(msg.c_str());
- return false;
- }
-
return true;
}
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index ce00e00fe..781dd15d6 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -4,15 +4,19 @@
#define cmQtAutoGenInitializer_h
#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmGeneratedFileStream.h"
#include "cmQtAutoGen.h"
#include <map>
+#include <ostream>
#include <set>
#include <string>
+#include <utility>
#include <vector>
class cmGeneratorTarget;
class cmTarget;
+class cmQtAutoGenGlobalInitializer;
/// @brief Initializes the QtAutoGen generators
class cmQtAutoGenInitializer : public cmQtAutoGen
@@ -22,13 +26,6 @@ public:
class Qrc
{
public:
- Qrc()
- : Generated(false)
- , Unique(false)
- {
- }
-
- public:
std::string LockFile;
std::string QrcFile;
std::string QrcName;
@@ -37,18 +34,55 @@ public:
std::string SettingsFile;
std::map<std::string, std::string> ConfigSettingsFile;
std::string RccFile;
- bool Generated;
- bool Unique;
+ bool Generated = false;
+ bool Unique = false;
std::vector<std::string> Options;
std::vector<std::string> Resources;
};
+ /// @brief Writes a CMake info file
+ class InfoWriter
+ {
+ public:
+ /// @brief Open the given file
+ InfoWriter(std::string const& filename);
+
+ /// @return True if the file is open
+ explicit operator bool() const { return static_cast<bool>(Ofs_); }
+
+ void Write(const char* text) { Ofs_ << text; }
+ void Write(const char* key, std::string const& value);
+ void WriteUInt(const char* key, unsigned int value);
+
+ template <class C>
+ void WriteStrings(const char* key, C const& container);
+ void WriteConfig(const char* key,
+ std::map<std::string, std::string> const& map);
+ template <class C>
+ void WriteConfigStrings(const char* key,
+ std::map<std::string, C> const& map);
+ void WriteNestedLists(const char* key,
+ std::vector<std::vector<std::string>> const& lists);
+
+ private:
+ template <class IT>
+ static std::string ListJoin(IT it_begin, IT it_end);
+ static std::string ConfigKey(const char* key, std::string const& config);
+
+ private:
+ cmGeneratedFileStream Ofs_;
+ };
+
public:
- static IntegerVersion GetQtVersion(cmGeneratorTarget const* target);
+ /// @return The detected Qt version and the required Qt major version
+ static std::pair<IntegerVersion, unsigned int> GetQtVersion(
+ cmGeneratorTarget const* target);
- cmQtAutoGenInitializer(cmGeneratorTarget* target, bool mocEnabled,
+ cmQtAutoGenInitializer(cmQtAutoGenGlobalInitializer* globalInitializer,
+ cmGeneratorTarget* target,
+ IntegerVersion const& qtVersion, bool mocEnabled,
bool uicEnabled, bool rccEnabled,
- IntegerVersion const& qtVersion);
+ bool globalAutogenTarget, bool globalAutoRccTarget);
bool InitCustomTargets();
bool SetupCustomTargets();
@@ -65,7 +99,8 @@ private:
bool SetupWriteAutogenInfo();
bool SetupWriteRccInfo();
- void AddGeneratedSource(std::string const& filename, GeneratorT genType);
+ void AddGeneratedSource(std::string const& filename, GeneratorT genType,
+ bool prepend = false);
bool GetMocExecutable();
bool GetUicExecutable();
@@ -75,7 +110,12 @@ private:
std::vector<std::string>& files,
std::string& errorMessage);
+ std::pair<bool, std::string> GetQtExecutable(const std::string& executable,
+ bool ignoreMissingTarget,
+ std::string* output);
+
private:
+ cmQtAutoGenGlobalInitializer* GlobalInitializer;
cmGeneratorTarget* Target;
// Configuration
@@ -100,6 +140,7 @@ private:
struct
{
std::string Name;
+ bool GlobalTarget = false;
// Settings
std::string Parallel;
// Configuration files
@@ -107,6 +148,7 @@ private:
std::string SettingsFile;
std::map<std::string, std::string> ConfigSettingsFile;
// Dependencies
+ bool DependOrigin = false;
std::set<std::string> DependFiles;
std::set<cmTarget*> DependTargets;
// Sources to process
@@ -123,10 +165,10 @@ private:
std::string Executable;
std::string PredefsCmd;
std::set<std::string> Skip;
- std::string Includes;
- std::map<std::string, std::string> ConfigIncludes;
- std::string Defines;
- std::map<std::string, std::string> ConfigDefines;
+ std::vector<std::string> Includes;
+ std::map<std::string, std::vector<std::string>> ConfigIncludes;
+ std::set<std::string> Defines;
+ std::map<std::string, std::set<std::string>> ConfigDefines;
std::string MocsCompilation;
} Moc;
@@ -137,8 +179,8 @@ private:
std::string Executable;
std::set<std::string> Skip;
std::vector<std::string> SearchPaths;
- std::string Options;
- std::map<std::string, std::string> ConfigOptions;
+ std::vector<std::string> Options;
+ std::map<std::string, std::vector<std::string>> ConfigOptions;
std::vector<std::string> FileFiles;
std::vector<std::vector<std::string>> FileOptions;
} Uic;
@@ -147,6 +189,7 @@ private:
struct
{
bool Enabled = false;
+ bool GlobalTarget = false;
std::string Executable;
std::vector<std::string> ListOptions;
std::vector<Qrc> Qrcs;
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 734b2d70d..e2d7debed 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -8,12 +8,14 @@
#include "cmAlgorithms.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
#include "cmSystemTools.h"
#include "cmake.h"
#include <algorithm>
+#include <utility>
// -- Class methods
@@ -52,7 +54,7 @@ void cmQtAutoGenerator::Logger::Info(GeneratorT genType,
}
{
std::lock_guard<std::mutex> lock(Mutex_);
- cmSystemTools::Stdout(msg.c_str(), msg.size());
+ cmSystemTools::Stdout(msg);
}
}
@@ -76,7 +78,7 @@ void cmQtAutoGenerator::Logger::Warning(GeneratorT genType,
msg.push_back('\n');
{
std::lock_guard<std::mutex> lock(Mutex_);
- cmSystemTools::Stdout(msg.c_str(), msg.size());
+ cmSystemTools::Stdout(msg);
}
}
@@ -105,7 +107,7 @@ void cmQtAutoGenerator::Logger::Error(GeneratorT genType,
msg.push_back('\n');
{
std::lock_guard<std::mutex> lock(Mutex_);
- cmSystemTools::Stderr(msg.c_str(), msg.size());
+ cmSystemTools::Stderr(msg);
}
}
@@ -147,7 +149,7 @@ void cmQtAutoGenerator::Logger::ErrorCommand(
msg.push_back('\n');
{
std::lock_guard<std::mutex> lock(Mutex_);
- cmSystemTools::Stderr(msg.c_str(), msg.size());
+ cmSystemTools::Stderr(msg);
}
}
@@ -685,7 +687,7 @@ bool cmQtAutoGenerator::Run(std::string const& infoFile,
bool success = false;
{
- cmake cm(cmake::RoleScript);
+ cmake cm(cmake::RoleScript, cmState::Unknown);
cm.SetHomeOutputDirectory(InfoDir());
cm.SetHomeDirectory(InfoDir());
cm.GetCurrentSnapshot().SetDefaultDefinitions();
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index 75143f5a6..9956a99a3 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -24,7 +24,6 @@ class cmMakefile;
/// @brief Base class for QtAutoGen gernerators
class cmQtAutoGenerator : public cmQtAutoGen
{
- CM_DISABLE_COPY(cmQtAutoGenerator)
public:
// -- Types
@@ -206,9 +205,6 @@ public:
bool MergedOutput = false;
};
- // -- Constructor
- ReadOnlyProcessT() = default;
-
// -- Const accessors
const SetupT& Setup() const { return Setup_; }
ProcessResultT* Result() const { return Setup_.Result; }
@@ -248,6 +244,9 @@ public:
cmQtAutoGenerator();
virtual ~cmQtAutoGenerator();
+ cmQtAutoGenerator(cmQtAutoGenerator const&) = delete;
+ cmQtAutoGenerator& operator=(cmQtAutoGenerator const&) = delete;
+
// -- Run
bool Run(std::string const& infoFile, std::string const& config);
diff --git a/Source/cmQtAutoGeneratorMocUic.cxx b/Source/cmQtAutoGeneratorMocUic.cxx
index 2e6f90f7c..ddff4cf87 100644
--- a/Source/cmQtAutoGeneratorMocUic.cxx
+++ b/Source/cmQtAutoGeneratorMocUic.cxx
@@ -1,19 +1,21 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmQtAutoGeneratorMocUic.h"
-#include "cmQtAutoGen.h"
#include <algorithm>
#include <array>
+#include <cstddef>
#include <functional>
#include <list>
#include <memory>
+#include <set>
#include <sstream>
#include <utility>
#include "cmAlgorithms.h"
#include "cmCryptoHash.h"
#include "cmMakefile.h"
+#include "cmQtAutoGen.h"
#include "cmSystemTools.h"
#include "cmake.h"
@@ -676,19 +678,21 @@ void cmQtAutoGeneratorMocUic::JobMocT::Process(WorkerT& wrk)
BuildFile += '/';
BuildFile += IncludeString;
} else {
- std::string rel = wrk.FileSys().GetFilePathChecksum(SourceFile);
- rel += "/moc_";
- rel += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
- rel += ".cpp";
- // Register relative file path
- wrk.Gen().ParallelMocAutoRegister(rel);
+ // Relative build path
+ std::string relPath = wrk.FileSys().GetFilePathChecksum(SourceFile);
+ relPath += "/moc_";
+ relPath += wrk.FileSys().GetFilenameWithoutLastExtension(SourceFile);
+
+ // Register relative file path with duplication check
+ relPath = wrk.Gen().ParallelMocAutoRegister(relPath);
+
// Absolute build path
if (wrk.Base().MultiConfig) {
BuildFile = wrk.Base().AutogenIncludeDir;
BuildFile += '/';
- BuildFile += rel;
+ BuildFile += relPath;
} else {
- BuildFile = wrk.Base().AbsoluteBuildPath(rel);
+ BuildFile = wrk.Base().AbsoluteBuildPath(relPath);
}
}
@@ -842,10 +846,10 @@ void cmQtAutoGeneratorMocUic::JobMocT::GenerateMoc(WorkerT& wrk)
wrk.Moc().AllOptions.end());
// Add predefs include
if (!wrk.Moc().PredefsFileAbs.empty()) {
- cmd.push_back("--include");
+ cmd.emplace_back("--include");
cmd.push_back(wrk.Moc().PredefsFileAbs);
}
- cmd.push_back("-o");
+ cmd.emplace_back("-o");
cmd.push_back(BuildFile);
cmd.push_back(SourceFile);
@@ -961,7 +965,7 @@ void cmQtAutoGeneratorMocUic::JobUicT::GenerateUic(WorkerT& wrk)
}
cmd.insert(cmd.end(), allOpts.begin(), allOpts.end());
}
- cmd.push_back("-o");
+ cmd.emplace_back("-o");
cmd.push_back(BuildFile);
cmd.push_back(SourceFile);
@@ -1109,8 +1113,7 @@ void cmQtAutoGeneratorMocUic::WorkerT::UVProcessStart(uv_async_t* handle)
{
std::lock_guard<std::mutex> lock(wrk.ProcessMutex_);
if (wrk.Process_ && !wrk.Process_->IsStarted()) {
- wrk.Process_->start(handle->loop,
- std::bind(&WorkerT::UVProcessFinished, &wrk));
+ wrk.Process_->start(handle->loop, [&wrk] { wrk.UVProcessFinished(); });
}
}
}
@@ -1130,11 +1133,6 @@ void cmQtAutoGeneratorMocUic::WorkerT::UVProcessFinished()
cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
: Base_(&FileSys())
, Moc_(&FileSys())
- , Stage_(StageT::SETTINGS_READ)
- , JobsRemain_(0)
- , JobError_(false)
- , JobThreadsAbort_(false)
- , MocAutoFileUpdated_(false)
{
// Precompile regular expressions
Moc_.RegExpInclude.compile(
@@ -1147,9 +1145,7 @@ cmQtAutoGeneratorMocUic::cmQtAutoGeneratorMocUic()
UVRequest().init(*UVLoop(), &cmQtAutoGeneratorMocUic::UVPollStage, this);
}
-cmQtAutoGeneratorMocUic::~cmQtAutoGeneratorMocUic()
-{
-}
+cmQtAutoGeneratorMocUic::~cmQtAutoGeneratorMocUic() = default;
bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
{
@@ -1216,7 +1212,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
};
// -- Read info file
- if (!makefile->ReadListFile(InfoFile().c_str())) {
+ if (!makefile->ReadListFile(InfoFile())) {
Log().ErrorFile(GeneratorT::GEN, InfoFile(), "File processing failed");
return false;
}
@@ -1279,16 +1275,6 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
Moc_.SkipList.insert(lst.begin(), lst.end());
}
Moc_.Definitions = InfoGetConfigList("AM_MOC_DEFINITIONS");
-#ifdef _WIN32
- {
- std::string win32("WIN32");
- auto itB = Moc().Definitions.cbegin();
- auto itE = Moc().Definitions.cend();
- if (std::find(itB, itE, win32) == itE) {
- Moc_.Definitions.emplace_back(std::move(win32));
- }
- }
-#endif
Moc_.IncludePaths = InfoGetConfigList("AM_MOC_INCLUDES");
Moc_.Options = InfoGetList("AM_MOC_OPTIONS");
Moc_.RelaxedMode = InfoGetBool("AM_MOC_RELAXED_MODE");
@@ -1301,7 +1287,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
std::string& error) {
if (!key.empty()) {
if (!exp.empty()) {
- Moc_.DependFilters.push_back(KeyExpT());
+ Moc_.DependFilters.emplace_back();
KeyExpT& filter(Moc_.DependFilters.back());
if (filter.Exp.compile(exp)) {
filter.Key = key;
@@ -1519,7 +1505,7 @@ bool cmQtAutoGeneratorMocUic::Init(cmMakefile* makefile)
}
// Append framework includes
for (std::string const& path : frameworkPaths) {
- Moc_.Includes.push_back("-F");
+ Moc_.Includes.emplace_back("-F");
Moc_.Includes.push_back(path);
}
}
@@ -1969,11 +1955,31 @@ bool cmQtAutoGeneratorMocUic::ParallelMocIncluded(
return (MocIncludedFiles_.find(sourceFile) != MocIncludedFiles_.end());
}
-void cmQtAutoGeneratorMocUic::ParallelMocAutoRegister(
- std::string const& mocFile)
+std::string cmQtAutoGeneratorMocUic::ParallelMocAutoRegister(
+ std::string const& baseName)
{
- std::lock_guard<std::mutex> mocLock(JobsMutex_);
- MocAutoFiles_.emplace(mocFile);
+ std::string res;
+ {
+ std::lock_guard<std::mutex> mocLock(JobsMutex_);
+ res = baseName;
+ res += ".cpp";
+ if (MocAutoFiles_.find(res) == MocAutoFiles_.end()) {
+ MocAutoFiles_.emplace(res);
+ } else {
+ // Append number suffix to the file name
+ for (unsigned int ii = 2; ii != 1024; ++ii) {
+ res = baseName;
+ res += '_';
+ res += std::to_string(ii);
+ res += ".cpp";
+ if (MocAutoFiles_.find(res) == MocAutoFiles_.end()) {
+ MocAutoFiles_.emplace(res);
+ break;
+ }
+ }
+ }
+ }
+ return res;
}
void cmQtAutoGeneratorMocUic::ParallelMocAutoUpdated()
diff --git a/Source/cmQtAutoGeneratorMocUic.h b/Source/cmQtAutoGeneratorMocUic.h
index 222695411..c22df29ab 100644
--- a/Source/cmQtAutoGeneratorMocUic.h
+++ b/Source/cmQtAutoGeneratorMocUic.h
@@ -11,7 +11,6 @@
#include "cm_uv.h"
#include "cmsys/RegularExpression.hxx"
-#include <algorithm>
#include <condition_variable>
#include <cstddef>
#include <deque>
@@ -21,6 +20,7 @@
#include <set>
#include <string>
#include <thread>
+#include <utility>
#include <vector>
class cmMakefile;
@@ -28,11 +28,13 @@ class cmMakefile;
// @brief AUTOMOC and AUTOUIC generator
class cmQtAutoGeneratorMocUic : public cmQtAutoGenerator
{
- CM_DISABLE_COPY(cmQtAutoGeneratorMocUic)
public:
cmQtAutoGeneratorMocUic();
~cmQtAutoGeneratorMocUic() override;
+ cmQtAutoGeneratorMocUic(cmQtAutoGeneratorMocUic const&) = delete;
+ cmQtAutoGeneratorMocUic& operator=(cmQtAutoGeneratorMocUic const&) = delete;
+
public:
// -- Types
class WorkerT;
@@ -49,8 +51,8 @@ public:
{
}
- KeyExpT(std::string const& key, std::string const& exp)
- : Key(key)
+ KeyExpT(std::string key, std::string const& exp)
+ : Key(std::move(key))
, Exp(exp)
{
}
@@ -63,7 +65,6 @@ public:
///
class BaseSettingsT
{
- CM_DISABLE_COPY(BaseSettingsT)
public:
// -- Volatile methods
BaseSettingsT(FileSystem* fileSystem)
@@ -75,6 +76,9 @@ public:
{
}
+ BaseSettingsT(BaseSettingsT const&) = delete;
+ BaseSettingsT& operator=(BaseSettingsT const&) = delete;
+
// -- Const methods
std::string AbsoluteBuildPath(std::string const& relativePath) const;
bool FindHeader(std::string& header,
@@ -103,13 +107,15 @@ public:
///
class MocSettingsT
{
- CM_DISABLE_COPY(MocSettingsT)
public:
MocSettingsT(FileSystem* fileSys)
: FileSys(fileSys)
{
}
+ MocSettingsT(MocSettingsT const&) = delete;
+ MocSettingsT& operator=(MocSettingsT const&) = delete;
+
// -- Const methods
bool skipped(std::string const& fileName) const;
std::string FindMacro(std::string const& content) const;
@@ -145,9 +151,12 @@ public:
///
class UicSettingsT
{
- CM_DISABLE_COPY(UicSettingsT)
public:
UicSettingsT() = default;
+
+ UicSettingsT(UicSettingsT const&) = delete;
+ UicSettingsT& operator=(UicSettingsT const&) = delete;
+
// -- Const methods
bool skipped(std::string const& fileName) const;
@@ -166,10 +175,13 @@ public:
///
class JobT
{
- CM_DISABLE_COPY(JobT)
public:
JobT() = default;
virtual ~JobT() = default;
+
+ JobT(JobT const&) = delete;
+ JobT& operator=(JobT const&) = delete;
+
// -- Abstract processing interface
virtual void Process(WorkerT& wrk) = 0;
};
@@ -240,10 +252,10 @@ public:
class JobMocT : public JobT
{
public:
- JobMocT(std::string&& sourceFile, std::string const& includerFile,
+ JobMocT(std::string&& sourceFile, std::string includerFile,
std::string&& includeString)
: SourceFile(std::move(sourceFile))
- , IncluderFile(includerFile)
+ , IncluderFile(std::move(includerFile))
, IncludeString(std::move(includeString))
{
}
@@ -269,10 +281,10 @@ public:
class JobUicT : public JobT
{
public:
- JobUicT(std::string&& sourceFile, std::string const& includerFile,
+ JobUicT(std::string&& sourceFile, std::string includerFile,
std::string&& includeString)
: SourceFile(std::move(sourceFile))
- , IncluderFile(includerFile)
+ , IncluderFile(std::move(includerFile))
, IncludeString(std::move(includeString))
{
}
@@ -293,11 +305,13 @@ public:
///
class WorkerT
{
- CM_DISABLE_COPY(WorkerT)
public:
WorkerT(cmQtAutoGeneratorMocUic* gen, uv_loop_t* uvLoop);
~WorkerT();
+ WorkerT(WorkerT const&) = delete;
+ WorkerT& operator=(WorkerT const&) = delete;
+
// -- Const accessors
cmQtAutoGeneratorMocUic& Gen() const { return *Gen_; }
Logger& Log() const { return Gen_->Log(); }
@@ -375,7 +389,7 @@ public:
bool ParallelJobPushMoc(JobHandleT& jobHandle);
bool ParallelJobPushUic(JobHandleT& jobHandle);
bool ParallelMocIncluded(std::string const& sourceFile);
- void ParallelMocAutoRegister(std::string const& mocFile);
+ std::string ParallelMocAutoRegister(std::string const& baseName);
void ParallelMocAutoUpdated();
private:
@@ -404,7 +418,7 @@ private:
MocSettingsT Moc_;
UicSettingsT Uic_;
// -- Progress
- StageT Stage_;
+ StageT Stage_ = StageT::SETTINGS_READ;
// -- Job queues
std::mutex JobsMutex_;
struct
@@ -416,15 +430,15 @@ private:
JobQueueT Uic;
} JobQueues_;
JobQueueT JobQueue_;
- std::size_t volatile JobsRemain_;
- bool volatile JobError_;
- bool volatile JobThreadsAbort_;
+ std::size_t volatile JobsRemain_ = 0;
+ bool volatile JobError_ = false;
+ bool volatile JobThreadsAbort_ = false;
std::condition_variable JobsConditionRead_;
// -- Moc meta
std::set<std::string> MocIncludedStrings_;
std::set<std::string> MocIncludedFiles_;
std::set<std::string> MocAutoFiles_;
- bool volatile MocAutoFileUpdated_;
+ bool volatile MocAutoFileUpdated_ = false;
// -- Settings file
std::string SettingsFile_;
std::string SettingsStringMoc_;
diff --git a/Source/cmQtAutoGeneratorRcc.cxx b/Source/cmQtAutoGeneratorRcc.cxx
index 65c674110..021a15f18 100644
--- a/Source/cmQtAutoGeneratorRcc.cxx
+++ b/Source/cmQtAutoGeneratorRcc.cxx
@@ -10,25 +10,15 @@
#include "cmSystemTools.h"
#include "cmUVHandlePtr.h"
-#include <functional>
-
// -- Class methods
cmQtAutoGeneratorRcc::cmQtAutoGeneratorRcc()
- : MultiConfig_(false)
- , SettingsChanged_(false)
- , Stage_(StageT::SETTINGS_READ)
- , Error_(false)
- , Generate_(false)
- , BuildFileChanged_(false)
{
// Initialize libuv asynchronous iteration request
UVRequest().init(*UVLoop(), &cmQtAutoGeneratorRcc::UVPollStage, this);
}
-cmQtAutoGeneratorRcc::~cmQtAutoGeneratorRcc()
-{
-}
+cmQtAutoGeneratorRcc::~cmQtAutoGeneratorRcc() = default;
bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
{
@@ -64,7 +54,7 @@ bool cmQtAutoGeneratorRcc::Init(cmMakefile* makefile)
};
// -- Read info file
- if (!makefile->ReadListFile(InfoFile().c_str())) {
+ if (!makefile->ReadListFile(InfoFile())) {
Log().ErrorFile(GeneratorT::RCC, InfoFile(), "File processing failed");
return false;
}
@@ -609,7 +599,7 @@ bool cmQtAutoGeneratorRcc::GenerateRcc()
std::vector<std::string> cmd;
cmd.push_back(RccExecutable_);
cmd.insert(cmd.end(), Options_.begin(), Options_.end());
- cmd.push_back("-o");
+ cmd.emplace_back("-o");
cmd.push_back(RccFileOutput_);
cmd.push_back(QrcFile_);
// We're done here if the process fails to start
@@ -670,8 +660,7 @@ bool cmQtAutoGeneratorRcc::StartProcess(
Process_ = cm::make_unique<ReadOnlyProcessT>();
Process_->setup(&ProcessResult_, mergedOutput, command, workingDirectory);
// Start process
- if (!Process_->start(UVLoop(),
- std::bind(&cm::uv_async_ptr::send, &UVRequest()))) {
+ if (!Process_->start(UVLoop(), [this] { UVRequest().send(); })) {
Log().ErrorFile(GeneratorT::RCC, QrcFile_, ProcessResult_.ErrorMessage);
Error_ = true;
// Clean up
diff --git a/Source/cmQtAutoGeneratorRcc.h b/Source/cmQtAutoGeneratorRcc.h
index 74cec3661..1ec1c4a8c 100644
--- a/Source/cmQtAutoGeneratorRcc.h
+++ b/Source/cmQtAutoGeneratorRcc.h
@@ -17,11 +17,13 @@ class cmMakefile;
// @brief AUTORCC generator
class cmQtAutoGeneratorRcc : public cmQtAutoGenerator
{
- CM_DISABLE_COPY(cmQtAutoGeneratorRcc)
public:
cmQtAutoGeneratorRcc();
~cmQtAutoGeneratorRcc() override;
+ cmQtAutoGeneratorRcc(cmQtAutoGeneratorRcc const&) = delete;
+ cmQtAutoGeneratorRcc& operator=(cmQtAutoGeneratorRcc const&) = delete;
+
private:
// -- Types
@@ -70,7 +72,7 @@ private:
private:
// -- Config settings
- bool MultiConfig_;
+ bool MultiConfig_ = false;
// -- Directories
std::string AutogenBuildDir_;
std::string IncludeDir_;
@@ -95,12 +97,12 @@ private:
// -- Settings file
std::string SettingsFile_;
std::string SettingsString_;
- bool SettingsChanged_;
+ bool SettingsChanged_ = false;
// -- libuv loop
- StageT Stage_;
- bool Error_;
- bool Generate_;
- bool BuildFileChanged_;
+ StageT Stage_ = StageT::SETTINGS_READ;
+ bool Error_ = false;
+ bool Generate_ = false;
+ bool BuildFileChanged_ = false;
};
#endif
diff --git a/Source/cmRST.cxx b/Source/cmRST.cxx
index 32ad0b080..55204d708 100644
--- a/Source/cmRST.cxx
+++ b/Source/cmRST.cxx
@@ -13,9 +13,9 @@
#include <stddef.h>
#include <utility>
-cmRST::cmRST(std::ostream& os, std::string const& docroot)
+cmRST::cmRST(std::ostream& os, std::string docroot)
: OS(os)
- , DocRoot(docroot)
+ , DocRoot(std::move(docroot))
, IncludeDepth(0)
, OutputLinePending(false)
, LastLineEndedInColonColon(false)
@@ -122,7 +122,7 @@ void cmRST::ProcessModule(std::istream& is)
void cmRST::Reset()
{
if (!this->MarkupLines.empty()) {
- this->UnindentLines(this->MarkupLines);
+ cmRST::UnindentLines(this->MarkupLines);
}
switch (this->Directive) {
case DirectiveNone:
@@ -178,7 +178,7 @@ void cmRST::ProcessLine(std::string const& line)
// Record the literal lines to output after whole block.
// Ignore the language spec and record the opening line as blank.
this->Directive = DirectiveCodeBlock;
- this->MarkupLines.push_back("");
+ this->MarkupLines.emplace_back();
} else if (this->ReplaceDirective.find(line)) {
// Record the replace directive content.
this->Directive = DirectiveReplace;
@@ -221,15 +221,14 @@ void cmRST::ProcessLine(std::string const& line)
// Record the literal lines to output after whole block.
this->Markup = MarkupNormal;
this->Directive = DirectiveLiteralBlock;
- this->MarkupLines.push_back("");
+ this->MarkupLines.emplace_back();
this->OutputLine("", false);
}
// Print non-markup lines.
else {
this->NormalLine(line);
this->LastLineEndedInColonColon =
- (line.size() >= 2 && line[line.size() - 2] == ':' &&
- line[line.size() - 1] == ':');
+ (line.size() >= 2 && line[line.size() - 2] == ':' && line.back() == ':');
}
}
diff --git a/Source/cmRST.h b/Source/cmRST.h
index ee478677d..d8d2a0bab 100644
--- a/Source/cmRST.h
+++ b/Source/cmRST.h
@@ -25,7 +25,7 @@
class cmRST
{
public:
- cmRST(std::ostream& os, std::string const& docroot);
+ cmRST(std::ostream& os, std::string docroot);
bool ProcessFile(std::string const& fname, bool isModule = false);
private:
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx
index a71861af7..e347a2cf5 100644
--- a/Source/cmRulePlaceholderExpander.cxx
+++ b/Source/cmRulePlaceholderExpander.cxx
@@ -10,13 +10,13 @@
#include "cmSystemTools.h"
cmRulePlaceholderExpander::cmRulePlaceholderExpander(
- std::map<std::string, std::string> const& compilers,
- std::map<std::string, std::string> const& variableMappings,
- std::string const& compilerSysroot, std::string const& linkerSysroot)
- : Compilers(compilers)
- , VariableMappings(variableMappings)
- , CompilerSysroot(compilerSysroot)
- , LinkerSysroot(linkerSysroot)
+ std::map<std::string, std::string> compilers,
+ std::map<std::string, std::string> variableMappings,
+ std::string compilerSysroot, std::string linkerSysroot)
+ : Compilers(std::move(compilers))
+ , VariableMappings(std::move(variableMappings))
+ , CompilerSysroot(std::move(compilerSysroot))
+ , LinkerSysroot(std::move(linkerSysroot))
{
}
@@ -110,7 +110,7 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable(
if (replaceValues.Target) {
if (variable == "TARGET_QUOTED") {
std::string targetQuoted = replaceValues.Target;
- if (!targetQuoted.empty() && targetQuoted[0] != '\"') {
+ if (!targetQuoted.empty() && targetQuoted.front() != '\"') {
targetQuoted = '\"';
targetQuoted += replaceValues.Target;
targetQuoted += '\"';
@@ -120,7 +120,7 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable(
if (variable == "TARGET_UNQUOTED") {
std::string unquoted = replaceValues.Target;
std::string::size_type sz = unquoted.size();
- if (sz > 2 && unquoted[0] == '\"' && unquoted[sz - 1] == '\"') {
+ if (sz > 2 && unquoted.front() == '\"' && unquoted.back() == '\"') {
unquoted = unquoted.substr(1, sz - 2);
}
return unquoted;
@@ -162,6 +162,16 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable(
}
}
}
+ if (replaceValues.SwiftAuxiliarySources) {
+ if (variable == "SWIFT_AUXILIARY_SOURCES") {
+ return replaceValues.SwiftAuxiliarySources;
+ }
+ }
+ if (replaceValues.SwiftModuleName) {
+ if (variable == "SWIFT_MODULE_NAME") {
+ return replaceValues.SwiftModuleName;
+ }
+ }
if (variable == "TARGET_SONAME" || variable == "SONAME_FLAG" ||
variable == "TARGET_INSTALLNAME_DIR") {
// All these variables depend on TargetSOName
diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h
index a7d8ceefb..5c0363729 100644
--- a/Source/cmRulePlaceholderExpander.h
+++ b/Source/cmRulePlaceholderExpander.h
@@ -15,9 +15,9 @@ class cmRulePlaceholderExpander
{
public:
cmRulePlaceholderExpander(
- std::map<std::string, std::string> const& compilers,
- std::map<std::string, std::string> const& variableMappings,
- std::string const& compilerSysroot, std::string const& linkerSysroot);
+ std::map<std::string, std::string> compilers,
+ std::map<std::string, std::string> variableMappings,
+ std::string compilerSysroot, std::string linkerSysroot);
void SetTargetImpLib(std::string const& targetImpLib)
{
@@ -58,6 +58,8 @@ public:
const char* Includes;
const char* DependencyFile;
const char* FilterPrefix;
+ const char* SwiftAuxiliarySources;
+ const char* SwiftModuleName;
};
// Expand rule variables in CMake of the type found in language rules
diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx
index 2cae71436..9182b4165 100644
--- a/Source/cmScriptGenerator.cxx
+++ b/Source/cmScriptGenerator.cxx
@@ -4,20 +4,19 @@
#include "cmSystemTools.h"
-cmScriptGenerator::cmScriptGenerator(
- const std::string& config_var,
- std::vector<std::string> const& configurations)
- : RuntimeConfigVariable(config_var)
- , Configurations(configurations)
+#include <utility>
+
+cmScriptGenerator::cmScriptGenerator(std::string config_var,
+ std::vector<std::string> configurations)
+ : RuntimeConfigVariable(std::move(config_var))
+ , Configurations(std::move(configurations))
, ConfigurationName("")
, ConfigurationTypes(nullptr)
, ActionsPerConfig(false)
{
}
-cmScriptGenerator::~cmScriptGenerator()
-{
-}
+cmScriptGenerator::~cmScriptGenerator() = default;
void cmScriptGenerator::Generate(
std::ostream& os, const std::string& config,
diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h
index c8fed1950..e334d5bad 100644
--- a/Source/cmScriptGenerator.h
+++ b/Source/cmScriptGenerator.h
@@ -12,10 +12,7 @@
class cmScriptGeneratorIndent
{
public:
- cmScriptGeneratorIndent()
- : Level(0)
- {
- }
+ cmScriptGeneratorIndent() = default;
cmScriptGeneratorIndent(int level)
: Level(level)
{
@@ -32,7 +29,7 @@ public:
}
private:
- int Level;
+ int Level = 0;
};
inline std::ostream& operator<<(std::ostream& os,
cmScriptGeneratorIndent indent)
@@ -47,13 +44,14 @@ inline std::ostream& operator<<(std::ostream& os,
*/
class cmScriptGenerator
{
- CM_DISABLE_COPY(cmScriptGenerator)
-
public:
- cmScriptGenerator(const std::string& config_var,
- std::vector<std::string> const& configurations);
+ cmScriptGenerator(std::string config_var,
+ std::vector<std::string> configurations);
virtual ~cmScriptGenerator();
+ cmScriptGenerator(cmScriptGenerator const&) = delete;
+ cmScriptGenerator& operator=(cmScriptGenerator const&) = delete;
+
void Generate(std::ostream& os, const std::string& config,
std::vector<std::string> const& configurationTypes);
diff --git a/Source/cmSearchPath.cxx b/Source/cmSearchPath.cxx
index 5dd4413c4..0f51e0eb6 100644
--- a/Source/cmSearchPath.cxx
+++ b/Source/cmSearchPath.cxx
@@ -16,9 +16,7 @@ cmSearchPath::cmSearchPath(cmFindCommon* findCmd)
{
}
-cmSearchPath::~cmSearchPath()
-{
-}
+cmSearchPath::~cmSearchPath() = default;
void cmSearchPath::ExtractWithout(const std::set<std::string>& ignore,
std::vector<std::string>& outPaths,
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index f15a14a4c..e740c0519 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -96,11 +96,16 @@ void cmServer::ProcessRequest(cmConnection* connection,
return;
}
- cmSystemTools::SetMessageCallback(reportMessage,
- const_cast<cmServerRequest*>(&request));
+ cmSystemTools::SetMessageCallback(
+ [&request](const char* msg, const char* title) {
+ reportMessage(msg, title, request);
+ });
+
if (this->Protocol) {
this->Protocol->CMakeInstance()->SetProgressCallback(
- reportProgress, const_cast<cmServerRequest*>(&request));
+ [&request](const char* msg, float prog) {
+ reportProgress(msg, prog, request);
+ });
this->WriteResponse(connection, this->Protocol->Process(request),
debug.get());
} else {
@@ -150,28 +155,25 @@ void cmServer::PrintHello(cmConnection* connection) const
this->WriteJsonObject(connection, hello, nullptr);
}
-void cmServer::reportProgress(const char* msg, float progress, void* data)
+void cmServer::reportProgress(const char* msg, float progress,
+ const cmServerRequest& request)
{
- const cmServerRequest* request = static_cast<const cmServerRequest*>(data);
- assert(request);
if (progress < 0.0f || progress > 1.0f) {
- request->ReportMessage(msg, "");
+ request.ReportMessage(msg, "");
} else {
- request->ReportProgress(0, static_cast<int>(progress * 1000), 1000, msg);
+ request.ReportProgress(0, static_cast<int>(progress * 1000), 1000, msg);
}
}
void cmServer::reportMessage(const char* msg, const char* title,
- bool& /* cancel */, void* data)
+ const cmServerRequest& request)
{
- const cmServerRequest* request = static_cast<const cmServerRequest*>(data);
- assert(request);
assert(msg);
std::string titleString;
if (title) {
titleString = title;
}
- request->ReportMessage(std::string(msg), titleString);
+ request.ReportMessage(std::string(msg), titleString);
}
cmServerResponse cmServer::SetProtocolVersion(const cmServerRequest& request)
@@ -216,7 +218,7 @@ cmServerResponse cmServer::SetProtocolVersion(const cmServerRequest& request)
}
this->Protocol =
- this->FindMatchingProtocol(this->SupportedProtocols, major, minor);
+ cmServer::FindMatchingProtocol(this->SupportedProtocols, major, minor);
if (!this->Protocol) {
return request.ReportError("Protocol version not supported.");
}
@@ -417,7 +419,7 @@ static void __start_thread(void* arg)
auto server = static_cast<cmServerBase*>(arg);
std::string error;
bool success = server->Serve(&error);
- if (!success || error.empty() == false) {
+ if (!success || !error.empty()) {
std::cerr << "Error during serve: " << error << std::endl;
}
}
diff --git a/Source/cmServer.h b/Source/cmServer.h
index ca37ce276..e1ed27a0c 100644
--- a/Source/cmServer.h
+++ b/Source/cmServer.h
@@ -88,14 +88,15 @@ protected:
class cmServer : public cmServerBase
{
- CM_DISABLE_COPY(cmServer)
-
public:
class DebugInfo;
cmServer(cmConnection* conn, bool supportExperimental);
~cmServer() override;
+ cmServer(cmServer const&) = delete;
+ cmServer& operator=(cmServer const&) = delete;
+
bool Serve(std::string* errorMessage) override;
cmFileMonitor* FileMonitor() const;
@@ -118,9 +119,10 @@ public:
void OnConnected(cmConnection* connection) override;
private:
- static void reportProgress(const char* msg, float progress, void* data);
- static void reportMessage(const char* msg, const char* title, bool& cancel,
- void* data);
+ static void reportProgress(const char* msg, float progress,
+ const cmServerRequest& request);
+ static void reportMessage(const char* msg, const char* title,
+ const cmServerRequest& request);
// Handle requests:
cmServerResponse SetProtocolVersion(const cmServerRequest& request);
diff --git a/Source/cmServerConnection.cxx b/Source/cmServerConnection.cxx
index 1fc8cf8ec..844a85890 100644
--- a/Source/cmServerConnection.cxx
+++ b/Source/cmServerConnection.cxx
@@ -7,13 +7,13 @@
#include "cmServerDictionary.h"
#include "cm_uv.h"
-#include <algorithm>
#ifdef _WIN32
# include "io.h"
#else
# include <unistd.h>
#endif
#include <cassert>
+#include <utility>
cmStdIoConnection::cmStdIoConnection(
cmConnectionBufferStrategy* bufferStrategy)
@@ -119,9 +119,7 @@ cmServerStdIoConnection::cmServerStdIoConnection()
{
}
-cmConnectionBufferStrategy::~cmConnectionBufferStrategy()
-{
-}
+cmConnectionBufferStrategy::~cmConnectionBufferStrategy() = default;
void cmConnectionBufferStrategy::clear()
{
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index f051fd9b1..203ee93e4 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -20,6 +20,7 @@
#include <functional>
#include <memory>
#include <string>
+#include <utility>
#include <vector>
// Get rid of some windows macros:
@@ -39,11 +40,10 @@ std::vector<std::string> toStringList(const Json::Value& in)
} // namespace
cmServerRequest::cmServerRequest(cmServer* server, cmConnection* connection,
- const std::string& t, const std::string& c,
- const Json::Value& d)
- : Type(t)
- , Cookie(c)
- , Data(d)
+ std::string t, std::string c, Json::Value d)
+ : Type(std::move(t))
+ , Cookie(std::move(c))
+ , Data(std::move(d))
, Connection(connection)
, m_Server(server)
{
@@ -130,7 +130,8 @@ bool cmServerProtocol::Activate(cmServer* server,
{
assert(server);
this->m_Server = server;
- this->m_CMakeInstance = cm::make_unique<cmake>(cmake::RoleProject);
+ this->m_CMakeInstance =
+ cm::make_unique<cmake>(cmake::RoleProject, cmState::Project);
const bool result = this->DoActivate(request, errorMessage);
if (!result) {
this->m_CMakeInstance = nullptr;
@@ -221,13 +222,22 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request,
std::string* errorMessage)
{
std::string sourceDirectory = request.Data[kSOURCE_DIRECTORY_KEY].asString();
- const std::string buildDirectory =
- request.Data[kBUILD_DIRECTORY_KEY].asString();
+ std::string buildDirectory = request.Data[kBUILD_DIRECTORY_KEY].asString();
std::string generator = request.Data[kGENERATOR_KEY].asString();
std::string extraGenerator = request.Data[kEXTRA_GENERATOR_KEY].asString();
std::string toolset = request.Data[kTOOLSET_KEY].asString();
std::string platform = request.Data[kPLATFORM_KEY].asString();
+ // normalize source and build directory
+ if (!sourceDirectory.empty()) {
+ sourceDirectory = cmSystemTools::CollapseFullPath(sourceDirectory);
+ cmSystemTools::ConvertToUnixSlashes(sourceDirectory);
+ }
+ if (!buildDirectory.empty()) {
+ buildDirectory = cmSystemTools::CollapseFullPath(buildDirectory);
+ cmSystemTools::ConvertToUnixSlashes(buildDirectory);
+ }
+
if (buildDirectory.empty()) {
setErrorMessage(errorMessage,
std::string("\"") + kBUILD_DIRECTORY_KEY +
@@ -244,7 +254,7 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request,
return false;
}
- const std::string cachePath = cm->FindCacheFile(buildDirectory);
+ const std::string cachePath = cmake::FindCacheFile(buildDirectory);
if (cm->LoadCache(cachePath)) {
cmState* state = cm->GetState();
@@ -706,15 +716,15 @@ cmServerResponse cmServerProtocol1::ProcessCTests(
}
cmServerProtocol1::GeneratorInformation::GeneratorInformation(
- const std::string& generatorName, const std::string& extraGeneratorName,
- const std::string& toolset, const std::string& platform,
- const std::string& sourceDirectory, const std::string& buildDirectory)
- : GeneratorName(generatorName)
- , ExtraGeneratorName(extraGeneratorName)
- , Toolset(toolset)
- , Platform(platform)
- , SourceDirectory(sourceDirectory)
- , BuildDirectory(buildDirectory)
+ std::string generatorName, std::string extraGeneratorName,
+ std::string toolset, std::string platform, std::string sourceDirectory,
+ std::string buildDirectory)
+ : GeneratorName(std::move(generatorName))
+ , ExtraGeneratorName(std::move(extraGeneratorName))
+ , Toolset(std::move(toolset))
+ , Platform(std::move(platform))
+ , SourceDirectory(std::move(sourceDirectory))
+ , BuildDirectory(std::move(buildDirectory))
{
}
diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h
index df71cffc7..2f55a208f 100644
--- a/Source/cmServerProtocol.h
+++ b/Source/cmServerProtocol.h
@@ -56,9 +56,8 @@ public:
cmConnection* Connection;
private:
- cmServerRequest(cmServer* server, cmConnection* connection,
- const std::string& t, const std::string& c,
- const Json::Value& d);
+ cmServerRequest(cmServer* server, cmConnection* connection, std::string t,
+ std::string c, Json::Value d);
void ReportProgress(int min, int current, int max,
const std::string& message) const;
@@ -72,12 +71,13 @@ private:
class cmServerProtocol
{
- CM_DISABLE_COPY(cmServerProtocol)
-
public:
cmServerProtocol() = default;
virtual ~cmServerProtocol() = default;
+ cmServerProtocol(cmServerProtocol const&) = delete;
+ cmServerProtocol& operator=(cmServerProtocol const&) = delete;
+
virtual std::pair<int, int> ProtocolVersion() const = 0;
virtual bool IsExperimental() const = 0;
virtual const cmServerResponse Process(const cmServerRequest& request) = 0;
@@ -140,12 +140,10 @@ private:
{
public:
GeneratorInformation() = default;
- GeneratorInformation(const std::string& generatorName,
- const std::string& extraGeneratorName,
- const std::string& toolset,
- const std::string& platform,
- const std::string& sourceDirectory,
- const std::string& buildDirectory);
+ GeneratorInformation(std::string generatorName,
+ std::string extraGeneratorName, std::string toolset,
+ std::string platform, std::string sourceDirectory,
+ std::string buildDirectory);
void SetupGenerator(cmake* cm, std::string* errorMessage);
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 985aac80f..6bd071cfb 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -4,6 +4,7 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
@@ -37,6 +38,14 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
putEnvArg += args[1];
cmSystemTools::PutEnv(putEnvArg);
}
+ // if there's extra arguments, warn user
+ // that they are ignored by this command.
+ if (args.size() > 2) {
+ std::string m = "Only the first value argument is used when setting "
+ "an environment variable. Argument '" +
+ args[2] + "' and later are unused.";
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m);
+ }
return true;
}
@@ -54,7 +63,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
}
// SET (VAR PARENT_SCOPE) // Removes the definition of VAR
// in the parent scope.
- if (args.size() == 2 && args[args.size() - 1] == "PARENT_SCOPE") {
+ if (args.size() == 2 && args.back() == "PARENT_SCOPE") {
this->Makefile->RaiseScope(variable, nullptr);
return true;
}
@@ -74,12 +83,12 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
unsigned int ignoreLastArgs = 0;
// look for PARENT_SCOPE argument
- if (args.size() > 1 && args[args.size() - 1] == "PARENT_SCOPE") {
+ if (args.size() > 1 && args.back() == "PARENT_SCOPE") {
parentScope = true;
ignoreLastArgs++;
} else {
// look for FORCE argument
- if (args.size() > 4 && args[args.size() - 1] == "FORCE") {
+ if (args.size() > 4 && args.back() == "FORCE") {
force = true;
ignoreLastArgs++;
}
@@ -103,7 +112,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
// we should be nice and try to catch some simple screwups if the last or
// next to last args are CACHE then they screwed up. If they used FORCE
// without CACHE they screwed up
- if ((args[args.size() - 1] == "CACHE") ||
+ if ((args.back() == "CACHE") ||
(args.size() > 1 && args[args.size() - 2] == "CACHE") ||
(force && !cache)) {
this->SetError("given invalid arguments for CACHE mode.");
@@ -112,7 +121,15 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
if (cache) {
std::string::size_type cacheStart = args.size() - 3 - (force ? 1 : 0);
- type = cmState::StringToCacheEntryType(args[cacheStart + 1].c_str());
+ if (!cmState::StringToCacheEntryType(args[cacheStart + 1].c_str(), type)) {
+ std::string m = "implicitly converting '" + args[cacheStart + 1] +
+ "' to 'STRING' type.";
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, m);
+ // Setting this may not be required, since it's
+ // initialized as a string. Keeping this here to
+ // ensure that the type is actually converting to a string.
+ type = cmStateEnums::STRING;
+ }
docstring = args[cacheStart + 2].c_str();
}
diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx
index 8445b027a..9388e7ccf 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.cxx
+++ b/Source/cmSetSourceFilesPropertiesCommand.cxx
@@ -53,17 +53,17 @@ bool cmSetSourceFilesPropertiesCommand::RunCommand(
for (j = propbeg; j != propend; ++j) {
// old style allows for specifier before PROPERTIES keyword
if (*j == "ABSTRACT") {
- propertyPairs.push_back("ABSTRACT");
- propertyPairs.push_back("1");
+ propertyPairs.emplace_back("ABSTRACT");
+ propertyPairs.emplace_back("1");
} else if (*j == "WRAP_EXCLUDE") {
- propertyPairs.push_back("WRAP_EXCLUDE");
- propertyPairs.push_back("1");
+ propertyPairs.emplace_back("WRAP_EXCLUDE");
+ propertyPairs.emplace_back("1");
} else if (*j == "GENERATED") {
generated = true;
- propertyPairs.push_back("GENERATED");
- propertyPairs.push_back("1");
+ propertyPairs.emplace_back("GENERATED");
+ propertyPairs.emplace_back("1");
} else if (*j == "COMPILE_FLAGS") {
- propertyPairs.push_back("COMPILE_FLAGS");
+ propertyPairs.emplace_back("COMPILE_FLAGS");
++j;
if (j == propend) {
errors = "called with incorrect number of arguments "
@@ -72,7 +72,7 @@ bool cmSetSourceFilesPropertiesCommand::RunCommand(
}
propertyPairs.push_back(*j);
} else if (*j == "OBJECT_DEPENDS") {
- propertyPairs.push_back("OBJECT_DEPENDS");
+ propertyPairs.emplace_back("OBJECT_DEPENDS");
++j;
if (j == propend) {
errors = "called with incorrect number of arguments "
diff --git a/Source/cmSiteNameCommand.cxx b/Source/cmSiteNameCommand.cxx
index 7f33b7a33..01758ee3a 100644
--- a/Source/cmSiteNameCommand.cxx
+++ b/Source/cmSiteNameCommand.cxx
@@ -19,12 +19,12 @@ bool cmSiteNameCommand::InitialPass(std::vector<std::string> const& args,
return false;
}
std::vector<std::string> paths;
- paths.push_back("/usr/bsd");
- paths.push_back("/usr/sbin");
- paths.push_back("/usr/bin");
- paths.push_back("/bin");
- paths.push_back("/sbin");
- paths.push_back("/usr/local/bin");
+ paths.emplace_back("/usr/bsd");
+ paths.emplace_back("/usr/sbin");
+ paths.emplace_back("/usr/bin");
+ paths.emplace_back("/bin");
+ paths.emplace_back("/sbin");
+ paths.emplace_back("/usr/local/bin");
const char* cacheValue = this->Makefile->GetDefinition(args[0]);
if (cacheValue) {
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 5d1f3f006..d05fb68d9 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -2,11 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSourceFile.h"
-#include <sstream>
+#include <array>
+#include <utility>
#include "cmCustomCommand.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmProperty.h"
#include "cmState.h"
#include "cmSystemTools.h"
@@ -16,8 +18,6 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name,
cmSourceFileLocationKind kind)
: Location(mf, name, kind)
{
- this->CustomCommand = nullptr;
- this->FindFullPathFailed = false;
}
cmSourceFile::~cmSourceFile()
@@ -31,6 +31,8 @@ std::string const& cmSourceFile::GetExtension() const
}
const std::string cmSourceFile::propLANGUAGE = "LANGUAGE";
+const std::string cmSourceFile::propLOCATION = "LOCATION";
+const std::string cmSourceFile::propGENERATED = "GENERATED";
void cmSourceFile::SetObjectLibrary(std::string const& objlib)
{
@@ -111,91 +113,88 @@ std::string const& cmSourceFile::GetFullPath() const
bool cmSourceFile::FindFullPath(std::string* error)
{
- // If this method has already failed once do not try again.
- if (this->FindFullPathFailed) {
- return false;
- }
-
- // If the file is generated compute the location without checking on
- // disk.
- if (this->GetPropertyAsBool("GENERATED")) {
+ // If the file is generated compute the location without checking on disk.
+ if (this->GetIsGenerated()) {
// The file is either already a full path or is relative to the
// build directory for the target.
this->Location.DirectoryUseBinary();
- this->FullPath = this->Location.GetDirectory();
- this->FullPath += "/";
- this->FullPath += this->Location.GetName();
+ this->FullPath = this->Location.GetFullPath();
return true;
}
- // The file is not generated. It must exist on disk.
- cmMakefile const* mf = this->Location.GetMakefile();
- const char* tryDirs[3] = { nullptr, nullptr, nullptr };
- if (this->Location.DirectoryIsAmbiguous()) {
- tryDirs[0] = mf->GetCurrentSourceDirectory().c_str();
- tryDirs[1] = mf->GetCurrentBinaryDirectory().c_str();
- } else {
- tryDirs[0] = "";
+ // If this method has already failed once do not try again.
+ if (this->FindFullPathFailed) {
+ return false;
}
- cmake const* const cmakeInst = mf->GetCMakeInstance();
- std::vector<std::string> const& srcExts = cmakeInst->GetSourceExtensions();
- std::vector<std::string> const& hdrExts = cmakeInst->GetHeaderExtensions();
- for (const char* const* di = tryDirs; *di; ++di) {
- std::string tryPath = this->Location.GetDirectory();
- if (!tryPath.empty()) {
- tryPath += "/";
- }
- tryPath += this->Location.GetName();
- tryPath = cmSystemTools::CollapseFullPath(tryPath, *di);
- if (this->TryFullPath(tryPath, "")) {
+ // The file is not generated. It must exist on disk.
+ cmMakefile const* makefile = this->Location.GetMakefile();
+ // Location path
+ std::string const lPath = this->Location.GetFullPath();
+ // List of extension lists
+ std::array<std::vector<std::string> const*, 2> const extsLists = {
+ { &makefile->GetCMakeInstance()->GetSourceExtensions(),
+ &makefile->GetCMakeInstance()->GetHeaderExtensions() }
+ };
+
+ // Tries to find the file in a given directory
+ auto findInDir = [this, &extsLists, &lPath](std::string const& dir) -> bool {
+ // Compute full path
+ std::string const fullPath = cmSystemTools::CollapseFullPath(lPath, dir);
+ // Try full path
+ if (cmSystemTools::FileExists(fullPath)) {
+ this->FullPath = fullPath;
return true;
}
- for (std::string const& ext : srcExts) {
- if (this->TryFullPath(tryPath, ext)) {
- return true;
+ // Try full path with extension
+ for (auto exts : extsLists) {
+ for (std::string const& ext : *exts) {
+ if (!ext.empty()) {
+ std::string extPath = fullPath;
+ extPath += '.';
+ extPath += ext;
+ if (cmSystemTools::FileExists(extPath)) {
+ this->FullPath = extPath;
+ return true;
+ }
+ }
}
}
- for (std::string const& ext : hdrExts) {
- if (this->TryFullPath(tryPath, ext)) {
- return true;
- }
+ // File not found
+ return false;
+ };
+
+ // Try to find the file in various directories
+ if (this->Location.DirectoryIsAmbiguous()) {
+ if (findInDir(makefile->GetCurrentSourceDirectory()) ||
+ findInDir(makefile->GetCurrentBinaryDirectory())) {
+ return true;
+ }
+ } else {
+ if (findInDir({})) {
+ return true;
}
}
- std::ostringstream e;
- std::string missing = this->Location.GetDirectory();
- if (!missing.empty()) {
- missing += "/";
- }
- missing += this->Location.GetName();
- e << "Cannot find source file:\n " << missing << "\nTried extensions";
- for (std::string const& srcExt : srcExts) {
- e << " ." << srcExt;
- }
- for (std::string const& ext : hdrExts) {
- e << " ." << ext;
+ // Compose error
+ std::string err;
+ err += "Cannot find source file:\n ";
+ err += lPath;
+ err += "\nTried extensions";
+ for (auto exts : extsLists) {
+ for (std::string const& ext : *exts) {
+ err += " .";
+ err += ext;
+ }
}
- if (error) {
- *error = e.str();
+ if (error != nullptr) {
+ *error = std::move(err);
} else {
- this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ makefile->IssueMessage(MessageType::FATAL_ERROR, err);
}
this->FindFullPathFailed = true;
- return false;
-}
-bool cmSourceFile::TryFullPath(const std::string& path, const std::string& ext)
-{
- std::string tryPath = path;
- if (!ext.empty()) {
- tryPath += ".";
- tryPath += ext;
- }
- if (cmSystemTools::FileExists(tryPath)) {
- this->FullPath = tryPath;
- return true;
- }
+ // File not found
return false;
}
@@ -240,12 +239,22 @@ bool cmSourceFile::Matches(cmSourceFileLocation const& loc)
void cmSourceFile::SetProperty(const std::string& prop, const char* value)
{
this->Properties.SetProperty(prop, value);
+
+ // Update IsGenerated flag
+ if (prop == propGENERATED) {
+ this->IsGenerated = cmSystemTools::IsOn(value);
+ }
}
void cmSourceFile::AppendProperty(const std::string& prop, const char* value,
bool asString)
{
this->Properties.AppendProperty(prop, value, asString);
+
+ // Update IsGenerated flag
+ if (prop == propGENERATED) {
+ this->IsGenerated = this->GetPropertyAsBool(propGENERATED);
+ }
}
const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
@@ -264,7 +273,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
// cmSourceFileLocation class to commit to a particular full path to
// the source file as late as possible. If the users requests the
// LOCATION property we must commit now.
- if (prop == "LOCATION") {
+ if (prop == propLOCATION) {
// Commit to a location.
this->GetFullPath();
}
@@ -276,7 +285,7 @@ const char* cmSourceFile::GetPropertyForUser(const std::string& prop)
const char* cmSourceFile::GetProperty(const std::string& prop) const
{
// Check for computed properties.
- if (prop == "LOCATION") {
+ if (prop == propLOCATION) {
if (this->FullPath.empty()) {
return nullptr;
}
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index ab0f22927..a82a58aa9 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -55,6 +55,10 @@ public:
command like get_property or get_source_file_property. */
const char* GetPropertyForUser(const std::string& prop);
+ ///! Checks is the GENERATED property is set and true
+ /// @return Equivalent to GetPropertyAsBool("GENERATED")
+ bool GetIsGenerated() const { return this->IsGenerated; }
+
/**
* The full path to the file. The non-const version of this method
* may attempt to locate the file on disk and finalize its location.
@@ -106,20 +110,22 @@ public:
private:
cmSourceFileLocation Location;
cmPropertyMap Properties;
- cmCustomCommand* CustomCommand;
+ cmCustomCommand* CustomCommand = nullptr;
std::string Extension;
std::string Language;
std::string FullPath;
std::string ObjectLibrary;
std::vector<std::string> Depends;
- bool FindFullPathFailed;
+ bool FindFullPathFailed = false;
+ bool IsGenerated = false;
bool FindFullPath(std::string* error);
- bool TryFullPath(const std::string& path, const std::string& ext);
void CheckExtension();
void CheckLanguage(std::string const& ext);
static const std::string propLANGUAGE;
+ static const std::string propLOCATION;
+ static const std::string propGENERATED;
};
// TODO: Factor out into platform information modules.
diff --git a/Source/cmSourceFileLocation.cxx b/Source/cmSourceFileLocation.cxx
index 15433f94f..acacba26c 100644
--- a/Source/cmSourceFileLocation.cxx
+++ b/Source/cmSourceFileLocation.cxx
@@ -5,17 +5,13 @@
#include "cmAlgorithms.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmake.h"
#include <assert.h>
-cmSourceFileLocation::cmSourceFileLocation()
- : Makefile(nullptr)
- , AmbiguousDirectory(true)
- , AmbiguousExtension(true)
-{
-}
+cmSourceFileLocation::cmSourceFileLocation() = default;
cmSourceFileLocation::cmSourceFileLocation(const cmSourceFileLocation& loc)
: Makefile(loc.Makefile)
@@ -46,6 +42,16 @@ cmSourceFileLocation::cmSourceFileLocation(cmMakefile const* mf,
}
}
+std::string cmSourceFileLocation::GetFullPath() const
+{
+ std::string path = this->GetDirectory();
+ if (!path.empty()) {
+ path += '/';
+ }
+ path += this->GetName();
+ return path;
+}
+
void cmSourceFileLocation::Update(cmSourceFileLocation const& loc)
{
if (this->AmbiguousDirectory && !loc.AmbiguousDirectory) {
@@ -197,7 +203,7 @@ bool cmSourceFileLocation::Matches(cmSourceFileLocation const& loc)
// This can occur when referencing a source file from a different
// directory. This is not yet allowed.
this->Makefile->IssueMessage(
- cmake::INTERNAL_ERROR,
+ MessageType::INTERNAL_ERROR,
"Matches error: Each side has a directory relative to a different "
"location. This can occur when referencing a source file from a "
"different directory. This is not yet allowed.");
diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h
index 886a18458..87040b882 100644
--- a/Source/cmSourceFileLocation.h
+++ b/Source/cmSourceFileLocation.h
@@ -34,6 +34,8 @@ public:
cmSourceFileLocation();
cmSourceFileLocation(const cmSourceFileLocation& loc);
+ cmSourceFileLocation& operator=(cmSourceFileLocation const&) = delete;
+
/**
* Return whether the given source file location could refers to the
* same source file as this location given the level of ambiguity in
@@ -78,14 +80,19 @@ public:
const std::string& GetName() const { return this->Name; }
/**
+ * Get the full file path composed of GetDirectory() and GetName().
+ */
+ std::string GetFullPath() const;
+
+ /**
* Get the cmMakefile instance for which the source file was created.
*/
cmMakefile const* GetMakefile() const { return this->Makefile; }
private:
- cmMakefile const* const Makefile;
- bool AmbiguousDirectory;
- bool AmbiguousExtension;
+ cmMakefile const* const Makefile = nullptr;
+ bool AmbiguousDirectory = true;
+ bool AmbiguousExtension = true;
std::string Directory;
std::string Name;
@@ -94,8 +101,6 @@ private:
// Update the location with additional knowledge.
void Update(cmSourceFileLocation const& loc);
void UpdateExtension(const std::string& name);
-
- cmSourceFileLocation& operator=(const cmSourceFileLocation& loc) = delete;
};
#endif
diff --git a/Source/cmSourceGroup.cxx b/Source/cmSourceGroup.cxx
index 12ef62bc2..7e1e836a0 100644
--- a/Source/cmSourceGroup.cxx
+++ b/Source/cmSourceGroup.cxx
@@ -2,15 +2,17 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmSourceGroup.h"
+#include <utility>
+
class cmSourceGroupInternals
{
public:
std::vector<cmSourceGroup> GroupChildren;
};
-cmSourceGroup::cmSourceGroup(const std::string& name, const char* regex,
+cmSourceGroup::cmSourceGroup(std::string name, const char* regex,
const char* parentName)
- : Name(name)
+ : Name(std::move(name))
{
this->Internal = new cmSourceGroupInternals;
this->SetGroupRegex(regex);
diff --git a/Source/cmSourceGroup.h b/Source/cmSourceGroup.h
index b39f8ddb1..7c6549446 100644
--- a/Source/cmSourceGroup.h
+++ b/Source/cmSourceGroup.h
@@ -26,7 +26,7 @@ class cmSourceGroupInternals;
class cmSourceGroup
{
public:
- cmSourceGroup(const std::string& name, const char* regex,
+ cmSourceGroup(std::string name, const char* regex,
const char* parentName = nullptr);
cmSourceGroup(cmSourceGroup const& r);
~cmSourceGroup();
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index c3df313e1..34ded3890 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -105,7 +105,7 @@ bool addFilesToItsSourceGroups(const std::string& root,
tokenizedPath.pop_back();
if (tokenizedPath.empty()) {
- tokenizedPath.push_back("");
+ tokenizedPath.emplace_back();
}
sg = makefile.GetOrCreateSourceGroup(tokenizedPath);
@@ -254,16 +254,12 @@ bool cmSourceGroupCommand::InitialPass(std::vector<std::string> const& args,
bool cmSourceGroupCommand::checkArgumentsPreconditions(
const ParsedArguments& parsedArguments, std::string& errorMsg) const
{
- if (!checkSingleParameterArgumentPreconditions(kPrefixOptionName,
- parsedArguments, errorMsg) ||
- !checkSingleParameterArgumentPreconditions(kTreeOptionName,
- parsedArguments, errorMsg) ||
- !checkSingleParameterArgumentPreconditions(kRegexOptionName,
- parsedArguments, errorMsg)) {
- return false;
- }
-
- return true;
+ return checkSingleParameterArgumentPreconditions(
+ kPrefixOptionName, parsedArguments, errorMsg) &&
+ checkSingleParameterArgumentPreconditions(kTreeOptionName, parsedArguments,
+ errorMsg) &&
+ checkSingleParameterArgumentPreconditions(kRegexOptionName,
+ parsedArguments, errorMsg);
}
bool cmSourceGroupCommand::processTree(ParsedArguments& parsedArguments,
@@ -286,12 +282,8 @@ bool cmSourceGroupCommand::processTree(ParsedArguments& parsedArguments,
std::set<std::string> sourceGroupPaths =
getSourceGroupFilesPaths(root, filesVector);
- if (!addFilesToItsSourceGroups(root, sourceGroupPaths, prefix,
- *(this->Makefile), errorMsg)) {
- return false;
- }
-
- return true;
+ return addFilesToItsSourceGroups(root, sourceGroupPaths, prefix,
+ *(this->Makefile), errorMsg);
}
bool cmSourceGroupCommand::checkSingleParameterArgumentPreconditions(
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index a2008a0d1..a08e9b8ba 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -22,14 +22,6 @@
#include "cmake.h"
cmState::cmState()
- : IsInTryCompile(false)
- , IsGeneratorMultiConfig(false)
- , WindowsShell(false)
- , WindowsVSIDE(false)
- , WatcomWMake(false)
- , MinGWMake(false)
- , NMake(false)
- , MSYSShell(false)
{
this->CacheManager = new cmCacheManager;
this->GlobVerificationManager = new cmGlobVerificationManager;
@@ -83,14 +75,23 @@ const char* cmState::CacheEntryTypeToString(cmStateEnums::CacheEntryType type)
cmStateEnums::CacheEntryType cmState::StringToCacheEntryType(const char* s)
{
+ cmStateEnums::CacheEntryType type = cmStateEnums::STRING;
+ StringToCacheEntryType(s, type);
+ return type;
+}
+
+bool cmState::StringToCacheEntryType(const char* s,
+ cmStateEnums::CacheEntryType& type)
+{
int i = 0;
while (cmCacheEntryTypes[i]) {
if (strcmp(s, cmCacheEntryTypes[i]) == 0) {
- return static_cast<cmStateEnums::CacheEntryType>(i);
+ type = static_cast<cmStateEnums::CacheEntryType>(i);
+ return true;
}
++i;
}
- return cmStateEnums::STRING;
+ return false;
}
bool cmState::IsCacheEntryType(std::string const& key)
@@ -547,13 +548,16 @@ const char* cmState::GetGlobalProperty(const std::string& prop)
std::string langs;
langs = cmJoin(this->EnabledLanguages, ";");
this->SetGlobalProperty("ENABLED_LANGUAGES", langs.c_str());
+ } else if (prop == "CMAKE_ROLE") {
+ std::string mode = this->GetModeString();
+ this->SetGlobalProperty("CMAKE_ROLE", mode.c_str());
}
#define STRING_LIST_ELEMENT(F) ";" #F
if (prop == "CMAKE_C_KNOWN_FEATURES") {
- return FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT) + 1;
+ return &FOR_EACH_C_FEATURE(STRING_LIST_ELEMENT)[1];
}
if (prop == "CMAKE_CXX_KNOWN_FEATURES") {
- return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1;
+ return &FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT)[1];
}
#undef STRING_LIST_ELEMENT
return this->GlobalProperties.GetPropertyValue(prop);
@@ -601,6 +605,16 @@ bool cmState::UseWindowsVSIDE() const
return this->WindowsVSIDE;
}
+void cmState::SetGhsMultiIDE(bool ghsMultiIDE)
+{
+ this->GhsMultiIDE = ghsMultiIDE;
+}
+
+bool cmState::UseGhsMultiIDE() const
+{
+ return this->GhsMultiIDE;
+}
+
void cmState::SetWatcomWMake(bool watcomWMake)
{
this->WatcomWMake = watcomWMake;
@@ -651,6 +665,40 @@ unsigned int cmState::GetCacheMinorVersion() const
return this->CacheManager->GetCacheMinorVersion();
}
+cmState::Mode cmState::GetMode() const
+{
+ return this->CurrentMode;
+}
+
+std::string cmState::GetModeString() const
+{
+ return ModeToString(this->CurrentMode);
+}
+
+void cmState::SetMode(cmState::Mode mode)
+{
+ this->CurrentMode = mode;
+}
+
+std::string cmState::ModeToString(cmState::Mode mode)
+{
+ switch (mode) {
+ case Project:
+ return "PROJECT";
+ case Script:
+ return "SCRIPT";
+ case FindPackage:
+ return "FIND_PACKAGE";
+ case CTest:
+ return "CTEST";
+ case CPack:
+ return "CPACK";
+ case Unknown:
+ return "UNKNOWN";
+ }
+ return "UNKNOWN";
+}
+
std::string const& cmState::GetBinaryDirectory() const
{
return this->BinaryDirectory;
@@ -867,8 +915,8 @@ static bool ParseEntryWithoutType(const std::string& entry, std::string& var,
// if value is enclosed in single quotes ('foo') then remove them
// it is used to enclose trailing space or tab
- if (flag && value.size() >= 2 && value[0] == '\'' &&
- value[value.size() - 1] == '\'') {
+ if (flag && value.size() >= 2 && value.front() == '\'' &&
+ value.back() == '\'') {
value = value.substr(1, value.size() - 2);
}
@@ -900,8 +948,8 @@ bool cmState::ParseCacheEntry(const std::string& entry, std::string& var,
// if value is enclosed in single quotes ('foo') then remove them
// it is used to enclose trailing space or tab
- if (flag && value.size() >= 2 && value[0] == '\'' &&
- value[value.size() - 1] == '\'') {
+ if (flag && value.size() >= 2 && value.front() == '\'' &&
+ value.back() == '\'') {
value = value.substr(1, value.size() - 2);
}
diff --git a/Source/cmState.h b/Source/cmState.h
index 916985dbb..f755f8362 100644
--- a/Source/cmState.h
+++ b/Source/cmState.h
@@ -35,6 +35,16 @@ public:
cmState();
~cmState();
+ enum Mode
+ {
+ Unknown,
+ Project,
+ Script,
+ FindPackage,
+ CTest,
+ CPack,
+ };
+
static const char* GetTargetTypeName(cmStateEnums::TargetType targetType);
cmStateSnapshot CreateBaseSnapshot();
@@ -55,6 +65,8 @@ public:
cmStateSnapshot Pop(cmStateSnapshot const& originSnapshot);
static cmStateEnums::CacheEntryType StringToCacheEntryType(const char*);
+ static bool StringToCacheEntryType(const char*,
+ cmStateEnums::CacheEntryType& type);
static const char* CacheEntryTypeToString(cmStateEnums::CacheEntryType);
static bool IsCacheEntryType(std::string const& key);
@@ -154,6 +166,8 @@ public:
bool UseWindowsShell() const;
void SetWindowsVSIDE(bool windowsVSIDE);
bool UseWindowsVSIDE() const;
+ void SetGhsMultiIDE(bool ghsMultiIDE);
+ bool UseGhsMultiIDE() const;
void SetWatcomWMake(bool watcomWMake);
bool UseWatcomWMake() const;
void SetMinGWMake(bool minGWMake);
@@ -166,6 +180,12 @@ public:
unsigned int GetCacheMajorVersion() const;
unsigned int GetCacheMinorVersion() const;
+ Mode GetMode() const;
+ std::string GetModeString() const;
+ void SetMode(Mode mode);
+
+ static std::string ModeToString(Mode mode);
+
private:
friend class cmake;
void AddCacheEntry(const std::string& key, const char* value,
@@ -202,14 +222,16 @@ private:
std::string SourceDirectory;
std::string BinaryDirectory;
- bool IsInTryCompile;
- bool IsGeneratorMultiConfig;
- bool WindowsShell;
- bool WindowsVSIDE;
- bool WatcomWMake;
- bool MinGWMake;
- bool NMake;
- bool MSYSShell;
+ bool IsInTryCompile = false;
+ bool IsGeneratorMultiConfig = false;
+ bool WindowsShell = false;
+ bool WindowsVSIDE = false;
+ bool GhsMultiIDE = false;
+ bool WatcomWMake = false;
+ bool MinGWMake = false;
+ bool NMake = false;
+ bool MSYSShell = false;
+ Mode CurrentMode = Unknown;
};
#endif
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index f94e7146e..6752743a1 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -138,6 +138,32 @@ void cmStateDirectory::SetRelativePathTopBinary(const char* dir)
this->DirectoryState->RelativePathTopBinary = dir;
}
+bool cmStateDirectory::ContainsBoth(std::string const& local_path,
+ std::string const& remote_path) const
+{
+ auto PathEqOrSubDir = [](std::string const& a, std::string const& b) {
+ return (cmSystemTools::ComparePath(a, b) ||
+ cmSystemTools::IsSubDirectory(a, b));
+ };
+
+ bool bothInBinary = PathEqOrSubDir(local_path, GetRelativePathTopBinary()) &&
+ PathEqOrSubDir(remote_path, GetRelativePathTopBinary());
+
+ bool bothInSource = PathEqOrSubDir(local_path, GetRelativePathTopSource()) &&
+ PathEqOrSubDir(remote_path, GetRelativePathTopSource());
+
+ return bothInBinary || bothInSource;
+}
+
+std::string cmStateDirectory::ConvertToRelPathIfNotContained(
+ std::string const& local_path, std::string const& remote_path) const
+{
+ if (!this->ContainsBoth(local_path, remote_path)) {
+ return remote_path;
+ }
+ return cmSystemTools::ForceToRelativePath(local_path, remote_path);
+}
+
cmStateDirectory::cmStateDirectory(
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator iter,
const cmStateSnapshot& snapshot)
diff --git a/Source/cmStateDirectory.h b/Source/cmStateDirectory.h
index e5f4d05d1..69565940d 100644
--- a/Source/cmStateDirectory.h
+++ b/Source/cmStateDirectory.h
@@ -32,6 +32,12 @@ public:
void SetRelativePathTopSource(const char* dir);
void SetRelativePathTopBinary(const char* dir);
+ bool ContainsBoth(std::string const& local_path,
+ std::string const& remote_path) const;
+
+ std::string ConvertToRelPathIfNotContained(
+ std::string const& local_path, std::string const& remote_path) const;
+
cmStringRange GetIncludeDirectoriesEntries() const;
cmBacktraceRange GetIncludeDirectoriesEntryBacktraces() const;
void AppendIncludeDirectoriesEntry(std::string const& vec,
diff --git a/Source/cmStatePrivate.h b/Source/cmStatePrivate.h
index e76f2af37..ec0ed6c93 100644
--- a/Source/cmStatePrivate.h
+++ b/Source/cmStatePrivate.h
@@ -50,8 +50,7 @@ struct cmStateDetail::PolicyStackEntry : public cmPolicies::PolicyMap
{
typedef cmPolicies::PolicyMap derived;
PolicyStackEntry(bool w = false)
- : derived()
- , Weak(w)
+ : Weak(w)
{
}
PolicyStackEntry(derived const& d, bool w)
diff --git a/Source/cmStateSnapshot.cxx b/Source/cmStateSnapshot.cxx
index c2510f355..63bec710b 100644
--- a/Source/cmStateSnapshot.cxx
+++ b/Source/cmStateSnapshot.cxx
@@ -16,7 +16,6 @@
#include "cmStateDirectory.h"
#include "cmStatePrivate.h"
#include "cmVersion.h"
-#include "cmake.h"
#if !defined(_WIN32)
# include <sys/utsname.h>
@@ -28,7 +27,6 @@
cmStateSnapshot::cmStateSnapshot(cmState* state)
: State(state)
- , Position()
{
}
@@ -66,6 +64,12 @@ bool cmStateSnapshot::IsValid() const
: false;
}
+cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectory() const
+{
+ return cmStateSnapshot(this->State,
+ this->Position->BuildSystemDirectory->DirectoryEnd);
+}
+
cmStateSnapshot cmStateSnapshot::GetBuildsystemDirectoryParent() const
{
cmStateSnapshot snapshot;
@@ -343,8 +347,7 @@ void cmStateSnapshot::SetDefaultDefinitions()
std::to_string(cmVersion::GetTweakVersion()));
this->SetDefinition("CMAKE_VERSION", cmVersion::GetCMakeVersion());
- this->SetDefinition("CMAKE_FILES_DIRECTORY",
- cmake::GetCMakeFilesDirectory());
+ this->SetDefinition("CMAKE_FILES_DIRECTORY", "/CMakeFiles");
// Setup the default include file regular expression (match everything).
this->Position->BuildSystemDirectory->Properties.SetProperty(
diff --git a/Source/cmStateSnapshot.h b/Source/cmStateSnapshot.h
index 014c62e9d..c315f4851 100644
--- a/Source/cmStateSnapshot.h
+++ b/Source/cmStateSnapshot.h
@@ -37,6 +37,7 @@ public:
std::vector<cmStateSnapshot> GetChildren();
bool IsValid() const;
+ cmStateSnapshot GetBuildsystemDirectory() const;
cmStateSnapshot GetBuildsystemDirectoryParent() const;
cmStateSnapshot GetCallStackParent() const;
cmStateSnapshot GetCallStackBottom() const;
diff --git a/Source/cmString.cxx b/Source/cmString.cxx
new file mode 100644
index 000000000..2a0c125e6
--- /dev/null
+++ b/Source/cmString.cxx
@@ -0,0 +1,152 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#define _SCL_SECURE_NO_WARNINGS
+
+#include "cmString.hxx"
+
+#include <memory>
+#include <ostream>
+#include <stdexcept>
+#include <string>
+#include <type_traits>
+
+namespace cm {
+
+static std::string const empty_string_;
+
+void String::internally_mutate_to_stable_string()
+{
+ // We assume that only one thread mutates this instance at
+ // a time even if we point to a shared string buffer refernced
+ // by other threads.
+ *this = String(data(), size());
+}
+
+bool String::is_stable() const
+{
+ return str_if_stable() != nullptr;
+}
+
+void String::stabilize()
+{
+ if (is_stable()) {
+ return;
+ }
+ this->internally_mutate_to_stable_string();
+}
+
+std::string const* String::str_if_stable() const
+{
+ if (!data()) {
+ // We view no string.
+ // This is stable for the lifetime of our current value.
+ return &empty_string_;
+ }
+
+ if (string_ && data() == string_->data() && size() == string_->size()) {
+ // We view an entire string.
+ // This is stable for the lifetime of our current value.
+ return string_.get();
+ }
+
+ return nullptr;
+}
+
+std::string const& String::str()
+{
+ if (std::string const* s = str_if_stable()) {
+ return *s;
+ }
+ // Mutate to hold a std::string that is stable for the lifetime
+ // of our current value.
+ this->internally_mutate_to_stable_string();
+ return *string_;
+}
+
+const char* String::c_str()
+{
+ const char* c = data();
+ if (c == nullptr) {
+ return c;
+ }
+
+ // We always point into a null-terminated string so it is safe to
+ // access one past the end. If it is a null byte then we can use
+ // the pointer directly.
+ if (c[size()] == '\0') {
+ return c;
+ }
+
+ // Mutate to hold a std::string so we can get a null terminator.
+ this->internally_mutate_to_stable_string();
+ c = string_->c_str();
+ return c;
+}
+
+String& String::insert(size_type index, size_type count, char ch)
+{
+ std::string s;
+ s.reserve(size() + count);
+ s.assign(data(), size());
+ s.insert(index, count, ch);
+ return *this = std::move(s);
+}
+
+String& String::erase(size_type index, size_type count)
+{
+ if (index > size()) {
+ throw std::out_of_range("Index out of range in String::erase");
+ }
+ size_type const rcount = std::min(count, size() - index);
+ size_type const rindex = index + rcount;
+ std::string s;
+ s.reserve(size() - rcount);
+ s.assign(data(), index);
+ s.append(data() + rindex, size() - rindex);
+ return *this = std::move(s);
+}
+
+String String::substr(size_type pos, size_type count) const
+{
+ if (pos > size()) {
+ throw std::out_of_range("Index out of range in String::substr");
+ }
+ return String(*this, pos, count);
+}
+
+String::String(std::string&& s, Private)
+ : string_(std::make_shared<std::string>(std::move(s)))
+ , view_(string_->data(), string_->size())
+{
+}
+
+String::size_type String::copy(char* dest, size_type count,
+ size_type pos) const
+{
+ return view_.copy(dest, count, pos);
+}
+
+std::ostream& operator<<(std::ostream& os, String const& s)
+{
+ return os.write(s.data(), s.size());
+}
+
+std::string& operator+=(std::string& self, String const& s)
+{
+ return self += s.view();
+}
+
+String IntoString<char*>::into_string(const char* s)
+{
+ if (!s) {
+ return String();
+ }
+ return std::string(s);
+}
+
+string_view AsStringView<String>::view(String const& s)
+{
+ return s.view();
+}
+
+} // namespace cm
diff --git a/Source/cmString.hxx b/Source/cmString.hxx
new file mode 100644
index 000000000..49bad7870
--- /dev/null
+++ b/Source/cmString.hxx
@@ -0,0 +1,815 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cmString_hxx
+#define cmString_hxx
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cm_static_string_view.hxx"
+#include "cm_string_view.hxx"
+
+#include <algorithm>
+#include <functional>
+#include <initializer_list>
+#include <memory>
+#include <ostream>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+namespace cm {
+
+class String;
+
+/**
+ * Trait to convert type T into a String.
+ * Implementations must derive from 'std::true_type'
+ * and define an 'into_string' member that accepts
+ * type T (by value or reference) and returns one of:
+ *
+ * - 'std::string' to construct an owned instance.
+ * - 'cm::string_view' to construct a borrowed or null instances.
+ * The buffer from which the view is borrowed must outlive
+ * all copies of the resulting String, e.g. static storage.
+ * - 'cm::String' for already-constructed instances.
+ */
+template <typename T>
+struct IntoString : std::false_type
+{
+};
+
+template <typename T>
+struct IntoString<T&> : IntoString<T>
+{
+};
+
+template <typename T>
+struct IntoString<T const> : IntoString<T>
+{
+};
+
+template <typename T>
+struct IntoString<T const*> : IntoString<T*>
+{
+};
+
+template <typename T, std::string::size_type N>
+struct IntoString<T const[N]> : IntoString<T[N]>
+{
+};
+
+template <>
+struct IntoString<char*> : std::true_type
+{
+ static String into_string(const char* s);
+};
+
+template <>
+struct IntoString<std::nullptr_t> : std::true_type
+{
+ static string_view into_string(std::nullptr_t) { return string_view(); }
+};
+
+template <std::string::size_type N>
+struct IntoString<char[N]> : std::true_type
+{
+ static std::string into_string(char const (&s)[N])
+ {
+ return std::string(s, N - 1);
+ }
+};
+
+template <>
+struct IntoString<std::string> : std::true_type
+{
+ static std::string into_string(std::string s) { return s; }
+};
+
+template <>
+struct IntoString<string_view> : std::true_type
+{
+ static std::string into_string(string_view s) { return std::string(s); }
+};
+
+template <>
+struct IntoString<static_string_view> : std::true_type
+{
+ static string_view into_string(static_string_view s) { return s; }
+};
+
+template <>
+struct IntoString<char> : std::true_type
+{
+ static std::string into_string(char const& c) { return std::string(1, c); }
+};
+
+/**
+ * Trait to convert type T into a 'cm::string_view'.
+ * Implementations must derive from 'std::true_type' and
+ * define a 'view' member that accepts type T (by reference)
+ * and returns a 'cm::string_view'.
+ */
+template <typename T>
+struct AsStringView : std::false_type
+{
+};
+
+template <typename T>
+struct AsStringView<T&> : AsStringView<T>
+{
+};
+
+template <typename T>
+struct AsStringView<T const> : AsStringView<T>
+{
+};
+
+template <typename T>
+struct AsStringView<T const*> : AsStringView<T*>
+{
+};
+
+template <typename T, std::string::size_type N>
+struct AsStringView<T const[N]> : AsStringView<T[N]>
+{
+};
+
+template <>
+struct AsStringView<char*> : std::true_type
+{
+ static string_view view(const char* s) { return s; }
+};
+
+template <std::string::size_type N>
+struct AsStringView<char[N]> : std::true_type
+{
+ static string_view view(char const (&s)[N]) { return string_view(s, N - 1); }
+};
+
+template <>
+struct AsStringView<std::string> : std::true_type
+{
+ static string_view view(std::string const& s) { return s; }
+};
+
+template <>
+struct AsStringView<char> : std::true_type
+{
+ static string_view view(const char& s) { return string_view(&s, 1); }
+};
+
+template <>
+struct AsStringView<string_view> : std::true_type
+{
+ static string_view view(string_view const& s) { return s; }
+};
+
+template <>
+struct AsStringView<static_string_view> : std::true_type
+{
+ static string_view view(static_string_view const& s) { return s; }
+};
+
+template <>
+struct AsStringView<String> : std::true_type
+{
+ static string_view view(String const& s);
+};
+
+/**
+ * \class String
+ *
+ * A custom string type that holds a view of a string buffer
+ * and optionally shares ownership of the buffer. Instances
+ * may have one of the following states:
+ *
+ * - null: views and owns nothing.
+ * Conversion to 'bool' is 'false'.
+ * 'data()' and 'c_str()' return nullptr.
+ * 'size()' returns 0.
+ * 'str()' returns an empty string.
+ *
+ * - borrowed: views a string but does not own it. This is used
+ * to bind to static storage (e.g. string literals) or for
+ * temporary instances that do not outlive the borrowed buffer.
+ * Copies and substrings still borrow the original buffer.
+ * Mutation allocates a new internal string and converts to
+ * the 'owned' state.
+ * Conversion to 'bool' is 'true'.
+ * 'c_str()' may internally mutate to the 'owned' state.
+ * 'str()' internally mutates to the 'owned' state.
+ *
+ * - owned: views an immutable 'std::string' instance owned internally.
+ * Copies and substrings share ownership of the internal string.
+ * Mutation allocates a new internal string.
+ * Conversion to 'bool' is 'true'.
+ */
+class String
+{
+ enum class Private
+ {
+ };
+
+public:
+ using traits_type = std::string::traits_type;
+ using value_type = string_view::value_type;
+ using pointer = string_view::pointer;
+ using const_pointer = string_view::const_pointer;
+ using reference = string_view::reference;
+ using const_reference = string_view::const_reference;
+ using const_iterator = string_view::const_iterator;
+ using iterator = string_view::const_iterator;
+ using const_reverse_iterator = string_view::const_reverse_iterator;
+ using reverse_iterator = string_view::const_reverse_iterator;
+ using difference_type = string_view::difference_type;
+ using size_type = string_view::size_type;
+
+ static size_type const npos = string_view::npos;
+
+ /** Construct a null string. */
+ String() = default;
+
+ /** Construct from any type implementing the IntoString trait. */
+ template <typename T,
+ typename = typename std::enable_if<IntoString<T>::value>::type>
+ String(T&& s)
+ : String(IntoString<T>::into_string(std::forward<T>(s)), Private())
+ {
+ }
+
+ /** Construct via std::string initializer list constructor. */
+ String(std::initializer_list<char> il)
+ : String(std::string(il))
+ {
+ }
+
+ /** Construct by copying the specified buffer. */
+ String(const char* d, size_type s)
+ : String(std::string(d, s))
+ {
+ }
+
+ /** Construct by copying from input iterator range. */
+ template <typename InputIterator>
+ String(InputIterator first, InputIterator last)
+ : String(std::string(first, last))
+ {
+ }
+
+ /** Construct a string with 'n' copies of character 'c'. */
+ String(size_type n, char c)
+ : String(std::string(n, c))
+ {
+ }
+
+ /** Construct from a substring of another String instance.
+ This shares ownership of the other string's buffer
+ but views only a substring. */
+ String(String const& s, size_type pos, size_type count = npos)
+ : string_(s.string_)
+ , view_(s.data() + pos, std::min(count, s.size() - pos))
+ {
+ }
+
+ /** Construct by moving from another String instance.
+ The other instance is left as a null string. */
+ String(String&& s) noexcept
+ : string_(std::move(s.string_))
+ , view_(s.view_)
+ {
+ s.view_ = string_view();
+ }
+
+ /** Construct by copying from another String instance.
+ This shares ownership of the other string's buffer. */
+ String(String const&) noexcept = default;
+
+ ~String() = default;
+
+ /** Construct by borrowing an externally-owned buffer. The buffer
+ must outlive the returned instance and all copies of it. */
+ static String borrow(string_view v) { return String(v, Private()); }
+
+ /** Assign by moving from another String instance.
+ The other instance is left as a null string. */
+ String& operator=(String&& s) noexcept
+ {
+ string_ = std::move(s.string_);
+ view_ = s.view_;
+ s.view_ = string_view();
+ return *this;
+ }
+
+ /** Assign by copying from another String instance.
+ This shares ownership of the other string's buffer. */
+ String& operator=(String const&) noexcept = default;
+
+ /** Assign from any type implementing the IntoString trait. */
+ template <typename T>
+ typename // NOLINT(*)
+ std::enable_if<IntoString<T>::value, String&>::type
+ operator=(T&& s)
+ {
+ *this = String(std::forward<T>(s));
+ return *this;
+ }
+
+ /** Assign via std::string initializer list constructor. */
+ String& operator=(std::initializer_list<char> il)
+ {
+ *this = String(il);
+ return *this;
+ }
+
+ /** Return true if the instance is not a null string. */
+ explicit operator bool() const noexcept { return data() != nullptr; }
+
+ /** Return a view of the string. */
+ string_view view() const noexcept { return view_; }
+
+ /** Return true if the instance is an empty stringn or null string. */
+ bool empty() const noexcept { return view_.empty(); }
+
+ /** Return a pointer to the start of the string. */
+ const char* data() const noexcept { return view_.data(); }
+
+ /** Return the length of the string in bytes. */
+ size_type size() const noexcept { return view_.size(); }
+ size_type length() const noexcept { return view_.length(); }
+
+ /** Return the character at the given position.
+ No bounds checking is performed. */
+ char operator[](size_type pos) const noexcept { return view_[pos]; }
+
+ /** Return the character at the given position.
+ If the position is out of bounds, throws std::out_of_range. */
+ char at(size_type pos) const { return view_.at(pos); }
+
+ char front() const noexcept { return view_.front(); }
+
+ char back() const noexcept { return view_.back(); }
+
+ /** Return true if this instance is stable and otherwise false.
+ An instance is stable if it is in the 'null' state or if it is
+ an 'owned' state not produced by substring operations, or
+ after a call to 'stabilize()' or 'str()'. */
+ bool is_stable() const;
+
+ /** If 'is_stable()' does not return true, mutate so it does. */
+ void stabilize();
+
+ /** Get a pointer to a normal std::string if 'is_stable()' returns
+ true and otherwise nullptr. The pointer is valid until this
+ instance is mutated or destroyed. */
+ std::string const* str_if_stable() const;
+
+ /** Get a refernce to a normal std::string. The reference
+ is valid until this instance is mutated or destroyed. */
+ std::string const& str();
+
+ /** Get a pointer to a C-style null-terminated string
+ containing the same value as this instance. The pointer
+ is valid until this instance is mutated, destroyed,
+ or str() is called. */
+ const char* c_str();
+
+ const_iterator begin() const noexcept { return view_.begin(); }
+ const_iterator end() const noexcept { return view_.end(); }
+ const_iterator cbegin() const noexcept { return begin(); }
+ const_iterator cend() const noexcept { return end(); }
+
+ const_reverse_iterator rbegin() const noexcept { return view_.rbegin(); }
+ const_reverse_iterator rend() const noexcept { return view_.rend(); }
+ const_reverse_iterator crbegin() const noexcept { return rbegin(); }
+ const_reverse_iterator crend() const noexcept { return rend(); }
+
+ /** Append to the string using any type that implements the
+ AsStringView trait. */
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, String&>::type operator+=(
+ T&& s)
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ std::string r;
+ r.reserve(size() + v.size());
+ r.assign(data(), size());
+ r.append(v.data(), v.size());
+ return *this = std::move(r);
+ }
+
+ /** Assign to an empty string. */
+ void clear() { *this = ""_s; }
+
+ /** Insert 'count' copies of 'ch' at position 'index'. */
+ String& insert(size_type index, size_type count, char ch);
+
+ /** Erase 'count' characters starting at position 'index'. */
+ String& erase(size_type index = 0, size_type count = npos);
+
+ void push_back(char ch)
+ {
+ std::string s;
+ s.reserve(size() + 1);
+ s.assign(data(), size());
+ s.push_back(ch);
+ *this = std::move(s);
+ }
+
+ void pop_back() { *this = String(*this, 0, size() - 1); }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, String&>::type replace(
+ size_type pos, size_type count, T&& s)
+ {
+ const_iterator first = begin() + pos;
+ const_iterator last = first + count;
+ return replace(first, last, std::forward<T>(s));
+ }
+
+ template <typename InputIterator>
+ String& replace(const_iterator first, const_iterator last,
+ InputIterator first2, InputIterator last2)
+ {
+ std::string out;
+ out.append(view_.begin(), first);
+ out.append(first2, last2);
+ out.append(last, view_.end());
+ return *this = std::move(out);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, String&>::type replace(
+ const_iterator first, const_iterator last, T&& s)
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ std::string out;
+ out.reserve((first - view_.begin()) + v.size() + (view_.end() - last));
+ out.append(view_.begin(), first);
+ out.append(v.data(), v.size());
+ out.append(last, view_.end());
+ return *this = std::move(out);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, String&>::type replace(
+ size_type pos, size_type count, T&& s, size_type pos2,
+ size_type count2 = npos)
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ v = v.substr(pos2, count2);
+ return replace(pos, count, v);
+ }
+
+ String& replace(size_type pos, size_type count, size_type count2, char ch)
+ {
+ const_iterator first = begin() + pos;
+ const_iterator last = first + count;
+ return replace(first, last, count2, ch);
+ }
+
+ String& replace(const_iterator first, const_iterator last, size_type count2,
+ char ch)
+ {
+ std::string out;
+ out.reserve((first - view_.begin()) + count2 + (view_.end() - last));
+ out.append(view_.begin(), first);
+ out.append(count2, ch);
+ out.append(last, view_.end());
+ return *this = std::move(out);
+ }
+
+ size_type copy(char* dest, size_type count, size_type pos = 0) const;
+
+ void resize(size_type count) { resize(count, char()); }
+
+ void resize(size_type count, char ch)
+ {
+ std::string s;
+ s.reserve(count);
+ if (count <= size()) {
+ s.assign(data(), count);
+ } else {
+ s.assign(data(), size());
+ s.resize(count, ch);
+ }
+ *this = std::move(s);
+ }
+
+ void swap(String& other)
+ {
+ std::swap(string_, other.string_);
+ std::swap(view_, other.view_);
+ }
+
+ /** Return a substring starting at position 'pos' and
+ consisting of at most 'count' characters. */
+ String substr(size_type pos = 0, size_type count = npos) const;
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, int>::type compare(
+ T&& s) const
+ {
+ return view_.compare(AsStringView<T>::view(std::forward<T>(s)));
+ }
+
+ int compare(size_type pos1, size_type count1, string_view v) const
+ {
+ return view_.compare(pos1, count1, v);
+ }
+
+ int compare(size_type pos1, size_type count1, string_view v, size_type pos2,
+ size_type count2) const
+ {
+ return view_.compare(pos1, count1, v, pos2, count2);
+ }
+
+ int compare(size_type pos1, size_type count1, const char* s) const
+ {
+ return view_.compare(pos1, count1, s);
+ }
+
+ int compare(size_type pos1, size_type count1, const char* s,
+ size_type count2) const
+ {
+ return view_.compare(pos1, count1, s, count2);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, size_type>::type find(
+ T&& s, size_type pos = 0) const
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ return view_.find(v, pos);
+ }
+
+ size_type find(const char* s, size_type pos, size_type count) const
+ {
+ return view_.find(s, pos, count);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, size_type>::type rfind(
+ T&& s, size_type pos = npos) const
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ return view_.rfind(v, pos);
+ }
+
+ size_type rfind(const char* s, size_type pos, size_type count) const
+ {
+ return view_.rfind(s, pos, count);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, size_type>::type
+ find_first_of(T&& s, size_type pos = 0) const
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ return view_.find_first_of(v, pos);
+ }
+
+ size_type find_first_of(const char* s, size_type pos, size_type count) const
+ {
+ return view_.find_first_of(s, pos, count);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, size_type>::type
+ find_first_not_of(T&& s, size_type pos = 0) const
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ return view_.find_first_not_of(v, pos);
+ }
+
+ size_type find_first_not_of(const char* s, size_type pos,
+ size_type count) const
+ {
+ return view_.find_first_not_of(s, pos, count);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, size_type>::type
+ find_last_of(T&& s, size_type pos = npos) const
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ return view_.find_last_of(v, pos);
+ }
+
+ size_type find_last_of(const char* s, size_type pos, size_type count) const
+ {
+ return view_.find_last_of(s, pos, count);
+ }
+
+ template <typename T>
+ typename std::enable_if<AsStringView<T>::value, size_type>::type
+ find_last_not_of(T&& s, size_type pos = npos) const
+ {
+ string_view v = AsStringView<T>::view(std::forward<T>(s));
+ return view_.find_last_not_of(v, pos);
+ }
+
+ size_type find_last_not_of(const char* s, size_type pos,
+ size_type count) const
+ {
+ return view_.find_last_not_of(s, pos, count);
+ }
+
+private:
+ // Internal constructor to move from existing String.
+ String(String&& s, Private) noexcept
+ : String(std::move(s))
+ {
+ }
+
+ // Internal constructor for dynamically allocated string.
+ String(std::string&& s, Private);
+
+ // Internal constructor for view of statically allocated string.
+ String(string_view v, Private)
+ : view_(v)
+ {
+ }
+
+ void internally_mutate_to_stable_string();
+
+ std::shared_ptr<std::string const> string_;
+ string_view view_;
+};
+
+template <typename L, typename R>
+typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value,
+ bool>::type
+operator==(L&& l, R&& r)
+{
+ return (AsStringView<L>::view(std::forward<L>(l)) ==
+ AsStringView<R>::view(std::forward<R>(r)));
+}
+
+template <typename L, typename R>
+typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value,
+ bool>::type
+operator!=(L&& l, R&& r)
+{
+ return (AsStringView<L>::view(std::forward<L>(l)) !=
+ AsStringView<R>::view(std::forward<R>(r)));
+}
+
+template <typename L, typename R>
+typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value,
+ bool>::type
+operator<(L&& l, R&& r)
+{
+ return (AsStringView<L>::view(std::forward<L>(l)) <
+ AsStringView<R>::view(std::forward<R>(r)));
+}
+
+template <typename L, typename R>
+typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value,
+ bool>::type
+operator<=(L&& l, R&& r)
+{
+ return (AsStringView<L>::view(std::forward<L>(l)) <=
+ AsStringView<R>::view(std::forward<R>(r)));
+}
+
+template <typename L, typename R>
+typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value,
+ bool>::type
+operator>(L&& l, R&& r)
+{
+ return (AsStringView<L>::view(std::forward<L>(l)) >
+ AsStringView<R>::view(std::forward<R>(r)));
+}
+
+template <typename L, typename R>
+typename std::enable_if<AsStringView<L>::value && AsStringView<R>::value,
+ bool>::type
+operator>=(L&& l, R&& r)
+{
+ return (AsStringView<L>::view(std::forward<L>(l)) >=
+ AsStringView<R>::view(std::forward<R>(r)));
+}
+
+std::ostream& operator<<(std::ostream& os, String const& s);
+std::string& operator+=(std::string& self, String const& s);
+
+template <typename L, typename R>
+struct StringOpPlus
+{
+ L l;
+ R r;
+#if defined(__SUNPRO_CC)
+ StringOpPlus(L in_l, R in_r)
+ : l(in_l)
+ , r(in_r)
+ {
+ }
+#endif
+ operator std::string() const;
+ std::string::size_type size() const { return l.size() + r.size(); }
+};
+
+template <typename T>
+struct StringAdd
+{
+ static const bool value = AsStringView<T>::value;
+ typedef string_view temp_type;
+ template <typename S>
+ static temp_type temp(S&& s)
+ {
+ return AsStringView<T>::view(std::forward<S>(s));
+ }
+};
+
+template <typename L, typename R>
+struct StringAdd<StringOpPlus<L, R>> : std::true_type
+{
+ typedef StringOpPlus<L, R> const& temp_type;
+ static temp_type temp(temp_type s) { return s; }
+};
+
+template <typename L, typename R>
+StringOpPlus<L, R>::operator std::string() const
+{
+ std::string s;
+ s.reserve(size());
+ s += *this;
+ return s;
+}
+
+template <typename L, typename R>
+std::string& operator+=(std::string& s, StringOpPlus<L, R> const& a)
+{
+ s.reserve(s.size() + a.size());
+ s += a.l;
+ s += a.r;
+ return s;
+}
+
+template <typename L, typename R>
+String& operator+=(String& s, StringOpPlus<L, R> const& a)
+{
+ std::string r;
+ r.reserve(s.size() + a.size());
+ r.assign(s.data(), s.size());
+ r += a.l;
+ r += a.r;
+ s = std::move(r);
+ return s;
+}
+
+template <typename L, typename R>
+std::ostream& operator<<(std::ostream& os, StringOpPlus<L, R> const& a)
+{
+ return os << a.l << a.r;
+}
+
+template <typename L, typename R>
+struct IntoString<StringOpPlus<L, R>> : std::true_type
+{
+ static std::string into_string(StringOpPlus<L, R> const& a) { return a; }
+};
+
+template <typename L, typename R>
+typename std::enable_if<StringAdd<L>::value && StringAdd<R>::value,
+ StringOpPlus<typename StringAdd<L>::temp_type,
+ typename StringAdd<R>::temp_type>>::type
+operator+(L&& l, R&& r)
+{
+ return { StringAdd<L>::temp(std::forward<L>(l)),
+ StringAdd<R>::temp(std::forward<R>(r)) };
+}
+
+template <typename LL, typename LR, typename R>
+typename std::enable_if<AsStringView<R>::value, bool>::type operator==(
+ StringOpPlus<LL, LR> const& l, R&& r)
+{
+ return std::string(l) == AsStringView<R>::view(std::forward<R>(r));
+}
+
+template <typename L, typename RL, typename RR>
+typename std::enable_if<AsStringView<L>::value, bool>::type operator==(
+ L&& l, StringOpPlus<RL, RR> const& r)
+{
+ return AsStringView<L>::view(std::forward<L>(l)) == std::string(r);
+}
+
+} // namespace cm
+
+namespace std {
+
+template <>
+struct hash<cm::String>
+{
+ typedef cm::String argument_type;
+ typedef size_t result_type;
+
+ result_type operator()(argument_type const& s) const noexcept
+ {
+ result_type const h(std::hash<cm::string_view>{}(s.view()));
+ return h;
+ }
+};
+}
+
+#endif
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 1605fd7bc..91d619020 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -156,7 +156,7 @@ bool cmStringCommand::HandleAsciiCommand(std::vector<std::string> const& args)
return false;
}
std::string::size_type cc;
- std::string const& outvar = args[args.size() - 1];
+ std::string const& outvar = args.back();
std::string output;
for (cc = 1; cc < args.size() - 1; cc++) {
int ch = atoi(args[cc].c_str());
@@ -755,7 +755,7 @@ bool cmStringCommand::HandleRandomCommand(std::vector<std::string> const& args)
this->SetError("sub-command RANDOM invoked with bad length.");
return false;
}
- const std::string& variableName = args[args.size() - 1];
+ const std::string& variableName = args.back();
std::vector<char> result;
@@ -765,8 +765,7 @@ bool cmStringCommand::HandleRandomCommand(std::vector<std::string> const& args)
}
const char* alphaPtr = alphabet.c_str();
- int cc;
- for (cc = 0; cc < length; cc++) {
+ for (int cc = 0; cc < length; cc++) {
int idx = static_cast<int>(sizeofAlphabet * rand() / (RAND_MAX + 1.0));
result.push_back(*(alphaPtr + idx));
}
diff --git a/Source/cmStringReplaceHelper.cxx b/Source/cmStringReplaceHelper.cxx
index 69b7cedd6..4a6298782 100644
--- a/Source/cmStringReplaceHelper.cxx
+++ b/Source/cmStringReplaceHelper.cxx
@@ -5,13 +5,14 @@
#include "cmMakefile.h"
#include <sstream>
+#include <utility>
cmStringReplaceHelper::cmStringReplaceHelper(const std::string& regex,
- const std::string& replace_expr,
+ std::string replace_expr,
cmMakefile* makefile)
: RegExString(regex)
, RegularExpression(regex)
- , ReplaceExpression(replace_expr)
+ , ReplaceExpression(std::move(replace_expr))
, Makefile(makefile)
{
this->ParseReplaceExpression();
@@ -85,10 +86,12 @@ void cmStringReplaceHelper::ParseReplaceExpression()
auto r = this->ReplaceExpression.find('\\', l);
if (r == std::string::npos) {
r = this->ReplaceExpression.length();
- this->Replacements.push_back(this->ReplaceExpression.substr(l, r - l));
+ this->Replacements.emplace_back(
+ this->ReplaceExpression.substr(l, r - l));
} else {
if (r - l > 0) {
- this->Replacements.push_back(this->ReplaceExpression.substr(l, r - l));
+ this->Replacements.emplace_back(
+ this->ReplaceExpression.substr(l, r - l));
}
if (r == (this->ReplaceExpression.length() - 1)) {
this->ValidReplaceExpression = false;
@@ -97,11 +100,11 @@ void cmStringReplaceHelper::ParseReplaceExpression()
}
if ((this->ReplaceExpression[r + 1] >= '0') &&
(this->ReplaceExpression[r + 1] <= '9')) {
- this->Replacements.push_back(this->ReplaceExpression[r + 1] - '0');
+ this->Replacements.emplace_back(this->ReplaceExpression[r + 1] - '0');
} else if (this->ReplaceExpression[r + 1] == 'n') {
- this->Replacements.push_back("\n");
+ this->Replacements.emplace_back("\n");
} else if (this->ReplaceExpression[r + 1] == '\\') {
- this->Replacements.push_back("\\");
+ this->Replacements.emplace_back("\\");
} else {
this->ValidReplaceExpression = false;
std::ostringstream error;
diff --git a/Source/cmStringReplaceHelper.h b/Source/cmStringReplaceHelper.h
index 938325a31..b3e470416 100644
--- a/Source/cmStringReplaceHelper.h
+++ b/Source/cmStringReplaceHelper.h
@@ -6,6 +6,7 @@
#include "cmsys/RegularExpression.hxx"
#include <string>
+#include <utility>
#include <vector>
class cmMakefile;
@@ -13,8 +14,7 @@ class cmMakefile;
class cmStringReplaceHelper
{
public:
- cmStringReplaceHelper(const std::string& regex,
- const std::string& replace_expr,
+ cmStringReplaceHelper(const std::string& regex, std::string replace_expr,
cmMakefile* makefile = nullptr);
bool IsRegularExpressionValid() const
@@ -39,17 +39,16 @@ private:
, Value(s)
{
}
- RegexReplacement(const std::string& s)
+ RegexReplacement(std::string s)
: Number(-1)
- , Value(s)
+ , Value(std::move(s))
{
}
RegexReplacement(int n)
: Number(n)
- , Value()
{
}
- RegexReplacement() {}
+ RegexReplacement() = default;
int Number;
std::string Value;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 568ee828a..1d20e2f1a 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -49,6 +49,7 @@
#include <string.h>
#include <time.h>
#include <utility>
+#include <vector>
#if defined(_WIN32)
# include <windows.h>
@@ -75,6 +76,15 @@
# include <malloc.h> /* for malloc/free on QNX */
#endif
+namespace {
+
+cmSystemTools::InterruptCallback s_InterruptCallback;
+cmSystemTools::MessageCallback s_MessageCallback;
+cmSystemTools::OutputCallback s_StderrCallback;
+cmSystemTools::OutputCallback s_StdoutCallback;
+
+} // namespace
+
static bool cm_isspace(char c)
{
return ((c & 0x80) == 0) && isspace(c);
@@ -137,7 +147,10 @@ public:
CloseHandle(this->handle_);
}
}
- operator bool() const { return this->handle_ != INVALID_HANDLE_VALUE; }
+ explicit operator bool() const
+ {
+ return this->handle_ != INVALID_HANDLE_VALUE;
+ }
bool operator!() const { return this->handle_ == INVALID_HANDLE_VALUE; }
operator HANDLE() const { return this->handle_; }
@@ -157,15 +170,6 @@ bool cmSystemTools::s_FatalErrorOccured = false;
bool cmSystemTools::s_DisableMessages = false;
bool cmSystemTools::s_ForceUnixPaths = false;
-cmSystemTools::MessageCallback cmSystemTools::s_MessageCallback;
-cmSystemTools::OutputCallback cmSystemTools::s_StdoutCallback;
-cmSystemTools::OutputCallback cmSystemTools::s_StderrCallback;
-cmSystemTools::InterruptCallback cmSystemTools::s_InterruptCallback;
-void* cmSystemTools::s_MessageCallbackClientData;
-void* cmSystemTools::s_StdoutCallbackClientData;
-void* cmSystemTools::s_StderrCallbackClientData;
-void* cmSystemTools::s_InterruptCallbackClientData;
-
// replace replace with with as many times as it shows up in source.
// write the result into source.
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -263,68 +267,59 @@ void cmSystemTools::Error(const char* m1, const char* m2, const char* m3,
message += m4;
}
cmSystemTools::s_ErrorOccured = true;
- cmSystemTools::Message(message.c_str(), "Error");
+ cmSystemTools::Message(message, "Error");
+}
+
+void cmSystemTools::Error(const std::string& m)
+{
+ std::string message = "CMake Error: " + m;
+ cmSystemTools::s_ErrorOccured = true;
+ cmSystemTools::Message(message, "Error");
}
-void cmSystemTools::SetInterruptCallback(InterruptCallback f, void* clientData)
+void cmSystemTools::SetInterruptCallback(InterruptCallback f)
{
- s_InterruptCallback = f;
- s_InterruptCallbackClientData = clientData;
+ s_InterruptCallback = std::move(f);
}
bool cmSystemTools::GetInterruptFlag()
{
if (s_InterruptCallback) {
- return (*s_InterruptCallback)(s_InterruptCallbackClientData);
+ return s_InterruptCallback();
}
return false;
}
-void cmSystemTools::SetMessageCallback(MessageCallback f, void* clientData)
-{
- s_MessageCallback = f;
- s_MessageCallbackClientData = clientData;
-}
-
-void cmSystemTools::SetStdoutCallback(OutputCallback f, void* clientData)
-{
- s_StdoutCallback = f;
- s_StdoutCallbackClientData = clientData;
-}
-
-void cmSystemTools::SetStderrCallback(OutputCallback f, void* clientData)
+void cmSystemTools::SetMessageCallback(MessageCallback f)
{
- s_StderrCallback = f;
- s_StderrCallbackClientData = clientData;
+ s_MessageCallback = std::move(f);
}
-void cmSystemTools::Stdout(const char* s)
+void cmSystemTools::SetStdoutCallback(OutputCallback f)
{
- cmSystemTools::Stdout(s, strlen(s));
+ s_StdoutCallback = std::move(f);
}
-void cmSystemTools::Stderr(const char* s)
+void cmSystemTools::SetStderrCallback(OutputCallback f)
{
- cmSystemTools::Stderr(s, strlen(s));
+ s_StderrCallback = std::move(f);
}
-void cmSystemTools::Stderr(const char* s, size_t length)
+void cmSystemTools::Stderr(const std::string& s)
{
if (s_StderrCallback) {
- (*s_StderrCallback)(s, length, s_StderrCallbackClientData);
+ s_StderrCallback(s);
} else {
- std::cerr.write(s, length);
- std::cerr.flush();
+ std::cerr << s << std::flush;
}
}
-void cmSystemTools::Stdout(const char* s, size_t length)
+void cmSystemTools::Stdout(const std::string& s)
{
if (s_StdoutCallback) {
- (*s_StdoutCallback)(s, length, s_StdoutCallbackClientData);
+ s_StdoutCallback(s);
} else {
- std::cout.write(s, length);
- std::cout.flush();
+ std::cout << s << std::flush;
}
}
@@ -334,8 +329,7 @@ void cmSystemTools::Message(const char* m1, const char* title)
return;
}
if (s_MessageCallback) {
- (*s_MessageCallback)(m1, title, s_DisableMessages,
- s_MessageCallbackClientData);
+ s_MessageCallback(m1, title);
return;
}
std::cerr << m1 << std::endl << std::flush;
@@ -346,7 +340,7 @@ void cmSystemTools::ReportLastSystemError(const char* msg)
std::string m = msg;
m += ": System Error: ";
m += Superclass::GetLastSystemError();
- cmSystemTools::Error(m.c_str());
+ cmSystemTools::Error(m);
}
bool cmSystemTools::IsInternallyOn(const char* val)
@@ -530,7 +524,7 @@ public:
void Store(std::vector<std::string>& args) const
{
for (char** arg = this->ArgV; arg && *arg; ++arg) {
- args.push_back(*arg);
+ args.emplace_back(*arg);
}
}
};
@@ -557,7 +551,7 @@ std::vector<std::string> cmSystemTools::HandleResponseFile(
error += cmSystemTools::GetLastSystemError();
error += "):\n ";
error += arg.substr(1);
- cmSystemTools::Error(error.c_str());
+ cmSystemTools::Error(error);
} else {
std::string line;
cmSystemTools::GetLineFromStream(responseFile, line);
@@ -788,7 +782,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
if (pipe == cmsysProcess_Pipe_STDOUT) {
if (outputflag != OUTPUT_NONE) {
processOutput.DecodeText(data, length, strdata, 1);
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
}
if (captureStdOut) {
tempStdOut.insert(tempStdOut.end(), data, data + length);
@@ -796,7 +790,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
} else if (pipe == cmsysProcess_Pipe_STDERR) {
if (outputflag != OUTPUT_NONE) {
processOutput.DecodeText(data, length, strdata, 2);
- cmSystemTools::Stderr(strdata.c_str(), strdata.size());
+ cmSystemTools::Stderr(strdata);
}
if (captureStdErr) {
tempStdErr.insert(tempStdErr.end(), data, data + length);
@@ -807,11 +801,11 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
if (outputflag != OUTPUT_NONE) {
processOutput.DecodeText(std::string(), strdata, 1);
if (!strdata.empty()) {
- cmSystemTools::Stdout(strdata.c_str(), strdata.size());
+ cmSystemTools::Stdout(strdata);
}
processOutput.DecodeText(std::string(), strdata, 2);
if (!strdata.empty()) {
- cmSystemTools::Stderr(strdata.c_str(), strdata.size());
+ cmSystemTools::Stderr(strdata);
}
}
}
@@ -941,17 +935,12 @@ std::string cmSystemTools::FileExistsInParentDirectories(const char* fname,
return "";
}
-bool cmSystemTools::cmCopyFile(const char* source, const char* destination)
+bool cmSystemTools::cmCopyFile(const std::string& source,
+ const std::string& destination)
{
return Superclass::CopyFileAlways(source, destination);
}
-bool cmSystemTools::CopyFileIfDifferent(const char* source,
- const char* destination)
-{
- return Superclass::CopyFileIfDifferent(source, destination);
-}
-
#ifdef _WIN32
cmSystemTools::WindowsFileRetry cmSystemTools::GetWindowsFileRetry()
{
@@ -1036,7 +1025,8 @@ void cmSystemTools::InitializeLibUV()
#endif
}
-bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
+bool cmSystemTools::RenameFile(const std::string& oldname,
+ const std::string& newname)
{
#ifdef _WIN32
# ifndef INVALID_FILE_ATTRIBUTES
@@ -1074,7 +1064,7 @@ bool cmSystemTools::RenameFile(const char* oldname, const char* newname)
return retry.Count > 0;
#else
/* On UNIX we have an OS-provided call to do this atomically. */
- return rename(oldname, newname) == 0;
+ return rename(oldname.c_str(), newname.c_str()) == 0;
#endif
}
@@ -1301,7 +1291,7 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
int type /* = 0 */)
{
files.clear();
- if (glob[glob.size() - 1] != '*') {
+ if (glob.back() != '*') {
return false;
}
std::string path = cmSystemTools::GetFilenamePath(glob);
@@ -1318,7 +1308,7 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
if ((std::string(d.GetFile(i)) != ".") &&
(std::string(d.GetFile(i)) != "..")) {
std::string fname = path;
- if (path[path.size() - 1] != '/') {
+ if (path.back() != '/') {
fname += "/";
}
fname += d.GetFile(i);
@@ -1340,13 +1330,11 @@ bool cmSystemTools::SimpleGlob(const std::string& glob,
return res;
}
-cmSystemTools::FileFormat cmSystemTools::GetFileFormat(const char* cext)
+cmSystemTools::FileFormat cmSystemTools::GetFileFormat(std::string const& ext)
{
- if (!cext || *cext == 0) {
+ if (ext.empty()) {
return cmSystemTools::NO_FILE_FORMAT;
}
- // std::string ext = cmSystemTools::LowerCase(cext);
- std::string ext = cext;
if (ext == "c" || ext == ".c" || ext == "m" || ext == ".m") {
return cmSystemTools::C_FILE_FORMAT;
}
@@ -1460,6 +1448,80 @@ std::string cmSystemTools::RelativePath(std::string const& local,
return cmsys::SystemTools::RelativePath(local, remote);
}
+std::string cmSystemTools::ForceToRelativePath(std::string const& local_path,
+ std::string const& remote_path)
+{
+ // The paths should never be quoted.
+ assert(local_path.front() != '\"');
+ assert(remote_path.front() != '\"');
+
+ // The local path should never have a trailing slash.
+ assert(local_path.empty() || local_path.back() != '/');
+
+ // If the path is already relative then just return the path.
+ if (!cmSystemTools::FileIsFullPath(remote_path)) {
+ return remote_path;
+ }
+
+ // Identify the longest shared path component between the remote
+ // path and the local path.
+ std::vector<std::string> local;
+ cmSystemTools::SplitPath(local_path, local);
+ std::vector<std::string> remote;
+ cmSystemTools::SplitPath(remote_path, remote);
+ unsigned int common = 0;
+ while (common < remote.size() && common < local.size() &&
+ cmSystemTools::ComparePath(remote[common], local[common])) {
+ ++common;
+ }
+
+ // If no part of the path is in common then return the full path.
+ if (common == 0) {
+ return remote_path;
+ }
+
+ // If the entire path is in common then just return a ".".
+ if (common == remote.size() && common == local.size()) {
+ return ".";
+ }
+
+ // If the entire path is in common except for a trailing slash then
+ // just return a "./".
+ if (common + 1 == remote.size() && remote[common].empty() &&
+ common == local.size()) {
+ return "./";
+ }
+
+ // Construct the relative path.
+ std::string relative;
+
+ // First add enough ../ to get up to the level of the shared portion
+ // of the path. Leave off the trailing slash. Note that the last
+ // component of local will never be empty because local should never
+ // have a trailing slash.
+ for (unsigned int i = common; i < local.size(); ++i) {
+ relative += "..";
+ if (i < local.size() - 1) {
+ relative += "/";
+ }
+ }
+
+ // Now add the portion of the destination path that is not included
+ // in the shared portion of the path. Add a slash the first time
+ // only if there was already something in the path. If there was a
+ // trailing slash in the input then the last iteration of the loop
+ // will add a slash followed by an empty string which will preserve
+ // the trailing slash in the output.
+
+ if (!relative.empty() && !remote.empty()) {
+ relative += "/";
+ }
+ relative += cmJoin(cmMakeRange(remote).advance(common), "/");
+
+ // Finally return the path.
+ return relative;
+}
+
std::string cmSystemTools::CollapseCombinedPath(std::string const& dir,
std::string const& file)
{
@@ -1508,7 +1570,7 @@ std::vector<std::string> cmSystemTools::GetEnvironmentVariables()
std::vector<std::string> env;
int cc;
for (cc = 0; environ[cc]; ++cc) {
- env.push_back(environ[cc]);
+ env.emplace_back(environ[cc]);
}
return env;
}
@@ -1585,7 +1647,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
e += outFileName;
e += "\": ";
e += cmSystemTools::GetLastSystemError();
- cmSystemTools::Error(e.c_str());
+ cmSystemTools::Error(e);
return false;
}
cmArchiveWrite::Compress compress = cmArchiveWrite::CompressNone;
@@ -1618,7 +1680,7 @@ bool cmSystemTools::CreateTar(const char* outFileName,
}
}
if (!a) {
- cmSystemTools::Error(a.GetError().c_str());
+ cmSystemTools::Error(a.GetError());
return false;
}
return true;
@@ -1821,13 +1883,13 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
if (verbose) {
if (extract) {
cmSystemTools::Stdout("x ");
- cmSystemTools::Stdout(cm_archive_entry_pathname(entry).c_str());
+ cmSystemTools::Stdout(cm_archive_entry_pathname(entry));
} else {
list_item_verbose(stdout, entry);
}
cmSystemTools::Stdout("\n");
} else if (!extract) {
- cmSystemTools::Stdout(cm_archive_entry_pathname(entry).c_str());
+ cmSystemTools::Stdout(cm_archive_entry_pathname(entry));
cmSystemTools::Stdout("\n");
}
if (extract) {
@@ -2985,7 +3047,7 @@ std::vector<std::string> cmSystemTools::tokenize(const std::string& str,
} while (tokend != std::string::npos);
if (tokens.empty()) {
- tokens.push_back("");
+ tokens.emplace_back();
}
return tokens;
}
@@ -3006,8 +3068,38 @@ bool cmSystemTools::StringToULong(const char* str, unsigned long* value)
return (*endp == '\0') && (endp != str) && (errno == 0);
}
+std::string cmSystemTools::EncodeURL(std::string const& in, bool escapeSlashes)
+{
+ std::string out;
+ for (char c : in) {
+ char hexCh[4] = { 0, 0, 0, 0 };
+ hexCh[0] = c;
+ switch (c) {
+ case '+':
+ case '?':
+ case '\\':
+ case '&':
+ case ' ':
+ case '=':
+ case '%':
+ sprintf(hexCh, "%%%02X", static_cast<int>(c));
+ break;
+ case '/':
+ if (escapeSlashes) {
+ strcpy(hexCh, "%2F");
+ }
+ break;
+ default:
+ break;
+ }
+ out.append(hexCh);
+ }
+ return out;
+}
+
bool cmSystemTools::CreateSymlink(const std::string& origName,
- const std::string& newName)
+ const std::string& newName,
+ std::string* errorMessage)
{
uv_fs_t req;
int flags = 0;
@@ -3021,7 +3113,32 @@ bool cmSystemTools::CreateSymlink(const std::string& origName,
if (err) {
std::string e =
"failed to create symbolic link '" + newName + "': " + uv_strerror(err);
- cmSystemTools::Error(e.c_str());
+ if (errorMessage) {
+ *errorMessage = std::move(e);
+ } else {
+ cmSystemTools::Error(e);
+ }
+ return false;
+ }
+
+ return true;
+}
+
+bool cmSystemTools::CreateLink(const std::string& origName,
+ const std::string& newName,
+ std::string* errorMessage)
+{
+ uv_fs_t req;
+ int err =
+ uv_fs_link(nullptr, &req, origName.c_str(), newName.c_str(), nullptr);
+ if (err) {
+ std::string e =
+ "failed to create link '" + newName + "': " + uv_strerror(err);
+ if (errorMessage) {
+ *errorMessage = std::move(e);
+ } else {
+ cmSystemTools::Error(e);
+ }
return false;
}
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 98300eb33..0f92fe257 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -10,6 +10,7 @@
#include "cmProcessOutput.h"
#include "cmsys/Process.h"
#include "cmsys/SystemTools.hxx" // IWYU pragma: export
+#include <functional>
#include <stddef.h>
#include <string>
#include <vector>
@@ -55,42 +56,42 @@ public:
*/
static std::string TrimWhitespace(const std::string& s);
- typedef void (*MessageCallback)(const char*, const char*, bool&, void*);
+ using MessageCallback = std::function<void(const char*, const char*)>;
/**
* Set the function used by GUIs to display error messages
* Function gets passed: message as a const char*,
- * title as a const char*, and a reference to bool that when
- * set to false, will disable further messages (cancel).
+ * title as a const char*.
*/
- static void SetMessageCallback(MessageCallback f,
- void* clientData = nullptr);
+ static void SetMessageCallback(MessageCallback f);
/**
* Display an error message.
*/
static void Error(const char* m, const char* m2 = nullptr,
const char* m3 = nullptr, const char* m4 = nullptr);
+ static void Error(const std::string& m);
/**
* Display a message.
*/
static void Message(const char* m, const char* title = nullptr);
+ static void Message(const std::string& m, const char* title = nullptr)
+ {
+ Message(m.c_str(), title);
+ }
- typedef void (*OutputCallback)(const char*, size_t length, void*);
+ using OutputCallback = std::function<void(std::string const&)>;
///! Send a string to stdout
- static void Stdout(const char* s);
- static void Stdout(const char* s, size_t length);
- static void SetStdoutCallback(OutputCallback, void* clientData = nullptr);
+ static void Stdout(const std::string& s);
+ static void SetStdoutCallback(OutputCallback f);
///! Send a string to stderr
- static void Stderr(const char* s);
- static void Stderr(const char* s, size_t length);
- static void SetStderrCallback(OutputCallback, void* clientData = nullptr);
+ static void Stderr(const std::string& s);
+ static void SetStderrCallback(OutputCallback f);
- typedef bool (*InterruptCallback)(void*);
- static void SetInterruptCallback(InterruptCallback f,
- void* clientData = nullptr);
+ using InterruptCallback = std::function<bool()>;
+ static void SetInterruptCallback(InterruptCallback f);
static bool GetInterruptFlag();
///! Return true if there was an error at any point.
@@ -176,12 +177,13 @@ public:
std::vector<std::string>& files, int type = 0);
///! Copy a file.
- static bool cmCopyFile(const char* source, const char* destination);
- static bool CopyFileIfDifferent(const char* source, const char* destination);
+ static bool cmCopyFile(const std::string& source,
+ const std::string& destination);
/** Rename a file or directory within a single disk volume (atomic
if possible). */
- static bool RenameFile(const char* oldname, const char* newname);
+ static bool RenameFile(const std::string& oldname,
+ const std::string& newname);
///! Compute the hash of a file
static std::string ComputeFileHash(const std::string& source,
@@ -332,7 +334,7 @@ public:
/**
* Determine the file type based on the extension
*/
- static FileFormat GetFileFormat(const char* ext);
+ static FileFormat GetFileFormat(std::string const& ext);
/** Windows if this is true, the CreateProcess in RunCommand will
* not show new console windows when running programs.
@@ -375,6 +377,14 @@ public:
static std::string RelativePath(std::string const& local,
std::string const& remote);
+ /**
+ * Convert the given remote path to a relative path with respect to
+ * the given local path. Both paths must use forward slashes and not
+ * already be escaped or quoted.
+ */
+ static std::string ForceToRelativePath(std::string const& local_path,
+ std::string const& remote_path);
+
/** Joins two paths while collapsing x/../ parts
* For example CollapseCombinedPath("a/b/c", "../../d") results in "a/d"
*/
@@ -398,11 +408,13 @@ public:
original environment. */
class SaveRestoreEnvironment
{
- CM_DISABLE_COPY(SaveRestoreEnvironment)
public:
SaveRestoreEnvironment();
~SaveRestoreEnvironment();
+ SaveRestoreEnvironment(SaveRestoreEnvironment const&) = delete;
+ SaveRestoreEnvironment& operator=(SaveRestoreEnvironment const&) = delete;
+
private:
std::vector<std::string> Env;
};
@@ -495,6 +507,10 @@ public:
static bool StringToLong(const char* str, long* value);
static bool StringToULong(const char* str, unsigned long* value);
+ /** Encode a string as a URL. */
+ static std::string EncodeURL(std::string const& in,
+ bool escapeSlashes = true);
+
#ifdef _WIN32
struct WindowsFileRetry
{
@@ -516,7 +532,14 @@ public:
/** Create a symbolic link if the platform supports it. Returns whether
creation succeeded. */
static bool CreateSymlink(const std::string& origName,
- const std::string& newName);
+ const std::string& newName,
+ std::string* errorMessage = nullptr);
+
+ /** Create a hard link if the platform supports it. Returns whether
+ creation succeeded. */
+ static bool CreateLink(const std::string& origName,
+ const std::string& newName,
+ std::string* errorMessage = nullptr);
private:
static bool s_ForceUnixPaths;
@@ -525,14 +548,6 @@ private:
static bool s_FatalErrorOccured;
static bool s_DisableMessages;
static bool s_DisableRunCommandOutput;
- static MessageCallback s_MessageCallback;
- static OutputCallback s_StdoutCallback;
- static OutputCallback s_StderrCallback;
- static InterruptCallback s_InterruptCallback;
- static void* s_MessageCallbackClientData;
- static void* s_StdoutCallbackClientData;
- static void* s_StderrCallbackClientData;
- static void* s_InterruptCallbackClientData;
};
#endif
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index f0d6519bb..93cdd46ce 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -6,7 +6,6 @@
#include <algorithm>
#include <assert.h>
#include <iterator>
-#include <map>
#include <set>
#include <sstream>
#include <string.h>
@@ -18,8 +17,8 @@
#include "cmGlobalGenerator.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmMessenger.h"
-#include "cmOutputConverter.h"
#include "cmProperty.h"
#include "cmSourceFile.h"
#include "cmSourceFileLocation.h"
@@ -87,7 +86,7 @@ const char* cmTargetPropertyComputer::GetSources<cmTarget>(
cmSystemTools::ExpandListArgument(entry, files);
for (std::string const& file : files) {
if (cmHasLiteralPrefix(file, "$<TARGET_OBJECTS:") &&
- file[file.size() - 1] == '>') {
+ file.back() == '>') {
std::string objLibName = file.substr(17, file.size() - 18);
if (cmGeneratorExpression::Find(objLibName) != std::string::npos) {
@@ -100,7 +99,7 @@ const char* cmTargetPropertyComputer::GetSources<cmTarget>(
bool addContent = false;
bool noMessage = true;
std::ostringstream e;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (context.GetBottom().GetPolicy(cmPolicies::CMP0051)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0051) << "\n";
@@ -218,6 +217,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("ANDROID_ASSETS_DIRECTORIES", nullptr);
this->SetPropertyDefault("ANDROID_ANT_ADDITIONAL_OPTIONS", nullptr);
this->SetPropertyDefault("BUILD_RPATH", nullptr);
+ this->SetPropertyDefault("BUILD_RPATH_USE_ORIGIN", nullptr);
this->SetPropertyDefault("INSTALL_NAME_DIR", nullptr);
this->SetPropertyDefault("INSTALL_RPATH", "");
this->SetPropertyDefault("INSTALL_RPATH_USE_LINK_PATH", "OFF");
@@ -238,6 +238,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("AUTOMOC", nullptr);
this->SetPropertyDefault("AUTOUIC", nullptr);
this->SetPropertyDefault("AUTORCC", nullptr);
+ this->SetPropertyDefault("AUTOGEN_ORIGIN_DEPENDS", nullptr);
this->SetPropertyDefault("AUTOGEN_PARALLEL", nullptr);
this->SetPropertyDefault("AUTOMOC_COMPILER_PREDEFINES", nullptr);
this->SetPropertyDefault("AUTOMOC_DEPEND_FILTERS", nullptr);
@@ -486,24 +487,10 @@ cmGlobalGenerator* cmTarget::GetGlobalGenerator() const
return this->GetMakefile()->GetGlobalGenerator();
}
-void cmTarget::AddUtility(const std::string& u, cmMakefile* makefile)
+void cmTarget::AddUtility(std::string const& u, cmMakefile* mf)
{
- if (this->Utilities.insert(u).second && makefile) {
- this->UtilityBacktraces.insert(
- std::make_pair(u, makefile->GetBacktrace()));
- }
-}
-
-cmListFileBacktrace const* cmTarget::GetUtilityBacktrace(
- const std::string& u) const
-{
- std::map<std::string, cmListFileBacktrace>::const_iterator i =
- this->UtilityBacktraces.find(u);
- if (i == this->UtilityBacktraces.end()) {
- return nullptr;
- }
-
- return &i->second;
+ BT<std::string> util(u, mf ? mf->GetBacktrace() : cmListFileBacktrace());
+ this->Utilities.insert(util);
}
cmListFileBacktrace const& cmTarget::GetBacktrace() const
@@ -583,7 +570,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s)
if (src != s) {
std::ostringstream e;
bool noMessage = false;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0049)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0049) << "\n";
@@ -594,7 +581,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s)
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (!noMessage) {
e << "Legacy variable expansion in source file \"" << s
@@ -602,7 +589,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s)
<< "\". This behavior will be removed in a "
"future version of CMake.";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return "";
}
}
@@ -674,7 +661,7 @@ public:
}
};
-cmSourceFile* cmTarget::AddSource(const std::string& src)
+cmSourceFile* cmTarget::AddSource(const std::string& src, bool before)
{
cmSourceFileLocation sfl(this->Makefile, src,
cmSourceFileLocationKind::Known);
@@ -683,8 +670,14 @@ cmSourceFile* cmTarget::AddSource(const std::string& src)
TargetPropertyEntryFinder(sfl)) ==
this->Internal->SourceEntries.end()) {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->SourceEntries.push_back(src);
- this->Internal->SourceBacktraces.push_back(lfbt);
+ this->Internal->SourceEntries.insert(
+ before ? this->Internal->SourceEntries.begin()
+ : this->Internal->SourceEntries.end(),
+ src);
+ this->Internal->SourceBacktraces.insert(
+ before ? this->Internal->SourceBacktraces.begin()
+ : this->Internal->SourceBacktraces.end(),
+ lfbt);
}
if (cmGeneratorExpression::Find(src) != std::string::npos) {
return nullptr;
@@ -743,7 +736,7 @@ bool cmTarget::PushTLLCommandTrace(TLLSignature signature,
}
}
if (this->TLLCommands.empty() || this->TLLCommands.back().second != lfc) {
- this->TLLCommands.push_back(std::make_pair(signature, lfc));
+ this->TLLCommands.emplace_back(signature, lfc);
}
return ret;
}
@@ -753,11 +746,12 @@ void cmTarget::GetTllSignatureTraces(std::ostream& s, TLLSignature sig) const
const char* sigString =
(sig == cmTarget::KeywordTLLSignature ? "keyword" : "plain");
s << "The uses of the " << sigString << " signature are here:\n";
- cmOutputConverter converter(this->GetMakefile()->GetStateSnapshot());
+ cmStateDirectory cmDir =
+ this->GetMakefile()->GetStateSnapshot().GetDirectory();
for (auto const& cmd : this->TLLCommands) {
if (cmd.first == sig) {
cmListFileContext lfc = cmd.second;
- lfc.FilePath = converter.ConvertToRelativePath(
+ lfc.FilePath = cmDir.ConvertToRelPathIfNotContained(
this->Makefile->GetState()->GetSourceDirectory(), lfc.FilePath);
s << " * " << lfc << std::endl;
}
@@ -946,40 +940,40 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
if (prop == propMANUALLY_ADDED_DEPENDENCIES) {
std::ostringstream e;
e << "MANUALLY_ADDED_DEPENDENCIES property is read-only\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == propNAME) {
std::ostringstream e;
e << "NAME property is read-only\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == propTYPE) {
std::ostringstream e;
e << "TYPE property is read-only\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == propEXPORT_NAME && this->IsImported()) {
std::ostringstream e;
e << "EXPORT_NAME property can't be set on imported targets (\""
<< this->Name << "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == propSOURCES && this->IsImported()) {
std::ostringstream e;
e << "SOURCES property can't be set on imported targets (\"" << this->Name
<< "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == propIMPORTED_GLOBAL && !this->IsImported()) {
std::ostringstream e;
e << "IMPORTED_GLOBAL property can't be set on non-imported targets (\""
<< this->Name << "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
@@ -987,7 +981,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->IncludeDirectoriesEntries.clear();
this->Internal->IncludeDirectoriesBacktraces.clear();
if (value) {
- this->Internal->IncludeDirectoriesEntries.push_back(value);
+ this->Internal->IncludeDirectoriesEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
}
@@ -995,7 +989,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->CompileOptionsEntries.clear();
this->Internal->CompileOptionsBacktraces.clear();
if (value) {
- this->Internal->CompileOptionsEntries.push_back(value);
+ this->Internal->CompileOptionsEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->CompileOptionsBacktraces.push_back(lfbt);
}
@@ -1003,7 +997,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->CompileFeaturesEntries.clear();
this->Internal->CompileFeaturesBacktraces.clear();
if (value) {
- this->Internal->CompileFeaturesEntries.push_back(value);
+ this->Internal->CompileFeaturesEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
}
@@ -1011,7 +1005,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->CompileDefinitionsEntries.clear();
this->Internal->CompileDefinitionsBacktraces.clear();
if (value) {
- this->Internal->CompileDefinitionsEntries.push_back(value);
+ this->Internal->CompileDefinitionsEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
}
@@ -1019,7 +1013,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->LinkOptionsEntries.clear();
this->Internal->LinkOptionsBacktraces.clear();
if (value) {
- this->Internal->LinkOptionsEntries.push_back(value);
+ this->Internal->LinkOptionsEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->LinkOptionsBacktraces.push_back(lfbt);
}
@@ -1027,7 +1021,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->LinkDirectoriesEntries.clear();
this->Internal->LinkDirectoriesBacktraces.clear();
if (value) {
- this->Internal->LinkDirectoriesEntries.push_back(value);
+ this->Internal->LinkDirectoriesEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->LinkDirectoriesBacktraces.push_back(lfbt);
}
@@ -1036,7 +1030,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->LinkImplementationPropertyBacktraces.clear();
if (value) {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->LinkImplementationPropertyEntries.push_back(value);
+ this->Internal->LinkImplementationPropertyEntries.emplace_back(value);
this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt);
}
} else if (prop == propSOURCES) {
@@ -1044,7 +1038,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
this->Internal->SourceBacktraces.clear();
if (value) {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->SourceEntries.push_back(value);
+ this->Internal->SourceEntries.emplace_back(value);
this->Internal->SourceBacktraces.push_back(lfbt);
}
} else if (prop == propIMPORTED_GLOBAL) {
@@ -1052,7 +1046,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
std::ostringstream e;
e << "IMPORTED_GLOBAL property can't be set to FALSE on targets (\""
<< this->Name << "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
/* no need to change anything if value does not change */
@@ -1069,7 +1063,7 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
e << "CUDA_PTX_COMPILATION property can only be applied to OBJECT "
"targets (\""
<< this->Name << "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
} else {
this->Properties.SetProperty(prop, value);
@@ -1087,21 +1081,21 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
if (prop == "NAME") {
std::ostringstream e;
e << "NAME property is read-only\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == "EXPORT_NAME" && this->IsImported()) {
std::ostringstream e;
e << "EXPORT_NAME property can't be set on imported targets (\""
<< this->Name << "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == "SOURCES" && this->IsImported()) {
std::ostringstream e;
e << "SOURCES property can't be set on imported targets (\"" << this->Name
<< "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == "IMPORTED_GLOBAL") {
@@ -1109,57 +1103,57 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
e << "IMPORTED_GLOBAL property can't be appended, only set on imported "
"targets (\""
<< this->Name << "\")\n";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return;
}
if (prop == "INCLUDE_DIRECTORIES") {
if (value && *value) {
- this->Internal->IncludeDirectoriesEntries.push_back(value);
+ this->Internal->IncludeDirectoriesEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->IncludeDirectoriesBacktraces.push_back(lfbt);
}
} else if (prop == "COMPILE_OPTIONS") {
if (value && *value) {
- this->Internal->CompileOptionsEntries.push_back(value);
+ this->Internal->CompileOptionsEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->CompileOptionsBacktraces.push_back(lfbt);
}
} else if (prop == "COMPILE_FEATURES") {
if (value && *value) {
- this->Internal->CompileFeaturesEntries.push_back(value);
+ this->Internal->CompileFeaturesEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->CompileFeaturesBacktraces.push_back(lfbt);
}
} else if (prop == "COMPILE_DEFINITIONS") {
if (value && *value) {
- this->Internal->CompileDefinitionsEntries.push_back(value);
+ this->Internal->CompileDefinitionsEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->CompileDefinitionsBacktraces.push_back(lfbt);
}
} else if (prop == "LINK_OPTIONS") {
if (value && *value) {
- this->Internal->LinkOptionsEntries.push_back(value);
+ this->Internal->LinkOptionsEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->LinkOptionsBacktraces.push_back(lfbt);
}
} else if (prop == "LINK_DIRECTORIES") {
if (value && *value) {
- this->Internal->LinkDirectoriesEntries.push_back(value);
+ this->Internal->LinkDirectoriesEntries.emplace_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
this->Internal->LinkDirectoriesBacktraces.push_back(lfbt);
}
} else if (prop == "LINK_LIBRARIES") {
if (value && *value) {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->LinkImplementationPropertyEntries.push_back(value);
+ this->Internal->LinkImplementationPropertyEntries.emplace_back(value);
this->Internal->LinkImplementationPropertyBacktraces.push_back(lfbt);
}
} else if (prop == "SOURCES") {
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
- this->Internal->SourceEntries.push_back(value);
+ this->Internal->SourceEntries.emplace_back(value);
this->Internal->SourceBacktraces.push_back(lfbt);
} else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME")) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
prop + " property may not be APPENDed.");
} else {
this->Properties.AppendProperty(prop, value, asString);
@@ -1296,7 +1290,7 @@ static void cmTargetCheckLINK_INTERFACE_LIBRARIES(const std::string& prop,
<< "the LINK_INTERFACE_LIBRARIES and LINK_INTERFACE_LIBRARIES_DEBUG "
<< "properties accordingly.";
}
- context->IssueMessage(cmake::FATAL_ERROR, e.str());
+ context->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
@@ -1318,7 +1312,7 @@ static void cmTargetCheckINTERFACE_LINK_LIBRARIES(const char* value,
"property may contain configuration-sensitive generator-expressions "
"which may be used to specify per-configuration rules.";
- context->IssueMessage(cmake::FATAL_ERROR, e.str());
+ context->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
static void cmTargetCheckIMPORTED_GLOBAL(const cmTarget* target,
@@ -1332,7 +1326,7 @@ static void cmTargetCheckIMPORTED_GLOBAL(const cmTarget* target,
e << "Attempt to promote imported target \"" << target->GetName()
<< "\" to global scope (by setting IMPORTED_GLOBAL) "
"which is not built in this directory.";
- context->IssueMessage(cmake::FATAL_ERROR, e.str());
+ context->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
}
@@ -1696,21 +1690,21 @@ bool cmTarget::CheckImportedLibName(std::string const& prop,
if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY ||
!this->IsImported()) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
prop +
" property may be set only on imported INTERFACE library targets.");
return false;
}
if (!value.empty()) {
if (value[0] == '-') {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
prop + " property value\n " + value +
"\nmay not start with '-'.");
return false;
}
std::string::size_type bad = value.find_first_of(":/\\;");
if (bad != std::string::npos) {
- this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR,
prop + " property value\n " + value +
"\nmay not contain '" +
value.substr(bad, 1) + "'.");
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 694de1c3c..24b37423e 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -6,7 +6,6 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <iosfwd>
-#include <map>
#include <set>
#include <string>
#include <unordered_map>
@@ -124,7 +123,7 @@ public:
void AddSources(std::vector<std::string> const& srcs);
void AddTracedSources(std::vector<std::string> const& srcs);
cmSourceFile* AddSourceCMP0049(const std::string& src);
- cmSourceFile* AddSource(const std::string& src);
+ cmSourceFile* AddSource(const std::string& src, bool before = false);
//* how we identify a library, by name and type
typedef std::pair<std::string, cmTargetLinkLibraryType> LibraryID;
@@ -190,10 +189,12 @@ public:
* name as would be specified to the ADD_EXECUTABLE or UTILITY_SOURCE
* commands. It is not a full path nor does it have an extension.
*/
- void AddUtility(const std::string& u, cmMakefile* makefile = nullptr);
+ void AddUtility(std::string const& u, cmMakefile* mf = nullptr);
///! Get the utilities used by this target
- std::set<std::string> const& GetUtilities() const { return this->Utilities; }
- cmListFileBacktrace const* GetUtilityBacktrace(const std::string& u) const;
+ std::set<BT<std::string>> const& GetUtilities() const
+ {
+ return this->Utilities;
+ }
///! Set/Get a property of this target file
void SetProperty(const std::string& prop, const char* value);
@@ -307,8 +308,7 @@ private:
bool IsGeneratorProvided;
cmPropertyMap Properties;
std::set<std::string> SystemIncludeDirectories;
- std::set<std::string> Utilities;
- std::map<std::string, cmListFileBacktrace> UtilityBacktraces;
+ std::set<BT<std::string>> Utilities;
cmPolicies::PolicyMap PolicyMap;
std::string Name;
std::string InstallPath;
@@ -343,11 +343,4 @@ private:
typedef std::unordered_map<std::string, cmTarget> cmTargets;
-class cmTargetSet : public std::set<std::string>
-{
-};
-class cmTargetManifest : public std::map<std::string, cmTargetSet>
-{
-};
-
#endif
diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx
index 4e716dc1f..c4dc8383b 100644
--- a/Source/cmTargetCompileDefinitionsCommand.cxx
+++ b/Source/cmTargetCompileDefinitionsCommand.cxx
@@ -6,8 +6,8 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -24,7 +24,7 @@ void cmTargetCompileDefinitionsCommand::HandleMissingTarget(
e << "Cannot specify compile definitions for target \"" << name
<< "\" "
"which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
std::string cmTargetCompileDefinitionsCommand::Join(
diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx
index f58e40414..c9e394b1c 100644
--- a/Source/cmTargetCompileFeaturesCommand.cxx
+++ b/Source/cmTargetCompileFeaturesCommand.cxx
@@ -6,7 +6,7 @@
#include "cmAlgorithms.h"
#include "cmMakefile.h"
-#include "cmake.h"
+#include "cmMessageType.h"
class cmExecutionStatus;
class cmTarget;
@@ -24,7 +24,7 @@ void cmTargetCompileFeaturesCommand::HandleMissingTarget(
e << "Cannot specify compile features for target \"" << name
<< "\" "
"which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
std::string cmTargetCompileFeaturesCommand::Join(
diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx
index 4df3630bb..8b4763a8c 100644
--- a/Source/cmTargetCompileOptionsCommand.cxx
+++ b/Source/cmTargetCompileOptionsCommand.cxx
@@ -7,8 +7,8 @@
#include "cmAlgorithms.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -24,7 +24,7 @@ void cmTargetCompileOptionsCommand::HandleMissingTarget(
std::ostringstream e;
e << "Cannot specify compile options for target \"" << name
<< "\" which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
std::string cmTargetCompileOptionsCommand::Join(
diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h
index b698db601..5ea008523 100644
--- a/Source/cmTargetDepend.h
+++ b/Source/cmTargetDepend.h
@@ -19,6 +19,7 @@ class cmTargetDepend
// mutable members to achieve a map with set syntax.
mutable bool Link;
mutable bool Util;
+ mutable cmListFileBacktrace Backtrace;
public:
cmTargetDepend(cmGeneratorTarget const* t)
@@ -42,8 +43,13 @@ public:
this->Link = true;
}
}
+ void SetBacktrace(cmListFileBacktrace const& bt) const
+ {
+ this->Backtrace = bt;
+ }
bool IsLink() const { return this->Link; }
bool IsUtil() const { return this->Util; }
+ cmListFileBacktrace const& GetBacktrace() const { return this->Backtrace; }
};
/** Unordered set of (direct) dependencies of a target. */
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
index af142aa97..d6918c09b 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -8,9 +8,9 @@
#include "cmGeneratorExpression.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -27,7 +27,7 @@ void cmTargetIncludeDirectoriesCommand::HandleMissingTarget(
std::ostringstream e;
e << "Cannot specify include directories for target \"" << name
<< "\" which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
std::string cmTargetIncludeDirectoriesCommand::Join(
diff --git a/Source/cmTargetLinkDirectoriesCommand.cxx b/Source/cmTargetLinkDirectoriesCommand.cxx
index bca3e45dd..269f7513e 100644
--- a/Source/cmTargetLinkDirectoriesCommand.cxx
+++ b/Source/cmTargetLinkDirectoriesCommand.cxx
@@ -8,9 +8,9 @@
#include "cmGeneratorExpression.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -26,7 +26,7 @@ void cmTargetLinkDirectoriesCommand::HandleMissingTarget(
std::ostringstream e;
e << "Cannot specify link directories for target \"" << name
<< "\" which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
std::string cmTargetLinkDirectoriesCommand::Join(
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index ded683147..5c7b95cb1 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -8,6 +8,7 @@
#include "cmGeneratorExpression.h"
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmState.h"
#include "cmStateTypes.h"
@@ -51,7 +52,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
}
}
if (!this->Target) {
- cmake::MessageType t = cmake::FATAL_ERROR; // fail by default
+ MessageType t = MessageType::FATAL_ERROR; // fail by default
std::ostringstream e;
e << "Cannot specify link libraries for target \"" << args[0] << "\" "
<< "which is not built by this project.";
@@ -60,7 +61,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
if (args.size() < 2) {
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0016)) {
case cmPolicies::WARN:
- t = cmake::AUTHOR_WARNING;
+ t = MessageType::AUTHOR_WARNING;
// Print the warning.
e << "\n"
<< "CMake does not support this but it used to work accidentally "
@@ -69,7 +70,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
<< cmPolicies::GetPolicyWarning(cmPolicies::CMP0016);
break;
case cmPolicies::OLD: // OLD behavior does not warn.
- t = cmake::MESSAGE;
+ t = MessageType::MESSAGE;
break;
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::REQUIRED_ALWAYS:
@@ -81,11 +82,11 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
}
// Now actually print the message.
switch (t) {
- case cmake::AUTHOR_WARNING:
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ case MessageType::AUTHOR_WARNING:
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
break;
- case cmake::FATAL_ERROR:
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ case MessageType::FATAL_ERROR:
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
break;
default:
@@ -98,7 +99,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
if (this->Target->GetType() == cmStateEnums::UTILITY) {
std::ostringstream e;
const char* modal = nullptr;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0039)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0039) << "\n";
@@ -109,13 +110,13 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
modal = "must";
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (modal) {
e << "Utility target \"" << this->Target->GetName() << "\" " << modal
<< " not be used as the target of a target_link_libraries call.";
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
@@ -141,7 +142,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
this->CurrentProcessingState = ProcessingPlainLinkInterface;
if (i != 1) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The LINK_INTERFACE_LIBRARIES option must appear as the second "
"argument, just after the target name.");
return true;
@@ -152,7 +153,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
"argument, just after the target name.");
return true;
@@ -163,7 +164,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
this->CurrentProcessingState != ProcessingPlainPrivateInterface &&
this->CurrentProcessingState != ProcessingPlainPublicInterface) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The LINK_PUBLIC or LINK_PRIVATE option must appear as the second "
"argument, just after the target name.");
return true;
@@ -175,7 +176,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
"argument, just after the target name.");
return true;
@@ -186,7 +187,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
this->CurrentProcessingState != ProcessingPlainPublicInterface &&
this->CurrentProcessingState != ProcessingPlainPrivateInterface) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The LINK_PUBLIC or LINK_PRIVATE option must appear as the second "
"argument, just after the target name.");
return true;
@@ -198,7 +199,7 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
this->CurrentProcessingState != ProcessingKeywordPublicInterface &&
this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The INTERFACE, PUBLIC or PRIVATE option must appear as the second "
"argument, just after the target name.");
return true;
@@ -256,9 +257,9 @@ bool cmTargetLinkLibrariesCommand::InitialPass(
// Make sure the last argument was not a library type specifier.
if (haveLLT) {
std::ostringstream e;
- e << "The \"" << this->LinkLibraryTypeNames[llt]
+ e << "The \"" << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[llt]
<< "\" argument must be followed by a library.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
cmSystemTools::SetFatalErrorOccured();
}
@@ -284,11 +285,13 @@ void cmTargetLinkLibrariesCommand::LinkLibraryTypeSpecifierWarning(int left,
int right)
{
std::ostringstream w;
- w << "Link library type specifier \"" << this->LinkLibraryTypeNames[left]
- << "\" is followed by specifier \"" << this->LinkLibraryTypeNames[right]
+ w << "Link library type specifier \""
+ << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[left]
+ << "\" is followed by specifier \""
+ << cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[right]
<< "\" instead of a library name. "
<< "The first specifier will be ignored.";
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
@@ -297,7 +300,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"INTERFACE library can only be used with the INTERFACE keyword of "
"target_link_libraries");
return false;
@@ -305,7 +308,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
if (this->Target->IsImported() &&
this->CurrentProcessingState != ProcessingKeywordLinkInterface) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"IMPORTED library can only be used with the INTERFACE keyword of "
"target_link_libraries");
return false;
@@ -323,7 +326,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
sig, this->Makefile->GetExecutionContext())) {
std::ostringstream e;
const char* modal = nullptr;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0023)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0023) << "\n";
@@ -334,7 +337,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
modal = "must";
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (modal) {
@@ -353,7 +356,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
? cmTarget::PlainTLLSignature
: cmTarget::KeywordTLLSignature);
this->Makefile->IssueMessage(messageType, e.str());
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
return false;
}
}
@@ -406,7 +409,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
<< this->Target->GetName()
<< "\" which is not built in this directory.\n"
<< "This is allowed only when policy CMP0079 is set to NEW.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
return false;
}
@@ -424,7 +427,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
<< " may not be linked into another target. One may link only to "
"INTERFACE, OBJECT, STATIC or SHARED libraries, or to executables "
"with the ENABLE_EXPORTS property set.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
this->Target->AddLinkLibrary(*this->Makefile, lib, libRef, llt);
@@ -440,7 +443,7 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
"which the target was created rather than in this calling "
"directory.";
/* clang-format on */
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, w.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, w.str());
}
// Handle (additional) case where the command was called with PRIVATE /
@@ -449,11 +452,12 @@ bool cmTargetLinkLibrariesCommand::HandleLibrary(const std::string& lib,
// STATIC library.)
if (this->CurrentProcessingState == ProcessingKeywordPrivateInterface ||
this->CurrentProcessingState == ProcessingPlainPrivateInterface) {
- if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY) {
+ if (this->Target->GetType() == cmStateEnums::STATIC_LIBRARY ||
+ this->Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
std::string configLib =
this->Target->GetDebugGeneratorExpressions(libRef, llt);
- if (cmGeneratorExpression::IsValidTargetName(lib) ||
- cmGeneratorExpression::Find(lib) != std::string::npos) {
+ if (cmGeneratorExpression::IsValidTargetName(libRef) ||
+ cmGeneratorExpression::Find(libRef) != std::string::npos) {
configLib = "$<LINK_ONLY:" + configLib + ">";
}
this->Target->AppendProperty("INTERFACE_LINK_LIBRARIES",
diff --git a/Source/cmTargetLinkOptionsCommand.cxx b/Source/cmTargetLinkOptionsCommand.cxx
index d6ed5ae6e..536648638 100644
--- a/Source/cmTargetLinkOptionsCommand.cxx
+++ b/Source/cmTargetLinkOptionsCommand.cxx
@@ -7,8 +7,8 @@
#include "cmAlgorithms.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -23,7 +23,7 @@ void cmTargetLinkOptionsCommand::HandleMissingTarget(const std::string& name)
std::ostringstream e;
e << "Cannot specify link options for target \"" << name
<< "\" which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
std::string cmTargetLinkOptionsCommand::Join(
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index 9a8fd96f1..1b8ee812f 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -84,15 +84,6 @@ bool cmTargetPropCommandBase::ProcessContentArgs(
this->SetError("called with invalid arguments");
return false;
}
- if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
- scope != "INTERFACE") {
- this->SetError("may only set INTERFACE properties on INTERFACE targets");
- return false;
- }
- if (this->Target->IsImported() && scope != "INTERFACE") {
- this->SetError("may only set INTERFACE properties on IMPORTED targets");
- return false;
- }
++argIndex;
@@ -101,10 +92,21 @@ bool cmTargetPropCommandBase::ProcessContentArgs(
for (unsigned int i = argIndex; i < args.size(); ++i, ++argIndex) {
if (args[i] == "PUBLIC" || args[i] == "PRIVATE" ||
args[i] == "INTERFACE") {
- return this->PopulateTargetProperies(scope, content, prepend, system);
+ break;
}
content.push_back(args[i]);
}
+ if (!content.empty()) {
+ if (this->Target->GetType() == cmStateEnums::INTERFACE_LIBRARY &&
+ scope != "INTERFACE") {
+ this->SetError("may only set INTERFACE properties on INTERFACE targets");
+ return false;
+ }
+ if (this->Target->IsImported() && scope != "INTERFACE") {
+ this->SetError("may only set INTERFACE properties on IMPORTED targets");
+ return false;
+ }
+ }
return this->PopulateTargetProperies(scope, content, prepend, system);
}
@@ -112,6 +114,9 @@ bool cmTargetPropCommandBase::PopulateTargetProperies(
const std::string& scope, const std::vector<std::string>& content,
bool prepend, bool system)
{
+ if (content.empty()) {
+ return true;
+ }
if (scope == "PRIVATE" || scope == "PUBLIC") {
if (!this->HandleDirectContent(this->Target, content, prepend, system)) {
return false;
diff --git a/Source/cmTargetPropertyComputer.cxx b/Source/cmTargetPropertyComputer.cxx
index 06ce0b1e6..d2c3496ed 100644
--- a/Source/cmTargetPropertyComputer.cxx
+++ b/Source/cmTargetPropertyComputer.cxx
@@ -7,10 +7,10 @@
#include <sstream>
#include <unordered_set>
+#include "cmMessageType.h"
#include "cmMessenger.h"
#include "cmPolicies.h"
#include "cmStateSnapshot.h"
-#include "cmake.h"
bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
std::string const& tgtName, cmMessenger* messenger,
@@ -18,7 +18,7 @@ bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
{
std::ostringstream e;
const char* modal = nullptr;
- cmake::MessageType messageType = cmake::AUTHOR_WARNING;
+ MessageType messageType = MessageType::AUTHOR_WARNING;
switch (context.GetBottom().GetPolicy(cmPolicies::CMP0026)) {
case cmPolicies::WARN:
e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0026) << "\n";
@@ -29,7 +29,7 @@ bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
case cmPolicies::REQUIRED_IF_USED:
case cmPolicies::NEW:
modal = "may";
- messageType = cmake::FATAL_ERROR;
+ messageType = MessageType::FATAL_ERROR;
}
if (modal) {
@@ -41,7 +41,7 @@ bool cmTargetPropertyComputer::HandleLocationPropertyPolicy(
messenger->IssueMessage(messageType, e.str(), context);
}
- return messageType != cmake::FATAL_ERROR;
+ return messageType != MessageType::FATAL_ERROR;
}
bool cmTargetPropertyComputer::WhiteListedInterfaceProperty(
@@ -65,6 +65,7 @@ bool cmTargetPropertyComputer::WhiteListedInterfaceProperty(
builtIns.insert("EXPORT_NAME");
builtIns.insert("IMPORTED");
builtIns.insert("IMPORTED_GLOBAL");
+ builtIns.insert("MANUALLY_ADDED_DEPENDENCIES");
builtIns.insert("NAME");
builtIns.insert("TYPE");
}
@@ -100,7 +101,7 @@ bool cmTargetPropertyComputer::PassesWhitelist(
e << "INTERFACE_LIBRARY targets may only have whitelisted properties. "
"The property \""
<< prop << "\" is not allowed.";
- messenger->IssueMessage(cmake::FATAL_ERROR, e.str(), context);
+ messenger->IssueMessage(MessageType::FATAL_ERROR, e.str(), context);
return false;
}
return true;
diff --git a/Source/cmTargetSourcesCommand.cxx b/Source/cmTargetSourcesCommand.cxx
index 7429053ea..11e288fe6 100644
--- a/Source/cmTargetSourcesCommand.cxx
+++ b/Source/cmTargetSourcesCommand.cxx
@@ -7,10 +7,10 @@
#include "cmAlgorithms.h"
#include "cmGeneratorExpression.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmPolicies.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
-#include "cmake.h"
class cmExecutionStatus;
@@ -34,7 +34,7 @@ void cmTargetSourcesCommand::HandleMissingTarget(const std::string& name)
e << "Cannot specify sources for target \"" << name
<< "\" "
"which is not built by this project.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->Makefile->IssueMessage(MessageType::FATAL_ERROR, e.str());
}
std::string cmTargetSourcesCommand::Join(
@@ -99,7 +99,7 @@ std::vector<std::string> cmTargetSourcesCommand::ConvertToAbsoluteContent(
case cmPolicies::REQUIRED_ALWAYS:
case cmPolicies::REQUIRED_IF_USED:
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0076));
break;
case cmPolicies::NEW: {
@@ -117,7 +117,7 @@ std::vector<std::string> cmTargetSourcesCommand::ConvertToAbsoluteContent(
e << "A private source from a directory other than that of target \""
<< tgt->GetName() << "\" has a relative path.";
}
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str());
+ this->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, e.str());
}
return useAbsoluteContent ? absoluteContent : content;
diff --git a/Source/cmTest.cxx b/Source/cmTest.cxx
index 4d0cbaafc..7d45cf5e3 100644
--- a/Source/cmTest.cxx
+++ b/Source/cmTest.cxx
@@ -14,9 +14,7 @@ cmTest::cmTest(cmMakefile* mf)
this->OldStyle = true;
}
-cmTest::~cmTest()
-{
-}
+cmTest::~cmTest() = default;
cmListFileBacktrace const& cmTest::GetBacktrace() const
{
diff --git a/Source/cmTestGenerator.cxx b/Source/cmTestGenerator.cxx
index 796d2df64..5102613eb 100644
--- a/Source/cmTestGenerator.cxx
+++ b/Source/cmTestGenerator.cxx
@@ -7,6 +7,7 @@
#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
+#include "cmListFileCache.h"
#include "cmLocalGenerator.h"
#include "cmOutputConverter.h"
#include "cmProperty.h"
@@ -25,9 +26,7 @@ cmTestGenerator::cmTestGenerator(
this->LG = nullptr;
}
-cmTestGenerator::~cmTestGenerator()
-{
-}
+cmTestGenerator::~cmTestGenerator() = default;
void cmTestGenerator::Compute(cmLocalGenerator* lg)
{
@@ -89,7 +88,7 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Prepend with the emulator when cross compiling if required.
const char* emulator = target->GetProperty("CROSSCOMPILING_EMULATOR");
- if (emulator != nullptr) {
+ if (emulator != nullptr && *emulator) {
std::vector<std::string> emulatorWithArgs;
cmSystemTools::ExpandListArgument(emulator, emulatorWithArgs);
std::string emulatorExe(emulatorWithArgs[0]);
@@ -121,16 +120,15 @@ void cmTestGenerator::GenerateScriptForConfig(std::ostream& os,
// Output properties for the test.
cmPropertyMap& pm = this->Test->GetProperties();
- if (!pm.empty()) {
- os << indent << "set_tests_properties(" << this->Test->GetName()
- << " PROPERTIES ";
- for (auto const& i : pm) {
- os << " " << i.first << " "
- << cmOutputConverter::EscapeForCMake(
- ge.Parse(i.second.GetValue())->Evaluate(this->LG, config));
- }
- os << ")" << std::endl;
+ os << indent << "set_tests_properties(" << this->Test->GetName()
+ << " PROPERTIES ";
+ for (auto const& i : pm) {
+ os << " " << i.first << " "
+ << cmOutputConverter::EscapeForCMake(
+ ge.Parse(i.second.GetValue())->Evaluate(this->LG, config));
}
+ this->GenerateInternalProperties(os);
+ os << ")" << std::endl;
}
void cmTestGenerator::GenerateScriptNoConfig(std::ostream& os, Indent indent)
@@ -179,13 +177,37 @@ void cmTestGenerator::GenerateOldStyle(std::ostream& fout, Indent indent)
// Output properties for the test.
cmPropertyMap& pm = this->Test->GetProperties();
- if (!pm.empty()) {
- fout << indent << "set_tests_properties(" << this->Test->GetName()
- << " PROPERTIES ";
- for (auto const& i : pm) {
- fout << " " << i.first << " "
- << cmOutputConverter::EscapeForCMake(i.second.GetValue());
+ fout << indent << "set_tests_properties(" << this->Test->GetName()
+ << " PROPERTIES ";
+ for (auto const& i : pm) {
+ fout << " " << i.first << " "
+ << cmOutputConverter::EscapeForCMake(i.second.GetValue());
+ }
+ this->GenerateInternalProperties(fout);
+ fout << ")" << std::endl;
+}
+
+void cmTestGenerator::GenerateInternalProperties(std::ostream& os)
+{
+ cmListFileBacktrace bt = this->Test->GetBacktrace();
+ if (bt.Empty()) {
+ return;
+ }
+
+ os << " "
+ << "_BACKTRACE_TRIPLES"
+ << " \"";
+
+ bool prependTripleSeparator = false;
+ while (!bt.Empty()) {
+ const auto& entry = bt.Top();
+ if (prependTripleSeparator) {
+ os << ";";
}
- fout << ")" << std::endl;
+ os << entry.FilePath << ";" << entry.Line << ";" << entry.Name;
+ bt = bt.Pop();
+ prependTripleSeparator = true;
}
+
+ os << "\"";
}
diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h
index 73d05a3bb..8b9cf78a1 100644
--- a/Source/cmTestGenerator.h
+++ b/Source/cmTestGenerator.h
@@ -20,14 +20,15 @@ class cmTest;
*/
class cmTestGenerator : public cmScriptGenerator
{
- CM_DISABLE_COPY(cmTestGenerator)
-
public:
cmTestGenerator(cmTest* test,
std::vector<std::string> const& configurations =
std::vector<std::string>());
~cmTestGenerator() override;
+ cmTestGenerator(cmTestGenerator const&) = delete;
+ cmTestGenerator& operator=(cmTestGenerator const&) = delete;
+
void Compute(cmLocalGenerator* lg);
/** Test if this generator installs the test for a given configuration. */
@@ -35,6 +36,9 @@ public:
cmTest* GetTest() const;
+private:
+ void GenerateInternalProperties(std::ostream& os);
+
protected:
void GenerateScriptConfigs(std::ostream& os, Indent indent) override;
void GenerateScriptActions(std::ostream& os, Indent indent) override;
diff --git a/Source/cmTimestamp.h b/Source/cmTimestamp.h
index 8dd499a3e..d5fbdfd67 100644
--- a/Source/cmTimestamp.h
+++ b/Source/cmTimestamp.h
@@ -15,20 +15,18 @@
class cmTimestamp
{
public:
- cmTimestamp() {}
-
std::string CurrentTime(const std::string& formatString, bool utcFlag);
std::string FileModificationTime(const char* path,
const std::string& formatString,
bool utcFlag);
-private:
- time_t CreateUtcTimeTFromTm(struct tm& timeStruct) const;
-
std::string CreateTimestampFromTimeT(time_t timeT, std::string formatString,
bool utcFlag) const;
+private:
+ time_t CreateUtcTimeTFromTm(struct tm& timeStruct) const;
+
std::string AddTimestampComponent(char flag, struct tm& timeStruct,
time_t timeT) const;
};
diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx
index 3ff84ceb5..05b3f0587 100644
--- a/Source/cmTryCompileCommand.cxx
+++ b/Source/cmTryCompileCommand.cxx
@@ -3,6 +3,7 @@
#include "cmTryCompileCommand.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmake.h"
class cmExecutionStatus;
@@ -18,7 +19,7 @@ bool cmTryCompileCommand::InitialPass(std::vector<std::string> const& argv,
if (this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
cmake::FIND_PACKAGE_MODE) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The TRY_COMPILE() command is not supported in --find-package mode.");
return false;
}
diff --git a/Source/cmTryRunCommand.cxx b/Source/cmTryRunCommand.cxx
index 939613802..c57aabdc3 100644
--- a/Source/cmTryRunCommand.cxx
+++ b/Source/cmTryRunCommand.cxx
@@ -7,6 +7,7 @@
#include "cmDuration.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmState.h"
#include "cmStateTypes.h"
#include "cmSystemTools.h"
@@ -25,7 +26,7 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
if (this->Makefile->GetCMakeInstance()->GetWorkingMode() ==
cmake::FIND_PACKAGE_MODE) {
this->Makefile->IssueMessage(
- cmake::FATAL_ERROR,
+ MessageType::FATAL_ERROR,
"The TRY_RUN() command is not supported in --find-package mode.");
return false;
}
@@ -45,7 +46,8 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
if (argv[i] == "ARGS") {
++i;
while (i < argv.size() && argv[i] != "COMPILE_DEFINITIONS" &&
- argv[i] != "CMAKE_FLAGS" && argv[i] != "LINK_LIBRARIES") {
+ argv[i] != "CMAKE_FLAGS" && argv[i] != "LINK_OPTIONS" &&
+ argv[i] != "LINK_LIBRARIES") {
runArgs += " ";
runArgs += argv[i];
++i;
@@ -99,11 +101,11 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
bool captureRunOutput = false;
if (!this->OutputVariable.empty()) {
captureRunOutput = true;
- tryCompile.push_back("OUTPUT_VARIABLE");
+ tryCompile.emplace_back("OUTPUT_VARIABLE");
tryCompile.push_back(this->OutputVariable);
}
if (!this->CompileOutputVariable.empty()) {
- tryCompile.push_back("OUTPUT_VARIABLE");
+ tryCompile.emplace_back("OUTPUT_VARIABLE");
tryCompile.push_back(this->CompileOutputVariable);
}
if (!this->RunOutputVariable.empty()) {
@@ -119,7 +121,7 @@ bool cmTryRunCommand::InitialPass(std::vector<std::string> const& argv,
// now try running the command if it compiled
if (!res) {
if (this->OutputFile.empty()) {
- cmSystemTools::Error(this->FindErrorMessage.c_str());
+ cmSystemTools::Error(this->FindErrorMessage);
} else {
// "run" it and capture the output
std::string runOutputContents;
@@ -215,7 +217,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
// removed at the end of TRY_RUN and the user can run it manually
// on the target platform.
std::string copyDest = this->Makefile->GetHomeOutputDirectory();
- copyDest += cmake::GetCMakeFilesDirectory();
+ copyDest += "/CMakeFiles";
copyDest += "/";
copyDest += cmSystemTools::GetFilenameWithoutExtension(this->OutputFile);
copyDest += "-";
@@ -352,7 +354,7 @@ void cmTryRunCommand::DoNotRunExecutable(const std::string& runArgs,
errorMessage += " " + internalRunOutputName + " (advanced)\n";
}
errorMessage += detailsString;
- cmSystemTools::Error(errorMessage.c_str());
+ cmSystemTools::Error(errorMessage);
return;
}
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h
index 2937e0d1a..992c429b1 100644
--- a/Source/cmUVHandlePtr.h
+++ b/Source/cmUVHandlePtr.h
@@ -3,7 +3,6 @@
#pragma once
#include "cmConfigure.h" // IWYU pragma: keep
-#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <memory>
@@ -11,12 +10,22 @@
#include "cm_uv.h"
-#define CM_PERFECT_FWD_CTOR(Class, FwdTo) \
- template <typename... Args> \
- Class(Args&&... args) \
- : FwdTo(std::forward<Args>(args)...) \
- { \
- }
+#if defined(__SUNPRO_CC)
+
+# include <utility>
+
+# define CM_INHERIT_CTOR(Class, Base, Tpl) \
+ template <typename... Args> \
+ Class(Args&&... args) \
+ : Base Tpl(std::forward<Args>(args)...) \
+ { \
+ }
+
+#else
+
+# define CM_INHERIT_CTOR(Class, Base, Tpl) using Base Tpl ::Base;
+
+#endif
namespace cm {
@@ -52,7 +61,8 @@ protected:
void allocate(void* data = nullptr);
public:
- CM_DISABLE_COPY(uv_handle_ptr_base_)
+ uv_handle_ptr_base_(uv_handle_ptr_base_ const&) = delete;
+ uv_handle_ptr_base_& operator=(uv_handle_ptr_base_ const&) = delete;
uv_handle_ptr_base_(uv_handle_ptr_base_&&) noexcept;
uv_handle_ptr_base_& operator=(uv_handle_ptr_base_&&) noexcept;
@@ -77,8 +87,8 @@ public:
}
// Dtor and ctor need to be inline defined like this for default ctors and
- // dtors to work.
- uv_handle_ptr_base_() {}
+ // dtors to work. Some compilers do not like '= default' here.
+ uv_handle_ptr_base_() {} // NOLINT(modernize-use-equals-default)
uv_handle_ptr_base_(std::nullptr_t) {}
~uv_handle_ptr_base_() { reset(); }
@@ -116,7 +126,7 @@ class uv_handle_ptr_ : public uv_handle_ptr_base_<T>
friend class uv_handle_ptr_;
public:
- CM_PERFECT_FWD_CTOR(uv_handle_ptr_, uv_handle_ptr_base_<T>);
+ CM_INHERIT_CTOR(uv_handle_ptr_, uv_handle_ptr_base_, <T>);
/***
* Allow less verbose calling of uv_<T> functions
@@ -133,13 +143,13 @@ template <>
class uv_handle_ptr_<uv_handle_t> : public uv_handle_ptr_base_<uv_handle_t>
{
public:
- CM_PERFECT_FWD_CTOR(uv_handle_ptr_, uv_handle_ptr_base_<uv_handle_t>);
+ CM_INHERIT_CTOR(uv_handle_ptr_, uv_handle_ptr_base_, <uv_handle_t>);
};
class uv_async_ptr : public uv_handle_ptr_<uv_async_t>
{
public:
- CM_PERFECT_FWD_CTOR(uv_async_ptr, uv_handle_ptr_<uv_async_t>);
+ CM_INHERIT_CTOR(uv_async_ptr, uv_handle_ptr_, <uv_async_t>);
int init(uv_loop_t& loop, uv_async_cb async_cb, void* data = nullptr);
@@ -148,7 +158,7 @@ public:
struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t>
{
- CM_PERFECT_FWD_CTOR(uv_signal_ptr, uv_handle_ptr_<uv_signal_t>);
+ CM_INHERIT_CTOR(uv_signal_ptr, uv_handle_ptr_, <uv_signal_t>);
int init(uv_loop_t& loop, void* data = nullptr);
@@ -159,7 +169,7 @@ struct uv_signal_ptr : public uv_handle_ptr_<uv_signal_t>
struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
{
- CM_PERFECT_FWD_CTOR(uv_pipe_ptr, uv_handle_ptr_<uv_pipe_t>);
+ CM_INHERIT_CTOR(uv_pipe_ptr, uv_handle_ptr_, <uv_pipe_t>);
operator uv_stream_t*() const;
@@ -168,7 +178,7 @@ struct uv_pipe_ptr : public uv_handle_ptr_<uv_pipe_t>
struct uv_process_ptr : public uv_handle_ptr_<uv_process_t>
{
- CM_PERFECT_FWD_CTOR(uv_process_ptr, uv_handle_ptr_<uv_process_t>);
+ CM_INHERIT_CTOR(uv_process_ptr, uv_handle_ptr_, <uv_process_t>);
int spawn(uv_loop_t& loop, uv_process_options_t const& options,
void* data = nullptr);
@@ -176,7 +186,7 @@ struct uv_process_ptr : public uv_handle_ptr_<uv_process_t>
struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
{
- CM_PERFECT_FWD_CTOR(uv_timer_ptr, uv_handle_ptr_<uv_timer_t>);
+ CM_INHERIT_CTOR(uv_timer_ptr, uv_handle_ptr_, <uv_timer_t>);
int init(uv_loop_t& loop, void* data = nullptr);
@@ -185,7 +195,7 @@ struct uv_timer_ptr : public uv_handle_ptr_<uv_timer_t>
struct uv_tty_ptr : public uv_handle_ptr_<uv_tty_t>
{
- CM_PERFECT_FWD_CTOR(uv_tty_ptr, uv_handle_ptr_<uv_tty_t>);
+ CM_INHERIT_CTOR(uv_tty_ptr, uv_handle_ptr_, <uv_tty_t>);
operator uv_stream_t*() const;
diff --git a/Source/cmUnexpectedCommand.h b/Source/cmUnexpectedCommand.h
index 7154881a4..33d6bdc2c 100644
--- a/Source/cmUnexpectedCommand.h
+++ b/Source/cmUnexpectedCommand.h
@@ -6,6 +6,7 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <string>
+#include <utility>
#include <vector>
#include "cmCommand.h"
@@ -15,8 +16,8 @@ class cmExecutionStatus;
class cmUnexpectedCommand : public cmCommand
{
public:
- cmUnexpectedCommand(std::string const& name, const char* error)
- : Name(name)
+ cmUnexpectedCommand(std::string name, const char* error)
+ : Name(std::move(name))
, Error(error)
{
}
diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx
index 01ef5cbea..9648b21d8 100644
--- a/Source/cmUseMangledMesaCommand.cxx
+++ b/Source/cmUseMangledMesaCommand.cxx
@@ -100,6 +100,6 @@ void cmUseMangledMesaCommand::CopyAndFullPathMesaHeader(const char* source,
// close the files before attempting to copy
fin.close();
fout.close();
- cmSystemTools::CopyFileIfDifferent(tempOutputFile.c_str(), outFile.c_str());
+ cmSystemTools::CopyFileIfDifferent(tempOutputFile, outFile);
cmSystemTools::RemoveFile(tempOutputFile);
}
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index f37462644..231bca41d 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -40,7 +40,7 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args,
msg += ". If your intention is to run this executable, you need to "
"preload the cache with the full path to a version of that "
"program, which runs on this build machine.";
- cmSystemTools::Message(msg.c_str(), "Warning");
+ cmSystemTools::Message(msg, "Warning");
}
} else {
cmState* state = this->Makefile->GetState();
diff --git a/Source/cmVS10CLFlagTable.h b/Source/cmVS10CLFlagTable.h
deleted file mode 100644
index df4d58c03..000000000
--- a/Source/cmVS10CLFlagTable.h
+++ /dev/null
@@ -1,205 +0,0 @@
-static cmVS7FlagTable cmVS10CLFlagTable[] = {
-
- // Enum Properties
- { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 },
- { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 },
- { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue",
- "EditAndContinue", 0 },
-
- { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 },
- { "WarningLevel", "W1", "Level1", "Level1", 0 },
- { "WarningLevel", "W2", "Level2", "Level2", 0 },
- { "WarningLevel", "W3", "Level3", "Level3", 0 },
- { "WarningLevel", "W4", "Level4", "Level4", 0 },
- { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 },
-
- { "Optimization", "Od", "Disabled", "Disabled", 0 },
- { "Optimization", "O1", "Minimize Size", "MinSpace", 0 },
- { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 },
- { "Optimization", "Ox", "Full Optimization", "Full", 0 },
-
- { "InlineFunctionExpansion", "", "Default", "Default", 0 },
- { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 },
- { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline",
- 0 },
- { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 },
-
- { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 },
- { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 },
- { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 },
-
- { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 },
- { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 },
- { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow",
- 0 },
- { "ExceptionHandling", "", "No", "false", 0 },
-
- { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck",
- 0 },
- { "BasicRuntimeChecks", "RTCu", "Uninitialized variables",
- "UninitializedLocalUsageCheck", 0 },
- { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)",
- "EnableFastChecks", 0 },
- { "BasicRuntimeChecks", "", "Default", "Default", 0 },
-
- { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 },
- { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 },
- { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 },
- { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL",
- "MultiThreadedDebugDLL", 0 },
-
- { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 },
- { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 },
- { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 },
- { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 },
- { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 },
- { "StructMemberAlignment", "", "Default", "Default", 0 },
-
- { "EnableEnhancedInstructionSet", "arch:SSE",
- "Streaming SIMD Extensions (/arch:SSE)", "StreamingSIMDExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:SSE2",
- "Streaming SIMD Extensions 2 (/arch:SSE2)", "StreamingSIMDExtensions2",
- 0 },
- { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 },
-
- { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 },
- { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 },
- { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 },
-
- { "PrecompiledHeader", "Yc", "Create", "Create",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Yu", "Use", "Use",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
- 0 },
-
- { "AssemblerOutput", "", "No Listing", "NoListing", 0 },
- { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
- { "AssemblerOutput", "FAc", "Assembly With Machine Code",
- "AssemblyAndMachineCode", 0 },
- { "AssemblerOutput", "FAs", "Assembly With Source Code",
- "AssemblyAndSourceCode", 0 },
- { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 },
-
- { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 },
- { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 },
- { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 },
-
- { "CompileAs", "", "Default", "Default", 0 },
- { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 },
- { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 },
-
- { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 },
- { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt",
- 0 },
- { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue",
- 0 },
- { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 },
-
- { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 },
- { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 },
- { "CompileAsManaged", "clr:pure",
- "Pure MSIL Common Language RunTime Support", "Pure", 0 },
- { "CompileAsManaged", "clr:safe",
- "Safe MSIL Common Language RunTime Support", "Safe", 0 },
- { "CompileAsManaged", "clr:oldSyntax",
- "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 },
-
- // Bool Properties
- { "SuppressStartupBanner", "nologo-", "", "false", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
- { "TreatWarningAsError", "WX-", "", "false", 0 },
- { "TreatWarningAsError", "WX", "", "true", 0 },
- { "IntrinsicFunctions", "Oi", "", "true", 0 },
- { "OmitFramePointers", "Oy-", "", "false", 0 },
- { "OmitFramePointers", "Oy", "", "true", 0 },
- { "EnableFiberSafeOptimizations", "GT", "", "true", 0 },
- { "WholeProgramOptimization", "GL", "", "true", 0 },
- { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 },
- { "IgnoreStandardIncludePath", "X", "", "true", 0 },
- { "PreprocessToFile", "P", "", "true", 0 },
- { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 },
- { "PreprocessKeepComments", "C", "", "true", 0 },
- { "StringPooling", "GF-", "", "false", 0 },
- { "StringPooling", "GF", "", "true", 0 },
- { "MinimalRebuild", "Gm-", "", "false", 0 },
- { "MinimalRebuild", "Gm", "", "true", 0 },
- { "SmallerTypeCheck", "RTCc", "", "true", 0 },
- { "BufferSecurityCheck", "GS-", "", "false", 0 },
- { "BufferSecurityCheck", "GS", "", "true", 0 },
- { "FunctionLevelLinking", "Gy-", "", "false", 0 },
- { "FunctionLevelLinking", "Gy", "", "true", 0 },
- { "FloatingPointExceptions", "fp:except-", "", "false", 0 },
- { "FloatingPointExceptions", "fp:except", "", "true", 0 },
- { "CreateHotpatchableImage", "hotpatch", "", "true", 0 },
- { "DisableLanguageExtensions", "Za", "", "true", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
- { "RuntimeTypeInfo", "GR-", "", "false", 0 },
- { "RuntimeTypeInfo", "GR", "", "true", 0 },
- { "OpenMPSupport", "openmp-", "", "false", 0 },
- { "OpenMPSupport", "openmp", "", "true", 0 },
- { "ExpandAttributedSource", "Fx", "", "true", 0 },
- { "ShowIncludes", "showIncludes", "", "true", 0 },
- { "EnablePREfast", "analyze-", "", "false", 0 },
- { "EnablePREfast", "analyze", "", "true", 0 },
- { "UseFullPaths", "FC", "", "true", 0 },
- { "OmitDefaultLibName", "Zl", "", "true", 0 },
- { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 },
-
- // Bool Properties With Argument
- { "MultiProcessorCompilation", "MP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "ProcessorNumber", "MP", "Multi-processor Compilation", "",
- cmVS7FlagTable::UserValueRequired },
- { "GenerateXMLDocumentationFiles", "doc", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "",
- cmVS7FlagTable::UserValueRequired },
- { "BrowseInformation", "FR", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "BrowseInformationFile", "FR", "Enable Browse Information", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalUsingDirectories", "AI", "Resolve #using References", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "UndefinePreprocessorDefinitions", "U",
- "Undefine Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedIncludeFiles", "FI", "Forced Include File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedUsingFiles", "FU", "Forced #using File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "",
- cmVS7FlagTable::UserValue },
- { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "",
- cmVS7FlagTable::UserValue },
- { "AssemblerListingLocation", "Fa", "ASM List Location", "",
- cmVS7FlagTable::UserValue },
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [XMLDocumentationFileName] - no command line Switch.
- // Skip [BrowseInformationFile] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS10CSharpFlagTable.h b/Source/cmVS10CSharpFlagTable.h
deleted file mode 100644
index 6ac7a76ae..000000000
--- a/Source/cmVS10CSharpFlagTable.h
+++ /dev/null
@@ -1,121 +0,0 @@
-static cmVS7FlagTable cmVS10CSharpFlagTable[] = {
- { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "OutputType", "target:exe", "", "Exe", 0 },
- { "OutputType", "target:winexe", "", "Winexe", 0 },
- { "OutputType", "target:library", "", "Library", 0 },
- { "OutputType", "target:module", "", "Module", 0 },
-
- { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "Platform", "platform:x86", "", "x86", 0 },
- { "Platform", "platform:Itanium", "", "Itanium", 0 },
- { "Platform", "platform:x64", "", "x64", 0 },
- { "Platform", "platform:arm", "", "arm", 0 },
- { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred",
- 0 },
- { "Platform", "platform:anycpu", "", "anycpu", 0 },
-
- { "References", "reference:", "mit alias", "", 0 },
- { "References", "reference:", "dateiliste", "", 0 },
- { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
- { "", "link", "", "", 0 },
-
- { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "ApplicationManifest", "win32manifest:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
-
- { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue },
-
- { "DebugSymbols", "debug", "", "true", 0 },
- { "DebugSymbols", "debug-", "", "false", 0 },
- { "DebugSymbols", "debug+", "", "true", 0 },
-
- { "DebugType", "debug:none", "", "none", 0 },
- { "DebugType", "debug:full", "", "full", 0 },
- { "DebugType", "debug:pdbonly", "", "pdbonly", 0 },
-
- { "Optimize", "optimize", "", "true", 0 },
- { "Optimize", "optimize-", "", "false", 0 },
- { "Optimize", "optimize+", "", "true", 0 },
-
- { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 },
- { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 },
- { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 },
-
- { "WarningsAsErrors", "warnaserror", "", "", 0 },
- { "WarningsAsErrors", "warnaserror-", "", "", 0 },
- { "WarningsAsErrors", "warnaserror+", "", "", 0 },
-
- { "WarningLevel", "warn:0", "", "0", 0 },
- { "WarningLevel", "warn:1", "", "1", 0 },
- { "WarningLevel", "warn:2", "", "2", 0 },
- { "WarningLevel", "warn:3", "", "3", 0 },
- { "WarningLevel", "warn:4", "", "4", 0 },
- { "DisabledWarnings", "nowarn", "", "", 0 },
-
- { "CheckForOverflowUnderflow", "checked", "", "true", 0 },
- { "CheckForOverflowUnderflow", "checked-", "", "false", 0 },
- { "CheckForOverflowUnderflow", "checked+", "", "true", 0 },
-
- { "AllowUnsafeBlocks", "unsafe", "", "true", 0 },
- { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 },
- { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 },
-
- { "DefineConstants", "define:", "", "",
- cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue },
-
- { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 },
- { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 },
- { "LangVersion", "langversion:3", "", "3", 0 },
- { "LangVersion", "langversion:4", "", "4", 0 },
- { "LangVersion", "langversion:5", "", "5", 0 },
- { "LangVersion", "langversion:6", "", "6", 0 },
- { "LangVersion", "langversion:default", "", "default", 0 },
-
- { "DelaySign", "delaysign", "", "true", 0 },
- { "DelaySign", "delaysign-", "", "false", 0 },
- { "DelaySign", "delaysign+", "", "true", 0 },
-
- { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 },
-
- { "KeyContainerName", "keycontainer", "", "", 0 },
-
- { "NoLogo", "nologo", "", "", 0 },
-
- { "NoConfig", "noconfig", "", "true", 0 },
-
- { "BaseAddress", "baseaddress:", "", "", 0 },
-
- { "CodePage", "codepage", "", "", 0 },
-
- { "Utf8Output", "utf8output", "", "", 0 },
-
- { "MainEntryPoint", "main:", "", "", 0 },
-
- { "GenerateFullPaths", "fullpaths", "", "true", 0 },
-
- { "FileAlignment", "filealign", "", "", 0 },
-
- { "PdbFile", "pdb:", "", "", 0 },
-
- { "NoStandardLib", "nostdlib", "", "true", 0 },
- { "NoStandardLib", "nostdlib-", "", "false", 0 },
- { "NoStandardLib", "nostdlib+", "", "true", 0 },
-
- { "SubsystemVersion", "subsystemversion", "", "", 0 },
-
- { "AdditionalLibPaths", "lib:", "", "", 0 },
-
- { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 },
- { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 },
- { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 },
- { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 },
-
- { 0, 0, 0, 0, 0 },
-};
diff --git a/Source/cmVS10CudaFlagTable.h b/Source/cmVS10CudaFlagTable.h
deleted file mode 100644
index 2b57e08ab..000000000
--- a/Source/cmVS10CudaFlagTable.h
+++ /dev/null
@@ -1,54 +0,0 @@
-static cmVS7FlagTable cmVS10CudaFlagTable[] = {
- // Collect options meant for the host compiler.
- { "AdditionalCompilerOptions", "Xcompiler=", "Host compiler options", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SpaceAppendable },
- { "AdditionalCompilerOptions", "Xcompiler", "Host compiler options", "",
- cmVS7FlagTable::UserFollowing | cmVS7FlagTable::SpaceAppendable },
-
- // Select the CUDA runtime library.
- { "CudaRuntime", "cudart=none", "No CUDA runtime library", "None", 0 },
- { "CudaRuntime", "cudart=shared", "Shared/dynamic CUDA runtime library",
- "Shared", 0 },
- { "CudaRuntime", "cudart=static", "Static CUDA runtime library", "Static",
- 0 },
- { "CudaRuntime", "cudart", "CUDA runtime library", "",
- cmVS7FlagTable::UserFollowing },
-
- // Capture arch/code arguments into temporaries for post-processing.
- { "cmake-temp-gencode", "gencode=", "", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "cmake-temp-gencode", "gencode", "", "",
- cmVS7FlagTable::UserFollowing | cmVS7FlagTable::SemicolonAppendable },
- { "cmake-temp-gencode", "-generate-code=", "", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "cmake-temp-gencode", "-generate-code", "", "",
- cmVS7FlagTable::UserFollowing | cmVS7FlagTable::SemicolonAppendable },
-
- { "cmake-temp-code", "code=", "", "", cmVS7FlagTable::UserValue },
- { "cmake-temp-code", "code", "", "", cmVS7FlagTable::UserFollowing },
- { "cmake-temp-code", "-gpu-code=", "", "", cmVS7FlagTable::UserValue },
- { "cmake-temp-code", "-gpu-code", "", "", cmVS7FlagTable::UserFollowing },
-
- { "cmake-temp-arch", "arch=", "", "", cmVS7FlagTable::UserValue },
- { "cmake-temp-arch", "arch", "", "", cmVS7FlagTable::UserFollowing },
- { "cmake-temp-arch", "-gpu-architecture=", "", "",
- cmVS7FlagTable::UserValue },
- { "cmake-temp-arch", "-gpu-architecture", "", "",
- cmVS7FlagTable::UserFollowing },
-
- // Other flags.
-
- { "FastMath", "use_fast_math", "", "true", 0 },
- { "FastMath", "-use_fast_math", "", "true", 0 },
-
- { "GPUDebugInfo", "G", "", "true", 0 },
- { "GPUDebugInfo", "-device-debug", "", "true", 0 },
-
- { "HostDebugInfo", "g", "", "true", 0 },
- { "HostDebugInfo", "-debug", "", "true", 0 },
-
- { "MaxRegCount", "maxrregcount=", "", "", cmVS7FlagTable::UserValue },
- { "MaxRegCount", "maxrregcount", "", "", cmVS7FlagTable::UserFollowing },
-
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS10CudaHostFlagTable.h b/Source/cmVS10CudaHostFlagTable.h
deleted file mode 100644
index 5b61066ca..000000000
--- a/Source/cmVS10CudaHostFlagTable.h
+++ /dev/null
@@ -1,35 +0,0 @@
-static cmVS7FlagTable cmVS10CudaHostFlagTable[] = {
- //{"Optimization", "", "<inherit from host>", "InheritFromHost", 0},
- { "Optimization", "Od", "Disabled", "Od", 0 },
- { "Optimization", "O1", "Minimize Size", "O1", 0 },
- { "Optimization", "O2", "Maximize Speed", "O2", 0 },
- { "Optimization", "Ox", "Full Optimization", "O3", 0 },
-
- //{"Runtime", "", "<inherit from host>", "InheritFromHost", 0},
- { "Runtime", "MT", "Multi-Threaded", "MT", 0 },
- { "Runtime", "MTd", "Multi-Threaded Debug", "MTd", 0 },
- { "Runtime", "MD", "Multi-Threaded DLL", "MD", 0 },
- { "Runtime", "MDd", "Multi-threaded Debug DLL", "MDd", 0 },
- { "Runtime", "ML", "Single-Threaded", "ML", 0 },
- { "Runtime", "MLd", "Single-Threaded Debug", "MLd", 0 },
-
- //{"RuntimeChecks", "", "<inherit from host>", "InheritFromHost", 0},
- //{"RuntimeChecks", "", "Default", "Default", 0},
- { "RuntimeChecks", "RTCs", "Stack Frames", "RTCs", 0 },
- { "RuntimeChecks", "RTCu", "Uninitialized Variables", "RTCu", 0 },
- { "RuntimeChecks", "RTC1", "Both", "RTC1", 0 },
-
- //{"TypeInfo", "", "<inherit from host>", "InheritFromHost", 0},
- { "TypeInfo", "GR", "Yes", "true", 0 },
- { "TypeInfo", "GR-", "No", "false", 0 },
-
- //{"Warning", "", "<inherit from host>", "InheritFromHost", 0},
- { "Warning", "W0", "Off: Turn Off All Warnings", "W0", 0 },
- { "Warning", "W1", "Level 1", "W1", 0 },
- { "Warning", "W2", "Level 2", "W2", 0 },
- { "Warning", "W3", "Level 3", "W3", 0 },
- { "Warning", "W4", "Level 4", "W4", 0 },
- { "Warning", "Wall", "Enable All Warnings", "Wall", 0 },
-
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS10LibFlagTable.h b/Source/cmVS10LibFlagTable.h
deleted file mode 100644
index be4f4753b..000000000
--- a/Source/cmVS10LibFlagTable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-static cmVS7FlagTable cmVS10LibFlagTable[] = {
-
- // Enum Properties
- { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport",
- 0 },
-
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- // Bool Properties
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLibWarningAsErrors", "WX", "", "true", 0 },
- { "Verbose", "VERBOSE", "", "true", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- // Skip [AdditionalDependencies] - no command line Switch.
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "RemoveObjects", "REMOVE:", "Remove Objects", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "",
- cmVS7FlagTable::UserValue },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue },
- { "DisplayLibrary", "LIST:", "Display Library to standard output", "",
- cmVS7FlagTable::UserValue },
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue },
- // Skip [TrackerLogDirectory] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS10LinkFlagTable.h b/Source/cmVS10LinkFlagTable.h
deleted file mode 100644
index 8f5b59b03..000000000
--- a/Source/cmVS10LinkFlagTable.h
+++ /dev/null
@@ -1,247 +0,0 @@
-static cmVS7FlagTable cmVS10LinkFlagTable[] = {
-
- // Enum Properties
- { "ShowProgress", "", "Not Set", "NotSet", 0 },
- { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose",
- 0 },
- { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib",
- 0 },
- { "ShowProgress", "VERBOSE:ICF",
- "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 },
- { "ShowProgress", "VERBOSE:REF",
- "About data removed during optimized linking", "LinkVerboseREF", 0 },
- { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH",
- "LinkVerboseSAFESEH", 0 },
- { "ShowProgress", "VERBOSE:CLR",
- "About linker activity related to managed code", "LinkVerboseCLR", 0 },
-
- { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 },
- { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only",
- "MultiplyDefinedSymbolOnly", 0 },
- { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only",
- "UndefinedSymbolOnly", 0 },
-
- { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only",
- "X86Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only",
- "X64Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only",
- "ItaniumImage", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 },
- { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable",
- "HighestAvailable", 0 },
- { "UACExecutionLevel", "level='requireAdministrator'",
- "requireAdministrator", "RequireAdministrator", 0 },
-
- { "SubSystem", "", "Not Set", "NotSet", 0 },
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- { "Driver", "", "Not Set", "NotSet", 0 },
- { "Driver", "Driver", "Driver", "Driver", 0 },
- { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 },
- { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 },
-
- { "LinkTimeCodeGeneration", "", "Default", "Default", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation",
- "UseLinkTimeCodeGeneration", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGInstrument",
- "Profile Guided Optimization - Instrument", "PGInstrument", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGOptimize",
- "Profile Guided Optimization - Optimization", "PGOptimization", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGUpdate",
- "Profile Guided Optimization - Update", "PGUpdate", 0 },
-
- { "TargetMachine", "", "Not Set", "NotSet", 0 },
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute",
- "MTAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute",
- "STAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE",
- "Default threading attribute", "DefaultThreadingAttribute", 0 },
-
- { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage",
- 0 },
- { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image",
- "ForcePureILImage", 0 },
- { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image",
- "ForceSafeILImage", 0 },
- { "CLRImageType", "", "Default image type", "Default", 0 },
-
- { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report",
- "NoErrorReport", 0 },
-
- { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 },
- { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled",
- 0 },
- { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only",
- "SystemDlls", 0 },
-
- // Bool Properties
- { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 },
- { "LinkIncremental", "INCREMENTAL", "", "true", 0 },
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 },
- { "LinkStatus", "LTCG:STATUS", "", "true", 0 },
- { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 },
- { "PreventDllBinding", "ALLOWBIND", "", "true", 0 },
- { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "GenerateManifest", "MANIFEST:NO", "", "false", 0 },
- { "GenerateManifest", "MANIFEST", "", "true", 0 },
- { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACUIAccess", "uiAccess='false'", "", "false", 0 },
- { "UACUIAccess", "uiAccess='true'", "", "true", 0 },
-
- { "GenerateDebugInformation", "DEBUG", "", "true",
- cmVS7FlagTable::CaseInsensitive },
- { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 },
- { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 },
- { "TerminalServerAware", "TSAWARE", "", "true", 0 },
- { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 },
- { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 },
- { "OptimizeReferences", "OPT:NOREF", "", "false", 0 },
- { "OptimizeReferences", "OPT:REF", "", "true", 0 },
- { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 },
- { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 },
- { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 },
- { "NoEntryPoint", "NOENTRY", "", "true", 0 },
- { "SetChecksum", "RELEASE", "", "true", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 },
- { "FixedBaseAddress", "FIXED:NO", "", "false", 0 },
- { "FixedBaseAddress", "FIXED", "", "true", 0 },
- { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 },
- { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 },
- { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 },
- { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 },
- { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 },
- { "Profile", "PROFILE", "", "true", 0 },
- { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 },
- { "LinkDelaySign", "DELAYSIGN", "", "true", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 },
- { "LinkDLL", "DLL", "", "true", 0 },
-
- // Bool Properties With Argument
- { "EnableUAC", "MANIFESTUAC:", "", "",
- cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable },
- { "GenerateMapFile", "MAP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "MapFileName", "MAP:", "Generate Map File", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "EmbedManagedResourceFile",
- "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalManifestDependencies",
- "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue },
- { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "",
- cmVS7FlagTable::UserValue },
- { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "ModuleDefinitionFile", "DEF:", "Module Definition File", "",
- cmVS7FlagTable::UserValue },
- { "ManifestFile", "ManifestFile:", "Manifest File", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "",
- cmVS7FlagTable::UserValue },
- { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "",
- cmVS7FlagTable::UserValue },
- // Skip [MapFileName] - no command line Switch.
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [HeapCommitSize] - no command line Switch.
- { "StackReserveSize", "STACK:", "Stack Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [StackCommitSize] - no command line Switch.
- { "FunctionOrder", "ORDER:@", "Function Order", "",
- cmVS7FlagTable::UserValue },
- { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "",
- cmVS7FlagTable::UserValue },
- { "MidlCommandFile", "MIDL:@", "MIDL Commands", "",
- cmVS7FlagTable::UserValue },
- { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "",
- cmVS7FlagTable::UserValue },
- { "TypeLibraryFile", "TLBOUT:", "Type Library", "",
- cmVS7FlagTable::UserValue },
- { "EntryPointSymbol", "ENTRY:", "Entry Point", "",
- cmVS7FlagTable::UserValue },
- { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue },
- { "ImportLibrary", "IMPLIB:", "Import Library", "",
- cmVS7FlagTable::UserValue },
- { "MergeSections", "MERGE:", "Merge Sections", "",
- cmVS7FlagTable::UserValue },
- { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue },
- { "KeyContainer", "KEYCONTAINER:", "Key Container", "",
- cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS10MASMFlagTable.h b/Source/cmVS10MASMFlagTable.h
deleted file mode 100644
index 0a452453f..000000000
--- a/Source/cmVS10MASMFlagTable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-static cmVS7FlagTable cmVS10MASMFlagTable[] = {
-
- // Enum Properties
- { "PreserveIdentifierCase", "", "Default", "0", 0 },
- { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1",
- 0 },
- { "PreserveIdentifierCase", "Cu",
- "Maps all identifiers to upper case. (/Cu)", "2", 0 },
- { "PreserveIdentifierCase", "Cx",
- "Preserves case in public and extern symbols. (/Cx)", "3", 0 },
-
- { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 },
- { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 },
- { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 },
- { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 },
-
- { "PackAlignmentBoundary", "", "Default", "0", 0 },
- { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 },
- { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 },
- { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 },
- { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 },
- { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 },
-
- { "CallingConvention", "", "Default", "0", 0 },
- { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1",
- 0 },
- { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2",
- 0 },
- { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 },
-
- { "ErrorReporting", "errorReport:prompt",
- "Prompt to send report immediately (/errorReport:prompt)", "0", 0 },
- { "ErrorReporting", "errorReport:queue",
- "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 },
- { "ErrorReporting", "errorReport:send",
- "Automatically send report (/errorReport:send)", "2", 0 },
- { "ErrorReporting", "errorReport:none",
- "Do not send report (/errorReport:none)", "3", 0 },
-
- // Bool Properties
- { "NoLogo", "nologo", "", "true", 0 },
- { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 },
- { "ListAllAvailableInformation", "Sa", "", "true", 0 },
- { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 },
- { "AddFirstPassListing", "Sf", "", "true", 0 },
- { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 },
- { "DisableSymbolTable", "Sn", "", "true", 0 },
- { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 },
- { "TreatWarningsAsErrors", "WX", "", "true", 0 },
- { "MakeAllSymbolsPublic", "Zf", "", "true", 0 },
- { "GenerateDebugInformation", "Zi", "", "true", 0 },
- { "EnableMASM51Compatibility", "Zm", "", "true", 0 },
- { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IncludePaths", "I", "Include Paths", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "BrowseFile", "FR", "Generate Browse Information File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
-
- // String Properties
- // Skip [Inputs] - no command line Switch.
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "",
- cmVS7FlagTable::UserValue },
- // Skip [CommandLineTemplate] - no command line Switch.
- // Skip [ExecutionDescription] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS10NASMFlagTable.h b/Source/cmVS10NASMFlagTable.h
deleted file mode 100644
index b91af9270..000000000
--- a/Source/cmVS10NASMFlagTable.h
+++ /dev/null
@@ -1,50 +0,0 @@
-static cmVS7FlagTable cmVS10NASMFlagTable[] = {
-
- // Enum Properties
- { "Outputswitch", "fwin32", "", "0", 0 },
- { "Outputswitch", "fwin", "", "0", 0 },
- { "Outputswitch", "fwin64", "", "1", 0 },
- { "Outputswitch", "felf", "", "2", 0 },
- { "Outputswitch", "felf32", "", "2", 0 },
- { "Outputswitch", "felf64", "", "3", 0 },
-
- { "ErrorReportingFormat", "Xgnu", "", "-Xgnu GNU format: Default format",
- 0 },
- { "ErrorReportingFormat", "Xvc", "",
- "-Xvc Style used by Microsoft Visual C++", 0 },
-
- // Bool Properties
- { "TreatWarningsAsErrors", "Werror", "", "true", 0 },
- { "GenerateDebugInformation", "g", "", "true", 0 },
- { "floatunderflow", "w+float-underflow", "", "true", 0 },
- { "macrodefaults", "w-macro-defaults", "", "true", 0 },
- { "user", "w-user", "%warning directives (default on)", "true", 0 },
- { "floatoverflow", "w-float-overflow", "", "true", 0 },
- { "floatdenorm", "w+float-denorm", "", "true", 0 },
- { "numberoverflow", "w-number-overflow", "", "true", 0 },
- { "macroselfref", "w+macro-selfref", "", "true", 0 },
- { "floattoolong", "w-float-toolong", "", "true", 0 },
- { "orphanlabels", "w-orphan-labels", "", "true", 0 },
- { "tasmmode", "t", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "UndefinePreprocessorDefinitions", "U",
- "Undefine Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IncludePaths", "I", "Include Paths", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AssembledCodeListingFile", "l",
- "Generates an assembled code listing file.", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- // Skip [Inputs] - no command line Switch.
- // Skip [CommandLineTemplate] - no command line Switch.
- // Skip [ExecutionDescription] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS10RCFlagTable.h b/Source/cmVS10RCFlagTable.h
deleted file mode 100644
index 6e2b8344c..000000000
--- a/Source/cmVS10RCFlagTable.h
+++ /dev/null
@@ -1,7 +0,0 @@
-static cmVS7FlagTable cmVS10RCFlagTable[] = {
- // Bool Properties
- { "NullTerminateStrings", "n", "", "true", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
-
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS11CLFlagTable.h b/Source/cmVS11CLFlagTable.h
deleted file mode 100644
index d156938e1..000000000
--- a/Source/cmVS11CLFlagTable.h
+++ /dev/null
@@ -1,220 +0,0 @@
-static cmVS7FlagTable cmVS11CLFlagTable[] = {
-
- // Enum Properties
- { "DebugInformationFormat", "", "None", "None", 0 },
- { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 },
- { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 },
- { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue",
- "EditAndContinue", 0 },
-
- { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 },
- { "WarningLevel", "W1", "Level1", "Level1", 0 },
- { "WarningLevel", "W2", "Level2", "Level2", 0 },
- { "WarningLevel", "W3", "Level3", "Level3", 0 },
- { "WarningLevel", "W4", "Level4", "Level4", 0 },
- { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 },
-
- { "Optimization", "Od", "Disabled", "Disabled", 0 },
- { "Optimization", "O1", "Minimize Size", "MinSpace", 0 },
- { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 },
- { "Optimization", "Ox", "Full Optimization", "Full", 0 },
-
- { "InlineFunctionExpansion", "", "Default", "Default", 0 },
- { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 },
- { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline",
- 0 },
- { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 },
-
- { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 },
- { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 },
- { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 },
-
- { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 },
- { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 },
- { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow",
- 0 },
- { "ExceptionHandling", "", "No", "false", 0 },
-
- { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck",
- 0 },
- { "BasicRuntimeChecks", "RTCu", "Uninitialized variables",
- "UninitializedLocalUsageCheck", 0 },
- { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)",
- "EnableFastChecks", 0 },
- { "BasicRuntimeChecks", "", "Default", "Default", 0 },
-
- { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 },
- { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 },
- { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 },
- { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL",
- "MultiThreadedDebugDLL", 0 },
-
- { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 },
- { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 },
- { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 },
- { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 },
- { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 },
- { "StructMemberAlignment", "", "Default", "Default", 0 },
-
- { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions",
- "StreamingSIMDExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2",
- "StreamingSIMDExtensions2", 0 },
- { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions",
- "AdvancedVectorExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions",
- "NoExtensions", 0 },
- { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 },
-
- { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 },
- { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 },
- { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 },
-
- { "PrecompiledHeader", "Yc", "Create", "Create",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Yu", "Use", "Use",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
- 0 },
-
- { "AssemblerOutput", "", "No Listing", "NoListing", 0 },
- { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
- { "AssemblerOutput", "FAc", "Assembly With Machine Code",
- "AssemblyAndMachineCode", 0 },
- { "AssemblerOutput", "FAs", "Assembly With Source Code",
- "AssemblyAndSourceCode", 0 },
- { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 },
-
- { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 },
- { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 },
- { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 },
-
- { "CompileAs", "", "Default", "Default", 0 },
- { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 },
- { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 },
-
- { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 },
- { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt",
- 0 },
- { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue",
- 0 },
- { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 },
-
- { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 },
- { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 },
- { "CompileAsManaged", "clr:pure",
- "Pure MSIL Common Language RunTime Support", "Pure", 0 },
- { "CompileAsManaged", "clr:safe",
- "Safe MSIL Common Language RunTime Support", "Safe", 0 },
- { "CompileAsManaged", "clr:oldSyntax",
- "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 },
-
- // Bool Properties
- { "CompileAsWinRT", "ZW", "", "true", 0 },
- { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 },
- { "SuppressStartupBanner", "nologo-", "", "false", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
- { "TreatWarningAsError", "WX-", "", "false", 0 },
- { "TreatWarningAsError", "WX", "", "true", 0 },
- { "SDLCheck", "sdl-", "", "false", 0 },
- { "SDLCheck", "sdl", "", "true", 0 },
- { "IntrinsicFunctions", "Oi", "", "true", 0 },
- { "OmitFramePointers", "Oy-", "", "false", 0 },
- { "OmitFramePointers", "Oy", "", "true", 0 },
- { "EnableFiberSafeOptimizations", "GT", "", "true", 0 },
- { "WholeProgramOptimization", "GL", "", "true", 0 },
- { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 },
- { "IgnoreStandardIncludePath", "X", "", "true", 0 },
- { "PreprocessToFile", "P", "", "true", 0 },
- { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 },
- { "PreprocessKeepComments", "C", "", "true", 0 },
- { "StringPooling", "GF-", "", "false", 0 },
- { "StringPooling", "GF", "", "true", 0 },
- { "MinimalRebuild", "Gm-", "", "false", 0 },
- { "MinimalRebuild", "Gm", "", "true", 0 },
- { "SmallerTypeCheck", "RTCc", "", "true", 0 },
- { "BufferSecurityCheck", "GS-", "", "false", 0 },
- { "BufferSecurityCheck", "GS", "", "true", 0 },
- { "FunctionLevelLinking", "Gy-", "", "false", 0 },
- { "FunctionLevelLinking", "Gy", "", "true", 0 },
- { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 },
- { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 },
- { "FloatingPointExceptions", "fp:except-", "", "false", 0 },
- { "FloatingPointExceptions", "fp:except", "", "true", 0 },
- { "CreateHotpatchableImage", "hotpatch", "", "true", 0 },
- { "DisableLanguageExtensions", "Za", "", "true", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
- { "RuntimeTypeInfo", "GR-", "", "false", 0 },
- { "RuntimeTypeInfo", "GR", "", "true", 0 },
- { "OpenMPSupport", "openmp-", "", "false", 0 },
- { "OpenMPSupport", "openmp", "", "true", 0 },
- { "ExpandAttributedSource", "Fx", "", "true", 0 },
- { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 },
- { "ShowIncludes", "showIncludes", "", "true", 0 },
- { "EnablePREfast", "analyze-", "", "false", 0 },
- { "EnablePREfast", "analyze", "", "true", 0 },
- { "UseFullPaths", "FC", "", "true", 0 },
- { "OmitDefaultLibName", "Zl", "", "true", 0 },
-
- // Bool Properties With Argument
- { "MultiProcessorCompilation", "MP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "ProcessorNumber", "MP", "Multi-processor Compilation", "",
- cmVS7FlagTable::UserValueRequired },
- { "GenerateXMLDocumentationFiles", "doc", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "",
- cmVS7FlagTable::UserValueRequired },
- { "BrowseInformation", "FR", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "BrowseInformationFile", "FR", "Enable Browse Information", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "UndefinePreprocessorDefinitions", "U",
- "Undefine Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedIncludeFiles", "FI", "Forced Include File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedUsingFiles", "FU", "Forced #using File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PREfastLog", "analyze:log", "Code Analysis Log", "",
- cmVS7FlagTable::UserFollowing },
- { "PREfastAdditionalPlugins", "analyze:plugin",
- "Additional Code Analysis Native plugins", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "",
- cmVS7FlagTable::UserValue },
- { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "",
- cmVS7FlagTable::UserValue },
- { "AssemblerListingLocation", "Fa", "ASM List Location", "",
- cmVS7FlagTable::UserValue },
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [XMLDocumentationFileName] - no command line Switch.
- // Skip [BrowseInformationFile] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS11CSharpFlagTable.h b/Source/cmVS11CSharpFlagTable.h
deleted file mode 100644
index 18b804a63..000000000
--- a/Source/cmVS11CSharpFlagTable.h
+++ /dev/null
@@ -1,121 +0,0 @@
-static cmVS7FlagTable cmVS11CSharpFlagTable[] = {
- { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "OutputType", "target:exe", "", "Exe", 0 },
- { "OutputType", "target:winexe", "", "Winexe", 0 },
- { "OutputType", "target:library", "", "Library", 0 },
- { "OutputType", "target:module", "", "Module", 0 },
-
- { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "Platform", "platform:x86", "", "x86", 0 },
- { "Platform", "platform:Itanium", "", "Itanium", 0 },
- { "Platform", "platform:x64", "", "x64", 0 },
- { "Platform", "platform:arm", "", "arm", 0 },
- { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred",
- 0 },
- { "Platform", "platform:anycpu", "", "anycpu", 0 },
-
- { "References", "reference:", "mit alias", "", 0 },
- { "References", "reference:", "dateiliste", "", 0 },
- { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
- { "", "link", "", "", 0 },
-
- { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "ApplicationManifest", "win32manifest:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
-
- { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue },
-
- { "DebugSymbols", "debug", "", "true", 0 },
- { "DebugSymbols", "debug-", "", "false", 0 },
- { "DebugSymbols", "debug+", "", "true", 0 },
-
- { "DebugType", "debug:none", "", "none", 0 },
- { "DebugType", "debug:full", "", "full", 0 },
- { "DebugType", "debug:pdbonly", "", "pdbonly", 0 },
-
- { "Optimize", "optimize", "", "true", 0 },
- { "Optimize", "optimize-", "", "false", 0 },
- { "Optimize", "optimize+", "", "true", 0 },
-
- { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 },
- { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 },
- { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 },
-
- { "WarningsAsErrors", "warnaserror", "", "", 0 },
- { "WarningsAsErrors", "warnaserror-", "", "", 0 },
- { "WarningsAsErrors", "warnaserror+", "", "", 0 },
-
- { "WarningLevel", "warn:0", "", "0", 0 },
- { "WarningLevel", "warn:1", "", "1", 0 },
- { "WarningLevel", "warn:2", "", "2", 0 },
- { "WarningLevel", "warn:3", "", "3", 0 },
- { "WarningLevel", "warn:4", "", "4", 0 },
- { "DisabledWarnings", "nowarn", "", "", 0 },
-
- { "CheckForOverflowUnderflow", "checked", "", "true", 0 },
- { "CheckForOverflowUnderflow", "checked-", "", "false", 0 },
- { "CheckForOverflowUnderflow", "checked+", "", "true", 0 },
-
- { "AllowUnsafeBlocks", "unsafe", "", "true", 0 },
- { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 },
- { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 },
-
- { "DefineConstants", "define:", "", "",
- cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue },
-
- { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 },
- { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 },
- { "LangVersion", "langversion:3", "", "3", 0 },
- { "LangVersion", "langversion:4", "", "4", 0 },
- { "LangVersion", "langversion:5", "", "5", 0 },
- { "LangVersion", "langversion:6", "", "6", 0 },
- { "LangVersion", "langversion:default", "", "default", 0 },
-
- { "DelaySign", "delaysign", "", "true", 0 },
- { "DelaySign", "delaysign-", "", "false", 0 },
- { "DelaySign", "delaysign+", "", "true", 0 },
-
- { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 },
-
- { "KeyContainerName", "keycontainer", "", "", 0 },
-
- { "NoLogo", "nologo", "", "", 0 },
-
- { "NoConfig", "noconfig", "", "true", 0 },
-
- { "BaseAddress", "baseaddress:", "", "", 0 },
-
- { "CodePage", "codepage", "", "", 0 },
-
- { "Utf8Output", "utf8output", "", "", 0 },
-
- { "MainEntryPoint", "main:", "", "", 0 },
-
- { "GenerateFullPaths", "fullpaths", "", "true", 0 },
-
- { "FileAlignment", "filealign", "", "", 0 },
-
- { "PdbFile", "pdb:", "", "", 0 },
-
- { "NoStandardLib", "nostdlib", "", "true", 0 },
- { "NoStandardLib", "nostdlib-", "", "false", 0 },
- { "NoStandardLib", "nostdlib+", "", "true", 0 },
-
- { "SubsystemVersion", "subsystemversion", "", "", 0 },
-
- { "AdditionalLibPaths", "lib:", "", "", 0 },
-
- { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 },
- { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 },
- { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 },
- { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 },
-
- { 0, 0, 0, 0, 0 },
-};
diff --git a/Source/cmVS11LibFlagTable.h b/Source/cmVS11LibFlagTable.h
deleted file mode 100644
index 15c8ddda3..000000000
--- a/Source/cmVS11LibFlagTable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-static cmVS7FlagTable cmVS11LibFlagTable[] = {
-
- // Enum Properties
- { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport",
- 0 },
-
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- // Bool Properties
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLibWarningAsErrors", "WX", "", "true", 0 },
- { "Verbose", "VERBOSE", "", "true", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- // Skip [AdditionalDependencies] - no command line Switch.
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "RemoveObjects", "REMOVE:", "Remove Objects", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "",
- cmVS7FlagTable::UserValue },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue },
- { "DisplayLibrary", "LIST:", "Display Library to standard output", "",
- cmVS7FlagTable::UserValue },
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- // Skip [TrackerLogDirectory] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS11LinkFlagTable.h b/Source/cmVS11LinkFlagTable.h
deleted file mode 100644
index 53f11392f..000000000
--- a/Source/cmVS11LinkFlagTable.h
+++ /dev/null
@@ -1,272 +0,0 @@
-static cmVS7FlagTable cmVS11LinkFlagTable[] = {
-
- // Enum Properties
- { "ShowProgress", "", "Not Set", "NotSet", 0 },
- { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose",
- 0 },
- { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib",
- 0 },
- { "ShowProgress", "VERBOSE:ICF",
- "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 },
- { "ShowProgress", "VERBOSE:REF",
- "About data removed during optimized linking", "LinkVerboseREF", 0 },
- { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH",
- "LinkVerboseSAFESEH", 0 },
- { "ShowProgress", "VERBOSE:CLR",
- "About linker activity related to managed code", "LinkVerboseCLR", 0 },
-
- { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 },
- { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only",
- "MultiplyDefinedSymbolOnly", 0 },
- { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only",
- "UndefinedSymbolOnly", 0 },
-
- { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only",
- "X86Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only",
- "X64Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only",
- "ItaniumImage", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 },
- { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable",
- "HighestAvailable", 0 },
- { "UACExecutionLevel", "level='requireAdministrator'",
- "requireAdministrator", "RequireAdministrator", 0 },
-
- { "SubSystem", "", "Not Set", "NotSet", 0 },
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- { "Driver", "", "Not Set", "NotSet", 0 },
- { "Driver", "Driver", "Driver", "Driver", 0 },
- { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 },
- { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 },
-
- { "LinkTimeCodeGeneration", "", "Default", "Default", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation",
- "UseLinkTimeCodeGeneration", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGInstrument",
- "Profile Guided Optimization - Instrument", "PGInstrument", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGOptimize",
- "Profile Guided Optimization - Optimization", "PGOptimization", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGUpdate",
- "Profile Guided Optimization - Update", "PGUpdate", 0 },
-
- { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 },
- { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 },
-
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "TargetMachine", "", "Not Set", "NotSet", 0 },
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute",
- "MTAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute",
- "STAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE",
- "Default threading attribute", "DefaultThreadingAttribute", 0 },
-
- { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage",
- 0 },
- { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image",
- "ForcePureILImage", 0 },
- { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image",
- "ForceSafeILImage", 0 },
- { "CLRImageType", "", "Default image type", "Default", 0 },
-
- { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report",
- "NoErrorReport", 0 },
-
- { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 },
- { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled",
- 0 },
- { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only",
- "SystemDlls", 0 },
-
- // Bool Properties
- { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 },
- { "LinkIncremental", "INCREMENTAL", "", "true", 0 },
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 },
- { "LinkStatus", "LTCG:STATUS", "", "true", 0 },
- { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 },
- { "PreventDllBinding", "ALLOWBIND", "", "true", 0 },
- { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "GenerateManifest", "MANIFEST:NO", "", "false", 0 },
- { "GenerateManifest", "MANIFEST", "", "true", 0 },
- { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACUIAccess", "uiAccess='false'", "", "false", 0 },
- { "UACUIAccess", "uiAccess='true'", "", "true", 0 },
-
- { "ManifestEmbed", "manifest:embed", "", "true", 0 },
- { "GenerateDebugInformation", "DEBUG", "", "true",
- cmVS7FlagTable::CaseInsensitive },
- { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 },
- { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 },
- { "TerminalServerAware", "TSAWARE", "", "true", 0 },
- { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 },
- { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 },
- { "OptimizeReferences", "OPT:NOREF", "", "false", 0 },
- { "OptimizeReferences", "OPT:REF", "", "true", 0 },
- { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 },
- { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 },
- { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 },
- { "AppContainer", "APPCONTAINER", "", "true", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 },
- { "NoEntryPoint", "NOENTRY", "", "true", 0 },
- { "SetChecksum", "RELEASE", "", "true", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 },
- { "FixedBaseAddress", "FIXED:NO", "", "false", 0 },
- { "FixedBaseAddress", "FIXED", "", "true", 0 },
- { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 },
- { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 },
- { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 },
- { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 },
- { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 },
- { "Profile", "PROFILE", "", "true", 0 },
- { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 },
- { "LinkDelaySign", "DELAYSIGN", "", "true", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 },
- { "DetectOneDefinitionRule", "ODR", "", "true", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 },
- { "LinkDLL", "DLL", "", "true", 0 },
-
- // Bool Properties With Argument
- { "EnableUAC", "MANIFESTUAC:", "", "",
- cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable },
- { "GenerateMapFile", "MAP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "MapFileName", "MAP:", "Generate Map File", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "EmbedManagedResourceFile",
- "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalManifestDependencies",
- "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ManifestInput", "manifestinput:", "Manifest Input", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue },
- { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "",
- cmVS7FlagTable::UserValue },
- { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "ModuleDefinitionFile", "DEF:", "Module Definition File", "",
- cmVS7FlagTable::UserValue },
- { "ManifestFile", "ManifestFile:", "Manifest File", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "",
- cmVS7FlagTable::UserValue },
- { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "",
- cmVS7FlagTable::UserValue },
- // Skip [MapFileName] - no command line Switch.
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [HeapCommitSize] - no command line Switch.
- { "StackReserveSize", "STACK:", "Stack Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [StackCommitSize] - no command line Switch.
- { "FunctionOrder", "ORDER:@", "Function Order", "",
- cmVS7FlagTable::UserValue },
- { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "",
- cmVS7FlagTable::UserValue },
- { "MidlCommandFile", "MIDL:@", "MIDL Commands", "",
- cmVS7FlagTable::UserValue },
- { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "",
- cmVS7FlagTable::UserValue },
- { "TypeLibraryFile", "TLBOUT:", "Type Library", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File",
- "", cmVS7FlagTable::UserValue },
- { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:",
- "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue },
- { "EntryPointSymbol", "ENTRY:", "Entry Point", "",
- cmVS7FlagTable::UserValue },
- { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue },
- { "ImportLibrary", "IMPLIB:", "Import Library", "",
- cmVS7FlagTable::UserValue },
- { "MergeSections", "MERGE:", "Merge Sections", "",
- cmVS7FlagTable::UserValue },
- { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue },
- { "KeyContainer", "KEYCONTAINER:", "Key Container", "",
- cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS11MASMFlagTable.h b/Source/cmVS11MASMFlagTable.h
deleted file mode 100644
index fdf8239da..000000000
--- a/Source/cmVS11MASMFlagTable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-static cmVS7FlagTable cmVS11MASMFlagTable[] = {
-
- // Enum Properties
- { "PreserveIdentifierCase", "", "Default", "0", 0 },
- { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1",
- 0 },
- { "PreserveIdentifierCase", "Cu",
- "Maps all identifiers to upper case. (/Cu)", "2", 0 },
- { "PreserveIdentifierCase", "Cx",
- "Preserves case in public and extern symbols. (/Cx)", "3", 0 },
-
- { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 },
- { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 },
- { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 },
- { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 },
-
- { "PackAlignmentBoundary", "", "Default", "0", 0 },
- { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 },
- { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 },
- { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 },
- { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 },
- { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 },
-
- { "CallingConvention", "", "Default", "0", 0 },
- { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1",
- 0 },
- { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2",
- 0 },
- { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 },
-
- { "ErrorReporting", "errorReport:prompt",
- "Prompt to send report immediately (/errorReport:prompt)", "0", 0 },
- { "ErrorReporting", "errorReport:queue",
- "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 },
- { "ErrorReporting", "errorReport:send",
- "Automatically send report (/errorReport:send)", "2", 0 },
- { "ErrorReporting", "errorReport:none",
- "Do not send report (/errorReport:none)", "3", 0 },
-
- // Bool Properties
- { "NoLogo", "nologo", "", "true", 0 },
- { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 },
- { "ListAllAvailableInformation", "Sa", "", "true", 0 },
- { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 },
- { "AddFirstPassListing", "Sf", "", "true", 0 },
- { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 },
- { "DisableSymbolTable", "Sn", "", "true", 0 },
- { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 },
- { "TreatWarningsAsErrors", "WX", "", "true", 0 },
- { "MakeAllSymbolsPublic", "Zf", "", "true", 0 },
- { "GenerateDebugInformation", "Zi", "", "true", 0 },
- { "EnableMASM51Compatibility", "Zm", "", "true", 0 },
- { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IncludePaths", "I", "Include Paths", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "BrowseFile", "FR", "Generate Browse Information File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
-
- // String Properties
- // Skip [Inputs] - no command line Switch.
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "",
- cmVS7FlagTable::UserValue },
- // Skip [CommandLineTemplate] - no command line Switch.
- // Skip [ExecutionDescription] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS11RCFlagTable.h b/Source/cmVS11RCFlagTable.h
deleted file mode 100644
index 4997fe115..000000000
--- a/Source/cmVS11RCFlagTable.h
+++ /dev/null
@@ -1,7 +0,0 @@
-static cmVS7FlagTable cmVS11RCFlagTable[] = {
- // Bool Properties
- { "NullTerminateStrings", "n", "", "true", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
-
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS12CLFlagTable.h b/Source/cmVS12CLFlagTable.h
deleted file mode 100644
index a4f251808..000000000
--- a/Source/cmVS12CLFlagTable.h
+++ /dev/null
@@ -1,222 +0,0 @@
-static cmVS7FlagTable cmVS12CLFlagTable[] = {
-
- // Enum Properties
- { "DebugInformationFormat", "", "None", "None", 0 },
- { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 },
- { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 },
- { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue",
- "EditAndContinue", 0 },
-
- { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 },
- { "WarningLevel", "W1", "Level1", "Level1", 0 },
- { "WarningLevel", "W2", "Level2", "Level2", 0 },
- { "WarningLevel", "W3", "Level3", "Level3", 0 },
- { "WarningLevel", "W4", "Level4", "Level4", 0 },
- { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 },
-
- { "Optimization", "", "Custom", "Custom", 0 },
- { "Optimization", "Od", "Disabled", "Disabled", 0 },
- { "Optimization", "O1", "Minimize Size", "MinSpace", 0 },
- { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 },
- { "Optimization", "Ox", "Full Optimization", "Full", 0 },
-
- { "InlineFunctionExpansion", "", "Default", "Default", 0 },
- { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 },
- { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline",
- 0 },
- { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 },
-
- { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 },
- { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 },
- { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 },
-
- { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 },
- { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 },
- { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow",
- 0 },
- { "ExceptionHandling", "", "No", "false", 0 },
-
- { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck",
- 0 },
- { "BasicRuntimeChecks", "RTCu", "Uninitialized variables",
- "UninitializedLocalUsageCheck", 0 },
- { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)",
- "EnableFastChecks", 0 },
- { "BasicRuntimeChecks", "", "Default", "Default", 0 },
-
- { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 },
- { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 },
- { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 },
- { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL",
- "MultiThreadedDebugDLL", 0 },
-
- { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 },
- { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 },
- { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 },
- { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 },
- { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 },
- { "StructMemberAlignment", "", "Default", "Default", 0 },
-
- { "BufferSecurityCheck", "GS-", "Disable Security Check", "false", 0 },
- { "BufferSecurityCheck", "GS", "Enable Security Check", "true", 0 },
-
- { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions",
- "StreamingSIMDExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2",
- "StreamingSIMDExtensions2", 0 },
- { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions",
- "AdvancedVectorExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions",
- "NoExtensions", 0 },
- { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 },
-
- { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 },
- { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 },
- { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 },
-
- { "PrecompiledHeader", "Yc", "Create", "Create",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Yu", "Use", "Use",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
- 0 },
-
- { "AssemblerOutput", "", "No Listing", "NoListing", 0 },
- { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
- { "AssemblerOutput", "FAc", "Assembly With Machine Code",
- "AssemblyAndMachineCode", 0 },
- { "AssemblerOutput", "FAs", "Assembly With Source Code",
- "AssemblyAndSourceCode", 0 },
- { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 },
-
- { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 },
- { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 },
- { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 },
- { "CallingConvention", "Gv", "__vectorcall", "VectorCall", 0 },
-
- { "CompileAs", "", "Default", "Default", 0 },
- { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 },
- { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 },
-
- { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 },
- { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt",
- 0 },
- { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue",
- 0 },
- { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 },
-
- { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 },
- { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 },
- { "CompileAsManaged", "clr:pure",
- "Pure MSIL Common Language RunTime Support", "Pure", 0 },
- { "CompileAsManaged", "clr:safe",
- "Safe MSIL Common Language RunTime Support", "Safe", 0 },
- { "CompileAsManaged", "clr:oldSyntax",
- "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 },
-
- // Bool Properties
- { "CompileAsWinRT", "ZW", "", "true", 0 },
- { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
- { "TreatWarningAsError", "WX-", "", "false", 0 },
- { "TreatWarningAsError", "WX", "", "true", 0 },
- { "SDLCheck", "sdl-", "", "false", 0 },
- { "SDLCheck", "sdl", "", "true", 0 },
- { "IntrinsicFunctions", "Oi", "", "true", 0 },
- { "OmitFramePointers", "Oy-", "", "false", 0 },
- { "OmitFramePointers", "Oy", "", "true", 0 },
- { "EnableFiberSafeOptimizations", "GT", "", "true", 0 },
- { "WholeProgramOptimization", "GL", "", "true", 0 },
- { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 },
- { "IgnoreStandardIncludePath", "X", "", "true", 0 },
- { "PreprocessToFile", "P", "", "true", 0 },
- { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 },
- { "PreprocessKeepComments", "C", "", "true", 0 },
- { "StringPooling", "GF-", "", "false", 0 },
- { "StringPooling", "GF", "", "true", 0 },
- { "MinimalRebuild", "Gm-", "", "false", 0 },
- { "MinimalRebuild", "Gm", "", "true", 0 },
- { "SmallerTypeCheck", "RTCc", "", "true", 0 },
- { "FunctionLevelLinking", "Gy-", "", "false", 0 },
- { "FunctionLevelLinking", "Gy", "", "true", 0 },
- { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 },
- { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 },
- { "FloatingPointExceptions", "fp:except-", "", "false", 0 },
- { "FloatingPointExceptions", "fp:except", "", "true", 0 },
- { "CreateHotpatchableImage", "hotpatch", "", "true", 0 },
- { "DisableLanguageExtensions", "Za", "", "true", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
- { "RuntimeTypeInfo", "GR-", "", "false", 0 },
- { "RuntimeTypeInfo", "GR", "", "true", 0 },
- { "OpenMPSupport", "openmp-", "", "false", 0 },
- { "OpenMPSupport", "openmp", "", "true", 0 },
- { "ExpandAttributedSource", "Fx", "", "true", 0 },
- { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 },
- { "ShowIncludes", "showIncludes", "", "true", 0 },
- { "EnablePREfast", "analyze-", "", "false", 0 },
- { "EnablePREfast", "analyze", "", "true", 0 },
- { "UseFullPaths", "FC", "", "true", 0 },
- { "OmitDefaultLibName", "Zl", "", "true", 0 },
-
- // Bool Properties With Argument
- { "MultiProcessorCompilation", "MP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "ProcessorNumber", "MP", "Multi-processor Compilation", "",
- cmVS7FlagTable::UserValueRequired },
- { "GenerateXMLDocumentationFiles", "doc", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "",
- cmVS7FlagTable::UserValueRequired },
- { "BrowseInformation", "FR", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "BrowseInformationFile", "FR", "Enable Browse Information", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "UndefinePreprocessorDefinitions", "U",
- "Undefine Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedIncludeFiles", "FI", "Forced Include File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedUsingFiles", "FU", "Forced #using File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PREfastLog", "analyze:log", "Code Analysis Log", "",
- cmVS7FlagTable::UserFollowing },
- { "PREfastAdditionalPlugins", "analyze:plugin",
- "Additional Code Analysis Native plugins", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "",
- cmVS7FlagTable::UserValue },
- { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "",
- cmVS7FlagTable::UserValue },
- { "AssemblerListingLocation", "Fa", "ASM List Location", "",
- cmVS7FlagTable::UserValue },
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [XMLDocumentationFileName] - no command line Switch.
- // Skip [BrowseInformationFile] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS12CSharpFlagTable.h b/Source/cmVS12CSharpFlagTable.h
deleted file mode 100644
index 0370499db..000000000
--- a/Source/cmVS12CSharpFlagTable.h
+++ /dev/null
@@ -1,121 +0,0 @@
-static cmVS7FlagTable cmVS12CSharpFlagTable[] = {
- { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "OutputType", "target:exe", "", "Exe", 0 },
- { "OutputType", "target:winexe", "", "Winexe", 0 },
- { "OutputType", "target:library", "", "Library", 0 },
- { "OutputType", "target:module", "", "Module", 0 },
-
- { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "Platform", "platform:x86", "", "x86", 0 },
- { "Platform", "platform:Itanium", "", "Itanium", 0 },
- { "Platform", "platform:x64", "", "x64", 0 },
- { "Platform", "platform:arm", "", "arm", 0 },
- { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred",
- 0 },
- { "Platform", "platform:anycpu", "", "anycpu", 0 },
-
- { "References", "reference:", "mit alias", "", 0 },
- { "References", "reference:", "dateiliste", "", 0 },
- { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
- { "", "link", "", "", 0 },
-
- { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "ApplicationManifest", "win32manifest:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
-
- { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue },
-
- { "DebugSymbols", "debug", "", "true", 0 },
- { "DebugSymbols", "debug-", "", "false", 0 },
- { "DebugSymbols", "debug+", "", "true", 0 },
-
- { "DebugType", "debug:none", "", "none", 0 },
- { "DebugType", "debug:full", "", "full", 0 },
- { "DebugType", "debug:pdbonly", "", "pdbonly", 0 },
-
- { "Optimize", "optimize", "", "true", 0 },
- { "Optimize", "optimize-", "", "false", 0 },
- { "Optimize", "optimize+", "", "true", 0 },
-
- { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 },
- { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 },
- { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 },
-
- { "WarningsAsErrors", "warnaserror", "", "", 0 },
- { "WarningsAsErrors", "warnaserror-", "", "", 0 },
- { "WarningsAsErrors", "warnaserror+", "", "", 0 },
-
- { "WarningLevel", "warn:0", "", "0", 0 },
- { "WarningLevel", "warn:1", "", "1", 0 },
- { "WarningLevel", "warn:2", "", "2", 0 },
- { "WarningLevel", "warn:3", "", "3", 0 },
- { "WarningLevel", "warn:4", "", "4", 0 },
- { "DisabledWarnings", "nowarn", "", "", 0 },
-
- { "CheckForOverflowUnderflow", "checked", "", "true", 0 },
- { "CheckForOverflowUnderflow", "checked-", "", "false", 0 },
- { "CheckForOverflowUnderflow", "checked+", "", "true", 0 },
-
- { "AllowUnsafeBlocks", "unsafe", "", "true", 0 },
- { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 },
- { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 },
-
- { "DefineConstants", "define:", "", "",
- cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue },
-
- { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 },
- { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 },
- { "LangVersion", "langversion:3", "", "3", 0 },
- { "LangVersion", "langversion:4", "", "4", 0 },
- { "LangVersion", "langversion:5", "", "5", 0 },
- { "LangVersion", "langversion:6", "", "6", 0 },
- { "LangVersion", "langversion:default", "", "default", 0 },
-
- { "DelaySign", "delaysign", "", "true", 0 },
- { "DelaySign", "delaysign-", "", "false", 0 },
- { "DelaySign", "delaysign+", "", "true", 0 },
-
- { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 },
-
- { "KeyContainerName", "keycontainer", "", "", 0 },
-
- { "NoLogo", "nologo", "", "", 0 },
-
- { "NoConfig", "noconfig", "", "true", 0 },
-
- { "BaseAddress", "baseaddress:", "", "", 0 },
-
- { "CodePage", "codepage", "", "", 0 },
-
- { "Utf8Output", "utf8output", "", "", 0 },
-
- { "MainEntryPoint", "main:", "", "", 0 },
-
- { "GenerateFullPaths", "fullpaths", "", "true", 0 },
-
- { "FileAlignment", "filealign", "", "", 0 },
-
- { "PdbFile", "pdb:", "", "", 0 },
-
- { "NoStandardLib", "nostdlib", "", "true", 0 },
- { "NoStandardLib", "nostdlib-", "", "false", 0 },
- { "NoStandardLib", "nostdlib+", "", "true", 0 },
-
- { "SubsystemVersion", "subsystemversion", "", "", 0 },
-
- { "AdditionalLibPaths", "lib:", "", "", 0 },
-
- { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 },
- { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 },
- { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 },
- { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 },
-
- { 0, 0, 0, 0, 0 },
-};
diff --git a/Source/cmVS12LibFlagTable.h b/Source/cmVS12LibFlagTable.h
deleted file mode 100644
index 2229b97da..000000000
--- a/Source/cmVS12LibFlagTable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-static cmVS7FlagTable cmVS12LibFlagTable[] = {
-
- // Enum Properties
- { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport",
- 0 },
-
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- // Bool Properties
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLibWarningAsErrors", "WX", "", "true", 0 },
- { "Verbose", "VERBOSE", "", "true", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- // Skip [AdditionalDependencies] - no command line Switch.
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "RemoveObjects", "REMOVE:", "Remove Objects", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "",
- cmVS7FlagTable::UserValue },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue },
- { "DisplayLibrary", "LIST:", "Display Library to standard output", "",
- cmVS7FlagTable::UserValue },
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- // Skip [TrackerLogDirectory] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS12LinkFlagTable.h b/Source/cmVS12LinkFlagTable.h
deleted file mode 100644
index ddc3ea191..000000000
--- a/Source/cmVS12LinkFlagTable.h
+++ /dev/null
@@ -1,272 +0,0 @@
-static cmVS7FlagTable cmVS12LinkFlagTable[] = {
-
- // Enum Properties
- { "ShowProgress", "", "Not Set", "NotSet", 0 },
- { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose",
- 0 },
- { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib",
- 0 },
- { "ShowProgress", "VERBOSE:ICF",
- "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 },
- { "ShowProgress", "VERBOSE:REF",
- "About data removed during optimized linking", "LinkVerboseREF", 0 },
- { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH",
- "LinkVerboseSAFESEH", 0 },
- { "ShowProgress", "VERBOSE:CLR",
- "About linker activity related to managed code", "LinkVerboseCLR", 0 },
-
- { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 },
- { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only",
- "MultiplyDefinedSymbolOnly", 0 },
- { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only",
- "UndefinedSymbolOnly", 0 },
-
- { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only",
- "X86Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only",
- "X64Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only",
- "ItaniumImage", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 },
- { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable",
- "HighestAvailable", 0 },
- { "UACExecutionLevel", "level='requireAdministrator'",
- "requireAdministrator", "RequireAdministrator", 0 },
-
- { "SubSystem", "", "Not Set", "NotSet", 0 },
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- { "Driver", "", "Not Set", "NotSet", 0 },
- { "Driver", "Driver", "Driver", "Driver", 0 },
- { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 },
- { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 },
-
- { "LinkTimeCodeGeneration", "", "Default", "Default", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation",
- "UseLinkTimeCodeGeneration", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGInstrument",
- "Profile Guided Optimization - Instrument", "PGInstrument", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGOptimize",
- "Profile Guided Optimization - Optimization", "PGOptimization", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGUpdate",
- "Profile Guided Optimization - Update", "PGUpdate", 0 },
-
- { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 },
- { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 },
-
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "TargetMachine", "", "Not Set", "NotSet", 0 },
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute",
- "MTAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute",
- "STAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE",
- "Default threading attribute", "DefaultThreadingAttribute", 0 },
-
- { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage",
- 0 },
- { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image",
- "ForcePureILImage", 0 },
- { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image",
- "ForceSafeILImage", 0 },
- { "CLRImageType", "", "Default image type", "Default", 0 },
-
- { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report",
- "NoErrorReport", 0 },
-
- { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 },
- { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled",
- 0 },
- { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only",
- "SystemDlls", 0 },
-
- // Bool Properties
- { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 },
- { "LinkIncremental", "INCREMENTAL", "", "true", 0 },
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 },
- { "LinkStatus", "LTCG:STATUS", "", "true", 0 },
- { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 },
- { "PreventDllBinding", "ALLOWBIND", "", "true", 0 },
- { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "GenerateManifest", "MANIFEST:NO", "", "false", 0 },
- { "GenerateManifest", "MANIFEST", "", "true", 0 },
- { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACUIAccess", "uiAccess='false'", "", "false", 0 },
- { "UACUIAccess", "uiAccess='true'", "", "true", 0 },
-
- { "ManifestEmbed", "manifest:embed", "", "true", 0 },
- { "GenerateDebugInformation", "DEBUG", "", "true",
- cmVS7FlagTable::CaseInsensitive },
- { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 },
- { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 },
- { "TerminalServerAware", "TSAWARE", "", "true", 0 },
- { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 },
- { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 },
- { "OptimizeReferences", "OPT:NOREF", "", "false", 0 },
- { "OptimizeReferences", "OPT:REF", "", "true", 0 },
- { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 },
- { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 },
- { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 },
- { "AppContainer", "APPCONTAINER", "", "true", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 },
- { "NoEntryPoint", "NOENTRY", "", "true", 0 },
- { "SetChecksum", "RELEASE", "", "true", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 },
- { "FixedBaseAddress", "FIXED:NO", "", "false", 0 },
- { "FixedBaseAddress", "FIXED", "", "true", 0 },
- { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 },
- { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 },
- { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 },
- { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 },
- { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 },
- { "Profile", "PROFILE", "", "true", 0 },
- { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 },
- { "LinkDelaySign", "DELAYSIGN", "", "true", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 },
- { "DetectOneDefinitionRule", "ODR", "", "true", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 },
- { "LinkDLL", "DLL", "", "true", 0 },
-
- // Bool Properties With Argument
- { "EnableUAC", "MANIFESTUAC:", "", "",
- cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable },
- { "GenerateMapFile", "MAP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "MapFileName", "MAP:", "Generate Map File", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "EmbedManagedResourceFile",
- "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalManifestDependencies",
- "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ManifestInput", "manifestinput:", "Manifest Input", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue },
- { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "",
- cmVS7FlagTable::UserValue },
- { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "ModuleDefinitionFile", "DEF:", "Module Definition File", "",
- cmVS7FlagTable::UserValue },
- { "ManifestFile", "ManifestFile:", "Manifest File", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "",
- cmVS7FlagTable::UserValue },
- { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "",
- cmVS7FlagTable::UserValue },
- // Skip [MapFileName] - no command line Switch.
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [HeapCommitSize] - no command line Switch.
- { "StackReserveSize", "STACK:", "Stack Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [StackCommitSize] - no command line Switch.
- { "FunctionOrder", "ORDER:@", "Function Order", "",
- cmVS7FlagTable::UserValue },
- { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "",
- cmVS7FlagTable::UserValue },
- { "MidlCommandFile", "MIDL:@", "MIDL Commands", "",
- cmVS7FlagTable::UserValue },
- { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "",
- cmVS7FlagTable::UserValue },
- { "TypeLibraryFile", "TLBOUT:", "Type Library", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File",
- "", cmVS7FlagTable::UserValue },
- { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:",
- "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue },
- { "EntryPointSymbol", "ENTRY:", "Entry Point", "",
- cmVS7FlagTable::UserValue },
- { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue },
- { "ImportLibrary", "IMPLIB:", "Import Library", "",
- cmVS7FlagTable::UserValue },
- { "MergeSections", "MERGE:", "Merge Sections", "",
- cmVS7FlagTable::UserValue },
- { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue },
- { "KeyContainer", "KEYCONTAINER:", "Key Container", "",
- cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS12MASMFlagTable.h b/Source/cmVS12MASMFlagTable.h
deleted file mode 100644
index acc0d48e1..000000000
--- a/Source/cmVS12MASMFlagTable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-static cmVS7FlagTable cmVS12MASMFlagTable[] = {
-
- // Enum Properties
- { "PreserveIdentifierCase", "", "Default", "0", 0 },
- { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1",
- 0 },
- { "PreserveIdentifierCase", "Cu",
- "Maps all identifiers to upper case. (/Cu)", "2", 0 },
- { "PreserveIdentifierCase", "Cx",
- "Preserves case in public and extern symbols. (/Cx)", "3", 0 },
-
- { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 },
- { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 },
- { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 },
- { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 },
-
- { "PackAlignmentBoundary", "", "Default", "0", 0 },
- { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 },
- { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 },
- { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 },
- { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 },
- { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 },
-
- { "CallingConvention", "", "Default", "0", 0 },
- { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1",
- 0 },
- { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2",
- 0 },
- { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 },
-
- { "ErrorReporting", "errorReport:prompt",
- "Prompt to send report immediately (/errorReport:prompt)", "0", 0 },
- { "ErrorReporting", "errorReport:queue",
- "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 },
- { "ErrorReporting", "errorReport:send",
- "Automatically send report (/errorReport:send)", "2", 0 },
- { "ErrorReporting", "errorReport:none",
- "Do not send report (/errorReport:none)", "3", 0 },
-
- // Bool Properties
- { "NoLogo", "nologo", "", "true", 0 },
- { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 },
- { "ListAllAvailableInformation", "Sa", "", "true", 0 },
- { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 },
- { "AddFirstPassListing", "Sf", "", "true", 0 },
- { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 },
- { "DisableSymbolTable", "Sn", "", "true", 0 },
- { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 },
- { "TreatWarningsAsErrors", "WX", "", "true", 0 },
- { "MakeAllSymbolsPublic", "Zf", "", "true", 0 },
- { "GenerateDebugInformation", "Zi", "", "true", 0 },
- { "EnableMASM51Compatibility", "Zm", "", "true", 0 },
- { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IncludePaths", "I", "Include Paths", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "BrowseFile", "FR", "Generate Browse Information File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
-
- // String Properties
- // Skip [Inputs] - no command line Switch.
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "",
- cmVS7FlagTable::UserValue },
- // Skip [CommandLineTemplate] - no command line Switch.
- // Skip [ExecutionDescription] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS12RCFlagTable.h b/Source/cmVS12RCFlagTable.h
deleted file mode 100644
index a650f8522..000000000
--- a/Source/cmVS12RCFlagTable.h
+++ /dev/null
@@ -1,7 +0,0 @@
-static cmVS7FlagTable cmVS12RCFlagTable[] = {
- // Bool Properties
- { "NullTerminateStrings", "n", "", "true", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
-
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS140CLFlagTable.h b/Source/cmVS140CLFlagTable.h
deleted file mode 100644
index 2b89042c8..000000000
--- a/Source/cmVS140CLFlagTable.h
+++ /dev/null
@@ -1,240 +0,0 @@
-static cmVS7FlagTable cmVS140CLFlagTable[] = {
-
- // Enum Properties
- { "DebugInformationFormat", "", "None", "None", 0 },
- { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 },
- { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 },
- { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue",
- "EditAndContinue", 0 },
-
- { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 },
- { "WarningLevel", "W1", "Level1", "Level1", 0 },
- { "WarningLevel", "W2", "Level2", "Level2", 0 },
- { "WarningLevel", "W3", "Level3", "Level3", 0 },
- { "WarningLevel", "W4", "Level4", "Level4", 0 },
- { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 },
-
- { "Optimization", "", "Custom", "Custom", 0 },
- { "Optimization", "Od", "Disabled", "Disabled", 0 },
- { "Optimization", "O1", "Minimize Size", "MinSpace", 0 },
- { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 },
- { "Optimization", "Ox", "Full Optimization", "Full", 0 },
-
- { "InlineFunctionExpansion", "", "Default", "Default", 0 },
- { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 },
- { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline",
- 0 },
- { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 },
-
- { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 },
- { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 },
- { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 },
-
- { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 },
- { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 },
- { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow",
- 0 },
- { "ExceptionHandling", "", "No", "false", 0 },
-
- { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck",
- 0 },
- { "BasicRuntimeChecks", "RTCu", "Uninitialized variables",
- "UninitializedLocalUsageCheck", 0 },
- { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)",
- "EnableFastChecks", 0 },
- { "BasicRuntimeChecks", "", "Default", "Default", 0 },
-
- { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 },
- { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 },
- { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 },
- { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL",
- "MultiThreadedDebugDLL", 0 },
-
- { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 },
- { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 },
- { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 },
- { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 },
- { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 },
- { "StructMemberAlignment", "", "Default", "Default", 0 },
-
- { "BufferSecurityCheck", "GS-", "Disable Security Check", "false", 0 },
- { "BufferSecurityCheck", "GS", "Enable Security Check", "true", 0 },
-
- { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions",
- "StreamingSIMDExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2",
- "StreamingSIMDExtensions2", 0 },
- { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions",
- "AdvancedVectorExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:AVX2",
- "Advanced Vector Extensions 2", "AdvancedVectorExtensions2", 0 },
- { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions",
- "NoExtensions", 0 },
- { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 },
-
- { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 },
- { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 },
- { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 },
-
- { "PrecompiledHeader", "Yc", "Create", "Create",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Yu", "Use", "Use",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
- 0 },
-
- { "AssemblerOutput", "", "No Listing", "NoListing", 0 },
- { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
- { "AssemblerOutput", "FAc", "Assembly With Machine Code",
- "AssemblyAndMachineCode", 0 },
- { "AssemblerOutput", "FAs", "Assembly With Source Code",
- "AssemblyAndSourceCode", 0 },
- { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 },
-
- { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 },
- { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 },
- { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 },
- { "CallingConvention", "Gv", "__vectorcall", "VectorCall", 0 },
-
- { "CompileAs", "", "Default", "Default", 0 },
- { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 },
- { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 },
-
- { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 },
- { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt",
- 0 },
- { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue",
- 0 },
- { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 },
-
- { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 },
- { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 },
- { "CompileAsManaged", "clr:pure",
- "Pure MSIL Common Language RunTime Support", "Pure", 0 },
- { "CompileAsManaged", "clr:safe",
- "Safe MSIL Common Language RunTime Support", "Safe", 0 },
- { "CompileAsManaged", "clr:oldSyntax",
- "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 },
-
- { "CppLanguageStandard", "", "Default", "Default", 0 },
- { "CppLanguageStandard", "std=c++98", "C++03", "c++98", 0 },
- { "CppLanguageStandard", "std=c++11", "C++11", "c++11", 0 },
- { "CppLanguageStandard", "std=c++1y", "C++14", "c++1y", 0 },
- { "CppLanguageStandard", "std=c++14", "C++14", "c++1y", 0 },
- { "CppLanguageStandard", "std=gnu++98", "C++03 (GNU Dialect)", "gnu++98",
- 0 },
- { "CppLanguageStandard", "std=gnu++11", "C++11 (GNU Dialect)", "gnu++11",
- 0 },
- { "CppLanguageStandard", "std=gnu++1y", "C++14 (GNU Dialect)", "gnu++1y",
- 0 },
- { "CppLanguageStandard", "std=gnu++14", "C++14 (GNU Dialect)", "gnu++1y",
- 0 },
-
- // Bool Properties
- { "CompileAsWinRT", "ZW", "", "true", 0 },
- { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
- { "TreatWarningAsError", "WX-", "", "false", 0 },
- { "TreatWarningAsError", "WX", "", "true", 0 },
- { "SDLCheck", "sdl-", "", "false", 0 },
- { "SDLCheck", "sdl", "", "true", 0 },
- { "IntrinsicFunctions", "Oi", "", "true", 0 },
- { "OmitFramePointers", "Oy-", "", "false", 0 },
- { "OmitFramePointers", "Oy", "", "true", 0 },
- { "EnableFiberSafeOptimizations", "GT", "", "true", 0 },
- { "WholeProgramOptimization", "GL", "", "true", 0 },
- { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 },
- { "IgnoreStandardIncludePath", "X", "", "true", 0 },
- { "PreprocessToFile", "P", "", "true", 0 },
- { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 },
- { "PreprocessKeepComments", "C", "", "true", 0 },
- { "StringPooling", "GF-", "", "false", 0 },
- { "StringPooling", "GF", "", "true", 0 },
- { "MinimalRebuild", "Gm-", "", "false", 0 },
- { "MinimalRebuild", "Gm", "", "true", 0 },
- { "SmallerTypeCheck", "RTCc", "", "true", 0 },
- { "FunctionLevelLinking", "Gy-", "", "false", 0 },
- { "FunctionLevelLinking", "Gy", "", "true", 0 },
- { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 },
- { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 },
- { "FloatingPointExceptions", "fp:except-", "", "false", 0 },
- { "FloatingPointExceptions", "fp:except", "", "true", 0 },
- { "CreateHotpatchableImage", "hotpatch", "", "true", 0 },
- { "DisableLanguageExtensions", "Za", "", "true", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
- { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 },
- { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 },
- { "RuntimeTypeInfo", "GR-", "", "false", 0 },
- { "RuntimeTypeInfo", "GR", "", "true", 0 },
- { "OpenMPSupport", "openmp-", "", "false", 0 },
- { "OpenMPSupport", "openmp", "", "true", 0 },
- { "ExpandAttributedSource", "Fx", "", "true", 0 },
- { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 },
- { "ShowIncludes", "showIncludes", "", "true", 0 },
- { "EnablePREfast", "analyze-", "", "false", 0 },
- { "EnablePREfast", "analyze", "", "true", 0 },
- { "UseFullPaths", "FC", "", "true", 0 },
- { "OmitDefaultLibName", "Zl", "", "true", 0 },
-
- // Bool Properties With Argument
- { "MultiProcessorCompilation", "MP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "ProcessorNumber", "MP", "Multi-processor Compilation", "",
- cmVS7FlagTable::UserValueRequired },
- { "GenerateXMLDocumentationFiles", "doc", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "",
- cmVS7FlagTable::UserValueRequired },
- { "BrowseInformation", "FR", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "BrowseInformationFile", "FR", "Enable Browse Information", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "UndefinePreprocessorDefinitions", "U",
- "Undefine Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedIncludeFiles", "FI", "Forced Include File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedUsingFiles", "FU", "Forced #using File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PREfastLog", "analyze:log", "Code Analysis Log", "",
- cmVS7FlagTable::UserFollowing },
- { "PREfastAdditionalPlugins", "analyze:plugin",
- "Additional Code Analysis Native plugins", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "",
- cmVS7FlagTable::UserValue },
- { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "",
- cmVS7FlagTable::UserValue },
- { "AssemblerListingLocation", "Fa", "ASM List Location", "",
- cmVS7FlagTable::UserValue },
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [XMLDocumentationFileName] - no command line Switch.
- // Skip [BrowseInformationFile] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS140CSharpFlagTable.h b/Source/cmVS140CSharpFlagTable.h
deleted file mode 100644
index f695f4582..000000000
--- a/Source/cmVS140CSharpFlagTable.h
+++ /dev/null
@@ -1,121 +0,0 @@
-static cmVS7FlagTable cmVS140CSharpFlagTable[] = {
- { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "OutputType", "target:exe", "", "Exe", 0 },
- { "OutputType", "target:winexe", "", "Winexe", 0 },
- { "OutputType", "target:library", "", "Library", 0 },
- { "OutputType", "target:module", "", "Module", 0 },
-
- { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "Platform", "platform:x86", "", "x86", 0 },
- { "Platform", "platform:Itanium", "", "Itanium", 0 },
- { "Platform", "platform:x64", "", "x64", 0 },
- { "Platform", "platform:arm", "", "arm", 0 },
- { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred",
- 0 },
- { "Platform", "platform:anycpu", "", "anycpu", 0 },
-
- { "References", "reference:", "mit alias", "", 0 },
- { "References", "reference:", "dateiliste", "", 0 },
- { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
- { "", "link", "", "", 0 },
-
- { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "ApplicationManifest", "win32manifest:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
-
- { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue },
-
- { "DebugSymbols", "debug", "", "true", 0 },
- { "DebugSymbols", "debug-", "", "false", 0 },
- { "DebugSymbols", "debug+", "", "true", 0 },
-
- { "DebugType", "debug:none", "", "none", 0 },
- { "DebugType", "debug:full", "", "full", 0 },
- { "DebugType", "debug:pdbonly", "", "pdbonly", 0 },
-
- { "Optimize", "optimize", "", "true", 0 },
- { "Optimize", "optimize-", "", "false", 0 },
- { "Optimize", "optimize+", "", "true", 0 },
-
- { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 },
- { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 },
- { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 },
-
- { "WarningsAsErrors", "warnaserror", "", "", 0 },
- { "WarningsAsErrors", "warnaserror-", "", "", 0 },
- { "WarningsAsErrors", "warnaserror+", "", "", 0 },
-
- { "WarningLevel", "warn:0", "", "0", 0 },
- { "WarningLevel", "warn:1", "", "1", 0 },
- { "WarningLevel", "warn:2", "", "2", 0 },
- { "WarningLevel", "warn:3", "", "3", 0 },
- { "WarningLevel", "warn:4", "", "4", 0 },
- { "DisabledWarnings", "nowarn", "", "", 0 },
-
- { "CheckForOverflowUnderflow", "checked", "", "true", 0 },
- { "CheckForOverflowUnderflow", "checked-", "", "false", 0 },
- { "CheckForOverflowUnderflow", "checked+", "", "true", 0 },
-
- { "AllowUnsafeBlocks", "unsafe", "", "true", 0 },
- { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 },
- { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 },
-
- { "DefineConstants", "define:", "", "",
- cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue },
-
- { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 },
- { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 },
- { "LangVersion", "langversion:3", "", "3", 0 },
- { "LangVersion", "langversion:4", "", "4", 0 },
- { "LangVersion", "langversion:5", "", "5", 0 },
- { "LangVersion", "langversion:6", "", "6", 0 },
- { "LangVersion", "langversion:default", "", "default", 0 },
-
- { "DelaySign", "delaysign", "", "true", 0 },
- { "DelaySign", "delaysign-", "", "false", 0 },
- { "DelaySign", "delaysign+", "", "true", 0 },
-
- { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 },
-
- { "KeyContainerName", "keycontainer", "", "", 0 },
-
- { "NoLogo", "nologo", "", "", 0 },
-
- { "NoConfig", "noconfig", "", "true", 0 },
-
- { "BaseAddress", "baseaddress:", "", "", 0 },
-
- { "CodePage", "codepage", "", "", 0 },
-
- { "Utf8Output", "utf8output", "", "", 0 },
-
- { "MainEntryPoint", "main:", "", "", 0 },
-
- { "GenerateFullPaths", "fullpaths", "", "true", 0 },
-
- { "FileAlignment", "filealign", "", "", 0 },
-
- { "PdbFile", "pdb:", "", "", 0 },
-
- { "NoStandardLib", "nostdlib", "", "true", 0 },
- { "NoStandardLib", "nostdlib-", "", "false", 0 },
- { "NoStandardLib", "nostdlib+", "", "true", 0 },
-
- { "SubsystemVersion", "subsystemversion", "", "", 0 },
-
- { "AdditionalLibPaths", "lib:", "", "", 0 },
-
- { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 },
- { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 },
- { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 },
- { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 },
-
- { 0, 0, 0, 0, 0 },
-};
diff --git a/Source/cmVS140LinkFlagTable.h b/Source/cmVS140LinkFlagTable.h
deleted file mode 100644
index fe0315386..000000000
--- a/Source/cmVS140LinkFlagTable.h
+++ /dev/null
@@ -1,285 +0,0 @@
-static cmVS7FlagTable cmVS140LinkFlagTable[] = {
-
- // Enum Properties
- { "ShowProgress", "", "Not Set", "NotSet", 0 },
- { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose",
- 0 },
- { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib",
- 0 },
- { "ShowProgress", "VERBOSE:ICF",
- "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 },
- { "ShowProgress", "VERBOSE:REF",
- "About data removed during optimized linking", "LinkVerboseREF", 0 },
- { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH",
- "LinkVerboseSAFESEH", 0 },
- { "ShowProgress", "VERBOSE:CLR",
- "About linker activity related to managed code", "LinkVerboseCLR", 0 },
-
- { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 },
- { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only",
- "MultiplyDefinedSymbolOnly", 0 },
- { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only",
- "UndefinedSymbolOnly", 0 },
-
- { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only",
- "X86Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only",
- "X64Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only",
- "ItaniumImage", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 },
- { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable",
- "HighestAvailable", 0 },
- { "UACExecutionLevel", "level='requireAdministrator'",
- "requireAdministrator", "RequireAdministrator", 0 },
-
- { "GenerateDebugInformation", "DEBUG:FASTLINK",
- "Optimize for faster linking", "DebugFastLink",
- cmVS7FlagTable::CaseInsensitive },
- { "GenerateDebugInformation", "DEBUG:FULL", "Optimize for debugging", "true",
- cmVS7FlagTable::CaseInsensitive },
- { "GenerateDebugInformation", "DEBUG:NONE",
- "Produces no debugging information", "false",
- cmVS7FlagTable::CaseInsensitive },
- { "GenerateDebugInformation", "DEBUG", "Optimize for debugging", "true",
- cmVS7FlagTable::CaseInsensitive },
-
- { "SubSystem", "", "Not Set", "NotSet", 0 },
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- { "Driver", "", "Not Set", "NotSet", 0 },
- { "Driver", "Driver", "Driver", "Driver", 0 },
- { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 },
- { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 },
-
- { "LinkTimeCodeGeneration", "", "Default", "Default", 0 },
- { "LinkTimeCodeGeneration", "LTCG:incremental",
- "Use Fast Link Time Code Generation", "UseFastLinkTimeCodeGeneration", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation",
- "UseLinkTimeCodeGeneration", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGInstrument",
- "Profile Guided Optimization - Instrument", "PGInstrument", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGOptimize",
- "Profile Guided Optimization - Optimization", "PGOptimization", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGUpdate",
- "Profile Guided Optimization - Update", "PGUpdate", 0 },
-
- { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 },
- { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 },
-
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "TargetMachine", "", "Not Set", "NotSet", 0 },
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute",
- "MTAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute",
- "STAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE",
- "Default threading attribute", "DefaultThreadingAttribute", 0 },
-
- { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage",
- 0 },
- { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image",
- "ForcePureILImage", 0 },
- { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image",
- "ForceSafeILImage", 0 },
- { "CLRImageType", "", "Default image type", "Default", 0 },
-
- { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report",
- "NoErrorReport", 0 },
-
- { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 },
- { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled",
- 0 },
- { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only",
- "SystemDlls", 0 },
-
- // Bool Properties
- { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 },
- { "LinkIncremental", "INCREMENTAL", "", "true", 0 },
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 },
- { "LinkStatus", "LTCG:STATUS", "", "true", 0 },
- { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 },
- { "PreventDllBinding", "ALLOWBIND", "", "true", 0 },
- { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "GenerateManifest", "MANIFEST:NO", "", "false", 0 },
- { "GenerateManifest", "MANIFEST", "", "true", 0 },
- { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACUIAccess", "uiAccess='false'", "", "false", 0 },
- { "UACUIAccess", "uiAccess='true'", "", "true", 0 },
-
- { "ManifestEmbed", "manifest:embed", "", "true", 0 },
- { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 },
- { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 },
- { "TerminalServerAware", "TSAWARE", "", "true", 0 },
- { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 },
- { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 },
- { "OptimizeReferences", "OPT:NOREF", "", "false", 0 },
- { "OptimizeReferences", "OPT:REF", "", "true", 0 },
- { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 },
- { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 },
- { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 },
- { "AppContainer", "APPCONTAINER", "", "true", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 },
- { "NoEntryPoint", "NOENTRY", "", "true", 0 },
- { "SetChecksum", "RELEASE", "", "true", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 },
- { "FixedBaseAddress", "FIXED:NO", "", "false", 0 },
- { "FixedBaseAddress", "FIXED", "", "true", 0 },
- { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 },
- { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 },
- { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 },
- { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 },
- { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 },
- { "Profile", "PROFILE", "", "true", 0 },
- { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 },
- { "LinkDelaySign", "DELAYSIGN", "", "true", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 },
- { "DetectOneDefinitionRule", "ODR", "", "true", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 },
- { "LinkDLL", "DLL", "", "true", 0 },
-
- // Bool Properties With Argument
- { "EnableUAC", "MANIFESTUAC:", "", "",
- cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable },
- { "GenerateMapFile", "MAP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "MapFileName", "MAP:", "Generate Map File", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "Natvis", "NATVIS:", "Natvis files", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "EmbedManagedResourceFile",
- "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalManifestDependencies",
- "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ManifestInput", "manifestinput:", "Manifest Input", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue },
- { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "",
- cmVS7FlagTable::UserValue },
- { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "ModuleDefinitionFile", "DEF:", "Module Definition File", "",
- cmVS7FlagTable::UserValue },
- { "ManifestFile", "ManifestFile:", "Manifest File", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "",
- cmVS7FlagTable::UserValue },
- { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "",
- cmVS7FlagTable::UserValue },
- // Skip [MapFileName] - no command line Switch.
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [HeapCommitSize] - no command line Switch.
- { "StackReserveSize", "STACK:", "Stack Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [StackCommitSize] - no command line Switch.
- { "FunctionOrder", "ORDER:@", "Function Order", "",
- cmVS7FlagTable::UserValue },
- { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "",
- cmVS7FlagTable::UserValue },
- { "MidlCommandFile", "MIDL:@", "MIDL Commands", "",
- cmVS7FlagTable::UserValue },
- { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "",
- cmVS7FlagTable::UserValue },
- { "TypeLibraryFile", "TLBOUT:", "Type Library", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File",
- "", cmVS7FlagTable::UserValue },
- { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:",
- "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue },
- { "EntryPointSymbol", "ENTRY:", "Entry Point", "",
- cmVS7FlagTable::UserValue },
- { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue },
- { "ImportLibrary", "IMPLIB:", "Import Library", "",
- cmVS7FlagTable::UserValue },
- { "MergeSections", "MERGE:", "Merge Sections", "",
- cmVS7FlagTable::UserValue },
- { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue },
- { "KeyContainer", "KEYCONTAINER:", "Key Container", "",
- cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS141CLFlagTable.h b/Source/cmVS141CLFlagTable.h
deleted file mode 100644
index 2a9944aab..000000000
--- a/Source/cmVS141CLFlagTable.h
+++ /dev/null
@@ -1,258 +0,0 @@
-static cmVS7FlagTable cmVS141CLFlagTable[] = {
-
- // Enum Properties
- { "DiagnosticsFormat", "diagnostics:classic", "Classic", "Classic", 0 },
- { "DiagnosticsFormat", "diagnostics:column", "Column", "Column", 0 },
- { "DiagnosticsFormat", "diagnostics:caret", "Caret", "Caret", 0 },
-
- { "DebugInformationFormat", "", "None", "None", 0 },
- { "DebugInformationFormat", "Z7", "C7 compatible", "OldStyle", 0 },
- { "DebugInformationFormat", "Zi", "Program Database", "ProgramDatabase", 0 },
- { "DebugInformationFormat", "ZI", "Program Database for Edit And Continue",
- "EditAndContinue", 0 },
-
- { "WarningLevel", "W0", "Turn Off All Warnings", "TurnOffAllWarnings", 0 },
- { "WarningLevel", "W1", "Level1", "Level1", 0 },
- { "WarningLevel", "W2", "Level2", "Level2", 0 },
- { "WarningLevel", "W3", "Level3", "Level3", 0 },
- { "WarningLevel", "W4", "Level4", "Level4", 0 },
- { "WarningLevel", "Wall", "EnableAllWarnings", "EnableAllWarnings", 0 },
-
- { "Optimization", "", "Custom", "Custom", 0 },
- { "Optimization", "Od", "Disabled", "Disabled", 0 },
- { "Optimization", "O1", "Minimize Size", "MinSpace", 0 },
- { "Optimization", "O2", "Maximize Speed", "MaxSpeed", 0 },
- { "Optimization", "Ox", "Full Optimization", "Full", 0 },
-
- { "InlineFunctionExpansion", "", "Default", "Default", 0 },
- { "InlineFunctionExpansion", "Ob0", "Disabled", "Disabled", 0 },
- { "InlineFunctionExpansion", "Ob1", "Only __inline", "OnlyExplicitInline",
- 0 },
- { "InlineFunctionExpansion", "Ob2", "Any Suitable", "AnySuitable", 0 },
-
- { "FavorSizeOrSpeed", "Os", "Favor small code", "Size", 0 },
- { "FavorSizeOrSpeed", "Ot", "Favor fast code", "Speed", 0 },
- { "FavorSizeOrSpeed", "", "Neither", "Neither", 0 },
-
- { "ExceptionHandling", "EHa", "Yes with SEH Exceptions", "Async", 0 },
- { "ExceptionHandling", "EHsc", "Yes", "Sync", 0 },
- { "ExceptionHandling", "EHs", "Yes with Extern C functions", "SyncCThrow",
- 0 },
- { "ExceptionHandling", "", "No", "false", 0 },
-
- { "BasicRuntimeChecks", "RTCs", "Stack Frames", "StackFrameRuntimeCheck",
- 0 },
- { "BasicRuntimeChecks", "RTCu", "Uninitialized variables",
- "UninitializedLocalUsageCheck", 0 },
- { "BasicRuntimeChecks", "RTC1", "Both (/RTC1, equiv. to /RTCsu)",
- "EnableFastChecks", 0 },
- { "BasicRuntimeChecks", "", "Default", "Default", 0 },
-
- { "RuntimeLibrary", "MT", "Multi-threaded", "MultiThreaded", 0 },
- { "RuntimeLibrary", "MTd", "Multi-threaded Debug", "MultiThreadedDebug", 0 },
- { "RuntimeLibrary", "MD", "Multi-threaded DLL", "MultiThreadedDLL", 0 },
- { "RuntimeLibrary", "MDd", "Multi-threaded Debug DLL",
- "MultiThreadedDebugDLL", 0 },
-
- { "StructMemberAlignment", "Zp1", "1 Byte", "1Byte", 0 },
- { "StructMemberAlignment", "Zp2", "2 Bytes", "2Bytes", 0 },
- { "StructMemberAlignment", "Zp4", "4 Byte", "4Bytes", 0 },
- { "StructMemberAlignment", "Zp8", "8 Bytes", "8Bytes", 0 },
- { "StructMemberAlignment", "Zp16", "16 Bytes", "16Bytes", 0 },
- { "StructMemberAlignment", "", "Default", "Default", 0 },
-
- { "BufferSecurityCheck", "GS-", "Disable Security Check", "false", 0 },
- { "BufferSecurityCheck", "GS", "Enable Security Check", "true", 0 },
-
- { "ControlFlowGuard", "guard:cf", "Yes", "Guard", 0 },
- { "ControlFlowGuard", "", "No", "false", 0 },
-
- { "EnableEnhancedInstructionSet", "arch:SSE", "Streaming SIMD Extensions",
- "StreamingSIMDExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:SSE2", "Streaming SIMD Extensions 2",
- "StreamingSIMDExtensions2", 0 },
- { "EnableEnhancedInstructionSet", "arch:AVX", "Advanced Vector Extensions",
- "AdvancedVectorExtensions", 0 },
- { "EnableEnhancedInstructionSet", "arch:AVX2",
- "Advanced Vector Extensions 2", "AdvancedVectorExtensions2", 0 },
- { "EnableEnhancedInstructionSet", "arch:IA32", "No Enhanced Instructions",
- "NoExtensions", 0 },
- { "EnableEnhancedInstructionSet", "", "Not Set", "NotSet", 0 },
-
- { "FloatingPointModel", "fp:precise", "Precise", "Precise", 0 },
- { "FloatingPointModel", "fp:strict", "Strict", "Strict", 0 },
- { "FloatingPointModel", "fp:fast", "Fast", "Fast", 0 },
-
- { "SpectreMitigation", "Qspectre", "Spectre mitigations", "Spectre", 0 },
-
- { "LanguageStandard", "std:c++17", "ISO C++17 Standard", "stdcpp17", 0 },
- { "LanguageStandard", "std:c++14", "ISO C++14 Standard", "stdcpp14", 0 },
- { "LanguageStandard", "std:c++latest", "ISO C++ Latest Draft Standard",
- "stdcpplatest", 0 },
-
- { "PrecompiledHeader", "Yc", "Create", "Create",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Yu", "Use", "Use",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "PrecompiledHeader", "Y-", "Not Using Precompiled Headers", "NotUsing",
- 0 },
-
- { "AssemblerOutput", "", "No Listing", "NoListing", 0 },
- { "AssemblerOutput", "FA", "Assembly-Only Listing", "AssemblyCode", 0 },
- { "AssemblerOutput", "FAc", "Assembly With Machine Code",
- "AssemblyAndMachineCode", 0 },
- { "AssemblerOutput", "FAs", "Assembly With Source Code",
- "AssemblyAndSourceCode", 0 },
- { "AssemblerOutput", "FAcs", "Assembly, Machine Code and Source", "All", 0 },
-
- { "CallingConvention", "Gd", "__cdecl", "Cdecl", 0 },
- { "CallingConvention", "Gr", "__fastcall", "FastCall", 0 },
- { "CallingConvention", "Gz", "__stdcall", "StdCall", 0 },
- { "CallingConvention", "Gv", "__vectorcall", "VectorCall", 0 },
-
- { "CompileAs", "", "Default", "Default", 0 },
- { "CompileAs", "TC", "Compile as C Code", "CompileAsC", 0 },
- { "CompileAs", "TP", "Compile as C++ Code", "CompileAsCpp", 0 },
-
- { "ErrorReporting", "errorReport:none", "Do Not Send Report", "None", 0 },
- { "ErrorReporting", "errorReport:prompt", "Prompt Immediately", "Prompt",
- 0 },
- { "ErrorReporting", "errorReport:queue", "Queue For Next Login", "Queue",
- 0 },
- { "ErrorReporting", "errorReport:send", "Send Automatically", "Send", 0 },
-
- { "CompileAsManaged", "", "No Common Language RunTime Support", "false", 0 },
- { "CompileAsManaged", "clr", "Common Language RunTime Support", "true", 0 },
- { "CompileAsManaged", "clr:pure",
- "Pure MSIL Common Language RunTime Support", "Pure", 0 },
- { "CompileAsManaged", "clr:safe",
- "Safe MSIL Common Language RunTime Support", "Safe", 0 },
- { "CompileAsManaged", "clr:oldSyntax",
- "Common Language RunTime Support, Old Syntax", "OldSyntax", 0 },
-
- { "CppLanguageStandard", "", "Default", "Default", 0 },
- { "CppLanguageStandard", "std=c++98", "C++03", "c++98", 0 },
- { "CppLanguageStandard", "std=c++11", "C++11", "c++11", 0 },
- { "CppLanguageStandard", "std=c++1y", "C++14", "c++1y", 0 },
- { "CppLanguageStandard", "std=c++14", "C++14", "c++1y", 0 },
- { "CppLanguageStandard", "std=gnu++98", "C++03 (GNU Dialect)", "gnu++98",
- 0 },
- { "CppLanguageStandard", "std=gnu++11", "C++11 (GNU Dialect)", "gnu++11",
- 0 },
- { "CppLanguageStandard", "std=gnu++1y", "C++14 (GNU Dialect)", "gnu++1y",
- 0 },
- { "CppLanguageStandard", "std=gnu++14", "C++14 (GNU Dialect)", "gnu++1y",
- 0 },
-
- // Bool Properties
- { "CompileAsWinRT", "ZW", "", "true", 0 },
- { "WinRTNoStdLib", "ZW:nostdlib", "", "true", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
- { "TreatWarningAsError", "WX-", "", "false", 0 },
- { "TreatWarningAsError", "WX", "", "true", 0 },
- { "SDLCheck", "sdl-", "", "false", 0 },
- { "SDLCheck", "sdl", "", "true", 0 },
- { "IntrinsicFunctions", "Oi", "", "true", 0 },
- { "OmitFramePointers", "Oy-", "", "false", 0 },
- { "OmitFramePointers", "Oy", "", "true", 0 },
- { "EnableFiberSafeOptimizations", "GT", "", "true", 0 },
- { "WholeProgramOptimization", "GL", "", "true", 0 },
- { "UndefineAllPreprocessorDefinitions", "u", "", "true", 0 },
- { "IgnoreStandardIncludePath", "X", "", "true", 0 },
- { "PreprocessToFile", "P", "", "true", 0 },
- { "PreprocessSuppressLineNumbers", "EP", "", "true", 0 },
- { "PreprocessKeepComments", "C", "", "true", 0 },
- { "StringPooling", "GF-", "", "false", 0 },
- { "StringPooling", "GF", "", "true", 0 },
- { "MinimalRebuild", "Gm-", "", "false", 0 },
- { "MinimalRebuild", "Gm", "", "true", 0 },
- { "SmallerTypeCheck", "RTCc", "", "true", 0 },
- { "FunctionLevelLinking", "Gy-", "", "false", 0 },
- { "FunctionLevelLinking", "Gy", "", "true", 0 },
- { "EnableParallelCodeGeneration", "Qpar-", "", "false", 0 },
- { "EnableParallelCodeGeneration", "Qpar", "", "true", 0 },
- { "FloatingPointExceptions", "fp:except-", "", "false", 0 },
- { "FloatingPointExceptions", "fp:except", "", "true", 0 },
- { "CreateHotpatchableImage", "hotpatch", "", "true", 0 },
- { "DisableLanguageExtensions", "Za", "", "true", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0 },
- { "TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0 },
- { "ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0 },
- { "RemoveUnreferencedCodeData", "Zc:inline-", "", "false", 0 },
- { "RemoveUnreferencedCodeData", "Zc:inline", "", "true", 0 },
- { "EnforceTypeConversionRules", "Zc:rvalueCast-", "", "false", 0 },
- { "EnforceTypeConversionRules", "Zc:rvalueCast", "", "true", 0 },
- { "RuntimeTypeInfo", "GR-", "", "false", 0 },
- { "RuntimeTypeInfo", "GR", "", "true", 0 },
- { "OpenMPSupport", "openmp-", "", "false", 0 },
- { "OpenMPSupport", "openmp", "", "true", 0 },
- { "ExpandAttributedSource", "Fx", "", "true", 0 },
- { "UseUnicodeForAssemblerListing", "FAu", "", "true", 0 },
- { "ShowIncludes", "showIncludes", "", "true", 0 },
- { "EnablePREfast", "analyze-", "", "false", 0 },
- { "EnablePREfast", "analyze", "", "true", 0 },
- { "UseFullPaths", "FC", "", "true", 0 },
- { "OmitDefaultLibName", "Zl", "", "true", 0 },
-
- // Bool Properties With Argument
- { "MultiProcessorCompilation", "MP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "ProcessorNumber", "MP", "Multi-processor Compilation", "",
- cmVS7FlagTable::UserValueRequired },
- { "GenerateXMLDocumentationFiles", "doc", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "",
- cmVS7FlagTable::UserValueRequired },
- { "BrowseInformation", "FR", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "BrowseInformationFile", "FR", "Enable Browse Information", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalIncludeDirectories", "I", "Additional Include Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalUsingDirectories", "AI", "Additional #using Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PreprocessorDefinitions", "D ", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "UndefinePreprocessorDefinitions", "U",
- "Undefine Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DisableSpecificWarnings", "wd", "Disable Specific Warnings", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedIncludeFiles", "FI", "Forced Include File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForcedUsingFiles", "FU", "Forced #using File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "PREfastLog", "analyze:log", "Code Analysis Log", "",
- cmVS7FlagTable::UserFollowing },
- { "PREfastAdditionalPlugins", "analyze:plugin",
- "Additional Code Analysis Native plugins", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "TreatSpecificWarningsAsErrors", "we", "Treat Specific Warnings As Errors",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "WarningVersion", "Wv:", "Warning Version", "",
- cmVS7FlagTable::UserValue },
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "PreprocessOutputPath", "Fi", "Preprocess Output Path", "",
- cmVS7FlagTable::UserValue },
- { "PrecompiledHeaderFile", "Yc", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderFile", "Yu", "Precompiled Header Name", "",
- cmVS7FlagTable::UserValueRequired },
- { "PrecompiledHeaderOutputFile", "Fp", "Precompiled Header Output File", "",
- cmVS7FlagTable::UserValue },
- { "AssemblerListingLocation", "Fa", "ASM List Location", "",
- cmVS7FlagTable::UserValue },
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDataBaseFileName", "Fd", "Program Database File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [XMLDocumentationFileName] - no command line Switch.
- // Skip [BrowseInformationFile] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS141CSharpFlagTable.h b/Source/cmVS141CSharpFlagTable.h
deleted file mode 100644
index 1f840970b..000000000
--- a/Source/cmVS141CSharpFlagTable.h
+++ /dev/null
@@ -1,126 +0,0 @@
-static cmVS7FlagTable cmVS141CSharpFlagTable[] = {
- { "ProjectName", "out:", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "OutputType", "target:exe", "", "Exe", 0 },
- { "OutputType", "target:winexe", "", "Winexe", 0 },
- { "OutputType", "target:library", "", "Library", 0 },
- { "OutputType", "target:module", "", "Module", 0 },
-
- { "DocumentationFile", "doc", "", "", cmIDEFlagTable::UserValueRequired },
-
- { "Platform", "platform:x86", "", "x86", 0 },
- { "Platform", "platform:Itanium", "", "Itanium", 0 },
- { "Platform", "platform:x64", "", "x64", 0 },
- { "Platform", "platform:arm", "", "arm", 0 },
- { "Platform", "platform:anycpu32bitpreferred", "", "anycpu32bitpreferred",
- 0 },
- { "Platform", "platform:anycpu", "", "anycpu", 0 },
-
- { "References", "reference:", "mit alias", "", 0 },
- { "References", "reference:", "dateiliste", "", 0 },
- { "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
- { "", "link", "", "", 0 },
-
- { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "ApplicationManifest", "win32manifest:", "", "",
- cmIDEFlagTable::UserValueRequired },
-
- { "NoWin32Manifest", "nowin32manifest", "", "true", 0 },
-
- { "DefineDebug", "debug", "", "true", cmIDEFlagTable::Continue },
-
- { "DebugSymbols", "debug", "", "true", 0 },
- { "DebugSymbols", "debug-", "", "false", 0 },
- { "DebugSymbols", "debug+", "", "true", 0 },
-
- { "DebugType", "debug:none", "", "none", 0 },
- { "DebugType", "debug:full", "", "full", 0 },
- { "DebugType", "debug:pdbonly", "", "pdbonly", 0 },
-
- { "Optimize", "optimize", "", "true", 0 },
- { "Optimize", "optimize-", "", "false", 0 },
- { "Optimize", "optimize+", "", "true", 0 },
-
- { "TreatWarningsAsErrors", "warnaserror", "", "true", 0 },
- { "TreatWarningsAsErrors", "warnaserror-", "", "false", 0 },
- { "TreatWarningsAsErrors", "warnaserror+", "", "true", 0 },
-
- { "WarningsAsErrors", "warnaserror", "", "", 0 },
- { "WarningsAsErrors", "warnaserror-", "", "", 0 },
- { "WarningsAsErrors", "warnaserror+", "", "", 0 },
-
- { "WarningLevel", "warn:0", "", "0", 0 },
- { "WarningLevel", "warn:1", "", "1", 0 },
- { "WarningLevel", "warn:2", "", "2", 0 },
- { "WarningLevel", "warn:3", "", "3", 0 },
- { "WarningLevel", "warn:4", "", "4", 0 },
- { "DisabledWarnings", "nowarn", "", "", 0 },
-
- { "CheckForOverflowUnderflow", "checked", "", "true", 0 },
- { "CheckForOverflowUnderflow", "checked-", "", "false", 0 },
- { "CheckForOverflowUnderflow", "checked+", "", "true", 0 },
-
- { "AllowUnsafeBlocks", "unsafe", "", "true", 0 },
- { "AllowUnsafeBlocks", "unsafe-", "", "false", 0 },
- { "AllowUnsafeBlocks", "unsafe+", "", "true", 0 },
-
- { "DefineConstants", "define:", "", "",
- cmIDEFlagTable::SemicolonAppendable | cmIDEFlagTable::UserValue },
-
- { "LangVersion", "langversion:ISO-1", "", "ISO-1", 0 },
- { "LangVersion", "langversion:ISO-2", "", "ISO-2", 0 },
- { "LangVersion", "langversion:3", "", "3", 0 },
- { "LangVersion", "langversion:4", "", "4", 0 },
- { "LangVersion", "langversion:5", "", "5", 0 },
- { "LangVersion", "langversion:6", "", "6", 0 },
- { "LangVersion", "langversion:7.0", "", "7.0", 0 },
- { "LangVersion", "langversion:7.1", "", "7.1", 0 },
- { "LangVersion", "langversion:7.2", "", "7.2", 0 },
- { "LangVersion", "langversion:7.3", "", "7.3", 0 },
- { "LangVersion", "langversion:default", "", "default", 0 },
- { "LangVersion", "langversion:latest", "", "latest", 0 },
-
- { "DelaySign", "delaysign", "", "true", 0 },
- { "DelaySign", "delaysign-", "", "false", 0 },
- { "DelaySign", "delaysign+", "", "true", 0 },
-
- { "AssemblyOriginatorKeyFile", "keyfile", "", "", 0 },
-
- { "KeyContainerName", "keycontainer", "", "", 0 },
-
- { "NoLogo", "nologo", "", "", 0 },
-
- { "NoConfig", "noconfig", "", "true", 0 },
-
- { "BaseAddress", "baseaddress:", "", "", 0 },
-
- { "CodePage", "codepage", "", "", 0 },
-
- { "Utf8Output", "utf8output", "", "", 0 },
-
- { "MainEntryPoint", "main:", "", "", 0 },
-
- { "GenerateFullPaths", "fullpaths", "", "true", 0 },
-
- { "FileAlignment", "filealign", "", "", 0 },
-
- { "PdbFile", "pdb:", "", "", 0 },
-
- { "NoStandardLib", "nostdlib", "", "true", 0 },
- { "NoStandardLib", "nostdlib-", "", "false", 0 },
- { "NoStandardLib", "nostdlib+", "", "true", 0 },
-
- { "SubsystemVersion", "subsystemversion", "", "", 0 },
-
- { "AdditionalLibPaths", "lib:", "", "", 0 },
-
- { "ErrorReport", "errorreport:none", "Do Not Send Report", "none", 0 },
- { "ErrorReport", "errorreport:prompt", "Prompt Immediately", "prompt", 0 },
- { "ErrorReport", "errorreport:queue", "Queue For Next Login", "queue", 0 },
- { "ErrorReport", "errorreport:send", "Send Automatically", "send", 0 },
-
- { 0, 0, 0, 0, 0 },
-};
diff --git a/Source/cmVS141LinkFlagTable.h b/Source/cmVS141LinkFlagTable.h
deleted file mode 100644
index 7e56c8e80..000000000
--- a/Source/cmVS141LinkFlagTable.h
+++ /dev/null
@@ -1,287 +0,0 @@
-static cmVS7FlagTable cmVS141LinkFlagTable[] = {
-
- // Enum Properties
- { "ShowProgress", "", "Not Set", "NotSet", 0 },
- { "ShowProgress", "VERBOSE", "Display all progress messages", "LinkVerbose",
- 0 },
- { "ShowProgress", "VERBOSE:Lib", "For Libraries Searched", "LinkVerboseLib",
- 0 },
- { "ShowProgress", "VERBOSE:ICF",
- "About COMDAT folding during optimized linking", "LinkVerboseICF", 0 },
- { "ShowProgress", "VERBOSE:REF",
- "About data removed during optimized linking", "LinkVerboseREF", 0 },
- { "ShowProgress", "VERBOSE:SAFESEH", "About Modules incompatible with SEH",
- "LinkVerboseSAFESEH", 0 },
- { "ShowProgress", "VERBOSE:CLR",
- "About linker activity related to managed code", "LinkVerboseCLR", 0 },
-
- { "ForceFileOutput", "FORCE", "Enabled", "Enabled", 0 },
- { "ForceFileOutput", "FORCE:MULTIPLE", "Multiply Defined Symbol Only",
- "MultiplyDefinedSymbolOnly", 0 },
- { "ForceFileOutput", "FORCE:UNRESOLVED", "Undefined Symbol Only",
- "UndefinedSymbolOnly", 0 },
-
- { "CreateHotPatchableImage", "FUNCTIONPADMIN", "Enabled", "Enabled", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:5", "X86 Image Only",
- "X86Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:6", "X64 Image Only",
- "X64Image", 0 },
- { "CreateHotPatchableImage", "FUNCTIONPADMIN:16", "Itanium Image Only",
- "ItaniumImage", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACExecutionLevel", "level='asInvoker'", "asInvoker", "AsInvoker", 0 },
- { "UACExecutionLevel", "level='highestAvailable'", "highestAvailable",
- "HighestAvailable", 0 },
- { "UACExecutionLevel", "level='requireAdministrator'",
- "requireAdministrator", "RequireAdministrator", 0 },
-
- { "GenerateDebugInformation", "DEBUG:FASTLINK",
- "Generate Debug Information optimized for faster links", "DebugFastLink",
- cmVS7FlagTable::CaseInsensitive },
- { "GenerateDebugInformation", "DEBUG:FULL",
- "Generate Debug Information optimized for sharing and publishing",
- "DebugFull", cmVS7FlagTable::CaseInsensitive },
- { "GenerateDebugInformation", "DEBUG:NONE",
- "Produces no debugging information", "false",
- cmVS7FlagTable::CaseInsensitive },
- { "GenerateDebugInformation", "DEBUG", "Generate Debug Information", "true",
- cmVS7FlagTable::CaseInsensitive },
-
- { "SubSystem", "", "Not Set", "NotSet", 0 },
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- { "Driver", "", "Not Set", "NotSet", 0 },
- { "Driver", "Driver", "Driver", "Driver", 0 },
- { "Driver", "DRIVER:UPONLY", "UP Only", "UpOnly", 0 },
- { "Driver", "DRIVER:WDM", "WDM", "WDM", 0 },
-
- { "LinkTimeCodeGeneration", "", "Default", "Default", 0 },
- { "LinkTimeCodeGeneration", "LTCG:incremental",
- "Use Fast Link Time Code Generation", "UseFastLinkTimeCodeGeneration", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "Use Link Time Code Generation",
- "UseLinkTimeCodeGeneration", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGInstrument",
- "Profile Guided Optimization - Instrument", "PGInstrument", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGOptimize",
- "Profile Guided Optimization - Optimization", "PGOptimization", 0 },
- { "LinkTimeCodeGeneration", "LTCG:PGUpdate",
- "Profile Guided Optimization - Update", "PGUpdate", 0 },
-
- { "GenerateWindowsMetadata", "WINMD", "Yes", "true", 0 },
- { "GenerateWindowsMetadata", "WINMD:NO", "No", "false", 0 },
-
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "TargetMachine", "", "Not Set", "NotSet", 0 },
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:ARM64", "MachineARM64", "MachineARM64", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA", "MTA threading attribute",
- "MTAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA", "STA threading attribute",
- "STAThreadingAttribute", 0 },
- { "CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE",
- "Default threading attribute", "DefaultThreadingAttribute", 0 },
-
- { "CLRImageType", "CLRIMAGETYPE:IJW", "Force IJW image", "ForceIJWImage",
- 0 },
- { "CLRImageType", "CLRIMAGETYPE:PURE", "Force Pure IL Image",
- "ForcePureILImage", 0 },
- { "CLRImageType", "CLRIMAGETYPE:SAFE", "Force Safe IL Image",
- "ForceSafeILImage", 0 },
- { "CLRImageType", "", "Default image type", "Default", 0 },
-
- { "SignHash", "CLRSIGNHASH:SHA1", "SHA1", "SHA1", 0 },
- { "SignHash", "CLRSIGNHASH:SHA256", "SHA256", "SHA256", 0 },
- { "SignHash", "CLRSIGNHASH:SHA384", "SHA384", "SHA384", 0 },
- { "SignHash", "CLRSIGNHASH:SHA512", "SHA512", "SHA512", 0 },
-
- { "LinkErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "LinkErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "LinkErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "LinkErrorReporting", "ERRORREPORT:NONE", "No Error Report",
- "NoErrorReport", 0 },
-
- { "CLRSupportLastError", "CLRSupportLastError", "Enabled", "Enabled", 0 },
- { "CLRSupportLastError", "CLRSupportLastError:NO", "Disabled", "Disabled",
- 0 },
- { "CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL", "System Dlls Only",
- "SystemDlls", 0 },
-
- // Bool Properties
- { "LinkIncremental", "INCREMENTAL:NO", "", "false", 0 },
- { "LinkIncremental", "INCREMENTAL", "", "true", 0 },
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "LinkStatus", "LTCG:NOSTATUS", "", "false", 0 },
- { "LinkStatus", "LTCG:STATUS", "", "true", 0 },
- { "PreventDllBinding", "ALLOWBIND:NO", "", "false", 0 },
- { "PreventDllBinding", "ALLOWBIND", "", "true", 0 },
- { "TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLinkerWarningAsErrors", "WX", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "GenerateManifest", "MANIFEST:NO", "", "false", 0 },
- { "GenerateManifest", "MANIFEST", "", "true", 0 },
- { "AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0 },
-
- // correct flags for uac should be /MANIFESTUAC, but some projects already
- // use this bug to access uac field, so keep these for compatibility
- { "UACUIAccess", "uiAccess='false'", "", "false", 0 },
- { "UACUIAccess", "uiAccess='true'", "", "true", 0 },
-
- { "ManifestEmbed", "manifest:embed", "", "true", 0 },
- { "MapExports", "MAPINFO:EXPORTS", "", "true", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0 },
- { "AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0 },
- { "LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0 },
- { "TerminalServerAware", "TSAWARE:NO", "", "false", 0 },
- { "TerminalServerAware", "TSAWARE", "", "true", 0 },
- { "SwapRunFromCD", "SWAPRUN:CD", "", "true", 0 },
- { "SwapRunFromNET", "SWAPRUN:NET", "", "true", 0 },
- { "OptimizeReferences", "OPT:NOREF", "", "false", 0 },
- { "OptimizeReferences", "OPT:REF", "", "true", 0 },
- { "EnableCOMDATFolding", "OPT:NOICF", "", "false", 0 },
- { "EnableCOMDATFolding", "OPT:ICF", "", "true", 0 },
- { "IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0 },
- { "AppContainer", "APPCONTAINER", "", "true", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0 },
- { "WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0 },
- { "NoEntryPoint", "NOENTRY", "", "true", 0 },
- { "SetChecksum", "RELEASE", "", "true", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0 },
- { "RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0 },
- { "FixedBaseAddress", "FIXED:NO", "", "false", 0 },
- { "FixedBaseAddress", "FIXED", "", "true", 0 },
- { "DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0 },
- { "DataExecutionPrevention", "NXCOMPAT", "", "true", 0 },
- { "TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0 },
- { "SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0 },
- { "SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0 },
- { "Profile", "PROFILE", "", "true", 0 },
- { "LinkDelaySign", "DELAYSIGN:NO", "", "false", 0 },
- { "LinkDelaySign", "DELAYSIGN", "", "true", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0 },
- { "CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0 },
- { "DetectOneDefinitionRule", "ODR", "", "true", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0 },
- { "ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0 },
- { "LinkDLL", "DLL", "", "true", 0 },
-
- // Bool Properties With Argument
- { "EnableUAC", "MANIFESTUAC:", "", "",
- cmVS7FlagTable::UserValueRequired | cmVS7FlagTable::SpaceAppendable },
- { "GenerateMapFile", "MAP", "", "true",
- cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue },
- { "MapFileName", "MAP:", "Generate Map File", "",
- cmVS7FlagTable::UserValueRequired },
-
- // String List Properties
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "Natvis", "NATVIS:", "Natvis files", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AddModuleNamesToAssembly", "ASSEMBLYMODULE:", "Add Module to Assembly",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "EmbedManagedResourceFile",
- "ASSEMBLYRESOURCE:", "Embed Managed Resource File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "DelayLoadDLLs", "DELAYLOAD:", "Delay Loaded Dlls", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:", "Assembly Link Resource",
- "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "AdditionalManifestDependencies",
- "MANIFESTDEPENDENCY:", "Additional Manifest Dependencies", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ManifestInput", "manifestinput:", "Manifest Input", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "Version", "VERSION:", "Version", "", cmVS7FlagTable::UserValue },
- { "SpecifySectionAttributes", "SECTION:", "Specify Section Attributes", "",
- cmVS7FlagTable::UserValue },
- { "MSDOSStubFileName", "STUB:", "MS-DOS Stub File Name", "",
- cmVS7FlagTable::UserValue },
- // Skip [TrackerLogDirectory] - no command line Switch.
- { "ModuleDefinitionFile", "DEF:", "Module Definition File", "",
- cmVS7FlagTable::UserValue },
- { "ManifestFile", "ManifestFile:", "Manifest File", "",
- cmVS7FlagTable::UserValue },
- { "ProgramDatabaseFile", "PDB:", "Generate Program Database File", "",
- cmVS7FlagTable::UserValue },
- { "StripPrivateSymbols", "PDBSTRIPPED:", "Strip Private Symbols", "",
- cmVS7FlagTable::UserValue },
- // Skip [MapFileName] - no command line Switch.
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "HeapReserveSize", "HEAP:", "Heap Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [HeapCommitSize] - no command line Switch.
- { "StackReserveSize", "STACK:", "Stack Reserve Size", "",
- cmVS7FlagTable::UserValue },
- // Skip [StackCommitSize] - no command line Switch.
- { "FunctionOrder", "ORDER:@", "Function Order", "",
- cmVS7FlagTable::UserValue },
- { "ProfileGuidedDatabase", "PGD:", "Profile Guided Database", "",
- cmVS7FlagTable::UserValue },
- { "MidlCommandFile", "MIDL:@", "MIDL Commands", "",
- cmVS7FlagTable::UserValue },
- { "MergedIDLBaseFileName", "IDLOUT:", "Merged IDL Base File Name", "",
- cmVS7FlagTable::UserValue },
- { "TypeLibraryFile", "TLBOUT:", "Type Library", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataFile", "WINMDFILE:", "Windows Metadata File", "",
- cmVS7FlagTable::UserValue },
- { "WindowsMetadataLinkKeyFile", "WINMDKEYFILE:", "Windows Metadata Key File",
- "", cmVS7FlagTable::UserValue },
- { "WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:",
- "Windows Metadata Key Container", "", cmVS7FlagTable::UserValue },
- { "EntryPointSymbol", "ENTRY:", "Entry Point", "",
- cmVS7FlagTable::UserValue },
- { "BaseAddress", "BASE:", "Base Address", "", cmVS7FlagTable::UserValue },
- { "ImportLibrary", "IMPLIB:", "Import Library", "",
- cmVS7FlagTable::UserValue },
- { "MergeSections", "MERGE:", "Merge Sections", "",
- cmVS7FlagTable::UserValue },
- { "LinkKeyFile", "KEYFILE:", "Key File", "", cmVS7FlagTable::UserValue },
- { "KeyContainer", "KEYCONTAINER:", "Key Container", "",
- cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS14LibFlagTable.h b/Source/cmVS14LibFlagTable.h
deleted file mode 100644
index adce075fb..000000000
--- a/Source/cmVS14LibFlagTable.h
+++ /dev/null
@@ -1,77 +0,0 @@
-static cmVS7FlagTable cmVS14LibFlagTable[] = {
-
- // Enum Properties
- { "ErrorReporting", "ERRORREPORT:PROMPT", "PromptImmediately",
- "PromptImmediately", 0 },
- { "ErrorReporting", "ERRORREPORT:QUEUE", "Queue For Next Login",
- "QueueForNextLogin", 0 },
- { "ErrorReporting", "ERRORREPORT:SEND", "Send Error Report",
- "SendErrorReport", 0 },
- { "ErrorReporting", "ERRORREPORT:NONE", "No Error Report", "NoErrorReport",
- 0 },
-
- { "TargetMachine", "MACHINE:ARM", "MachineARM", "MachineARM", 0 },
- { "TargetMachine", "MACHINE:ARM64", "MachineARM64", "MachineARM64", 0 },
- { "TargetMachine", "MACHINE:EBC", "MachineEBC", "MachineEBC", 0 },
- { "TargetMachine", "MACHINE:IA64", "MachineIA64", "MachineIA64", 0 },
- { "TargetMachine", "MACHINE:MIPS", "MachineMIPS", "MachineMIPS", 0 },
- { "TargetMachine", "MACHINE:MIPS16", "MachineMIPS16", "MachineMIPS16", 0 },
- { "TargetMachine", "MACHINE:MIPSFPU", "MachineMIPSFPU", "MachineMIPSFPU",
- 0 },
- { "TargetMachine", "MACHINE:MIPSFPU16", "MachineMIPSFPU16",
- "MachineMIPSFPU16", 0 },
- { "TargetMachine", "MACHINE:SH4", "MachineSH4", "MachineSH4", 0 },
- { "TargetMachine", "MACHINE:THUMB", "MachineTHUMB", "MachineTHUMB", 0 },
- { "TargetMachine", "MACHINE:X64", "MachineX64", "MachineX64", 0 },
- { "TargetMachine", "MACHINE:X86", "MachineX86", "MachineX86", 0 },
-
- { "SubSystem", "SUBSYSTEM:CONSOLE", "Console", "Console", 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWS", "Windows", "Windows", 0 },
- { "SubSystem", "SUBSYSTEM:NATIVE", "Native", "Native", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_APPLICATION", "EFI Application",
- "EFI Application", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
- "EFI Boot Service Driver", "EFI Boot Service Driver", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_ROM", "EFI ROM", "EFI ROM", 0 },
- { "SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER", "EFI Runtime", "EFI Runtime",
- 0 },
- { "SubSystem", "SUBSYSTEM:WINDOWSCE", "WindowsCE", "WindowsCE", 0 },
- { "SubSystem", "SUBSYSTEM:POSIX", "POSIX", "POSIX", 0 },
-
- // Bool Properties
- { "SuppressStartupBanner", "NOLOGO", "", "true", 0 },
- { "IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0 },
- { "TreatLibWarningAsErrors", "WX:NO", "", "false", 0 },
- { "TreatLibWarningAsErrors", "WX", "", "true", 0 },
- { "Verbose", "VERBOSE", "", "true", 0 },
- { "LinkTimeCodeGeneration", "LTCG", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- // Skip [AdditionalDependencies] - no command line Switch.
- { "AdditionalLibraryDirectories",
- "LIBPATH:", "Additional Library Directories", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IgnoreSpecificDefaultLibraries",
- "NODEFAULTLIB:", "Ignore Specific Default Libraries", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "ExportNamedFunctions", "EXPORT:", "Export Named Functions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "RemoveObjects", "REMOVE:", "Remove Objects", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
-
- // String Properties
- { "OutputFile", "OUT:", "Output File", "", cmVS7FlagTable::UserValue },
- { "ModuleDefinitionFile", "DEF:", "Module Definition File Name", "",
- cmVS7FlagTable::UserValue },
- { "ForceSymbolReferences", "INCLUDE:", "Force Symbol References", "",
- cmVS7FlagTable::UserValue },
- { "DisplayLibrary", "LIST:", "Display Library to standard output", "",
- cmVS7FlagTable::UserValue },
- // Skip [MinimumRequiredVersion] - no command line Switch.
- { "Name", "NAME:", "Name", "", cmVS7FlagTable::UserValue },
- // Skip [AdditionalOptions] - no command line Switch.
- // Skip [TrackerLogDirectory] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS14MASMFlagTable.h b/Source/cmVS14MASMFlagTable.h
deleted file mode 100644
index 82ec9f1d0..000000000
--- a/Source/cmVS14MASMFlagTable.h
+++ /dev/null
@@ -1,76 +0,0 @@
-static cmVS7FlagTable cmVS14MASMFlagTable[] = {
-
- // Enum Properties
- { "PreserveIdentifierCase", "", "Default", "0", 0 },
- { "PreserveIdentifierCase", "Cp", "Preserves Identifier Case (/Cp)", "1",
- 0 },
- { "PreserveIdentifierCase", "Cu",
- "Maps all identifiers to upper case. (/Cu)", "2", 0 },
- { "PreserveIdentifierCase", "Cx",
- "Preserves case in public and extern symbols. (/Cx)", "3", 0 },
-
- { "WarningLevel", "W0", "Warning Level 0 (/W0)", "0", 0 },
- { "WarningLevel", "W1", "Warning Level 1 (/W1)", "1", 0 },
- { "WarningLevel", "W2", "Warning Level 2 (/W2)", "2", 0 },
- { "WarningLevel", "W3", "Warning Level 3 (/W3)", "3", 0 },
-
- { "PackAlignmentBoundary", "", "Default", "0", 0 },
- { "PackAlignmentBoundary", "Zp1", "One Byte Boundary (/Zp1)", "1", 0 },
- { "PackAlignmentBoundary", "Zp2", "Two Byte Boundary (/Zp2)", "2", 0 },
- { "PackAlignmentBoundary", "Zp4", "Four Byte Boundary (/Zp4)", "3", 0 },
- { "PackAlignmentBoundary", "Zp8", "Eight Byte Boundary (/Zp8)", "4", 0 },
- { "PackAlignmentBoundary", "Zp16", "Sixteen Byte Boundary (/Zp16)", "5", 0 },
-
- { "CallingConvention", "", "Default", "0", 0 },
- { "CallingConvention", "Gd", "Use C-style Calling Convention (/Gd)", "1",
- 0 },
- { "CallingConvention", "Gz", "Use stdcall Calling Convention (/Gz)", "2",
- 0 },
- { "CallingConvention", "Gc", "Use Pascal Calling Convention (/Gc)", "3", 0 },
-
- { "ErrorReporting", "errorReport:prompt",
- "Prompt to send report immediately (/errorReport:prompt)", "0", 0 },
- { "ErrorReporting", "errorReport:queue",
- "Prompt to send report at the next logon (/errorReport:queue)", "1", 0 },
- { "ErrorReporting", "errorReport:send",
- "Automatically send report (/errorReport:send)", "2", 0 },
- { "ErrorReporting", "errorReport:none",
- "Do not send report (/errorReport:none)", "3", 0 },
-
- // Bool Properties
- { "NoLogo", "nologo", "", "true", 0 },
- { "GeneratePreprocessedSourceListing", "EP", "", "true", 0 },
- { "ListAllAvailableInformation", "Sa", "", "true", 0 },
- { "UseSafeExceptionHandlers", "safeseh", "", "true", 0 },
- { "AddFirstPassListing", "Sf", "", "true", 0 },
- { "EnableAssemblyGeneratedCodeListing", "Sg", "", "true", 0 },
- { "DisableSymbolTable", "Sn", "", "true", 0 },
- { "EnableFalseConditionalsInListing", "Sx", "", "true", 0 },
- { "TreatWarningsAsErrors", "WX", "", "true", 0 },
- { "MakeAllSymbolsPublic", "Zf", "", "true", 0 },
- { "GenerateDebugInformation", "Zi", "", "true", 0 },
- { "EnableMASM51Compatibility", "Zm", "", "true", 0 },
- { "PerformSyntaxCheckOnly", "Zs", "", "true", 0 },
-
- // Bool Properties With Argument
-
- // String List Properties
- { "PreprocessorDefinitions", "D", "Preprocessor Definitions", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "IncludePaths", "I", "Include Paths", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- { "BrowseFile", "FR", "Generate Browse Information File", "",
- cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable },
- // Skip [AdditionalDependencies] - no command line Switch.
-
- // String Properties
- // Skip [Inputs] - no command line Switch.
- { "ObjectFileName", "Fo", "Object File Name", "",
- cmVS7FlagTable::UserValue },
- { "AssembledCodeListingFile", "Fl", "Assembled Code Listing File", "",
- cmVS7FlagTable::UserValue },
- // Skip [CommandLineTemplate] - no command line Switch.
- // Skip [ExecutionDescription] - no command line Switch.
- // Skip [AdditionalOptions] - no command line Switch.
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVS14RCFlagTable.h b/Source/cmVS14RCFlagTable.h
deleted file mode 100644
index 5dc8d5ada..000000000
--- a/Source/cmVS14RCFlagTable.h
+++ /dev/null
@@ -1,7 +0,0 @@
-static cmVS7FlagTable cmVS14RCFlagTable[] = {
- // Bool Properties
- { "NullTerminateStrings", "n", "", "true", 0 },
- { "SuppressStartupBanner", "nologo", "", "true", 0 },
-
- { 0, 0, 0, 0, 0 }
-};
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index 19c96b3bb..c78361e26 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -57,8 +57,9 @@ std::string VSInstanceInfo::GetInstallLocation() const
return loc;
}
-cmVSSetupAPIHelper::cmVSSetupAPIHelper()
- : setupConfig(NULL)
+cmVSSetupAPIHelper::cmVSSetupAPIHelper(unsigned int version)
+ : Version(version)
+ , setupConfig(NULL)
, setupConfig2(NULL)
, setupHelper(NULL)
, initializationFailure(false)
@@ -88,7 +89,7 @@ bool cmVSSetupAPIHelper::SetVSInstance(std::string const& vsInstallLocation)
return this->EnumerateAndChooseVSInstance();
}
-bool cmVSSetupAPIHelper::IsVS2017Installed()
+bool cmVSSetupAPIHelper::IsVSInstalled()
{
return this->EnumerateAndChooseVSInstance();
}
@@ -187,7 +188,7 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(
// Check if a compiler is installed with this instance.
{
std::string const vcRoot = vsInstanceInfo.GetInstallLocation();
- std::string const vcToolsVersionFile =
+ std::string vcToolsVersionFile =
vcRoot + "/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt";
std::string vcToolsVersion;
cmsys::ifstream fin(vcToolsVersionFile.c_str());
@@ -267,6 +268,19 @@ bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion)
return isInstalled && !vsToolsetVersion.empty();
}
+bool cmVSSetupAPIHelper::IsEWDKEnabled()
+{
+ std::string envEnterpriseWDK, envDisableRegistryUse;
+ cmSystemTools::GetEnv("EnterpriseWDK", envEnterpriseWDK);
+ cmSystemTools::GetEnv("DisableRegistryUse", envDisableRegistryUse);
+ if (!cmSystemTools::Strucmp(envEnterpriseWDK.c_str(), "True") &&
+ !cmSystemTools::Strucmp(envDisableRegistryUse.c_str(), "True")) {
+ return true;
+ }
+
+ return false;
+}
+
bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
{
bool isVSInstanceExists = false;
@@ -274,16 +288,36 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
return true;
}
+ if (this->IsEWDKEnabled()) {
+ std::string envWindowsSdkDir81, envVSVersion, envVsInstallDir;
+
+ cmSystemTools::GetEnv("WindowsSdkDir_81", envWindowsSdkDir81);
+ cmSystemTools::GetEnv("VisualStudioVersion", envVSVersion);
+ cmSystemTools::GetEnv("VSINSTALLDIR", envVsInstallDir);
+ if (envVSVersion.empty() || envVsInstallDir.empty())
+ return false;
+
+ chosenInstanceInfo.VSInstallLocation =
+ std::wstring(envVsInstallDir.begin(), envVsInstallDir.end());
+ chosenInstanceInfo.Version =
+ std::wstring(envVSVersion.begin(), envVSVersion.end());
+ chosenInstanceInfo.VCToolsetVersion = envVSVersion;
+ chosenInstanceInfo.ullVersion = std::stoi(envVSVersion);
+ chosenInstanceInfo.IsWin10SDKInstalled = true;
+ chosenInstanceInfo.IsWin81SDKInstalled = !envWindowsSdkDir81.empty();
+ return true;
+ }
+
if (initializationFailure || setupConfig == NULL || setupConfig2 == NULL ||
setupHelper == NULL)
return false;
std::string envVSCommonToolsDir;
+ std::string envVSCommonToolsDirEnvName =
+ "VS" + std::to_string(this->Version) + "0COMNTOOLS";
- // FIXME: When we support VS versions beyond 2017, the version
- // to choose will be passed in by the caller. We need to map that
- // to a per-version name of this environment variable.
- if (cmSystemTools::GetEnv("VS150COMNTOOLS", envVSCommonToolsDir)) {
+ if (cmSystemTools::GetEnv(envVSCommonToolsDirEnvName.c_str(),
+ envVSCommonToolsDir)) {
cmSystemTools::ConvertToUnixSlashes(envVSCommonToolsDir);
}
@@ -295,8 +329,7 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
return false;
}
- // FIXME: Add a way for caller to specify other versions.
- std::wstring wantVersion = std::to_wstring(15) + L'.';
+ std::wstring const wantVersion = std::to_wstring(this->Version) + L'.';
SmartCOMPtr<ISetupInstance> instance;
while (SUCCEEDED(enumInstances->Next(1, &instance, NULL)) && instance) {
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index 4144c1541..1bda54a47 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -112,20 +112,18 @@ struct VSInstanceInfo
bool IsWin10SDKInstalled = false;
bool IsWin81SDKInstalled = false;
- VSInstanceInfo() = default;
-
std::string GetInstallLocation() const;
};
class cmVSSetupAPIHelper
{
public:
- cmVSSetupAPIHelper();
+ cmVSSetupAPIHelper(unsigned int version);
~cmVSSetupAPIHelper();
bool SetVSInstance(std::string const& vsInstallLocation);
- bool IsVS2017Installed();
+ bool IsVSInstalled();
bool GetVSInstanceInfo(std::string& vsInstallLocation);
bool GetVCToolsetVersion(std::string& vsToolsetVersion);
bool IsWin10SDKInstalled();
@@ -140,6 +138,8 @@ private:
int ChooseVSInstance(const std::vector<VSInstanceInfo>& vecVSInstances);
bool EnumerateAndChooseVSInstance();
+ unsigned int Version;
+
// COM ptrs to query about VS instances
SmartCOMPtr<ISetupConfiguration> setupConfig;
SmartCOMPtr<ISetupConfiguration2> setupConfig2;
@@ -150,6 +150,7 @@ private:
HRESULT comInitialized;
// current best instance of VS selected
VSInstanceInfo chosenInstanceInfo;
+ bool IsEWDKEnabled();
std::string SpecifiedVSInstallLocation;
};
diff --git a/Source/cmVariableRequiresCommand.cxx b/Source/cmVariableRequiresCommand.cxx
index 06ca53c0a..c02157ad1 100644
--- a/Source/cmVariableRequiresCommand.cxx
+++ b/Source/cmVariableRequiresCommand.cxx
@@ -57,7 +57,7 @@ bool cmVariableRequiresCommand::InitialPass(
"One or more of the required variables is advanced."
" To set the variable, you must turn on advanced mode in cmake.";
}
- cmSystemTools::Error(message.c_str());
+ cmSystemTools::Error(message);
}
return true;
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index bd5d19c39..3df142099 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -19,13 +19,9 @@ const char* cmVariableWatch::GetAccessAsString(int access_type)
return cmVariableWatchAccessStrings[access_type];
}
-cmVariableWatch::cmVariableWatch()
-{
-}
+cmVariableWatch::cmVariableWatch() = default;
-cmVariableWatch::~cmVariableWatch()
-{
-}
+cmVariableWatch::~cmVariableWatch() = default;
bool cmVariableWatch::AddWatch(const std::string& variable, WatchMethod method,
void* client_data /*=0*/,
diff --git a/Source/cmVariableWatch.h b/Source/cmVariableWatch.h
index 27d1b12df..5855fed29 100644
--- a/Source/cmVariableWatch.h
+++ b/Source/cmVariableWatch.h
@@ -63,15 +63,9 @@ public:
protected:
struct Pair
{
- WatchMethod Method;
- void* ClientData;
- DeleteData DeleteDataCall;
- Pair()
- : Method(nullptr)
- , ClientData(nullptr)
- , DeleteDataCall(nullptr)
- {
- }
+ WatchMethod Method = nullptr;
+ void* ClientData = nullptr;
+ DeleteData DeleteDataCall = nullptr;
~Pair()
{
if (this->DeleteDataCall && this->ClientData) {
diff --git a/Source/cmVariableWatchCommand.cxx b/Source/cmVariableWatchCommand.cxx
index e080df1ec..5fe55bd53 100644
--- a/Source/cmVariableWatchCommand.cxx
+++ b/Source/cmVariableWatchCommand.cxx
@@ -7,6 +7,7 @@
#include "cmExecutionStatus.h"
#include "cmListFileCache.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
#include "cmVariableWatch.h"
#include "cmake.h"
@@ -59,7 +60,7 @@ static void cmVariableWatchCommandVariableAccessed(const std::string& variable,
error << "Error in cmake code at\nUnknown:0:\n"
<< "A command failed during the invocation of callback \""
<< data->Command << "\".";
- cmSystemTools::Error(error.str().c_str());
+ cmSystemTools::Error(error.str());
data->InCallback = false;
return;
}
@@ -70,7 +71,7 @@ static void cmVariableWatchCommandVariableAccessed(const std::string& variable,
msg << "Variable \"" << variable << "\" was accessed using "
<< accessString << " with value \"" << (newValue ? newValue : "")
<< "\".";
- makefile->IssueMessage(cmake::LOG, msg.str());
+ makefile->IssueMessage(MessageType::LOG, msg.str());
}
data->InCallback = false;
@@ -83,9 +84,7 @@ static void deleteVariableWatchCallbackData(void* client_data)
delete data;
}
-cmVariableWatchCommand::cmVariableWatchCommand()
-{
-}
+cmVariableWatchCommand::cmVariableWatchCommand() = default;
cmVariableWatchCommand::~cmVariableWatchCommand()
{
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index d5e834b45..7736e593b 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -6,6 +6,7 @@
#include "cmComputeLinkInformation.h"
#include "cmCustomCommandGenerator.h"
#include "cmGeneratedFileStream.h"
+#include "cmGeneratorExpression.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalVisualStudio10Generator.h"
#include "cmLocalVisualStudio10Generator.h"
@@ -34,6 +35,7 @@ static std::string cmVS10EscapeAttr(std::string arg)
cmSystemTools::ReplaceString(arg, "<", "&lt;");
cmSystemTools::ReplaceString(arg, ">", "&gt;");
cmSystemTools::ReplaceString(arg, "\"", "&quot;");
+ cmSystemTools::ReplaceString(arg, "\n", "&#10;");
return arg;
}
@@ -45,24 +47,21 @@ struct cmVisualStudio10TargetGenerator::Elem
bool HasContent = false;
std::string Tag;
- Elem(std::ostream& s)
+ Elem(std::ostream& s, const char* tag)
: S(s)
, Indent(0)
+ , Tag(tag)
{
+ this->StartElement();
}
Elem(const Elem&) = delete;
- Elem(Elem& par)
- : S(par.S)
- , Indent(par.Indent + 1)
- {
- par.SetHasElements();
- }
Elem(Elem& par, const char* tag)
: S(par.S)
, Indent(par.Indent + 1)
+ , Tag(tag)
{
par.SetHasElements();
- this->StartElement(tag);
+ this->StartElement();
}
void SetHasElements()
{
@@ -72,12 +71,7 @@ struct cmVisualStudio10TargetGenerator::Elem
}
}
std::ostream& WriteString(const char* line);
- Elem& StartElement(const std::string& tag)
- {
- this->Tag = tag;
- this->WriteString("<") << tag;
- return *this;
- }
+ void StartElement() { this->WriteString("<") << this->Tag; }
void Element(const char* tag, const std::string& val)
{
Elem(*this, tag).Content(val);
@@ -87,8 +81,6 @@ struct cmVisualStudio10TargetGenerator::Elem
this->S << " " << an << "=\"" << cmVS10EscapeAttr(av) << "\"";
return *this;
}
- // This method for now assumes that this->Tag has been set, e.g. by calling
- // StartElement().
void Content(const std::string& val)
{
if (!this->HasContent) {
@@ -307,6 +299,11 @@ std::ostream& cmVisualStudio10TargetGenerator::Elem::WriteString(
"$(UserRootDir)\\Microsoft.CSharp.$(Platform).user.props"
#define VS10_CSharp_TARGETS "$(MSBuildToolsPath)\\Microsoft.CSharp.targets"
+#define VS10_CSharp_NETCF_TARGETS \
+ "$(MSBuildExtensionsPath)\\Microsoft\\$(TargetFrameworkIdentifier)\\" \
+ "$(TargetFrameworkTargetsVersion)\\Microsoft.$(TargetFrameworkIdentifier)" \
+ ".CSharp.targets"
+
void cmVisualStudio10TargetGenerator::Generate()
{
// do not generate external ms projects
@@ -325,8 +322,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->GeneratorTarget->GetName() +
"\" is of type STATIC_LIBRARY. This is discouraged (and may be "
"disabled in future). Make it a SHARED library instead.";
- this->Makefile->IssueMessage(cmake::MessageType::DEPRECATION_WARNING,
- message);
+ this->Makefile->IssueMessage(MessageType::DEPRECATION_WARNING, message);
}
this->ProjectType = csproj;
this->Managed = true;
@@ -379,10 +375,15 @@ void cmVisualStudio10TargetGenerator::Generate()
<< this->GlobalGenerator->Encoding() << "\"?>"
<< "\n";
{
- Elem e0(BuildFileStream);
- e0.StartElement("Project");
+ Elem e0(BuildFileStream, "Project");
e0.Attribute("DefaultTargets", "Build");
- e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
+ const char* toolsVersion = this->GlobalGenerator->GetToolsVersion();
+ if (this->GlobalGenerator->GetVersion() ==
+ cmGlobalVisualStudioGenerator::VS12 &&
+ this->GlobalGenerator->TargetsWindowsCE()) {
+ toolsVersion = "4.0";
+ }
+ e0.Attribute("ToolsVersion", toolsVersion);
e0.Attribute("xmlns",
"http://schemas.microsoft.com/developer/msbuild/2003");
@@ -491,9 +492,31 @@ void cmVisualStudio10TargetGenerator::Generate()
targetFrameworkVersion = this->GeneratorTarget->GetProperty(
"DOTNET_TARGET_FRAMEWORK_VERSION");
}
+ if (!targetFrameworkVersion && this->ProjectType == csproj &&
+ this->GlobalGenerator->TargetsWindowsCE() &&
+ this->GlobalGenerator->GetVersion() ==
+ cmGlobalVisualStudioGenerator::VS12) {
+ // VS12 .NETCF default to .NET framework 3.9
+ targetFrameworkVersion = "v3.9";
+ }
if (targetFrameworkVersion) {
e1.Element("TargetFrameworkVersion", targetFrameworkVersion);
}
+ if (this->ProjectType == csproj &&
+ this->GlobalGenerator->TargetsWindowsCE()) {
+ const char* targetFrameworkId = this->GeneratorTarget->GetProperty(
+ "VS_TARGET_FRAMEWORK_IDENTIFIER");
+ if (!targetFrameworkId) {
+ targetFrameworkId = "WindowsEmbeddedCompact";
+ }
+ e1.Element("TargetFrameworkIdentifier", targetFrameworkId);
+ const char* targetFrameworkVer = this->GeneratorTarget->GetProperty(
+ "VS_TARGET_FRAMEWORKS_TARGET_VERSION");
+ if (!targetFrameworkVer) {
+ targetFrameworkVer = "v8.0";
+ }
+ e1.Element("TargetFrameworkTargetsVersion", targetFrameworkVer);
+ }
}
// Disable the project upgrade prompt that is displayed the first time a
@@ -634,6 +657,7 @@ void cmVisualStudio10TargetGenerator::Generate()
Elem(e0, "PropertyGroup").Attribute("Label", "UserMacros");
this->WriteWinRTPackageCertificateKeyFile(e0);
this->WritePathAndIncrementalLinkOptions(e0);
+ this->WriteCEDebugProjectConfigurationValues(e0);
this->WriteItemDefinitionGroups(e0);
this->WriteCustomCommands(e0);
this->WriteAllSources(e0);
@@ -648,7 +672,11 @@ void cmVisualStudio10TargetGenerator::Generate()
Elem(e0, "Import").Attribute("Project", VS10_CXX_TARGETS);
break;
case csproj:
- Elem(e0, "Import").Attribute("Project", VS10_CSharp_TARGETS);
+ if (this->GlobalGenerator->TargetsWindowsCE()) {
+ Elem(e0, "Import").Attribute("Project", VS10_CSharp_NETCF_TARGETS);
+ } else {
+ Elem(e0, "Import").Attribute("Project", VS10_CSharp_TARGETS);
+ }
break;
}
@@ -734,7 +762,8 @@ void cmVisualStudio10TargetGenerator::WriteDotNetReferences(Elem& e0)
// if the entry from VS_DOTNET_REFERENCES is an existing file, generate
// a new hint-reference and name it from the filename
if (cmsys::SystemTools::FileExists(ri, true)) {
- std::string name = cmsys::SystemTools::GetFilenameWithoutExtension(ri);
+ std::string name =
+ cmsys::SystemTools::GetFilenameWithoutLastExtension(ri);
std::string path = ri;
ConvertToWindowsSlash(path);
this->DotNetHintReferences[""].push_back(
@@ -921,8 +950,8 @@ void cmVisualStudio10TargetGenerator::WriteXamlFilesGroup(Elem& e0)
xamlType = "Page";
}
- Elem e2(e1);
- this->WriteSource(e2, xamlType, oi);
+ Elem e2(e1, xamlType);
+ this->WriteSource(e2, oi);
e2.SetHasElements();
if (this->ProjectType == csproj && !this->InSourceBuild) {
// add <Link> tag to written XAML source if necessary
@@ -1081,6 +1110,32 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues(Elem& e0)
}
}
+void cmVisualStudio10TargetGenerator::WriteCEDebugProjectConfigurationValues(
+ Elem& e0)
+{
+ if (!this->GlobalGenerator->TargetsWindowsCE()) {
+ return;
+ }
+ const char* additionalFiles =
+ this->GeneratorTarget->GetProperty("DEPLOYMENT_ADDITIONAL_FILES");
+ const char* remoteDirectory =
+ this->GeneratorTarget->GetProperty("DEPLOYMENT_REMOTE_DIRECTORY");
+ if (!(additionalFiles || remoteDirectory)) {
+ return;
+ }
+ for (std::string const& c : this->Configurations) {
+ Elem e1(e0, "PropertyGroup");
+ e1.Attribute("Condition", this->CalcCondition(c));
+
+ if (remoteDirectory) {
+ e1.Element("RemoteDirectory", remoteDirectory);
+ }
+ if (additionalFiles) {
+ e1.Element("CEAdditionalFiles", additionalFiles);
+ }
+ }
+}
+
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
Elem& e1, std::string const& config)
{
@@ -1278,15 +1333,15 @@ void cmVisualStudio10TargetGenerator::WriteCustomRule(
std::unique_ptr<Elem> spe2;
if (this->ProjectType != csproj) {
spe1 = cm::make_unique<Elem>(e0, "ItemGroup");
- spe2 = cm::make_unique<Elem>(*spe1);
- this->WriteSource(*spe2, "CustomBuild", source);
+ spe2 = cm::make_unique<Elem>(*spe1, "CustomBuild");
+ this->WriteSource(*spe2, source);
spe2->SetHasElements();
} else {
Elem e1(e0, "ItemGroup");
- Elem e2(e1);
+ Elem e2(e1, "None");
std::string link;
this->GetCSharpSourceLink(source, link);
- this->WriteSource(e2, "None", source);
+ this->WriteSource(e2, source);
e2.SetHasElements();
if (!link.empty()) {
e2.Element("Link", link);
@@ -1402,6 +1457,14 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
groupsUsed.insert(sourceGroup);
}
+ if (cmSourceFile const* srcCMakeLists =
+ this->LocalGenerator->CreateVCProjBuildRule()) {
+ std::string const& source = srcCMakeLists->GetFullPath();
+ cmSourceGroup* sourceGroup =
+ this->Makefile->FindSourceGroup(source, sourceGroups);
+ groupsUsed.insert(sourceGroup);
+ }
+
this->AddMissingSourceGroups(groupsUsed, sourceGroups);
// Write out group file
@@ -1419,8 +1482,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
<< this->GlobalGenerator->Encoding() << "\"?>"
<< "\n";
{
- Elem e0(fout);
- e0.StartElement("Project");
+ Elem e0(fout, "Project");
e0.Attribute("ToolsVersion", this->GlobalGenerator->GetToolsVersion());
e0.Attribute("xmlns",
"http://schemas.microsoft.com/developer/msbuild/2003");
@@ -1571,8 +1633,8 @@ void cmVisualStudio10TargetGenerator::WriteHeaderSource(Elem& e1,
cmSourceFile const* sf)
{
std::string const& fileName = sf->GetFullPath();
- Elem e2(e1);
- this->WriteSource(e2, "ClInclude", sf);
+ Elem e2(e1, "ClInclude");
+ this->WriteSource(e2, sf);
if (this->IsResxHeader(fileName)) {
e2.Element("FileType", "CppForm");
} else if (this->IsXamlHeader(fileName)) {
@@ -1692,6 +1754,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
subType = "Designer";
}
if (const char* c = sf->GetProperty("VS_COPY_TO_OUT_DIR")) {
+ tool = "Content";
copyToOutDir = c;
toolHasSettings = true;
}
@@ -1740,8 +1803,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
}
}
- Elem e2(e1);
- this->WriteSource(e2, tool, sf);
+ Elem e2(e1, tool);
+ this->WriteSource(e2, sf);
if (toolHasSettings) {
e2.SetHasElements();
@@ -1861,7 +1924,6 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(Elem& e1,
}
void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2,
- std::string const& tool,
cmSourceFile const* sf)
{
// Visual Studio tools append relative paths to the current dir, as in:
@@ -1897,11 +1959,10 @@ void cmVisualStudio10TargetGenerator::WriteSource(Elem& e2,
}
}
ConvertToWindowsSlash(sourceFile);
- e2.StartElement(tool);
e2.Attribute("Include", sourceFile);
ToolSource toolSource = { sf, forceRelative };
- this->Tools[tool].push_back(toolSource);
+ this->Tools[e2.Tag].push_back(toolSource);
}
void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
@@ -2005,8 +2066,8 @@ void cmVisualStudio10TargetGenerator::WriteAllSources(Elem& e0)
include_configs.begin(), include_configs.end(),
std::back_inserter(exclude_configs));
- Elem e2(e1);
- this->WriteSource(e2, tool, si.Source);
+ Elem e2(e1, tool);
+ this->WriteSource(e2, si.Source);
if (si.Kind == cmGeneratorTarget::SourceKindObjectSource) {
this->OutputSourceSpecificFlags(e2, si.Source);
}
@@ -2229,6 +2290,58 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
e1.Element("_ProjectFileVersion", "10.0.20506.1");
for (std::string const& config : this->Configurations) {
const std::string cond = this->CalcCondition(config);
+
+ if (ttype <= cmStateEnums::UTILITY) {
+ if (const char* workingDir = this->GeneratorTarget->GetProperty(
+ "VS_DEBUGGER_WORKING_DIRECTORY")) {
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(workingDir);
+ std::string genWorkingDir =
+ cge->Evaluate(this->LocalGenerator, config);
+
+ e1.WritePlatformConfigTag("LocalDebuggerWorkingDirectory", cond,
+ genWorkingDir);
+ }
+
+ if (const char* environment =
+ this->GeneratorTarget->GetProperty("VS_DEBUGGER_ENVIRONMENT")) {
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(environment);
+ std::string genEnvironment =
+ cge->Evaluate(this->LocalGenerator, config);
+
+ e1.WritePlatformConfigTag("LocalDebuggerEnvironment", cond,
+ genEnvironment);
+ }
+
+ if (const char* debuggerCommand =
+ this->GeneratorTarget->GetProperty("VS_DEBUGGER_COMMAND")) {
+
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(debuggerCommand);
+ std::string genDebuggerCommand =
+ cge->Evaluate(this->LocalGenerator, config);
+
+ e1.WritePlatformConfigTag("LocalDebuggerCommand", cond,
+ genDebuggerCommand);
+ }
+
+ if (const char* commandArguments = this->GeneratorTarget->GetProperty(
+ "VS_DEBUGGER_COMMAND_ARGUMENTS")) {
+ cmGeneratorExpression ge;
+ std::unique_ptr<cmCompiledGeneratorExpression> cge =
+ ge.Parse(commandArguments);
+ std::string genCommandArguments =
+ cge->Evaluate(this->LocalGenerator, config);
+
+ e1.WritePlatformConfigTag("LocalDebuggerCommandArguments", cond,
+ genCommandArguments);
+ }
+ }
+
if (ttype >= cmStateEnums::UTILITY) {
e1.WritePlatformConfigTag(
"IntDir", cond, "$(Platform)\\$(Configuration)\\$(ProjectName)\\");
@@ -2293,55 +2406,6 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions(
e1.WritePlatformConfigTag("ExcludePath", cond, sdkExcludeDirectories);
}
- if (const char* workingDir = this->GeneratorTarget->GetProperty(
- "VS_DEBUGGER_WORKING_DIRECTORY")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(workingDir);
- std::string genWorkingDir =
- cge->Evaluate(this->LocalGenerator, config);
-
- e1.WritePlatformConfigTag("LocalDebuggerWorkingDirectory", cond,
- genWorkingDir);
- }
-
- if (const char* environment =
- this->GeneratorTarget->GetProperty("VS_DEBUGGER_ENVIRONMENT")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(environment);
- std::string genEnvironment =
- cge->Evaluate(this->LocalGenerator, config);
-
- e1.WritePlatformConfigTag("LocalDebuggerEnvironment", cond,
- genEnvironment);
- }
-
- if (const char* debuggerCommand =
- this->GeneratorTarget->GetProperty("VS_DEBUGGER_COMMAND")) {
-
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(debuggerCommand);
- std::string genDebuggerCommand =
- cge->Evaluate(this->LocalGenerator, config);
-
- e1.WritePlatformConfigTag("LocalDebuggerCommand", cond,
- genDebuggerCommand);
- }
-
- if (const char* commandArguments = this->GeneratorTarget->GetProperty(
- "VS_DEBUGGER_COMMAND_ARGUMENTS")) {
- cmGeneratorExpression ge;
- std::unique_ptr<cmCompiledGeneratorExpression> cge =
- ge.Parse(commandArguments);
- std::string genCommandArguments =
- cge->Evaluate(this->LocalGenerator, config);
-
- e1.WritePlatformConfigTag("LocalDebuggerCommandArguments", cond,
- genCommandArguments);
- }
-
std::string name =
cmSystemTools::GetFilenameWithoutLastExtension(targetNameFull);
e1.WritePlatformConfigTag("TargetName", cond, name);
@@ -2536,7 +2600,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
"\" the /clr compiler flag was added manually. " +
"Set usage of C++/CLI by setting COMMON_LANGUAGE_RUNTIME "
"target property.";
- this->Makefile->IssueMessage(cmake::MessageType::WARNING, message);
+ this->Makefile->IssueMessage(MessageType::WARNING, message);
}
}
if (auto* clr =
@@ -2566,6 +2630,10 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
}
clOptions.AddDefines(targetDefines);
+ if (this->ProjectType == csproj) {
+ clOptions.AppendFlag("DefineConstants", targetDefines);
+ }
+
// Get includes for this target
if (!this->LangForClCompile.empty()) {
clOptions.AddIncludes(
@@ -2582,8 +2650,9 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
configDefine += configName;
configDefine += "\"";
clOptions.AddDefine(configDefine);
- if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) {
- clOptions.AddDefine(exportMacro);
+ if (const std::string* exportMacro =
+ this->GeneratorTarget->GetExportMacro()) {
+ clOptions.AddDefine(*exportMacro);
}
if (this->MSTools) {
@@ -2879,8 +2948,9 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
configDefine += configName;
configDefine += "\"";
cudaOptions.AddDefine(configDefine);
- if (const char* exportMacro = this->GeneratorTarget->GetExportMacro()) {
- cudaOptions.AddDefine(exportMacro);
+ if (const std::string* exportMacro =
+ this->GeneratorTarget->GetExportMacro()) {
+ cudaOptions.AddDefine(*exportMacro);
}
// Get includes for this target
@@ -2929,18 +2999,19 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaLinkOptions(
// Determine if we need to do a device link
bool doDeviceLinking = false;
- switch (this->GeneratorTarget->GetType()) {
- case cmStateEnums::SHARED_LIBRARY:
- case cmStateEnums::MODULE_LIBRARY:
- case cmStateEnums::EXECUTABLE:
- doDeviceLinking = true;
- break;
- case cmStateEnums::STATIC_LIBRARY:
- doDeviceLinking = this->GeneratorTarget->GetPropertyAsBool(
- "CUDA_RESOLVE_DEVICE_SYMBOLS");
- break;
- default:
- break;
+ if (const char* resolveDeviceSymbols =
+ this->GeneratorTarget->GetProperty("CUDA_RESOLVE_DEVICE_SYMBOLS")) {
+ doDeviceLinking = cmSystemTools::IsOn(resolveDeviceSymbols);
+ } else {
+ switch (this->GeneratorTarget->GetType()) {
+ case cmStateEnums::SHARED_LIBRARY:
+ case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::EXECUTABLE:
+ doDeviceLinking = true;
+ break;
+ default:
+ break;
+ }
}
cudaLinkOptions.AddFlag("PerformDeviceLink",
@@ -3521,8 +3592,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLibOptions(
this->LocalGenerator->GetCurrentBinaryDirectory();
for (cmComputeLinkInformation::Item const& l : libs) {
if (l.IsPath && cmVS10IsTargetsFile(l.Value)) {
- std::string path =
- this->LocalGenerator->ConvertToRelativePath(currentBinDir, l.Value);
+ std::string path = this->LocalGenerator->MaybeConvertToRelativePath(
+ currentBinDir, l.Value);
ConvertToWindowsSlash(path);
this->AddTargetsFileAndConfigPair(path, config);
}
@@ -3605,8 +3676,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
}
if (l.IsPath) {
- std::string path =
- this->LocalGenerator->ConvertToRelativePath(currentBinDir, l.Value);
+ std::string path = this->LocalGenerator->MaybeConvertToRelativePath(
+ currentBinDir, l.Value);
ConvertToWindowsSlash(path);
if (cmVS10IsTargetsFile(l.Value)) {
vsTargetVec.push_back(path);
@@ -3821,8 +3892,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
this->WriteDotNetReferenceCustomTags(e2, name);
// If the dependency target is not managed (compiled with /clr or
- // C# target) we cannot reference it and have to set
- // 'ReferenceOutputAssembly' to false.
+ // C# target) and not a WinRT component we cannot reference it and
+ // have to set 'ReferenceOutputAssembly' to false.
auto referenceNotManaged =
dt->GetManagedType("") < cmGeneratorTarget::ManagedType::Mixed;
// Workaround to check for manually set /clr flags.
@@ -3839,6 +3910,12 @@ void cmVisualStudio10TargetGenerator::WriteProjectReferences(Elem& e0)
if (referenceNotManaged && dt->GetType() == cmStateEnums::STATIC_LIBRARY) {
referenceNotManaged = !dt->IsCSharpOnly();
}
+
+ // Referencing WinRT components is okay.
+ if (referenceNotManaged) {
+ referenceNotManaged = !dt->GetPropertyAsBool("VS_WINRT_COMPONENT");
+ }
+
if (referenceNotManaged) {
e2.Element("ReferenceOutputAssembly", "false");
e2.Element("CopyToOutputDirectory", "Never");
@@ -3885,15 +3962,13 @@ void cmVisualStudio10TargetGenerator::WriteSinglePlatformExtension(
void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0)
{
std::vector<std::string> sdkReferences;
- Elem e1(e0);
- bool hasWrittenItemGroup = false;
+ std::unique_ptr<Elem> spe1;
if (const char* vsSDKReferences =
this->GeneratorTarget->GetProperty("VS_SDK_REFERENCES")) {
cmSystemTools::ExpandListArgument(vsSDKReferences, sdkReferences);
- e1.StartElement("ItemGroup");
- hasWrittenItemGroup = true;
+ spe1 = cm::make_unique<Elem>(e0, "ItemGroup");
for (std::string const& ri : sdkReferences) {
- Elem(e1, "SDKReference").Attribute("Include", ri);
+ Elem(*spe1, "SDKReference").Attribute("Include", ri);
}
}
@@ -3909,19 +3984,20 @@ void cmVisualStudio10TargetGenerator::WriteSDKReferences(Elem& e0)
if (desktopExtensionsVersion || mobileExtensionsVersion ||
iotExtensionsVersion) {
- if (!hasWrittenItemGroup) {
- e1.StartElement("ItemGroup");
+ if (!spe1) {
+ spe1 = cm::make_unique<Elem>(e0, "ItemGroup");
}
if (desktopExtensionsVersion) {
- this->WriteSingleSDKReference(e1, "WindowsDesktop",
+ this->WriteSingleSDKReference(*spe1, "WindowsDesktop",
desktopExtensionsVersion);
}
if (mobileExtensionsVersion) {
- this->WriteSingleSDKReference(e1, "WindowsMobile",
+ this->WriteSingleSDKReference(*spe1, "WindowsMobile",
mobileExtensionsVersion);
}
if (iotExtensionsVersion) {
- this->WriteSingleSDKReference(e1, "WindowsIoT", iotExtensionsVersion);
+ this->WriteSingleSDKReference(*spe1, "WindowsIoT",
+ iotExtensionsVersion);
}
}
}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 0dc03b655..590100496 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -25,12 +25,16 @@ class cmVS10GeneratorOptions;
class cmVisualStudio10TargetGenerator
{
- CM_DISABLE_COPY(cmVisualStudio10TargetGenerator)
-
public:
cmVisualStudio10TargetGenerator(cmGeneratorTarget* target,
cmGlobalVisualStudio10Generator* gg);
~cmVisualStudio10TargetGenerator();
+
+ cmVisualStudio10TargetGenerator(cmVisualStudio10TargetGenerator const&) =
+ delete;
+ cmVisualStudio10TargetGenerator& operator=(
+ cmVisualStudio10TargetGenerator const&) = delete;
+
void Generate();
private:
@@ -57,13 +61,14 @@ private:
void WriteProjectConfigurations(Elem& e0);
void WriteProjectConfigurationValues(Elem& e0);
void WriteMSToolConfigurationValues(Elem& e1, std::string const& config);
+ void WriteCEDebugProjectConfigurationValues(Elem& e0);
void WriteMSToolConfigurationValuesManaged(Elem& e1,
std::string const& config);
void WriteHeaderSource(Elem& e1, cmSourceFile const* sf);
void WriteExtraSource(Elem& e1, cmSourceFile const* sf);
void WriteNsightTegraConfigurationValues(Elem& e1,
std::string const& config);
- void WriteSource(Elem& e2, std::string const& tool, cmSourceFile const* sf);
+ void WriteSource(Elem& e2, cmSourceFile const* sf);
void WriteExcludeFromBuild(Elem& e2,
std::vector<size_t> const& exclude_configs);
void WriteAllSources(Elem& e0);
diff --git a/Source/cmVisualStudio10ToolsetOptions.cxx b/Source/cmVisualStudio10ToolsetOptions.cxx
index 9a1d95078..a490e03df 100644
--- a/Source/cmVisualStudio10ToolsetOptions.cxx
+++ b/Source/cmVisualStudio10ToolsetOptions.cxx
@@ -6,145 +6,127 @@
#include "cmIDEFlagTable.h"
#include "cmVisualStudioGeneratorOptions.h"
-#include "cmVS10CLFlagTable.h"
-#include "cmVS10CSharpFlagTable.h"
-#include "cmVS10LibFlagTable.h"
-#include "cmVS10LinkFlagTable.h"
-#include "cmVS10MASMFlagTable.h"
-#include "cmVS10RCFlagTable.h"
-#include "cmVS11CLFlagTable.h"
-#include "cmVS11CSharpFlagTable.h"
-#include "cmVS11LibFlagTable.h"
-#include "cmVS11LinkFlagTable.h"
-#include "cmVS11MASMFlagTable.h"
-#include "cmVS11RCFlagTable.h"
-#include "cmVS12CLFlagTable.h"
-#include "cmVS12CSharpFlagTable.h"
-#include "cmVS12LibFlagTable.h"
-#include "cmVS12LinkFlagTable.h"
-#include "cmVS12MASMFlagTable.h"
-#include "cmVS12RCFlagTable.h"
-#include "cmVS140CLFlagTable.h"
-#include "cmVS140CSharpFlagTable.h"
-#include "cmVS140LinkFlagTable.h"
-#include "cmVS141CLFlagTable.h"
-#include "cmVS141CSharpFlagTable.h"
-#include "cmVS141LinkFlagTable.h"
-#include "cmVS14LibFlagTable.h"
-#include "cmVS14MASMFlagTable.h"
-#include "cmVS14RCFlagTable.h"
-
-cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetClFlagTable(
+std::string cmVisualStudio10ToolsetOptions::GetClFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if (toolset == "v141") {
- return cmVS141CLFlagTable;
+ if (toolset == "v142") {
+ return "v142";
+ } else if (toolset == "v141") {
+ return "v141";
} else if (useToolset == "v140") {
- return cmVS140CLFlagTable;
+ return "v140";
} else if (useToolset == "v120") {
- return cmVS12CLFlagTable;
+ return "v12";
} else if (useToolset == "v110") {
- return cmVS11CLFlagTable;
+ return "v11";
} else if (useToolset == "v100") {
- return cmVS10CLFlagTable;
+ return "v10";
} else {
- return 0;
+ return "";
}
}
-cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetCSharpFlagTable(
+std::string cmVisualStudio10ToolsetOptions::GetCSharpFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v141")) {
- return cmVS141CSharpFlagTable;
+ if (useToolset == "v142") {
+ // FIXME: Add CSharp flag table for v142.
+ return "v141";
+ } else if (useToolset == "v141") {
+ return "v141";
} else if (useToolset == "v140") {
- return cmVS140CSharpFlagTable;
+ return "v140";
} else if (useToolset == "v120") {
- return cmVS12CSharpFlagTable;
+ return "v12";
} else if (useToolset == "v110") {
- return cmVS11CSharpFlagTable;
+ return "v11";
} else if (useToolset == "v100") {
- return cmVS10CSharpFlagTable;
+ return "v10";
} else {
- return 0;
+ return "";
}
}
-cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetRcFlagTable(
+std::string cmVisualStudio10ToolsetOptions::GetRcFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v140") || (useToolset == "v141")) {
- return cmVS14RCFlagTable;
+ if ((useToolset == "v140") || (useToolset == "v141") ||
+ (useToolset == "v142")) {
+ return "v14";
} else if (useToolset == "v120") {
- return cmVS12RCFlagTable;
+ return "v12";
} else if (useToolset == "v110") {
- return cmVS11RCFlagTable;
+ return "v11";
} else if (useToolset == "v100") {
- return cmVS10RCFlagTable;
+ return "v10";
} else {
- return 0;
+ return "";
}
}
-cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLibFlagTable(
+std::string cmVisualStudio10ToolsetOptions::GetLibFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v140") || (useToolset == "v141")) {
- return cmVS14LibFlagTable;
+ if ((useToolset == "v140") || (useToolset == "v141") ||
+ (useToolset == "v142")) {
+ return "v14";
} else if (useToolset == "v120") {
- return cmVS12LibFlagTable;
+ return "v12";
} else if (useToolset == "v110") {
- return cmVS11LibFlagTable;
+ return "v11";
} else if (useToolset == "v100") {
- return cmVS10LibFlagTable;
+ return "v10";
} else {
- return 0;
+ return "";
}
}
-cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetLinkFlagTable(
+std::string cmVisualStudio10ToolsetOptions::GetLinkFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if (useToolset == "v141") {
- return cmVS141LinkFlagTable;
+ if (useToolset == "v142") {
+ return "v142";
+ } else if (useToolset == "v141") {
+ return "v141";
} else if (useToolset == "v140") {
- return cmVS140LinkFlagTable;
+ return "v140";
} else if (useToolset == "v120") {
- return cmVS12LinkFlagTable;
+ return "v12";
} else if (useToolset == "v110") {
- return cmVS11LinkFlagTable;
+ return "v11";
} else if (useToolset == "v100") {
- return cmVS10LinkFlagTable;
+ return "v10";
} else {
- return 0;
+ return "";
}
}
-cmIDEFlagTable const* cmVisualStudio10ToolsetOptions::GetMasmFlagTable(
+std::string cmVisualStudio10ToolsetOptions::GetMasmFlagTableName(
std::string const& name, std::string const& toolset) const
{
std::string const useToolset = this->GetToolsetName(name, toolset);
- if ((useToolset == "v140") || (useToolset == "v141")) {
- return cmVS14MASMFlagTable;
+ if ((useToolset == "v140") || (useToolset == "v141") ||
+ (useToolset == "v142")) {
+ return "v14";
} else if (useToolset == "v120") {
- return cmVS12MASMFlagTable;
+ return "v12";
} else if (useToolset == "v110") {
- return cmVS11MASMFlagTable;
+ return "v11";
} else if (useToolset == "v100") {
- return cmVS10MASMFlagTable;
+ return "v10";
} else {
- return 0;
+ return "";
}
}
diff --git a/Source/cmVisualStudio10ToolsetOptions.h b/Source/cmVisualStudio10ToolsetOptions.h
index c736a49f5..875a35b24 100644
--- a/Source/cmVisualStudio10ToolsetOptions.h
+++ b/Source/cmVisualStudio10ToolsetOptions.h
@@ -7,8 +7,6 @@
#include <string>
-struct cmIDEFlagTable;
-
/** \class cmVisualStudio10ToolsetOptions
* \brief Retrieves toolset options for MSBuild.
*
@@ -17,20 +15,18 @@ struct cmIDEFlagTable;
class cmVisualStudio10ToolsetOptions
{
public:
- cmIDEFlagTable const* GetClFlagTable(std::string const& name,
- std::string const& toolset) const;
- cmIDEFlagTable const* GetCSharpFlagTable(std::string const& name,
- std::string const& toolset) const;
- cmIDEFlagTable const* GetRcFlagTable(std::string const& name,
- std::string const& toolset) const;
- cmIDEFlagTable const* GetLibFlagTable(std::string const& name,
- std::string const& toolset) const;
- cmIDEFlagTable const* GetLinkFlagTable(std::string const& name,
- std::string const& toolset) const;
- cmIDEFlagTable const* GetMasmFlagTable(std::string const& name,
- std::string const& toolset) const;
-
-private:
+ std::string GetClFlagTableName(std::string const& name,
+ std::string const& toolset) const;
+ std::string GetCSharpFlagTableName(std::string const& name,
+ std::string const& toolset) const;
+ std::string GetRcFlagTableName(std::string const& name,
+ std::string const& toolset) const;
+ std::string GetLibFlagTableName(std::string const& name,
+ std::string const& toolset) const;
+ std::string GetLinkFlagTableName(std::string const& name,
+ std::string const& toolset) const;
+ std::string GetMasmFlagTableName(std::string const& name,
+ std::string const& toolset) const;
std::string GetToolsetName(std::string const& name,
std::string const& toolset) const;
};
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index 5d67dcf51..5c3e533b8 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -70,6 +70,7 @@ void cmVisualStudioGeneratorOptions::FixExceptionHandlingDefault()
case cmGlobalVisualStudioGenerator::VS12:
case cmGlobalVisualStudioGenerator::VS14:
case cmGlobalVisualStudioGenerator::VS15:
+ case cmGlobalVisualStudioGenerator::VS16:
// by default VS puts <ExceptionHandling></ExceptionHandling> empty
// for a project, to make our projects look the same put a new line
// and space over for the closing </ExceptionHandling> as the default
@@ -269,7 +270,7 @@ void cmVisualStudioGeneratorOptions::FixManifestUACFlags()
if (keyValue[1].front() == '\'' && keyValue[1].back() == '\'') {
keyValue[1] =
- keyValue[1].substr(1, std::max<int>(0, keyValue[1].size() - 2));
+ keyValue[1].substr(1, std::max(0, cm::isize(keyValue[1]) - 2));
}
if (keyValue[0] == "level") {
diff --git a/Source/cmVisualStudioSlnParser.cxx b/Source/cmVisualStudioSlnParser.cxx
index a9acb3fce..93532765f 100644
--- a/Source/cmVisualStudioSlnParser.cxx
+++ b/Source/cmVisualStudioSlnParser.cxx
@@ -602,8 +602,8 @@ bool cmVisualStudioSlnParser::ParseTag(const std::string& fullTag,
}
const std::string& arg = cmSystemTools::TrimWhitespace(
fullTag.substr(idxLeftParen + 1, idxRightParen - idxLeftParen - 1));
- if (arg[0] == '"') {
- if (arg[arg.size() - 1] != '"') {
+ if (arg.front() == '"') {
+ if (arg.back() != '"') {
this->LastResult.SetError(ResultErrorInputStructure,
state.GetCurrentLine());
return false;
@@ -620,7 +620,7 @@ bool cmVisualStudioSlnParser::ParseValue(const std::string& value,
const std::string& trimmed = cmSystemTools::TrimWhitespace(value);
if (trimmed.empty())
parsedLine.AddValue(trimmed);
- else if (trimmed[0] == '"' && trimmed[trimmed.size() - 1] == '"')
+ else if (trimmed.front() == '"' && trimmed.back() == '"')
parsedLine.AddQuotedValue(trimmed.substr(1, trimmed.size() - 2));
else
parsedLine.AddValue(trimmed);
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index d5bcfc230..a01fa6f1c 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -6,8 +6,8 @@
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
#include "cmSystemTools.h"
-#include "cmake.h"
#include <memory> // IWYU pragma: keep
@@ -37,7 +37,7 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
// Remove the function blocker for this scope or bail.
std::unique_ptr<cmFunctionBlocker> fb(
mf.RemoveFunctionBlocker(this, lff));
- if (!fb.get()) {
+ if (!fb) {
return false;
}
@@ -45,7 +45,7 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
std::vector<cmExpandedCommandArgument> expandedArguments;
mf.ExpandArguments(this->Args, expandedArguments);
- cmake::MessageType messageType;
+ MessageType messageType;
cmListFileContext execContext = this->GetStartingContext();
@@ -72,7 +72,7 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
err += errorString;
err += ").";
mf.IssueMessage(messageType, err);
- if (messageType == cmake::FATAL_ERROR) {
+ if (messageType == MessageType::FATAL_ERROR) {
cmSystemTools::SetFatalErrorOccured();
return true;
}
diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx
index c504ef436..49dbf1a19 100644
--- a/Source/cmWriteFileCommand.cxx
+++ b/Source/cmWriteFileCommand.cxx
@@ -50,7 +50,7 @@ bool cmWriteFileCommand::InitialPass(std::vector<std::string> const& args,
// Set permissions to writable
if (cmSystemTools::GetPermissions(fileName.c_str(), mode)) {
#if defined(_MSC_VER) || defined(__MINGW32__)
- writable = mode & S_IWRITE;
+ writable = (mode & S_IWRITE) != 0;
mode_t newMode = mode | S_IWRITE;
#else
writable = mode & S_IWUSR;
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index 58cb9c9d3..1b161987a 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -5,16 +5,17 @@
#include <iomanip>
#include <iostream>
#include <sstream>
+#include <utility>
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
#include "cmXMLSafe.h"
-cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj, const TestObjects& tests,
+cmXCodeScheme::cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests,
const std::vector<std::string>& configList,
unsigned int xcVersion)
: Target(xcObj)
- , Tests(tests)
+ , Tests(std::move(tests))
, TargetName(xcObj->GetTarget()->GetName())
, ConfigList(configList)
, XcodeVersion(xcVersion)
@@ -35,7 +36,7 @@ void cmXCodeScheme::WriteXCodeSharedScheme(const std::string& xcProjDir,
xcodeSchemeFile += this->TargetName;
xcodeSchemeFile += ".xcscheme";
- cmGeneratedFileStream fout(xcodeSchemeFile.c_str());
+ cmGeneratedFileStream fout(xcodeSchemeFile);
fout.SetCopyIfDifferent(true);
if (!fout) {
return;
@@ -216,7 +217,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
if (!arguments.empty()) {
xout.StartElement("CommandLineArguments");
- for (auto argument : arguments) {
+ for (auto const& argument : arguments) {
xout.StartElement("CommandLineArgument");
xout.BreakAttributes();
diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h
index 96c76e642..8c4712359 100644
--- a/Source/cmXCodeScheme.h
+++ b/Source/cmXCodeScheme.h
@@ -20,7 +20,7 @@ class cmXCodeScheme
public:
typedef std::vector<const cmXCodeObject*> TestObjects;
- cmXCodeScheme(cmXCodeObject* xcObj, const TestObjects& tests,
+ cmXCodeScheme(cmXCodeObject* xcObj, TestObjects tests,
const std::vector<std::string>& configList,
unsigned int xcVersion);
diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h
index b08065409..1df8a09d7 100644
--- a/Source/cmXMLWriter.h
+++ b/Source/cmXMLWriter.h
@@ -16,12 +16,13 @@
class cmXMLWriter
{
- CM_DISABLE_COPY(cmXMLWriter)
-
public:
cmXMLWriter(std::ostream& output, std::size_t level = 0);
~cmXMLWriter();
+ cmXMLWriter(cmXMLWriter const&) = delete;
+ cmXMLWriter& operator=(cmXMLWriter const&) = delete;
+
void StartDocument(const char* encoding = "UTF-8");
void EndDocument();
diff --git a/Source/cm_codecvt.cxx b/Source/cm_codecvt.cxx
index 9519f9155..821c112b3 100644
--- a/Source/cm_codecvt.cxx
+++ b/Source/cm_codecvt.cxx
@@ -38,9 +38,7 @@ codecvt::codecvt(Encoding e)
}
}
-codecvt::~codecvt()
-{
-}
+codecvt::~codecvt() = default;
bool codecvt::do_always_noconv() const throw()
{
diff --git a/Source/cm_static_string_view.hxx b/Source/cm_static_string_view.hxx
new file mode 100644
index 000000000..1bef0c68b
--- /dev/null
+++ b/Source/cm_static_string_view.hxx
@@ -0,0 +1,41 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cm_static_string_view_hxx
+#define cm_static_string_view_hxx
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include "cm_string_view.hxx"
+
+#include <cstddef>
+
+namespace cm {
+
+/** A string_view that only binds to static storage.
+ *
+ * This is used together with the `""_s` user-defined literal operator
+ * to construct a type-safe abstraction of a string_view that only views
+ * statically allocated strings. These strings are const and available
+ * for the entire lifetime of the program.
+ */
+class static_string_view : public string_view
+{
+ static_string_view(string_view v)
+ : string_view(v)
+ {
+ }
+
+ friend static_string_view operator"" _s(const char* data, size_t size);
+};
+
+/** Create a static_string_view using `""_s` literal syntax. */
+inline static_string_view operator"" _s(const char* data, size_t size)
+{
+ return string_view(data, size);
+}
+
+} // namespace cm
+
+using cm::operator"" _s;
+
+#endif
diff --git a/Source/cm_string_view.cxx b/Source/cm_string_view.cxx
new file mode 100644
index 000000000..61fa80e82
--- /dev/null
+++ b/Source/cm_string_view.cxx
@@ -0,0 +1,301 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include "cm_string_view.hxx"
+
+#ifndef CMake_HAVE_CXX_STRING_VIEW
+
+# include "cm_kwiml.h"
+
+# include <algorithm>
+# include <ostream>
+# include <stdexcept>
+
+namespace cm {
+
+string_view::const_reference string_view::at(size_type pos) const
+{
+ if (pos >= size_) {
+ throw std::out_of_range("Index out of range in string_view::at");
+ }
+ return data_[pos];
+}
+
+string_view::size_type string_view::copy(char* dest, size_type count,
+ size_type pos) const
+{
+ if (pos > size_) {
+ throw std::out_of_range("Index out of range in string_view::copy");
+ }
+ size_type const rcount = std::min(count, size_ - pos);
+ traits_type::copy(dest, data_ + pos, rcount);
+ return rcount;
+}
+
+string_view string_view::substr(size_type pos, size_type count) const
+{
+ if (pos > size_) {
+ throw std::out_of_range("Index out of range in string_view::substr");
+ }
+ size_type const rcount = std::min(count, size_ - pos);
+ return string_view(data_ + pos, rcount);
+}
+
+int string_view::compare(string_view v) const noexcept
+{
+ size_type const rlen = std::min(size_, v.size_);
+ int c = traits_type::compare(data_, v.data_, rlen);
+ if (c == 0) {
+ if (size_ < v.size_) {
+ c = -1;
+ } else if (size_ > v.size_) {
+ c = 1;
+ }
+ }
+ return c;
+}
+
+int string_view::compare(size_type pos1, size_type count1, string_view v) const
+{
+ return substr(pos1, count1).compare(v);
+}
+
+int string_view::compare(size_type pos1, size_type count1, string_view v,
+ size_type pos2, size_type count2) const
+{
+ return substr(pos1, count1).compare(v.substr(pos2, count2));
+}
+
+int string_view::compare(const char* s) const
+{
+ return compare(string_view(s));
+}
+
+int string_view::compare(size_type pos1, size_type count1, const char* s) const
+{
+ return substr(pos1, count1).compare(string_view(s));
+}
+
+int string_view::compare(size_type pos1, size_type count1, const char* s,
+ size_type count2) const
+{
+ return substr(pos1, count1).compare(string_view(s, count2));
+}
+
+string_view::size_type string_view::find(string_view v, size_type pos) const
+ noexcept
+{
+ for (; pos + v.size_ <= size_; ++pos) {
+ if (std::char_traits<char>::compare(data_ + pos, v.data_, v.size_) == 0) {
+ return pos;
+ }
+ }
+ return npos;
+}
+
+string_view::size_type string_view::find(char c, size_type pos) const noexcept
+{
+ return find(string_view(&c, 1), pos);
+}
+
+string_view::size_type string_view::find(const char* s, size_type pos,
+ size_type count) const
+{
+ return find(string_view(s, count), pos);
+}
+
+string_view::size_type string_view::find(const char* s, size_type pos) const
+{
+ return find(string_view(s), pos);
+}
+
+string_view::size_type string_view::rfind(string_view v, size_type pos) const
+ noexcept
+{
+ if (size_ >= v.size_) {
+ for (pos = std::min(pos, size_ - v.size_) + 1; pos > 0;) {
+ --pos;
+ if (std::char_traits<char>::compare(data_ + pos, v.data_, v.size_) ==
+ 0) {
+ return pos;
+ }
+ }
+ }
+ return npos;
+}
+
+string_view::size_type string_view::rfind(char c, size_type pos) const noexcept
+{
+ return rfind(string_view(&c, 1), pos);
+}
+
+string_view::size_type string_view::rfind(const char* s, size_type pos,
+ size_type count) const
+{
+ return rfind(string_view(s, count), pos);
+}
+
+string_view::size_type string_view::rfind(const char* s, size_type pos) const
+{
+ return rfind(string_view(s), pos);
+}
+
+string_view::size_type string_view::find_first_of(string_view v,
+ size_type pos) const noexcept
+{
+ for (; pos < size_; ++pos) {
+ if (traits_type::find(v.data_, v.size_, data_[pos])) {
+ return pos;
+ }
+ }
+ return npos;
+}
+
+string_view::size_type string_view::find_first_of(char c, size_type pos) const
+ noexcept
+{
+ return find_first_of(string_view(&c, 1), pos);
+}
+
+string_view::size_type string_view::find_first_of(const char* s, size_type pos,
+ size_type count) const
+{
+ return find_first_of(string_view(s, count), pos);
+}
+
+string_view::size_type string_view::find_first_of(const char* s,
+ size_type pos) const
+{
+ return find_first_of(string_view(s), pos);
+}
+
+string_view::size_type string_view::find_last_of(string_view v,
+ size_type pos) const noexcept
+{
+ if (size_ > 0) {
+ for (pos = std::min(pos, size_ - 1) + 1; pos > 0;) {
+ --pos;
+ if (traits_type::find(v.data_, v.size_, data_[pos])) {
+ return pos;
+ }
+ }
+ }
+ return npos;
+}
+
+string_view::size_type string_view::find_last_of(char c, size_type pos) const
+ noexcept
+{
+ return find_last_of(string_view(&c, 1), pos);
+}
+
+string_view::size_type string_view::find_last_of(const char* s, size_type pos,
+ size_type count) const
+{
+ return find_last_of(string_view(s, count), pos);
+}
+
+string_view::size_type string_view::find_last_of(const char* s,
+ size_type pos) const
+{
+ return find_last_of(string_view(s), pos);
+}
+
+string_view::size_type string_view::find_first_not_of(string_view v,
+ size_type pos) const
+ noexcept
+{
+ for (; pos < size_; ++pos) {
+ if (!traits_type::find(v.data_, v.size_, data_[pos])) {
+ return pos;
+ }
+ }
+ return npos;
+}
+
+string_view::size_type string_view::find_first_not_of(char c,
+ size_type pos) const
+ noexcept
+{
+ return find_first_not_of(string_view(&c, 1), pos);
+}
+
+string_view::size_type string_view::find_first_not_of(const char* s,
+ size_type pos,
+ size_type count) const
+{
+ return find_first_not_of(string_view(s, count), pos);
+}
+
+string_view::size_type string_view::find_first_not_of(const char* s,
+ size_type pos) const
+{
+ return find_first_not_of(string_view(s), pos);
+}
+
+string_view::size_type string_view::find_last_not_of(string_view v,
+ size_type pos) const
+ noexcept
+{
+ if (size_ > 0) {
+ for (pos = std::min(pos, size_ - 1) + 1; pos > 0;) {
+ --pos;
+ if (!traits_type::find(v.data_, v.size_, data_[pos])) {
+ return pos;
+ }
+ }
+ }
+ return npos;
+}
+
+string_view::size_type string_view::find_last_not_of(char c,
+ size_type pos) const
+ noexcept
+{
+ return find_last_not_of(string_view(&c, 1), pos);
+}
+
+string_view::size_type string_view::find_last_not_of(const char* s,
+ size_type pos,
+ size_type count) const
+{
+ return find_last_not_of(string_view(s, count), pos);
+}
+
+string_view::size_type string_view::find_last_not_of(const char* s,
+ size_type pos) const
+{
+ return find_last_not_of(string_view(s), pos);
+}
+
+std::ostream& operator<<(std::ostream& o, string_view v)
+{
+ return o.write(v.data(), v.size());
+}
+
+std::string& operator+=(std::string& s, string_view v)
+{
+ s.append(v.data(), v.size());
+ return s;
+}
+}
+
+std::hash<cm::string_view>::result_type std::hash<cm::string_view>::operator()(
+ argument_type const& s) const noexcept
+{
+ // FNV-1a hash.
+ static KWIML_INT_uint64_t const fnv_offset_basis = 0xcbf29ce484222325;
+ static KWIML_INT_uint64_t const fnv_prime = 0x100000001b3;
+ KWIML_INT_uint64_t h = fnv_offset_basis;
+ for (char const& c : s) {
+ h = h ^ KWIML_INT_uint64_t(KWIML_INT_uint8_t(c));
+ h = h * fnv_prime;
+ }
+ return result_type(h);
+}
+#else
+// Avoid empty translation unit.
+void cm_string_view_cxx()
+{
+}
+#endif
diff --git a/Source/cm_string_view.hxx b/Source/cm_string_view.hxx
new file mode 100644
index 000000000..d368ed8e2
--- /dev/null
+++ b/Source/cm_string_view.hxx
@@ -0,0 +1,217 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#ifndef cm_string_view_hxx
+#define cm_string_view_hxx
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#if __cplusplus >= 201703L || defined(_MSVC_LANG) && _MSVC_LANG >= 201703L
+# define CMake_HAVE_CXX_STRING_VIEW
+#endif
+
+#ifdef CMake_HAVE_CXX_STRING_VIEW
+# include <string_view>
+namespace cm {
+using std::string_view;
+}
+#else
+# include <cstddef>
+# include <functional>
+# include <iosfwd>
+# include <iterator>
+# include <string>
+
+namespace cm {
+
+class string_view
+{
+public:
+ using traits_type = std::string::traits_type;
+ using value_type = char;
+ using pointer = char*;
+ using const_pointer = const char*;
+ using reference = char&;
+ using const_reference = char const&;
+ using const_iterator = const char*;
+ using iterator = const_iterator;
+ using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+ using reverse_iterator = const_reverse_iterator;
+ using size_type = std::string::size_type;
+ using difference_type = std::string::difference_type;
+
+ static size_type const npos = static_cast<size_type>(-1);
+
+ string_view() noexcept = default;
+ string_view(string_view const&) noexcept = default;
+
+ string_view(const char* s, size_t count) noexcept
+ : data_(s)
+ , size_(count)
+ {
+ }
+
+ string_view(const char* s) noexcept
+ : data_(s)
+ , size_(traits_type::length(s))
+ {
+ }
+
+ // C++17 does not define this constructor. Instead it defines
+ // a conversion operator on std::string to create a string_view.
+ // Since this implementation is used in C++11, std::string does
+ // not have that conversion.
+ string_view(std::string const& s) noexcept
+ : data_(s.data())
+ , size_(s.size())
+ {
+ }
+
+ // C++17 does not define this conversion. Instead it defines
+ // a constructor on std::string that can take a string_view.
+ // Since this implementation is used in C++11, std::string does
+ // not have that constructor.
+ explicit operator std::string() const { return std::string(data_, size_); }
+
+ string_view& operator=(string_view const&) = default;
+
+ const_iterator begin() const noexcept { return data_; }
+ const_iterator end() const noexcept { return data_ + size_; }
+ const_iterator cbegin() const noexcept { return begin(); }
+ const_iterator cend() const noexcept { return end(); }
+
+ const_reverse_iterator rbegin() const noexcept
+ {
+ return const_reverse_iterator(end());
+ }
+ const_reverse_iterator rend() const noexcept
+ {
+ return const_reverse_iterator(begin());
+ }
+ const_reverse_iterator crbegin() const noexcept { return rbegin(); }
+ const_reverse_iterator crend() const noexcept { return rend(); }
+
+ const_reference operator[](size_type pos) const noexcept
+ {
+ return data_[pos];
+ }
+ const_reference at(size_type pos) const;
+ const_reference front() const noexcept { return data_[0]; }
+ const_reference back() const noexcept { return data_[size_ - 1]; }
+ const_pointer data() const noexcept { return data_; }
+
+ size_type size() const noexcept { return size_; }
+ size_type length() const noexcept { return size_; }
+ size_type max_size() const noexcept { return npos - 1; }
+ bool empty() const noexcept { return size_ == 0; }
+
+ void remove_prefix(size_type n) noexcept
+ {
+ data_ += n;
+ size_ -= n;
+ }
+ void remove_suffix(size_type n) noexcept { size_ -= n; }
+ void swap(string_view& v) noexcept
+ {
+ string_view tmp = v;
+ v = *this;
+ *this = tmp;
+ }
+
+ size_type copy(char* dest, size_type count, size_type pos = 0) const;
+ string_view substr(size_type pos = 0, size_type count = npos) const;
+
+ int compare(string_view v) const noexcept;
+ int compare(size_type pos1, size_type count1, string_view v) const;
+ int compare(size_type pos1, size_type count1, string_view v, size_type pos2,
+ size_type count2) const;
+ int compare(const char* s) const;
+ int compare(size_type pos1, size_type count1, const char* s) const;
+ int compare(size_type pos1, size_type count1, const char* s,
+ size_type count2) const;
+
+ size_type find(string_view v, size_type pos = 0) const noexcept;
+ size_type find(char c, size_type pos = 0) const noexcept;
+ size_type find(const char* s, size_type pos, size_type count) const;
+ size_type find(const char* s, size_type pos = 0) const;
+
+ size_type rfind(string_view v, size_type pos = npos) const noexcept;
+ size_type rfind(char c, size_type pos = npos) const noexcept;
+ size_type rfind(const char* s, size_type pos, size_type count) const;
+ size_type rfind(const char* s, size_type pos = npos) const;
+
+ size_type find_first_of(string_view v, size_type pos = 0) const noexcept;
+ size_type find_first_of(char c, size_type pos = 0) const noexcept;
+ size_type find_first_of(const char* s, size_type pos, size_type count) const;
+ size_type find_first_of(const char* s, size_type pos = 0) const;
+
+ size_type find_last_of(string_view v, size_type pos = npos) const noexcept;
+ size_type find_last_of(char c, size_type pos = npos) const noexcept;
+ size_type find_last_of(const char* s, size_type pos, size_type count) const;
+ size_type find_last_of(const char* s, size_type pos = npos) const;
+
+ size_type find_first_not_of(string_view v, size_type pos = 0) const noexcept;
+ size_type find_first_not_of(char c, size_type pos = 0) const noexcept;
+ size_type find_first_not_of(const char* s, size_type pos,
+ size_type count) const;
+ size_type find_first_not_of(const char* s, size_type pos = 0) const;
+
+ size_type find_last_not_of(string_view v, size_type pos = npos) const
+ noexcept;
+ size_type find_last_not_of(char c, size_type pos = npos) const noexcept;
+ size_type find_last_not_of(const char* s, size_type pos,
+ size_type count) const;
+ size_type find_last_not_of(const char* s, size_type pos = npos) const;
+
+private:
+ const char* data_ = nullptr;
+ size_type size_ = 0;
+};
+
+std::ostream& operator<<(std::ostream& o, string_view v);
+
+std::string& operator+=(std::string& s, string_view v);
+
+inline bool operator==(string_view l, string_view r) noexcept
+{
+ return l.compare(r) == 0;
+}
+
+inline bool operator!=(string_view l, string_view r) noexcept
+{
+ return l.compare(r) != 0;
+}
+
+inline bool operator<(string_view l, string_view r) noexcept
+{
+ return l.compare(r) < 0;
+}
+
+inline bool operator<=(string_view l, string_view r) noexcept
+{
+ return l.compare(r) <= 0;
+}
+
+inline bool operator>(string_view l, string_view r) noexcept
+{
+ return l.compare(r) > 0;
+}
+
+inline bool operator>=(string_view l, string_view r) noexcept
+{
+ return l.compare(r) >= 0;
+}
+}
+
+namespace std {
+
+template <>
+struct hash<cm::string_view>
+{
+ typedef cm::string_view argument_type;
+ typedef size_t result_type;
+ result_type operator()(argument_type const& s) const noexcept;
+};
+}
+
+#endif
+#endif
diff --git a/Source/cm_thread.hxx b/Source/cm_thread.hxx
index 84e6a5c32..b1f064585 100644
--- a/Source/cm_thread.hxx
+++ b/Source/cm_thread.hxx
@@ -11,18 +11,18 @@ namespace cm {
class shared_mutex
{
uv_rwlock_t _M_;
- CM_DISABLE_COPY(shared_mutex)
public:
shared_mutex() { uv_rwlock_init(&_M_); }
~shared_mutex() { uv_rwlock_destroy(&_M_); }
- void lock() { uv_rwlock_wrlock(&_M_); }
+ shared_mutex(shared_mutex const&) = delete;
+ shared_mutex& operator=(shared_mutex const&) = delete;
+ void lock() { uv_rwlock_wrlock(&_M_); }
void unlock() { uv_rwlock_wrunlock(&_M_); }
void lock_shared() { uv_rwlock_rdlock(&_M_); }
-
void unlock_shared() { uv_rwlock_rdunlock(&_M_); }
};
@@ -30,7 +30,6 @@ template <typename T>
class shared_lock
{
T& _mutex;
- CM_DISABLE_COPY(shared_lock)
public:
shared_lock(T& m)
@@ -38,7 +37,12 @@ public:
{
_mutex.lock_shared();
}
+
~shared_lock() { _mutex.unlock_shared(); }
+
+ shared_lock(shared_lock const&) = delete;
+ shared_lock& operator=(shared_lock const&) = delete;
};
}
+
#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d0863b0cd..8023298f9 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -30,6 +30,7 @@
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cm_jsoncpp_writer.h"
+# include "cmFileAPI.h"
# include "cmGraphVizWriter.h"
# include "cmVariableWatch.h"
# include <unordered_map>
@@ -54,8 +55,8 @@
# include "cmGlobalVisualStudio11Generator.h"
# include "cmGlobalVisualStudio12Generator.h"
# include "cmGlobalVisualStudio14Generator.h"
-# include "cmGlobalVisualStudio15Generator.h"
# include "cmGlobalVisualStudio9Generator.h"
+# include "cmGlobalVisualStudioVersionedGenerator.h"
# include "cmVSSetupHelper.h"
# define CMAKE_HAVE_VS_GENERATORS
@@ -114,8 +115,10 @@ typedef std::unordered_map<std::string, Json::Value> JsonValueMapType;
} // namespace
-static bool cmakeCheckStampFile(const char* stampName, bool verbose = true);
-static bool cmakeCheckStampList(const char* stampList, bool verbose = true);
+static bool cmakeCheckStampFile(const std::string& stampName,
+ bool verbose = true);
+static bool cmakeCheckStampList(const std::string& stampList,
+ bool verbose = true);
void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/,
void* ctx, const char* /*unused*/,
@@ -125,7 +128,7 @@ void cmWarnUnusedCliWarning(const std::string& variable, int /*unused*/,
cm->MarkCliAsUsed(variable);
}
-cmake::cmake(Role role)
+cmake::cmake(Role role, cmState::Mode mode)
{
this->Trace = false;
this->TraceExpand = false;
@@ -139,8 +142,9 @@ cmake::cmake(Role role)
this->FileComparison = new cmFileTimeComparison;
this->State = new cmState;
+ this->State->SetMode(mode);
this->CurrentSnapshot = this->State->CreateBaseSnapshot();
- this->Messenger = new cmMessenger(this->State);
+ this->Messenger = new cmMessenger;
#ifdef __APPLE__
struct rlimit rlp;
@@ -153,8 +157,6 @@ cmake::cmake(Role role)
#endif
this->GlobalGenerator = nullptr;
- this->ProgressCallback = nullptr;
- this->ProgressCallbackClientData = nullptr;
this->CurrentWorkingMode = NORMAL_MODE;
#ifdef CMAKE_BUILD_WITH_CMAKE
@@ -177,31 +179,31 @@ cmake::cmake(Role role)
// these are used to find files when the extension
// is not given
// The "c" extension MUST precede the "C" extension.
- this->SourceFileExtensions.push_back("c");
- this->SourceFileExtensions.push_back("C");
-
- this->SourceFileExtensions.push_back("c++");
- this->SourceFileExtensions.push_back("cc");
- this->SourceFileExtensions.push_back("cpp");
- this->SourceFileExtensions.push_back("cxx");
- this->SourceFileExtensions.push_back("cu");
- this->SourceFileExtensions.push_back("m");
- this->SourceFileExtensions.push_back("M");
- this->SourceFileExtensions.push_back("mm");
+ this->SourceFileExtensions.emplace_back("c");
+ this->SourceFileExtensions.emplace_back("C");
+
+ this->SourceFileExtensions.emplace_back("c++");
+ this->SourceFileExtensions.emplace_back("cc");
+ this->SourceFileExtensions.emplace_back("cpp");
+ this->SourceFileExtensions.emplace_back("cxx");
+ this->SourceFileExtensions.emplace_back("cu");
+ this->SourceFileExtensions.emplace_back("m");
+ this->SourceFileExtensions.emplace_back("M");
+ this->SourceFileExtensions.emplace_back("mm");
std::copy(this->SourceFileExtensions.begin(),
this->SourceFileExtensions.end(),
std::inserter(this->SourceFileExtensionsSet,
this->SourceFileExtensionsSet.end()));
- this->HeaderFileExtensions.push_back("h");
- this->HeaderFileExtensions.push_back("hh");
- this->HeaderFileExtensions.push_back("h++");
- this->HeaderFileExtensions.push_back("hm");
- this->HeaderFileExtensions.push_back("hpp");
- this->HeaderFileExtensions.push_back("hxx");
- this->HeaderFileExtensions.push_back("in");
- this->HeaderFileExtensions.push_back("txx");
+ this->HeaderFileExtensions.emplace_back("h");
+ this->HeaderFileExtensions.emplace_back("hh");
+ this->HeaderFileExtensions.emplace_back("h++");
+ this->HeaderFileExtensions.emplace_back("hm");
+ this->HeaderFileExtensions.emplace_back("hpp");
+ this->HeaderFileExtensions.emplace_back("hxx");
+ this->HeaderFileExtensions.emplace_back("in");
+ this->HeaderFileExtensions.emplace_back("txx");
std::copy(this->HeaderFileExtensions.begin(),
this->HeaderFileExtensions.end(),
@@ -435,7 +437,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
}
std::cout << "loading initial cache file " << path << "\n";
- this->ReadListFile(args, path.c_str());
+ this->ReadListFile(args, path);
} else if (arg.find("-P", 0) == 0) {
i++;
if (i >= args.size()) {
@@ -449,7 +451,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
// Register fake project commands that hint misuse in script mode.
GetProjectCommandsInScriptMode(this->State);
- this->ReadListFile(args, path.c_str());
+ this->ReadListFile(args, path);
} else if (arg.find("--find-package", 0) == 0) {
findPackageMode = true;
}
@@ -463,7 +465,7 @@ bool cmake::SetCacheArgs(const std::vector<std::string>& args)
}
void cmake::ReadListFile(const std::vector<std::string>& args,
- const char* path)
+ const std::string& path)
{
// if a generator was not yet created, temporarily create one
cmGlobalGenerator* gg = this->GetGlobalGenerator();
@@ -476,7 +478,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
}
// read in the list file to fill the cache
- if (path) {
+ if (!path.empty()) {
this->CurrentSnapshot = this->State->Reset();
std::string homeDir = this->GetHomeDirectory();
std::string homeOutputDir = this->GetHomeOutputDirectory();
@@ -497,7 +499,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
mf.SetArgcArgv(args);
}
if (!mf.ReadListFile(path)) {
- cmSystemTools::Error("Error processing file: ", path);
+ cmSystemTools::Error("Error processing file: " + path);
}
this->SetHomeDirectory(homeDir);
this->SetHomeOutputDirectory(homeOutputDir);
@@ -531,7 +533,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
mf->SetArgcArgv(args);
std::string systemFile = mf->GetModulesFile("CMakeFindPackageMode.cmake");
- mf->ReadListFile(systemFile.c_str());
+ mf->ReadListFile(systemFile);
std::string language = mf->GetSafeDefinition("LANGUAGE");
std::string mode = mf->GetSafeDefinition("MODE");
@@ -809,7 +811,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
if (this->CurrentWorkingMode == cmake::NORMAL_MODE && !haveSourceDir &&
!haveBinaryDir) {
this->IssueMessage(
- cmake::WARNING,
+ MessageType::WARNING,
"No source or binary directory provided. Both will be assumed to be "
"the same as the current working directory, but note that this "
"warning will become a fatal error in future CMake releases.");
@@ -960,17 +962,25 @@ void cmake::AddDefaultExtraGenerators()
#endif
}
-void cmake::GetRegisteredGenerators(
- std::vector<GeneratorInfo>& generators) const
+void cmake::GetRegisteredGenerators(std::vector<GeneratorInfo>& generators,
+ bool includeNamesWithPlatform) const
{
for (cmGlobalGeneratorFactory* gen : this->Generators) {
- std::vector<std::string> names;
- gen->GetGenerators(names);
+ std::vector<std::string> names = gen->GetGeneratorNames();
+
+ if (includeNamesWithPlatform) {
+ std::vector<std::string> namesWithPlatform =
+ gen->GetGeneratorNamesWithPlatform();
+ names.insert(names.end(), namesWithPlatform.begin(),
+ namesWithPlatform.end());
+ }
for (std::string const& name : names) {
GeneratorInfo info;
info.supportsToolset = gen->SupportsToolset();
info.supportsPlatform = gen->SupportsPlatform();
+ info.supportedPlatforms = gen->GetKnownPlatforms();
+ info.defaultPlatform = gen->GetDefaultPlatformName();
info.name = name;
info.baseName = name;
info.isAlias = false;
@@ -1162,7 +1172,7 @@ int cmake::DoPreConfigureChecks()
}
err << "Specify --help for usage, or press the help button on the CMake "
"GUI.";
- cmSystemTools::Error(err.str().c_str());
+ cmSystemTools::Error(err.str());
return -2;
}
@@ -1180,7 +1190,7 @@ int cmake::DoPreConfigureChecks()
message += cacheStart;
message += "\" used to generate cache. ";
message += "Re-run cmake with a different source directory.";
- cmSystemTools::Error(message.c_str());
+ cmSystemTools::Error(message);
return -2;
}
} else {
@@ -1240,7 +1250,7 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
for (SaveCacheEntry const& i : saved) {
this->AddCacheEntry(i.key, i.value.c_str(), i.help.c_str(), i.type);
}
- cmSystemTools::Message(warning.str().c_str());
+ cmSystemTools::Message(warning.str());
// avoid reconfigure if there were errors
if (!cmSystemTools::GetErrorOccuredFlag()) {
// re-run configure
@@ -1309,6 +1319,23 @@ int cmake::Configure()
}
}
+ // Cache variables may have already been set by a previous invocation,
+ // so we cannot rely on command line options alone. Always ensure our
+ // messenger is in sync with the cache.
+ const char* value = this->State->GetCacheEntryValue("CMAKE_WARN_DEPRECATED");
+ this->Messenger->SetSuppressDeprecatedWarnings(value &&
+ cmSystemTools::IsOff(value));
+
+ value = this->State->GetCacheEntryValue("CMAKE_ERROR_DEPRECATED");
+ this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value));
+
+ value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
+ this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value));
+
+ value = this->State->GetCacheEntryValue("CMAKE_SUPPRESS_DEVELOPER_ERRORS");
+ this->Messenger->SetDevWarningsAsErrors(value &&
+ cmSystemTools::IsOff(value));
+
int ret = this->ActualConfigure();
const char* delCacheVars =
this->State->GetGlobalProperty("__CMAKE_DELETE_CACHE_CHANGE_VARS_");
@@ -1373,7 +1400,7 @@ int cmake::ActualConfigure()
message += *genName;
message += "\nEither remove the CMakeCache.txt file and CMakeFiles "
"directory or choose a different binary directory.";
- cmSystemTools::Error(message.c_str());
+ cmSystemTools::Error(message);
return -2;
}
}
@@ -1397,7 +1424,7 @@ int cmake::ActualConfigure()
message += *instance;
message += "\nEither remove the CMakeCache.txt file and CMakeFiles "
"directory or choose a different binary directory.";
- cmSystemTools::Error(message.c_str());
+ cmSystemTools::Error(message);
return -2;
}
} else {
@@ -1416,7 +1443,7 @@ int cmake::ActualConfigure()
message += *platformName;
message += "\nEither remove the CMakeCache.txt file and CMakeFiles "
"directory or choose a different binary directory.";
- cmSystemTools::Error(message.c_str());
+ cmSystemTools::Error(message);
return -2;
}
} else {
@@ -1434,7 +1461,7 @@ int cmake::ActualConfigure()
message += *tsName;
message += "\nEither remove the CMakeCache.txt file and CMakeFiles "
"directory or choose a different binary directory.";
- cmSystemTools::Error(message.c_str());
+ cmSystemTools::Error(message);
return -2;
}
} else {
@@ -1453,6 +1480,11 @@ int cmake::ActualConfigure()
this->TruncateOutputLog("CMakeError.log");
}
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ this->FileAPI = cm::make_unique<cmFileAPI>(this);
+ this->FileAPI->ReadQueries();
+#endif
+
// actually do the configure
this->GlobalGenerator->Configure();
// Before saving the cache
@@ -1498,7 +1530,7 @@ int cmake::ActualConfigure()
return 0;
}
-void cmake::CreateDefaultGlobalGenerator()
+std::unique_ptr<cmGlobalGenerator> cmake::EvaluateDefaultGlobalGenerator()
{
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
std::string found;
@@ -1515,7 +1547,6 @@ void cmake::CreateDefaultGlobalGenerator()
const char* GeneratorName;
};
static VSVersionedGenerator const vsGenerators[] = {
- { "15.0", "Visual Studio 15 2017" }, //
{ "14.0", "Visual Studio 14 2015" }, //
{ "12.0", "Visual Studio 12 2013" }, //
{ "11.0", "Visual Studio 11 2012" }, //
@@ -1526,8 +1557,9 @@ void cmake::CreateDefaultGlobalGenerator()
"\\Setup\\VC;ProductDir", //
";InstallDir" //
};
- cmVSSetupAPIHelper vsSetupAPIHelper;
- if (vsSetupAPIHelper.IsVS2017Installed()) {
+ if (cmVSSetupAPIHelper(16).IsVSInstalled()) {
+ found = "Visual Studio 16 2019";
+ } else if (cmVSSetupAPIHelper(15).IsVSInstalled()) {
found = "Visual Studio 15 2017";
} else {
for (VSVersionedGenerator const* g = cm::cbegin(vsGenerators);
@@ -1551,13 +1583,22 @@ void cmake::CreateDefaultGlobalGenerator()
if (!gen) {
gen = new cmGlobalNMakeMakefileGenerator(this);
}
- this->SetGlobalGenerator(gen);
- std::cout << "-- Building for: " << gen->GetName() << "\n";
+ return std::unique_ptr<cmGlobalGenerator>(gen);
#else
- this->SetGlobalGenerator(new cmGlobalUnixMakefileGenerator3(this));
+ return cm::make_unique<cmGlobalUnixMakefileGenerator3>(this);
#endif
}
+void cmake::CreateDefaultGlobalGenerator()
+{
+ auto gen = this->EvaluateDefaultGlobalGenerator();
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(CMAKE_BOOT_MINGW)
+ // This print could be unified for all platforms
+ std::cout << "-- Building for: " << gen->GetName() << "\n";
+#endif
+ this->SetGlobalGenerator(gen.release());
+}
+
void cmake::PreLoadCMakeFiles()
{
std::vector<std::string> args;
@@ -1565,14 +1606,14 @@ void cmake::PreLoadCMakeFiles()
if (!pre_load.empty()) {
pre_load += "/PreLoad.cmake";
if (cmSystemTools::FileExists(pre_load)) {
- this->ReadListFile(args, pre_load.c_str());
+ this->ReadListFile(args, pre_load);
}
}
pre_load = this->GetHomeOutputDirectory();
if (!pre_load.empty()) {
pre_load += "/PreLoad.cmake";
if (cmSystemTools::FileExists(pre_load)) {
- this->ReadListFile(args, pre_load.c_str());
+ this->ReadListFile(args, pre_load);
}
}
}
@@ -1588,13 +1629,13 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
// If we are given a stamp list file check if it is really out of date.
if (!this->CheckStampList.empty() &&
- cmakeCheckStampList(this->CheckStampList.c_str())) {
+ cmakeCheckStampList(this->CheckStampList)) {
return 0;
}
// If we are given a stamp file check if it is really out of date.
if (!this->CheckStampFile.empty() &&
- cmakeCheckStampFile(this->CheckStampFile.c_str())) {
+ cmakeCheckStampFile(this->CheckStampFile)) {
return 0;
}
@@ -1692,6 +1733,10 @@ int cmake::Generate()
// for the Visual Studio and Xcode generators.)
this->SaveCache(this->GetHomeOutputDirectory());
+#if defined(CMAKE_BUILD_WITH_CMAKE)
+ this->FileAPI->WriteReplies();
+#endif
+
return 0;
}
@@ -1701,6 +1746,18 @@ void cmake::AddCacheEntry(const std::string& key, const char* value,
this->State->AddCacheEntry(key, value, helpString,
cmStateEnums::CacheEntryType(type));
this->UnwatchUnusedCli(key);
+
+ if (key == "CMAKE_WARN_DEPRECATED") {
+ this->Messenger->SetSuppressDeprecatedWarnings(
+ value && cmSystemTools::IsOff(value));
+ } else if (key == "CMAKE_ERROR_DEPRECATED") {
+ this->Messenger->SetDeprecatedWarningsAsErrors(cmSystemTools::IsOn(value));
+ } else if (key == "CMAKE_SUPPRESS_DEVELOPER_WARNINGS") {
+ this->Messenger->SetSuppressDevWarnings(cmSystemTools::IsOn(value));
+ } else if (key == "CMAKE_SUPPRESS_DEVELOPER_ERRORS") {
+ this->Messenger->SetDevWarningsAsErrors(value &&
+ cmSystemTools::IsOff(value));
+ }
}
bool cmake::DoWriteGlobVerifyTarget() const
@@ -1765,7 +1822,10 @@ void cmake::AddDefaultGenerators()
{
#if defined(_WIN32) && !defined(__CYGWIN__)
# if !defined(CMAKE_BOOT_MINGW)
- this->Generators.push_back(cmGlobalVisualStudio15Generator::NewFactory());
+ this->Generators.push_back(
+ cmGlobalVisualStudioVersionedGenerator::NewFactory16());
+ this->Generators.push_back(
+ cmGlobalVisualStudioVersionedGenerator::NewFactory15());
this->Generators.push_back(cmGlobalVisualStudio14Generator::NewFactory());
this->Generators.push_back(cmGlobalVisualStudio12Generator::NewFactory());
this->Generators.push_back(cmGlobalVisualStudio11Generator::NewFactory());
@@ -1860,17 +1920,15 @@ bool cmake::DeleteCache(const std::string& path)
return this->State->DeleteCache(path);
}
-void cmake::SetProgressCallback(ProgressCallbackType f, void* cd)
+void cmake::SetProgressCallback(ProgressCallbackType f)
{
- this->ProgressCallback = f;
- this->ProgressCallbackClientData = cd;
+ this->ProgressCallback = std::move(f);
}
void cmake::UpdateProgress(const char* msg, float prog)
{
if (this->ProgressCallback && !this->State->GetIsInTryCompile()) {
- (*this->ProgressCallback)(msg, prog, this->ProgressCallbackClientData);
- return;
+ this->ProgressCallback(msg, prog);
}
}
@@ -1884,13 +1942,28 @@ void cmake::SetIsInTryCompile(bool b)
this->State->SetIsInTryCompile(b);
}
-void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v)
+void cmake::AppendGlobalGeneratorsDocumentation(
+ std::vector<cmDocumentationEntry>& v)
{
+ const auto defaultGenerator = this->EvaluateDefaultGlobalGenerator();
+ const std::string defaultName = defaultGenerator->GetName();
+ bool foundDefaultOne = false;
+
for (cmGlobalGeneratorFactory* g : this->Generators) {
cmDocumentationEntry e;
g->GetDocumentation(e);
+ if (!foundDefaultOne &&
+ cmSystemTools::StringStartsWith(e.Name, defaultName.c_str())) {
+ e.CustomNamePrefix = '*';
+ foundDefaultOne = true;
+ }
v.push_back(std::move(e));
}
+}
+
+void cmake::AppendExtraGeneratorsDocumentation(
+ std::vector<cmDocumentationEntry>& v)
+{
for (cmExternalMakefileProjectGeneratorFactory* eg : this->ExtraGenerators) {
const std::string doc = eg->GetDocumentation();
const std::string name = eg->GetName();
@@ -1916,12 +1989,19 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v)
}
}
+std::vector<cmDocumentationEntry> cmake::GetGeneratorsDocumentation()
+{
+ std::vector<cmDocumentationEntry> v;
+ this->AppendGlobalGeneratorsDocumentation(v);
+ this->AppendExtraGeneratorsDocumentation(v);
+ return v;
+}
+
void cmake::PrintGeneratorList()
{
#ifdef CMAKE_BUILD_WITH_CMAKE
cmDocumentation doc;
- std::vector<cmDocumentationEntry> generators;
- this->GetGeneratorDocumentation(generators);
+ auto generators = this->GetGeneratorsDocumentation();
doc.AppendSection("Generators", generators);
std::cerr << "\n";
doc.PrintDocumentation(cmDocumentation::ListGenerators, std::cerr);
@@ -1966,7 +2046,7 @@ int cmake::CheckBuildSystem()
if (verbose) {
std::ostringstream msg;
msg << "Re-run cmake no build system arguments\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
return 1;
}
@@ -1977,26 +2057,27 @@ int cmake::CheckBuildSystem()
std::ostringstream msg;
msg << "Re-run cmake missing file: " << this->CheckBuildSystemArgument
<< "\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
return 1;
}
// Read the rerun check file and use it to decide whether to do the
// global generate.
- cmake cm(RoleScript); // Actually, all we need is the `set` command.
+ // Actually, all we need is the `set` command.
+ cmake cm(RoleScript, cmState::Unknown);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cm.GetCurrentSnapshot().SetDefaultDefinitions();
cmGlobalGenerator gg(&cm);
cmMakefile mf(&gg, cm.GetCurrentSnapshot());
- if (!mf.ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
+ if (!mf.ReadListFile(this->CheckBuildSystemArgument) ||
cmSystemTools::GetErrorOccuredFlag()) {
if (verbose) {
std::ostringstream msg;
msg << "Re-run cmake error reading : " << this->CheckBuildSystemArgument
<< "\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
// There was an error reading the file. Just rerun.
return 1;
@@ -2030,7 +2111,7 @@ int cmake::CheckBuildSystem()
if (verbose) {
std::ostringstream msg;
msg << "Re-run cmake, missing byproduct: " << p << "\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
return 1;
}
@@ -2051,7 +2132,7 @@ int cmake::CheckBuildSystem()
std::ostringstream msg;
msg << "Re-run cmake no CMAKE_MAKEFILE_DEPENDS "
"or CMAKE_MAKEFILE_OUTPUTS :\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
return 1;
}
@@ -2061,8 +2142,7 @@ int cmake::CheckBuildSystem()
std::string dep_newest = *dep++;
for (; dep != depends.end(); ++dep) {
int result = 0;
- if (this->FileComparison->FileTimeCompare(dep_newest.c_str(), dep->c_str(),
- &result)) {
+ if (this->FileComparison->FileTimeCompare(dep_newest, *dep, &result)) {
if (result < 0) {
dep_newest = *dep;
}
@@ -2070,7 +2150,7 @@ int cmake::CheckBuildSystem()
if (verbose) {
std::ostringstream msg;
msg << "Re-run cmake: build system dependency is missing\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
return 1;
}
@@ -2081,8 +2161,7 @@ int cmake::CheckBuildSystem()
std::string out_oldest = *out++;
for (; out != outputs.end(); ++out) {
int result = 0;
- if (this->FileComparison->FileTimeCompare(out_oldest.c_str(), out->c_str(),
- &result)) {
+ if (this->FileComparison->FileTimeCompare(out_oldest, *out, &result)) {
if (result > 0) {
out_oldest = *out;
}
@@ -2090,7 +2169,7 @@ int cmake::CheckBuildSystem()
if (verbose) {
std::ostringstream msg;
msg << "Re-run cmake: build system output is missing\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
return 1;
}
@@ -2099,14 +2178,14 @@ int cmake::CheckBuildSystem()
// If any output is older than any dependency then rerun.
{
int result = 0;
- if (!this->FileComparison->FileTimeCompare(out_oldest.c_str(),
- dep_newest.c_str(), &result) ||
+ if (!this->FileComparison->FileTimeCompare(out_oldest, dep_newest,
+ &result) ||
result < 0) {
if (verbose) {
std::ostringstream msg;
msg << "Re-run cmake file: " << out_oldest
<< " older than: " << dep_newest << "\n";
- cmSystemTools::Stdout(msg.str().c_str());
+ cmSystemTools::Stdout(msg.str());
}
return 1;
}
@@ -2139,7 +2218,7 @@ void cmake::TruncateOutputLog(const char* fname)
inline std::string removeQuotes(const std::string& s)
{
- if (s[0] == '\"' && s[s.size() - 1] == '\"') {
+ if (s.front() == '\"' && s.back() == '\"') {
return s.substr(1, s.size() - 2);
}
return s;
@@ -2153,7 +2232,7 @@ void cmake::MarkCliAsUsed(const std::string& variable)
void cmake::GenerateGraphViz(const char* fileName) const
{
#ifdef CMAKE_BUILD_WITH_CMAKE
- cmGraphVizWriter gvWriter(this->GetGlobalGenerator()->GetLocalGenerators());
+ cmGraphVizWriter gvWriter(this->GetGlobalGenerator());
std::string settingsFile = this->GetHomeOutputDirectory();
settingsFile += "/CMakeGraphVizOptions.cmake";
@@ -2275,7 +2354,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
outFile += "/CMakeLists.txt";
// Copy file
- if (!cmSystemTools::cmCopyFile(inFile.c_str(), outFile.c_str())) {
+ if (!cmSystemTools::cmCopyFile(inFile, outFile)) {
std::cerr << "Error copying file \"" << inFile << "\" to \"" << outFile
<< "\".\n";
return 1;
@@ -2333,7 +2412,7 @@ int cmake::GetSystemInformation(std::vector<std::string>& args)
return 0;
}
-static bool cmakeCheckStampFile(const char* stampName, bool verbose)
+static bool cmakeCheckStampFile(const std::string& stampName, bool verbose)
{
// The stamp file does not exist. Use the stamp dependencies to
// determine whether it is really out of date. This works in
@@ -2361,8 +2440,7 @@ static bool cmakeCheckStampFile(const char* stampName, bool verbose)
while (cmSystemTools::GetLineFromStream(fin, dep)) {
int result;
if (!dep.empty() && dep[0] != '#' &&
- (!ftc.FileTimeCompare(stampDepends.c_str(), dep.c_str(), &result) ||
- result < 0)) {
+ (!ftc.FileTimeCompare(stampDepends, dep, &result) || result < 0)) {
// The stamp depends file is older than this dependency. The
// build system is really out of date.
std::cout << "CMake is re-running because " << stampName
@@ -2378,12 +2456,11 @@ static bool cmakeCheckStampFile(const char* stampName, bool verbose)
// by the VS IDE due to a "rebuild" request. Restore it atomically.
std::ostringstream stampTempStream;
stampTempStream << stampName << ".tmp" << cmSystemTools::RandomSeed();
- std::string stampTempString = stampTempStream.str();
- const char* stampTemp = stampTempString.c_str();
+ std::string stampTemp = stampTempStream.str();
{
// TODO: Teach cmGeneratedFileStream to use a random temp file (with
// multiple tries in unlikely case of conflict) and use that here.
- cmsys::ofstream stamp(stampTemp);
+ cmsys::ofstream stamp(stampTemp.c_str());
stamp << "# CMake generation timestamp file for this directory.\n";
}
if (cmSystemTools::RenameFile(stampTemp, stampName)) {
@@ -2397,11 +2474,11 @@ static bool cmakeCheckStampFile(const char* stampName, bool verbose)
return true;
}
cmSystemTools::RemoveFile(stampTemp);
- cmSystemTools::Error("Cannot restore timestamp ", stampName);
+ cmSystemTools::Error("Cannot restore timestamp ", stampName.c_str());
return false;
}
-static bool cmakeCheckStampList(const char* stampList, bool verbose)
+static bool cmakeCheckStampList(const std::string& stampList, bool verbose)
{
// If the stamp list does not exist CMake must rerun to generate it.
if (!cmSystemTools::FileExists(stampList)) {
@@ -2409,7 +2486,7 @@ static bool cmakeCheckStampList(const char* stampList, bool verbose)
<< "is missing.\n";
return false;
}
- cmsys::ifstream fin(stampList);
+ cmsys::ifstream fin(stampList.c_str());
if (!fin) {
std::cout << "CMake is re-running because generate.stamp.list "
<< "could not be read.\n";
@@ -2419,14 +2496,14 @@ static bool cmakeCheckStampList(const char* stampList, bool verbose)
// Check each stamp.
std::string stampName;
while (cmSystemTools::GetLineFromStream(fin, stampName)) {
- if (!cmakeCheckStampFile(stampName.c_str(), verbose)) {
+ if (!cmakeCheckStampFile(stampName, verbose)) {
return false;
}
}
return true;
}
-void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
+void cmake::IssueMessage(MessageType t, std::string const& text,
cmListFileBacktrace const& backtrace) const
{
this->Messenger->IssueMessage(t, text, backtrace);
@@ -2444,7 +2521,7 @@ std::vector<std::string> cmake::GetDebugConfigs()
}
// If no configurations were specified, use a default list.
if (configs.empty()) {
- configs.push_back("DEBUG");
+ configs.emplace_back("DEBUG");
}
return configs;
}
@@ -2456,7 +2533,8 @@ cmMessenger* cmake::GetMessenger() const
int cmake::Build(int jobs, const std::string& dir, const std::string& target,
const std::string& config,
- const std::vector<std::string>& nativeOptions, bool clean)
+ const std::vector<std::string>& nativeOptions, bool clean,
+ bool verbose)
{
this->SetHomeDirectory("");
@@ -2509,11 +2587,11 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
return 1;
}
projName = cachedProjectName;
- bool verbose = false;
+
const char* cachedVerbose =
this->State->GetCacheEntryValue("CMAKE_VERBOSE_MAKEFILE");
- if (cachedVerbose) {
- verbose = cmSystemTools::IsOn(cachedVerbose);
+ if (cmSystemTools::IsOn(cachedVerbose)) {
+ verbose = true;
}
#ifdef CMAKE_HAVE_VS_GENERATORS
@@ -2521,8 +2599,7 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
// actually starting the build. If not done separately from the build
// itself, there is the risk of building an out-of-date solution file due
// to limitations of the underlying build system.
- std::string const stampList = cachePath + "/" +
- GetCMakeFilesDirectoryPostSlash() +
+ std::string const stampList = cachePath + "/" + "CMakeFiles/" +
cmGlobalVisualStudio9Generator::GetGenerateStampList();
// Note that the stampList file only exists for VS generators.
@@ -2532,15 +2609,15 @@ int cmake::Build(int jobs, const std::string& dir, const std::string& target,
// the glob verification script before starting the build
this->AddScriptingCommands();
if (this->GlobalGenerator->MatchesGeneratorName("Visual Studio 9 2008")) {
- std::string const globVerifyScript = cachePath + "/" +
- GetCMakeFilesDirectoryPostSlash() + "VerifyGlobs.cmake";
+ std::string const globVerifyScript =
+ cachePath + "/" + "CMakeFiles/" + "VerifyGlobs.cmake";
if (cmSystemTools::FileExists(globVerifyScript)) {
std::vector<std::string> args;
- this->ReadListFile(args, globVerifyScript.c_str());
+ this->ReadListFile(args, globVerifyScript);
}
}
- if (!cmakeCheckStampList(stampList.c_str(), false)) {
+ if (!cmakeCheckStampList(stampList, false)) {
// Correctly initialize the home (=source) and home output (=binary)
// directories, which is required for running the generation step.
std::string homeOrig = this->GetHomeDirectory();
@@ -2606,7 +2683,7 @@ bool cmake::Open(const std::string& dir, bool dryRun)
std::unique_ptr<cmGlobalGenerator> gen(
this->CreateGlobalGenerator(fullName));
- if (!gen.get()) {
+ if (!gen) {
std::cerr << "Error: could create CMAKE_GENERATOR \"" << fullName
<< "\"\n";
return false;
@@ -2653,7 +2730,7 @@ void cmake::RunCheckForUnusedVariables()
}
}
if (haveUnused) {
- this->IssueMessage(cmake::WARNING, msg.str());
+ this->IssueMessage(MessageType::WARNING, msg.str());
}
#endif
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 5bca30693..53d44f148 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -5,7 +5,9 @@
#include "cmConfigure.h" // IWYU pragma: keep
+#include <functional>
#include <map>
+#include <memory> // IWYU pragma: keep
#include <set>
#include <string>
#include <unordered_set>
@@ -13,6 +15,8 @@
#include "cmInstalledFile.h"
#include "cmListFileCache.h"
+#include "cmMessageType.h"
+#include "cmState.h"
#include "cmStateSnapshot.h"
#include "cmStateTypes.h"
@@ -21,12 +25,12 @@
#endif
class cmExternalMakefileProjectGeneratorFactory;
+class cmFileAPI;
class cmFileTimeComparison;
class cmGlobalGenerator;
class cmGlobalGeneratorFactory;
class cmMakefile;
class cmMessenger;
-class cmState;
class cmVariableWatch;
struct cmDocumentationEntry;
@@ -56,8 +60,6 @@ struct cmDocumentationEntry;
class cmake
{
- CM_DISABLE_COPY(cmake)
-
public:
enum Role
{
@@ -66,19 +68,6 @@ public:
RoleProject // all commands
};
- enum MessageType
- {
- AUTHOR_WARNING,
- AUTHOR_ERROR,
- FATAL_ERROR,
- INTERNAL_ERROR,
- MESSAGE,
- WARNING,
- LOG,
- DEPRECATION_ERROR,
- DEPRECATION_WARNING
- };
-
enum DiagLevel
{
DIAG_IGNORE,
@@ -114,6 +103,8 @@ public:
std::string extraName;
bool supportsToolset;
bool supportsPlatform;
+ std::vector<std::string> supportedPlatforms;
+ std::string defaultPlatform;
bool isAlias;
};
@@ -123,22 +114,19 @@ public:
static const int DEFAULT_BUILD_PARALLEL_LEVEL = 0;
/// Default constructor
- cmake(Role role);
+ cmake(Role role, cmState::Mode mode);
/// Destructor
~cmake();
+ cmake(cmake const&) = delete;
+ cmake& operator=(cmake const&) = delete;
+
#if defined(CMAKE_BUILD_WITH_CMAKE)
Json::Value ReportVersionJson() const;
Json::Value ReportCapabilitiesJson(bool haveServerMode) const;
#endif
std::string ReportCapabilities(bool haveServerMode) const;
- static const char* GetCMakeFilesDirectory() { return "/CMakeFiles"; }
- static const char* GetCMakeFilesDirectoryPostSlash()
- {
- return "CMakeFiles/";
- }
-
//@{
/**
* Set/Get the home directory (or output directory) in the project. The
@@ -206,7 +194,8 @@ public:
void SetGlobalGenerator(cmGlobalGenerator*);
///! Get the names of the current registered generators
- void GetRegisteredGenerators(std::vector<GeneratorInfo>& generators) const;
+ void GetRegisteredGenerators(std::vector<GeneratorInfo>& generators,
+ bool includeNamesWithPlatform = true) const;
///! Set the name of the selected generator-specific instance.
void SetGeneratorInstance(std::string const& instance)
@@ -284,7 +273,7 @@ public:
///! Parse command line arguments that might set cache values
bool SetCacheArgs(const std::vector<std::string>&);
- typedef void (*ProgressCallbackType)(const char* msg, float progress, void*);
+ using ProgressCallbackType = std::function<void(const char*, float)>;
/**
* Set the function used by GUIs to receive progress updates
* Function gets passed: message as a const char*, a progress
@@ -292,7 +281,7 @@ public:
* number provided may be negative in cases where a message is
* to be displayed without any progress percentage.
*/
- void SetProgressCallback(ProgressCallbackType f, void* clientData = nullptr);
+ void SetProgressCallback(ProgressCallbackType f);
///! this is called by generators to update the progress
void UpdateProgress(const char* msg, float prog);
@@ -302,7 +291,7 @@ public:
cmVariableWatch* GetVariableWatch() { return this->VariableWatch; }
#endif
- void GetGeneratorDocumentation(std::vector<cmDocumentationEntry>&);
+ std::vector<cmDocumentationEntry> GetGeneratorsDocumentation();
///! Set/Get a property of this target file
void SetProperty(const std::string& prop, const char* value);
@@ -431,13 +420,14 @@ public:
/** Display a message to the user. */
void IssueMessage(
- cmake::MessageType t, std::string const& text,
+ MessageType t, std::string const& text,
cmListFileBacktrace const& backtrace = cmListFileBacktrace()) const;
///! run the --build option
int Build(int jobs, const std::string& dir, const std::string& target,
const std::string& config,
- const std::vector<std::string>& nativeOptions, bool clean);
+ const std::vector<std::string>& nativeOptions, bool clean,
+ bool verbose);
///! run the --open option
bool Open(const std::string& dir, bool dryRun);
@@ -454,7 +444,6 @@ public:
protected:
void RunCheckForUnusedVariables();
- void InitializeProperties();
int HandleDeleteCacheVariables(const std::string& var);
typedef std::vector<cmGlobalGeneratorFactory*> RegisteredGeneratorsVector;
@@ -474,7 +463,8 @@ protected:
std::string GeneratorToolset;
///! read in a cmake list file to initialize the cache
- void ReadListFile(const std::vector<std::string>& args, const char* path);
+ void ReadListFile(const std::vector<std::string>& args,
+ const std::string& path);
bool FindPackage(const std::vector<std::string>& args);
///! Check if CMAKE_CACHEFILE_DIR is set. If it is not, delete the log file.
@@ -497,8 +487,6 @@ protected:
private:
ProgressCallbackType ProgressCallback;
- void* ProgressCallbackClientData;
- bool InTryCompile;
WorkingMode CurrentWorkingMode;
bool DebugOutput;
bool Trace;
@@ -527,6 +515,7 @@ private:
#if defined(CMAKE_BUILD_WITH_CMAKE)
cmVariableWatch* VariableWatch;
+ std::unique_ptr<cmFileAPI> FileAPI;
#endif
cmState* State;
@@ -540,19 +529,11 @@ private:
// Print a list of valid generators to stderr.
void PrintGeneratorList();
+ std::unique_ptr<cmGlobalGenerator> EvaluateDefaultGlobalGenerator();
void CreateDefaultGlobalGenerator();
- /**
- * Convert a message type between a warning and an error, based on the state
- * of the error output CMake variables, in the cache.
- */
- cmake::MessageType ConvertMessageType(cmake::MessageType t) const;
-
- /*
- * Check if messages of this type should be output, based on the state of the
- * warning and error output CMake variables, in the cache.
- */
- bool IsMessageTypeVisible(cmake::MessageType t) const;
+ void AppendGlobalGeneratorsDocumentation(std::vector<cmDocumentationEntry>&);
+ void AppendExtraGeneratorsDocumentation(std::vector<cmDocumentationEntry>&);
};
#define CMAKE_STANDARD_OPTIONS_TABLE \
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index e52f2b361..a83f7dc8b 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -2,7 +2,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmAlgorithms.h"
-#include "cmDocumentationEntry.h"
+#include "cmDocumentationEntry.h" // IWYU pragma: keep
#include "cmGlobalGenerator.h"
#include "cmMakefile.h"
#include "cmState.h"
@@ -68,6 +68,8 @@ static const char* cmDocumentationUsageNote[][2] = {
" --clean-first = Build target 'clean' first, then build.\n" \
" (To clean only, use --target 'clean'.)\n" \
" --use-stderr = Ignored. Behavior is default in CMake >= 3.0.\n" \
+ " -v --verbose = Enable verbose output - if supported - including\n" \
+ " the build commands to be executed. \n" \
" -- = Pass remaining options to the native tool.\n"
static const char* cmDocumentationOptions[][2] = {
@@ -106,7 +108,7 @@ static int do_command(int ac, char const* const* av)
{
std::vector<std::string> args;
args.reserve(ac - 1);
- args.push_back(av[0]);
+ args.emplace_back(av[0]);
args.insert(args.end(), av + 2, av + ac);
return cmcmd::ExecuteCMakeCommand(args);
}
@@ -115,9 +117,8 @@ int do_cmake(int ac, char const* const* av);
static int do_build(int ac, char const* const* av);
static int do_open(int ac, char const* const* av);
-static cmMakefile* cmakemainGetMakefile(void* clientdata)
+static cmMakefile* cmakemainGetMakefile(cmake* cm)
{
- cmake* cm = static_cast<cmake*>(clientdata);
if (cm && cm->GetDebugOutput()) {
cmGlobalGenerator* gg = cm->GetGlobalGenerator();
if (gg) {
@@ -127,10 +128,10 @@ static cmMakefile* cmakemainGetMakefile(void* clientdata)
return nullptr;
}
-static std::string cmakemainGetStack(void* clientdata)
+static std::string cmakemainGetStack(cmake* cm)
{
std::string msg;
- cmMakefile* mf = cmakemainGetMakefile(clientdata);
+ cmMakefile* mf = cmakemainGetMakefile(cm);
if (mf) {
msg = mf->FormatListFileStack();
if (!msg.empty()) {
@@ -142,15 +143,14 @@ static std::string cmakemainGetStack(void* clientdata)
}
static void cmakemainMessageCallback(const char* m, const char* /*unused*/,
- bool& /*unused*/, void* clientdata)
+ cmake* cm)
{
- std::cerr << m << cmakemainGetStack(clientdata) << std::endl << std::flush;
+ std::cerr << m << cmakemainGetStack(cm) << std::endl << std::flush;
}
-static void cmakemainProgressCallback(const char* m, float prog,
- void* clientdata)
+static void cmakemainProgressCallback(const char* m, float prog, cmake* cm)
{
- cmMakefile* mf = cmakemainGetMakefile(clientdata);
+ cmMakefile* mf = cmakemainGetMakefile(cm);
std::string dir;
if ((mf) && (strstr(m, "Configuring") == m) && (prog < 0)) {
dir = " ";
@@ -161,8 +161,7 @@ static void cmakemainProgressCallback(const char* m, float prog,
}
if ((prog < 0) || (!dir.empty())) {
- std::cout << "-- " << m << dir << cmakemainGetStack(clientdata)
- << std::endl;
+ std::cout << "-- " << m << dir << cmakemainGetStack(cm) << std::endl;
}
std::cout.flush();
@@ -217,7 +216,7 @@ int do_cmake(int ac, char const* const* av)
doc.addCMakeStandardDocSections();
if (doc.CheckOptions(ac, av)) {
// Construct and print requested documentation.
- cmake hcm(cmake::RoleInternal);
+ cmake hcm(cmake::RoleInternal, cmState::Unknown);
hcm.SetHomeDirectory("");
hcm.SetHomeOutputDirectory("");
hcm.AddCMakePaths();
@@ -227,9 +226,7 @@ int do_cmake(int ac, char const* const* av)
std::vector<std::string> args(av, av + ac);
hcm.SetCacheArgs(args);
- std::vector<cmDocumentationEntry> generators;
-
- hcm.GetGeneratorDocumentation(generators);
+ auto generators = hcm.GetGeneratorsDocumentation();
doc.SetName("cmake");
doc.SetSection("Name", cmDocumentationName);
@@ -288,18 +285,18 @@ int do_cmake(int ac, char const* const* av)
return 1;
}
workingMode = cmake::SCRIPT_MODE;
- args.push_back(av[i]);
+ args.emplace_back(av[i]);
i++;
- args.push_back(av[i]);
+ args.emplace_back(av[i]);
} else if (cmHasLiteralPrefix(av[i], "--find-package")) {
workingMode = cmake::FIND_PACKAGE_MODE;
- args.push_back(av[i]);
+ args.emplace_back(av[i]);
} else {
- args.push_back(av[i]);
+ args.emplace_back(av[i]);
}
}
if (sysinfo) {
- cmake cm(cmake::RoleProject);
+ cmake cm(cmake::RoleProject, cmState::Project);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
int ret = cm.GetSystemInformation(args);
@@ -307,11 +304,27 @@ int do_cmake(int ac, char const* const* av)
}
cmake::Role const role =
workingMode == cmake::SCRIPT_MODE ? cmake::RoleScript : cmake::RoleProject;
- cmake cm(role);
+ cmState::Mode mode = cmState::Unknown;
+ switch (workingMode) {
+ case cmake::NORMAL_MODE:
+ mode = cmState::Project;
+ break;
+ case cmake::SCRIPT_MODE:
+ mode = cmState::Script;
+ break;
+ case cmake::FIND_PACKAGE_MODE:
+ mode = cmState::FindPackage;
+ break;
+ }
+ cmake cm(role, mode);
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
- cm.SetProgressCallback(cmakemainProgressCallback, &cm);
+ cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) {
+ cmakemainMessageCallback(msg, title, &cm);
+ });
+ cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cmakemainProgressCallback(msg, prog, &cm);
+ });
cm.SetWorkingMode(workingMode);
int res = cm.Run(args, view_only);
@@ -348,6 +361,31 @@ int do_cmake(int ac, char const* const* av)
return 0;
}
+namespace {
+int extract_job_number(int& index, char const* current, char const* next,
+ int len_of_flag)
+{
+ std::string command(current);
+ std::string jobString = command.substr(len_of_flag);
+ if (jobString.empty() && next && isdigit(next[0])) {
+ ++index; // skip parsing the job number
+ jobString = std::string(next);
+ }
+
+ int jobs = -1;
+ unsigned long numJobs = 0;
+ if (jobString.empty()) {
+ jobs = cmake::DEFAULT_BUILD_PARALLEL_LEVEL;
+ } else if (cmSystemTools::StringToULong(jobString.c_str(), &numJobs)) {
+ jobs = int(numJobs);
+ } else {
+ std::cerr << "'" << command.substr(0, len_of_flag) << "' invalid number '"
+ << jobString << "' given.\n\n";
+ }
+ return jobs;
+}
+}
+
static int do_build(int ac, char const* const* av)
{
#ifndef CMAKE_BUILD_WITH_CMAKE
@@ -360,12 +398,12 @@ static int do_build(int ac, char const* const* av)
std::string dir;
std::vector<std::string> nativeOptions;
bool clean = false;
+ bool verbose = cmSystemTools::HasEnv("VERBOSE");
bool hasTarget = false;
enum Doing
{
DoingNone,
- DoingJobs,
DoingDir,
DoingTarget,
DoingConfig,
@@ -374,13 +412,18 @@ static int do_build(int ac, char const* const* av)
Doing doing = DoingDir;
for (int i = 2; i < ac; ++i) {
if (doing == DoingNative) {
- nativeOptions.push_back(av[i]);
- } else if ((strcmp(av[i], "-j") == 0) ||
- (strcmp(av[i], "--parallel") == 0)) {
- jobs = cmake::DEFAULT_BUILD_PARALLEL_LEVEL;
- /* does the next argument start with a number? */
- if ((i + 1 < ac) && (isdigit(*av[i + 1]))) {
- doing = DoingJobs;
+ nativeOptions.emplace_back(av[i]);
+ } else if (cmHasLiteralPrefix(av[i], "-j")) {
+ const char* nextArg = ((i + 1 < ac) ? av[i + 1] : nullptr);
+ jobs = extract_job_number(i, av[i], nextArg, sizeof("-j") - 1);
+ if (jobs < 0) {
+ dir.clear();
+ }
+ } else if (cmHasLiteralPrefix(av[i], "--parallel")) {
+ const char* nextArg = ((i + 1 < ac) ? av[i + 1] : nullptr);
+ jobs = extract_job_number(i, av[i], nextArg, sizeof("--parallel") - 1);
+ if (jobs < 0) {
+ dir.clear();
}
} else if (strcmp(av[i], "--target") == 0) {
if (!hasTarget) {
@@ -396,24 +439,16 @@ static int do_build(int ac, char const* const* av)
} else if (strcmp(av[i], "--clean-first") == 0) {
clean = true;
doing = DoingNone;
+ } else if ((strcmp(av[i], "--verbose") == 0) ||
+ (strcmp(av[i], "-v") == 0)) {
+ verbose = true;
+ doing = DoingNone;
} else if (strcmp(av[i], "--use-stderr") == 0) {
/* tolerate legacy option */
} else if (strcmp(av[i], "--") == 0) {
doing = DoingNative;
} else {
switch (doing) {
- case DoingJobs: {
- unsigned long numJobs = 0;
- if (cmSystemTools::StringToULong(av[i], &numJobs)) {
- jobs = int(numJobs);
- doing = DoingNone;
- } else {
- std::cerr << "'" << av[i - 1] << "' invalid number '" << av[i]
- << "' given.\n\n";
- dir.clear();
- break;
- }
- } break;
case DoingDir:
dir = cmSystemTools::CollapseFullPath(av[i]);
doing = DoingNone;
@@ -463,10 +498,14 @@ static int do_build(int ac, char const* const* av)
return 1;
}
- cmake cm(cmake::RoleInternal);
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
- cm.SetProgressCallback(cmakemainProgressCallback, &cm);
- return cm.Build(jobs, dir, target, config, nativeOptions, clean);
+ cmake cm(cmake::RoleInternal, cmState::Project);
+ cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) {
+ cmakemainMessageCallback(msg, title, &cm);
+ });
+ cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cmakemainProgressCallback(msg, prog, &cm);
+ });
+ return cm.Build(jobs, dir, target, config, nativeOptions, clean, verbose);
#endif
}
@@ -501,9 +540,13 @@ static int do_open(int ac, char const* const* av)
return 1;
}
- cmake cm(cmake::RoleInternal);
- cmSystemTools::SetMessageCallback(cmakemainMessageCallback, &cm);
- cm.SetProgressCallback(cmakemainProgressCallback, &cm);
+ cmake cm(cmake::RoleInternal, cmState::Unknown);
+ cmSystemTools::SetMessageCallback([&cm](const char* msg, const char* title) {
+ cmakemainMessageCallback(msg, title, &cm);
+ });
+ cm.SetProgressCallback([&cm](const char* msg, float prog) {
+ cmakemainProgressCallback(msg, prog, &cm);
+ });
return cm.Open(dir, false) ? 0 : 1;
#endif
}
diff --git a/Source/cmcldeps.cxx b/Source/cmcldeps.cxx
index 0c5bbe2df..1a10666c5 100644
--- a/Source/cmcldeps.cxx
+++ b/Source/cmcldeps.cxx
@@ -221,7 +221,7 @@ static int process(const std::string& srcfilename, const std::string& dfile,
while (std::getline(ss, line)) {
if (startsWith(line, prefix)) {
std::string inc = trimLeadingSpace(line.substr(prefix.size()).c_str());
- if (inc[inc.size() - 1] == '\r') // blech, stupid \r\n
+ if (inc.back() == '\r') // blech, stupid \r\n
inc = inc.substr(0, inc.size() - 1);
includes.push_back(inc);
} else {
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 1d2f741d8..d20c5d23a 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -9,6 +9,7 @@
#include "cmMakefile.h"
#include "cmQtAutoGeneratorMocUic.h"
#include "cmQtAutoGeneratorRcc.h"
+#include "cmState.h"
#include "cmStateDirectory.h"
#include "cmStateSnapshot.h"
#include "cmSystemTools.h"
@@ -44,6 +45,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <utility>
class cmConnection;
@@ -76,7 +78,8 @@ void CMakeCommandUsage(const char* program)
<< " capabilities - Report capabilities built into cmake "
"in JSON format\n"
<< " chdir dir cmd [args...] - run command in a given directory\n"
- << " compare_files file1 file2 - check if file1 is same as file2\n"
+ << " compare_files [--ignore-eol] file1 file2\n"
+ << " - check if file1 is same as file2\n"
<< " copy <file>... destination - copy files to destination "
"(either file or directory)\n"
<< " copy_directory <dir>... destination - copy content of <dir>... "
@@ -121,7 +124,7 @@ void CMakeCommandUsage(const char* program)
;
/* clang-format on */
- cmSystemTools::Error(errorStream.str().c_str());
+ cmSystemTools::Error(errorStream.str());
}
static bool cmTarFilesFrom(std::string const& file,
@@ -130,14 +133,14 @@ static bool cmTarFilesFrom(std::string const& file,
if (cmSystemTools::FileIsDirectory(file)) {
std::ostringstream e;
e << "-E tar --files-from= file '" << file << "' is a directory";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return false;
}
cmsys::ifstream fin(file.c_str());
if (!fin) {
std::ostringstream e;
e << "-E tar --files-from= file '" << file << "' not found";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return false;
}
std::string line;
@@ -151,7 +154,7 @@ static bool cmTarFilesFrom(std::string const& file,
std::ostringstream e;
e << "-E tar --files-from='" << file << "' file invalid line:\n"
<< line << "\n";
- cmSystemTools::Error(e.str().c_str());
+ cmSystemTools::Error(e.str());
return false;
} else {
files.push_back(line);
@@ -199,7 +202,7 @@ static int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
std::vector<std::string> tidy_cmd;
cmSystemTools::ExpandListArgument(runCmd, tidy_cmd, true);
tidy_cmd.push_back(sourceFile);
- tidy_cmd.push_back("--");
+ tidy_cmd.emplace_back("--");
tidy_cmd.insert(tidy_cmd.end(), orig_cmd.begin(), orig_cmd.end());
// Run the tidy command line. Capture its stdout and hide its stderr.
@@ -226,9 +229,9 @@ static int HandleLWYU(const std::string& runCmd,
// Construct the ldd -r -u (link what you use lwyu) command line
// ldd -u -r lwuy target
std::vector<std::string> lwyu_cmd;
- lwyu_cmd.push_back("ldd");
- lwyu_cmd.push_back("-u");
- lwyu_cmd.push_back("-r");
+ lwyu_cmd.emplace_back("ldd");
+ lwyu_cmd.emplace_back("-u");
+ lwyu_cmd.emplace_back("-r");
lwyu_cmd.push_back(runCmd);
// Run the ldd -u -r command line.
@@ -270,9 +273,12 @@ static int HandleCppLint(const std::string& runCmd,
<< "\n";
return 1;
}
- std::cerr << "Warning: cpplint diagnostics:\n";
- // Output the output from cpplint to stderr
- std::cerr << stdOut;
+ if (!stdOut.empty()) {
+ std::cerr << "Warning: cpplint diagnostics:\n";
+ // Output the output from cpplint to stderr
+ std::cerr << stdOut;
+ }
+
// always return 0 so the build can continue as cpplint returns non-zero
// for any warning
return 0;
@@ -323,11 +329,15 @@ static int HandleCppCheck(const std::string& runCmd,
stdErr.find("(performance)") != std::string::npos ||
stdErr.find("(portability)") != std::string::npos ||
stdErr.find("(information)") != std::string::npos) {
- std::cerr << "Warning: cppcheck reported diagnostics:\n";
+ if (ret == 0) {
+ std::cerr << "Warning: cppcheck reported diagnostics:\n";
+ } else {
+ std::cerr << "Error: cppcheck reported failure:\n";
+ }
}
std::cerr << stdErr;
- // ignore errors so build continues
- return 0;
+
+ return ret;
}
typedef int (*CoCompileHandler)(const std::string&, const std::string&,
@@ -464,18 +474,17 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// If multiple source files specified,
// then destination must be directory
if ((args.size() > 4) &&
- (!cmSystemTools::FileIsDirectory(args[args.size() - 1]))) {
- std::cerr << "Error: Target (for copy command) \""
- << args[args.size() - 1] << "\" is not a directory.\n";
+ (!cmSystemTools::FileIsDirectory(args.back()))) {
+ std::cerr << "Error: Target (for copy command) \"" << args.back()
+ << "\" is not a directory.\n";
return 1;
}
// If error occurs we want to continue copying next files.
bool return_value = false;
for (std::string::size_type cc = 2; cc < args.size() - 1; cc++) {
- if (!cmSystemTools::cmCopyFile(args[cc].c_str(),
- args[args.size() - 1].c_str())) {
+ if (!cmSystemTools::cmCopyFile(args[cc], args.back())) {
std::cerr << "Error copying file \"" << args[cc] << "\" to \""
- << args[args.size() - 1] << "\".\n";
+ << args.back() << "\".\n";
return_value = true;
}
}
@@ -487,18 +496,17 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// If multiple source files specified,
// then destination must be directory
if ((args.size() > 4) &&
- (!cmSystemTools::FileIsDirectory(args[args.size() - 1]))) {
+ (!cmSystemTools::FileIsDirectory(args.back()))) {
std::cerr << "Error: Target (for copy_if_different command) \""
- << args[args.size() - 1] << "\" is not a directory.\n";
+ << args.back() << "\" is not a directory.\n";
return 1;
}
// If error occurs we want to continue copying next files.
bool return_value = false;
for (std::string::size_type cc = 2; cc < args.size() - 1; cc++) {
- if (!cmSystemTools::CopyFileIfDifferent(
- args[cc].c_str(), args[args.size() - 1].c_str())) {
+ if (!cmSystemTools::CopyFileIfDifferent(args[cc], args.back())) {
std::cerr << "Error copying file (if different) from \"" << args[cc]
- << "\" to \"" << args[args.size() - 1] << "\".\n";
+ << "\" to \"" << args.back() << "\".\n";
return_value = true;
}
}
@@ -510,9 +518,9 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// If error occurs we want to continue copying next files.
bool return_value = false;
for (std::string::size_type cc = 2; cc < args.size() - 1; cc++) {
- if (!cmSystemTools::CopyADirectory(args[cc], args[args.size() - 1])) {
+ if (!cmSystemTools::CopyADirectory(args[cc], args.back())) {
std::cerr << "Error copying directory from \"" << args[cc]
- << "\" to \"" << args[args.size() - 1] << "\".\n";
+ << "\" to \"" << args.back() << "\".\n";
return_value = true;
}
}
@@ -521,7 +529,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// Rename a file or directory
if (args[1] == "rename" && args.size() == 4) {
- if (!cmSystemTools::RenameFile(args[2].c_str(), args[3].c_str())) {
+ if (!cmSystemTools::RenameFile(args[2], args[3])) {
std::string e = cmSystemTools::GetLastSystemError();
std::cerr << "Error renaming from \"" << args[2] << "\" to \""
<< args[3] << "\": " << e << "\n";
@@ -531,10 +539,20 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
}
// Compare files
- if (args[1] == "compare_files" && args.size() == 4) {
- if (cmSystemTools::FilesDiffer(args[2], args[3])) {
- std::cerr << "Files \"" << args[2] << "\" to \"" << args[3]
- << "\" are different.\n";
+ if (args[1] == "compare_files" && (args.size() == 4 || args.size() == 5)) {
+ bool filesDiffer;
+ if (args.size() == 4) {
+ filesDiffer = cmSystemTools::FilesDiffer(args[2], args[3]);
+ } else if (args[2] == "--ignore-eol") {
+ filesDiffer = cmsys::SystemTools::TextFilesDiffer(args[3], args[4]);
+ } else {
+ ::CMakeCommandUsage(args[0].c_str());
+ return 1;
+ }
+
+ if (filesDiffer) {
+ std::cerr << "Files \"" << args[args.size() - 2] << "\" to \""
+ << args[args.size() - 1] << "\" are different.\n";
return 1;
}
return 0;
@@ -687,6 +705,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if (args[1] == "touch" && args.size() > 2) {
for (std::string::size_type cc = 2; cc < args.size(); cc++) {
if (!cmSystemTools::Touch(args[cc], true)) {
+ std::cerr << "cmake -E touch: failed to update \"";
+ std::cerr << args[cc] << "\".\n";
return 1;
}
}
@@ -697,6 +717,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if (args[1] == "touch_nocreate" && args.size() > 2) {
for (std::string::size_type cc = 2; cc < args.size(); cc++) {
if (!cmSystemTools::Touch(args[cc], false)) {
+ std::cerr << "cmake -E touch_nocreate: failed to update \"";
+ std::cerr << args[cc] << "\".\n";
return 1;
}
}
@@ -709,7 +731,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::cerr << "-E capabilities accepts no additional arguments\n";
return 1;
}
- cmake cm(cmake::RoleInternal);
+ cmake cm(cmake::RoleInternal, cmState::Unknown);
#if defined(CMAKE_BUILD_WITH_CMAKE)
std::cout << cm.ReportCapabilities(true);
#else
@@ -886,7 +908,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
const bool verbose = isCMakeVerbose();
// Create a cmake object instance to process dependencies.
- cmake cm(cmake::RoleScript); // All we need is the `set` command.
+ // All we need is the `set` command.
+ cmake cm(cmake::RoleScript, cmState::Unknown);
std::string gen;
std::string homeDir;
std::string startDir;
@@ -950,8 +973,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::unique_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator(&mf));
// Actually scan dependencies.
- return lgd->UpdateDependencies(depInfo.c_str(), verbose, color) ? 0
- : 2;
+ return lgd->UpdateDependencies(depInfo, verbose, color) ? 0 : 2;
}
return 1;
}
@@ -1009,7 +1031,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
std::string config;
if (args.size() > 3) {
config = args[3];
- };
+ }
return autoGen.Run(infoFile, config) ? 0 : 1;
}
#endif
@@ -1159,7 +1181,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
if (server.Serve(&errorMessage)) {
return 0;
}
- cmSystemTools::Error(errorMessage.c_str());
+ cmSystemTools::Error(errorMessage);
#else
static_cast<void>(supportExperimental);
static_cast<void>(isDebug);
@@ -1280,7 +1302,7 @@ bool cmcmd::SymlinkInternal(std::string const& file, std::string const& link)
cmSystemTools::RemoveFile(link);
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- return cmSystemTools::CopyFileAlways(file.c_str(), link.c_str());
+ return cmSystemTools::CopyFileAlways(file, link);
#else
std::string linktext = cmSystemTools::GetFilenameName(file);
return cmSystemTools::CreateSymlink(linktext, link);
@@ -1337,8 +1359,8 @@ static void cmcmdProgressReport(std::string const& dir, std::string const& num)
int cmcmd::ExecuteEchoColor(std::vector<std::string>& args)
{
// The arguments are
- // argv[0] == <cmake-executable>
- // argv[1] == cmake_echo_color
+ // args[0] == <cmake-executable>
+ // args[1] == cmake_echo_color
bool enabled = true;
int color = cmsysTerminal_Color_Normal;
@@ -1395,10 +1417,10 @@ int cmcmd::ExecuteEchoColor(std::vector<std::string>& args)
int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)
{
// The arguments are
- // argv[0] == <cmake-executable>
- // argv[1] == cmake_link_script
- // argv[2] == <link-script-name>
- // argv[3] == --verbose=?
+ // args[0] == <cmake-executable>
+ // args[1] == cmake_link_script
+ // args[2] == <link-script-name>
+ // args[3] == --verbose=?
bool verbose = false;
if (args.size() >= 4) {
if (args[3].find("--verbose=") == 0) {
@@ -1473,7 +1495,7 @@ int cmcmd::ExecuteLinkScript(std::vector<std::string>& args)
break;
default:
break;
- };
+ }
}
// Free the process instance.
@@ -1517,6 +1539,8 @@ class cmVSLink
std::string ManifestFileRC;
std::string ManifestFileRes;
std::string TargetFile;
+ std::string MtPath;
+ std::string RcPath;
public:
cmVSLink(int type, bool verbose)
@@ -1660,6 +1684,12 @@ bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
} else if (cmHasLiteralPrefix(*arg, "--intdir=")) {
intDir = arg->substr(9);
++arg;
+ } else if (cmHasLiteralPrefix(*arg, "--rc=")) {
+ this->RcPath = arg->substr(5);
+ ++arg;
+ } else if (cmHasLiteralPrefix(*arg, "--mt=")) {
+ this->MtPath = arg->substr(5);
+ ++arg;
} else {
std::cerr << "unknown argument '" << *arg << "'\n";
return false;
@@ -1711,7 +1741,7 @@ bool cmVSLink::Parse(std::vector<std::string>::const_iterator argBeg,
}
if (this->LinkGeneratesManifest) {
- this->LinkCommand.push_back("/MANIFEST");
+ this->LinkCommand.emplace_back("/MANIFEST");
this->LinkCommand.push_back("/MANIFESTFILE:" + this->LinkerManifestFile);
}
@@ -1799,7 +1829,7 @@ int cmVSLink::LinkIncremental()
// Compile the resource file.
std::vector<std::string> rcCommand;
- rcCommand.push_back("rc");
+ rcCommand.push_back(this->RcPath.empty() ? "rc" : this->RcPath);
rcCommand.push_back("/fo" + this->ManifestFileRes);
rcCommand.push_back(this->ManifestFileRC);
if (!RunCommand("RC Pass 1", rcCommand, this->Verbose, FORMAT_DECIMAL)) {
@@ -1858,9 +1888,9 @@ int cmVSLink::LinkNonIncremental()
int cmVSLink::RunMT(std::string const& out, bool notify)
{
std::vector<std::string> mtCommand;
- mtCommand.push_back("mt");
- mtCommand.push_back("/nologo");
- mtCommand.push_back("/manifest");
+ mtCommand.push_back(this->MtPath.empty() ? "mt" : this->MtPath);
+ mtCommand.emplace_back("/nologo");
+ mtCommand.emplace_back("/manifest");
if (this->LinkGeneratesManifest) {
mtCommand.push_back(this->LinkerManifestFile);
}
@@ -1870,7 +1900,7 @@ int cmVSLink::RunMT(std::string const& out, bool notify)
if (notify) {
// Add an undocumented option that enables a special return
// code to notify us when the manifest is modified.
- mtCommand.push_back("/notify_update");
+ mtCommand.emplace_back("/notify_update");
}
int mtRet = 0;
if (!RunCommand("MT", mtCommand, this->Verbose, FORMAT_HEX, &mtRet,
diff --git a/Source/cmparseMSBuildXML.py b/Source/cmparseMSBuildXML.py
deleted file mode 100755
index 1b38d1547..000000000
--- a/Source/cmparseMSBuildXML.py
+++ /dev/null
@@ -1,341 +0,0 @@
-# This python script parses the spec files from MSBuild to create
-# mappings from compiler options to IDE XML specifications. For
-# more information see here:
-
-# http://blogs.msdn.com/vcblog/archive/2008/12/16/msbuild-task.aspx
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/cl.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/lib.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/link.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V110/1033/cl.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V110/1033/lib.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V110/1033/link.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/v120/1033/cl.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/v120/1033/lib.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/v120/1033/link.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V140/1033/cl.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V140/1033/lib.xml"
-# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V140/1033/link.xml"
-# "${PROGRAMFILES}/Microsoft Visual Studio/VS15Preview/Common7/IDE/VC/VCTargets/1033/cl.xml"
-# "${PROGRAMFILES}/Microsoft Visual Studio/VS15Preview/Common7/IDE/VC/VCTargets/1033/lib.xml"
-# "${PROGRAMFILES}/Microsoft Visual Studio/VS15Preview/Common7/IDE/VC/VCTargets/1033/link.xml"
-#
-# BoolProperty <Name>true|false</Name>
-# simple example:
-# <BoolProperty ReverseSwitch="Oy-" Name="OmitFramePointers"
-# Category="Optimization" Switch="Oy">
-# <BoolProperty.DisplayName> <BoolProperty.Description>
-# <CLCompile>
-# <OmitFramePointers>true</OmitFramePointers>
-# </ClCompile>
-#
-# argument means it might be this: /MP3
-# example with argument:
-# <BoolProperty Name="MultiProcessorCompilation" Category="General" Switch="MP">
-# <BoolProperty.DisplayName>
-# <sys:String>Multi-processor Compilation</sys:String>
-# </BoolProperty.DisplayName>
-# <BoolProperty.Description>
-# <sys:String>Multi-processor Compilation</sys:String>
-# </BoolProperty.Description>
-# <Argument Property="ProcessorNumber" IsRequired="false" />
-# </BoolProperty>
-# <CLCompile>
-# <MultiProcessorCompilation>true</MultiProcessorCompilation>
-# <ProcessorNumber>4</ProcessorNumber>
-# </ClCompile>
-# IntProperty
-# not used AFIT
-# <IntProperty Name="ProcessorNumber" Category="General" Visible="false">
-
-
-# per config options example
-# <EnableFiberSafeOptimizations Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</EnableFiberSafeOptimizations>
-#
-# EnumProperty
-# <EnumProperty Name="Optimization" Category="Optimization">
-# <EnumProperty.DisplayName>
-# <sys:String>Optimization</sys:String>
-# </EnumProperty.DisplayName>
-# <EnumProperty.Description>
-# <sys:String>Select option for code optimization; choose Custom to use specific optimization options. (/Od, /O1, /O2, /Ox)</sys:String>
-# </EnumProperty.Description>
-# <EnumValue Name="MaxSpeed" Switch="O2">
-# <EnumValue.DisplayName>
-# <sys:String>Maximize Speed</sys:String>
-# </EnumValue.DisplayName>
-# <EnumValue.Description>
-# <sys:String>Equivalent to /Og /Oi /Ot /Oy /Ob2 /Gs /GF /Gy</sys:String>
-# </EnumValue.Description>
-# </EnumValue>
-# <EnumValue Name="MinSpace" Switch="O1">
-# <EnumValue.DisplayName>
-# <sys:String>Minimize Size</sys:String>
-# </EnumValue.DisplayName>
-# <EnumValue.Description>
-# <sys:String>Equivalent to /Og /Os /Oy /Ob2 /Gs /GF /Gy</sys:String>
-# </EnumValue.Description>
-# </EnumValue>
-# example for O2 would be this:
-# <Optimization>MaxSpeed</Optimization>
-# example for O1 would be this:
-# <Optimization>MinSpace</Optimization>
-#
-# StringListProperty
-# <StringListProperty Name="PreprocessorDefinitions" Category="Preprocessor" Switch="D ">
-# <StringListProperty.DisplayName>
-# <sys:String>Preprocessor Definitions</sys:String>
-# </StringListProperty.DisplayName>
-# <StringListProperty.Description>
-# <sys:String>Defines a preprocessing symbols for your source file.</sys:String>
-# </StringListProperty.Description>
-# </StringListProperty>
-
-# <StringListProperty Subtype="folder" Name="AdditionalIncludeDirectories" Category="General" Switch="I">
-# <StringListProperty.DisplayName>
-# <sys:String>Additional Include Directories</sys:String>
-# </StringListProperty.DisplayName>
-# <StringListProperty.Description>
-# <sys:String>Specifies one or more directories to add to the include path; separate with semi-colons if more than one. (/I[path])</sys:String>
-# </StringListProperty.Description>
-# </StringListProperty>
-# StringProperty
-
-# Example add bill include:
-
-# <AdditionalIncludeDirectories>..\..\..\..\..\..\bill;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-
-
-import sys
-from xml.dom.minidom import parse, parseString
-
-def getText(node):
- nodelist = node.childNodes
- rc = ""
- for child in nodelist:
- if child.nodeType == child.TEXT_NODE:
- rc = rc + child.data
- return rc
-
-def print_tree(document, spaces=""):
- for i in range(len(document.childNodes)):
- if document.childNodes[i].nodeType == document.childNodes[i].ELEMENT_NODE:
- print spaces+str(document.childNodes[i].nodeName )
- print_tree(document.childNodes[i],spaces+"----")
- pass
-
-###########################################################################################
-#Data structure that stores a property of MSBuild
-class Property:
- #type = type of MSBuild property (ex. if the property is EnumProperty type should be "Enum")
- #attributeNames = a list of any attributes that this property could have (ex. if this was a EnumProperty it should be ["Name","Category"])
- #document = the dom file that's root node is the Property node (ex. if you were parsing a BoolProperty the root node should be something like <BoolProperty Name="RegisterOutput" Category="General" IncludeInCommandLine="false">
- def __init__(self,type,attributeNames,document=None):
- self.suffix_type = "Property"
- self.prefix_type = type
- self.attributeNames = attributeNames
- self.attributes = {}
- self.DisplayName = ""
- self.Description = ""
- self.argumentProperty = ""
- self.argumentIsRequired = ""
- self.values = []
- if document is not None:
- self.populate(document)
- pass
-
- #document = the dom file that's root node is the Property node (ex. if you were parsing a BoolProperty the root node should be something like <BoolProperty Name="RegisterOutput" Category="General" IncludeInCommandLine="false">
- #spaces = do not use
- def populate(self,document, spaces = ""):
- if document.nodeName == self.prefix_type+self.suffix_type:
- for i in self.attributeNames:
- self.attributes[i] = document.getAttribute(i)
- for i in range(len(document.childNodes)):
- child = document.childNodes[i]
- if child.nodeType == child.ELEMENT_NODE:
- if child.nodeName == self.prefix_type+self.suffix_type+".DisplayName":
- self.DisplayName = getText(child.childNodes[1])
- if child.nodeName == self.prefix_type+self.suffix_type+".Description":
- self.Description = getText(child.childNodes[1])
- if child.nodeName == "Argument":
- self.argumentProperty = child.getAttribute("Property")
- self.argumentIsRequired = child.getAttribute("IsRequired")
- if child.nodeName == self.prefix_type+"Value":
- va = Property(self.prefix_type,["Name","DisplayName","Switch"])
- va.suffix_type = "Value"
- va.populate(child)
- self.values.append(va)
- self.populate(child,spaces+"----")
- pass
-
- #toString function
- def __str__(self):
- toReturn = self.prefix_type+self.suffix_type+":"
- for i in self.attributeNames:
- toReturn += "\n "+i+": "+self.attributes[i]
- if self.argumentProperty != "":
- toReturn += "\n Argument:\n Property: "+self.argumentProperty+"\n IsRequired: "+self.argumentIsRequired
- for i in self.values:
- toReturn+="\n "+str(i).replace("\n","\n ")
- return toReturn
-###########################################################################################
-
-###########################################################################################
-#Class that populates itself from an MSBuild file and outputs it in CMake
-#format
-
-class MSBuildToCMake:
- #document = the entire MSBuild xml file
- def __init__(self,document=None):
- self.enumProperties = []
- self.stringProperties = []
- self.stringListProperties = []
- self.boolProperties = []
- self.intProperties = []
- if document!=None :
- self.populate(document)
- pass
-
- #document = the entire MSBuild xml file
- #spaces = don't use
- #To add a new property (if they exist) copy and paste this code and fill in appropriate places
- #
- #if child.nodeName == "<Name>Property":
- # self.<Name>Properties.append(Property("<Name>",[<List of attributes>],child))
- #
- #Replace <Name> with the name of the new property (ex. if property is StringProperty replace <Name> with String)
- #Replace <List of attributes> with a list of attributes in your property's root node
- #in the __init__ function add the line self.<Name>Properties = []
- #
- #That is all that is required to add new properties
- #
- def populate(self,document, spaces=""):
- for i in range(len(document.childNodes)):
- child = document.childNodes[i]
- if child.nodeType == child.ELEMENT_NODE:
- if child.nodeName == "EnumProperty":
- self.enumProperties.append(Property("Enum",["Name","Category"],child))
- if child.nodeName == "StringProperty":
- self.stringProperties.append(Property("String",["Name","Subtype","Separator","Category","Visible","IncludeInCommandLine","Switch","DisplayName","ReadOnly"],child))
- if child.nodeName == "StringListProperty":
- self.stringListProperties.append(Property("StringList",["Name","Category","Switch","DisplayName","Subtype"],child))
- if child.nodeName == "BoolProperty":
- self.boolProperties.append(Property("Bool",["ReverseSwitch","Name","Category","Switch","DisplayName","SwitchPrefix","IncludeInCommandLine"],child))
- if child.nodeName == "IntProperty":
- self.intProperties.append(Property("Int",["Name","Category","Visible"],child))
- self.populate(child,spaces+"----")
- pass
-
- #outputs information that CMake needs to know about MSBuild xml files
- def toCMake(self):
- toReturn = "static cmVS7FlagTable cmVS10CxxTable[] =\n{\n"
- toReturn += "\n //Enum Properties\n"
- lastProp = {}
- for i in self.enumProperties:
- if i.attributes["Name"] == "CompileAsManaged":
- #write these out after the rest of the enumProperties
- lastProp = i
- continue
- for j in i.values:
- #hardcore Brad King's manual fixes for cmVS10CLFlagTable.h
- if i.attributes["Name"] == "PrecompiledHeader" and j.attributes["Switch"] != "":
- toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.attributes["DisplayName"]+"\", \""+j.attributes["Name"]+"\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
- else:
- #default (normal, non-hardcoded) case
- toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.attributes["DisplayName"]+"\", \""+j.attributes["Name"]+"\", 0},\n"
- toReturn += "\n"
-
- if lastProp != {}:
- for j in lastProp.values:
- toReturn+=" {\""+lastProp.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.attributes["DisplayName"]+"\", \""+j.attributes["Name"]+"\", 0},\n"
- toReturn += "\n"
-
- toReturn += "\n //Bool Properties\n"
- for i in self.boolProperties:
- if i.argumentProperty == "":
- if i.attributes["ReverseSwitch"] != "":
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \"\", \"false\", 0},\n"
- if i.attributes["Switch"] != "":
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\", \"\", \"true\", 0},\n"
-
- toReturn += "\n //Bool Properties With Argument\n"
- for i in self.boolProperties:
- if i.argumentProperty != "":
- if i.attributes["ReverseSwitch"] != "":
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \"\", \"false\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \""+i.attributes["DisplayName"]+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
- if i.attributes["Switch"] != "":
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\", \"\", \"true\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
- toReturn += " {\""+i.argumentProperty+"\", \""+i.attributes["Switch"]+"\", \""+i.attributes["DisplayName"]+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
-
- toReturn += "\n //String List Properties\n"
- for i in self.stringListProperties:
- if i.attributes["Switch"] == "":
- toReturn += " // Skip [" + i.attributes["Name"] + "] - no command line Switch.\n";
- else:
- toReturn +=" {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\",\n \""+i.attributes["DisplayName"]+"\",\n \"\", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},\n"
-
- toReturn += "\n //String Properties\n"
- for i in self.stringProperties:
- if i.attributes["Switch"] == "":
- if i.attributes["Name"] == "PrecompiledHeaderFile":
- #more hardcoding
- toReturn += " {\"PrecompiledHeaderFile\", \"Yc\",\n"
- toReturn += " \"Precompiled Header Name\",\n"
- toReturn += " \"\", cmVS7FlagTable::UserValueRequired},\n"
- toReturn += " {\"PrecompiledHeaderFile\", \"Yu\",\n"
- toReturn += " \"Precompiled Header Name\",\n"
- toReturn += " \"\", cmVS7FlagTable::UserValueRequired},\n"
- else:
- toReturn += " // Skip [" + i.attributes["Name"] + "] - no command line Switch.\n";
- else:
- toReturn +=" {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+i.attributes["Separator"]+"\",\n \""+i.attributes["DisplayName"]+"\",\n \"\", cmVS7FlagTable::UserValue},\n"
-
- toReturn += " {0,0,0,0,0}\n};"
- return toReturn
- pass
-
- #toString function
- def __str__(self):
- toReturn = ""
- allList = [self.enumProperties,self.stringProperties,self.stringListProperties,self.boolProperties,self.intProperties]
- for p in allList:
- for i in p:
- toReturn += "==================================================\n"+str(i).replace("\n","\n ")+"\n==================================================\n"
-
- return toReturn
-###########################################################################################
-
-###########################################################################################
-# main function
-def main(argv):
- xml_file = None
- help = """
- Please specify an input xml file with -x
-
- Exiting...
- Have a nice day :)"""
- for i in range(0,len(argv)):
- if argv[i] == "-x":
- xml_file = argv[i+1]
- if argv[i] == "-h":
- print help
- sys.exit(0)
- pass
- if xml_file == None:
- print help
- sys.exit(1)
-
- f = open(xml_file,"r")
- xml_str = f.read()
- xml_dom = parseString(xml_str)
-
- convertor = MSBuildToCMake(xml_dom)
- print convertor.toCMake()
-
- xml_dom.unlink()
-###########################################################################################
-# main entry point
-if __name__ == "__main__":
- main(sys.argv)
-
-sys.exit(0)
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index ca8a7763a..4a2531a4e 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -46,7 +46,10 @@ static const char* cmDocumentationOptions[][2] = {
"given number of jobs." },
{ "-Q,--quiet", "Make ctest quiet." },
{ "-O <file>, --output-log <file>", "Output to log file" },
- { "-N,--show-only", "Disable actual execution of tests." },
+ { "-N,--show-only[=format]",
+ "Disable actual execution of tests. The optional 'format' defines the "
+ "format of the test information and can be 'human' for the current text "
+ "format or 'json-v1' for json format. Defaults to 'human'." },
{ "-L <regex>, --label-regex <regex>",
"Run tests with labels matching "
"regular expression." },
@@ -128,7 +131,7 @@ static const char* cmDocumentationOptions[][2] = {
{ "--schedule-random", "Use a random order for scheduling tests" },
{ "--submit-index",
"Submit individual dashboard tests with specific index" },
- { "--timeout <seconds>", "Set a global timeout on all tests." },
+ { "--timeout <seconds>", "Set the default test timeout." },
{ "--stop-time <time>",
"Set a time at which all tests should stop running." },
{ "--http1.0", "Submit using HTTP 1.0." },
@@ -205,7 +208,7 @@ int main(int argc, char const* const* argv)
std::vector<std::string> args;
args.reserve(argc);
for (int i = 0; i < argc; ++i) {
- args.push_back(argv[i]);
+ args.emplace_back(argv[i]);
}
// run ctest
std::string output;
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 43aec00bf..e7da99462 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -42,6 +42,10 @@
# SET(KWSYS_HEADER_ROOT ${PROJECT_BINARY_DIR})
# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
#
+# KWSYS_CXX_STANDARD = A value for CMAKE_CXX_STANDARD within KWSys.
+# Set to empty string to use no default value.
+# KWSYS_CXX_COMPILE_FEATURES = target_compile_features arguments for KWSys.
+#
# Optional settings to setup install rules are as follows:
#
# KWSYS_INSTALL_BIN_DIR = The installation target directories into
@@ -82,24 +86,17 @@
# any outside mailing list and no documentation of the change will be
# written.
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)
+CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR)
FOREACH(p
- CMP0022 # CMake 2.8, Define link interface - required by android_mk export
- CMP0025 # CMake 3.0, Compiler id for Apple Clang is now AppleClang.
- CMP0042 # CMake 3.0, MACOSX_RPATH is enabled by default.
- CMP0048 # CMake 3.0, Let the project command manage version variables.
CMP0056 # CMake 3.2, Honor link flags in try_compile() source-file signature.
CMP0063 # CMake 3.3, Honor visibility properties for all target types.
+ CMP0067 # CMake 3.8, Honor language standard in try_compile source-file signature.
+ CMP0069 # CMake 3.9, INTERPROCEDURAL_OPTIMIZATION is enforced when enabled.
)
IF(POLICY ${p})
CMAKE_POLICY(SET ${p} NEW)
ENDIF()
ENDFOREACH()
-SET(CMAKE_LEGACY_CYGWIN_WIN32 0)
-
-IF(CMAKE_VERSION VERSION_LESS 3.0)
- SET(KWSYS_SPLIT_OBJECTS_FROM_INTERFACE 0)
-ENDIF()
#-----------------------------------------------------------------------------
# If a namespace is not specified, use "kwsys" and enable testing.
@@ -120,6 +117,12 @@ SET_PROPERTY(DIRECTORY
"KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>"
)
+if(KWSYS_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD "${KWSYS_CXX_STANDARD}")
+elseif(NOT DEFINED CMAKE_CXX_STANDARD AND NOT DEFINED KWSYS_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+
# Select library components.
IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
SET(KWSYS_ENABLE_C 1)
@@ -453,6 +456,10 @@ ELSE()
SET(KWSYS_LIBRARY_TYPE STATIC)
ENDIF()
+if(NOT DEFINED KWSYS_BUILD_PIC)
+ set(KWSYS_BUILD_PIC 0)
+endif()
+
#-----------------------------------------------------------------------------
# Configure some implementation details.
@@ -869,7 +876,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
SET(KWSYS_LINK_DEPENDENCY INTERFACE)
ADD_LIBRARY(${KWSYS_TARGET_OBJECT} OBJECT
${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
- IF(KWSYS_BUILD_SHARED)
+ IF(KWSYS_BUILD_SHARED OR KWSYS_BUILD_PIC)
SET_PROPERTY(TARGET ${KWSYS_TARGET_OBJECT} PROPERTY
POSITION_INDEPENDENT_CODE TRUE)
ENDIF()
@@ -879,6 +886,8 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
${KWSYS_TARGET_INTERFACE})
TARGET_SOURCES(${KWSYS_TARGET_LINK} INTERFACE
$<TARGET_OBJECTS:${KWSYS_TARGET_OBJECT}>)
+ target_compile_features(${KWSYS_TARGET_OBJECT} PRIVATE ${KWSYS_CXX_COMPILE_FEATURES})
+ target_compile_features(${KWSYS_TARGET_INTERFACE} INTERFACE ${KWSYS_CXX_COMPILE_FEATURES})
ELSE()
SET(KWSYS_TARGET_INTERFACE ${KWSYS_NAMESPACE})
SET(KWSYS_TARGET_OBJECT ${KWSYS_NAMESPACE})
@@ -887,6 +896,7 @@ IF(KWSYS_C_SRCS OR KWSYS_CXX_SRCS)
SET(KWSYS_LINK_DEPENDENCY PUBLIC)
ADD_LIBRARY(${KWSYS_TARGET_INTERFACE} ${KWSYS_LIBRARY_TYPE}
${KWSYS_C_SRCS} ${KWSYS_CXX_SRCS})
+ target_compile_features(${KWSYS_TARGET_INTERFACE} PUBLIC ${KWSYS_CXX_COMPILE_FEATURES})
ENDIF()
if (KWSYS_ALIAS_TARGET)
add_library(${KWSYS_ALIAS_TARGET} ALIAS ${KWSYS_TARGET_INTERFACE})
@@ -964,7 +974,7 @@ IF(KWSYS_ENABLE_C AND KWSYS_C_SRCS)
${KWSYS_TARGET_C_INTERFACE} ${KWSYS_TARGET_C_LINK})
SET(KWSYS_LINK_DEPENDENCY INTERFACE)
ADD_LIBRARY(${KWSYS_TARGET_C_OBJECT} OBJECT ${KWSYS_C_SRCS})
- IF(KWSYS_BUILD_SHARED)
+ IF(KWSYS_BUILD_SHARED OR KWSYS_BUILD_PIC)
SET_PROPERTY(TARGET ${KWSYS_TARGET_C_OBJECT} PROPERTY
POSITION_INDEPENDENT_CODE TRUE)
ENDIF()
diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c
index 094c2ee23..f65690b31 100644
--- a/Source/kwsys/ProcessUNIX.c
+++ b/Source/kwsys/ProcessUNIX.c
@@ -1162,7 +1162,7 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length,
case KWSYSPE_PIPE_STDERR:
wd->PipeId = kwsysProcess_Pipe_STDERR;
break;
- };
+ }
return 1;
}
} else if (n < 0 && errno == EAGAIN) {
diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx
index d368fa29f..f323efc4b 100644
--- a/Source/kwsys/SystemInformation.cxx
+++ b/Source/kwsys/SystemInformation.cxx
@@ -3871,7 +3871,8 @@ SystemInformation::LongLong SystemInformationImplementation::GetProcessId()
{
#if defined(_WIN32)
return GetCurrentProcessId();
-#elif defined(__linux) || defined(__APPLE__)
+#elif defined(__linux) || defined(__APPLE__) || defined(__OpenBSD__) || \
+ defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
return getpid();
#else
return -1;
@@ -4423,7 +4424,8 @@ bool SystemInformationImplementation::ParseSysCtl()
&count) == KERN_SUCCESS) {
len = sizeof(value);
err = sysctlbyname("hw.pagesize", &value, &len, KWSYS_NULLPTR, 0);
- int64_t available_memory = vmstat.free_count * value;
+ int64_t available_memory =
+ (vmstat.free_count + vmstat.inactive_count) * value;
this->AvailablePhysicalMemory =
static_cast<size_t>(available_memory / 1048576);
}
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index 0a4ad7aac..d8904fed7 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -82,6 +82,10 @@
# include <signal.h> /* sigprocmask */
#endif
+#ifdef __linux
+# include <linux/fs.h>
+#endif
+
// Windows API.
#if defined(_WIN32)
# include <windows.h>
@@ -1355,39 +1359,15 @@ bool SystemTools::Touch(const std::string& filename, bool create)
}
CloseHandle(h);
#elif KWSYS_CXX_HAS_UTIMENSAT
- struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } };
- if (utimensat(AT_FDCWD, filename.c_str(), times, 0) < 0) {
+ // utimensat is only available on newer Unixes and macOS 10.13+
+ if (utimensat(AT_FDCWD, filename.c_str(), NULL, 0) < 0) {
return false;
}
#else
- struct stat st;
- if (stat(filename.c_str(), &st) < 0) {
- return false;
- }
- struct timeval mtime;
- gettimeofday(&mtime, 0);
-# if KWSYS_CXX_HAS_UTIMES
- struct timeval atime;
-# if KWSYS_CXX_STAT_HAS_ST_MTIM
- atime.tv_sec = st.st_atim.tv_sec;
- atime.tv_usec = st.st_atim.tv_nsec / 1000;
-# elif KWSYS_CXX_STAT_HAS_ST_MTIMESPEC
- atime.tv_sec = st.st_atimespec.tv_sec;
- atime.tv_usec = st.st_atimespec.tv_nsec / 1000;
-# else
- atime.tv_sec = st.st_atime;
- atime.tv_usec = 0;
-# endif
- struct timeval times[2] = { atime, mtime };
- if (utimes(filename.c_str(), times) < 0) {
+ // fall back to utimes
+ if (utimes(filename.c_str(), NULL) < 0) {
return false;
}
-# else
- struct utimbuf times = { st.st_atime, mtime.tv_sec };
- if (utime(filename.c_str(), &times) < 0) {
- return false;
- }
-# endif
#endif
return true;
}
@@ -2181,16 +2161,152 @@ bool SystemTools::FilesDiffer(const std::string& source,
return false;
}
+bool SystemTools::TextFilesDiffer(const std::string& path1,
+ const std::string& path2)
+{
+ kwsys::ifstream if1(path1.c_str());
+ kwsys::ifstream if2(path2.c_str());
+ if (!if1 || !if2) {
+ return true;
+ }
+
+ for (;;) {
+ std::string line1, line2;
+ bool hasData1 = GetLineFromStream(if1, line1);
+ bool hasData2 = GetLineFromStream(if2, line2);
+ if (hasData1 != hasData2) {
+ return true;
+ }
+ if (!hasData1) {
+ break;
+ }
+ if (line1 != line2) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Blockwise copy source to destination file
+ */
+static bool CopyFileContentBlockwise(const std::string& source,
+ const std::string& destination)
+{
+// Open files
+#if defined(_WIN32)
+ kwsys::ifstream fin(
+ Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(),
+ std::ios::in | std::ios::binary);
+#else
+ kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary);
+#endif
+ if (!fin) {
+ return false;
+ }
+
+ // try and remove the destination file so that read only destination files
+ // can be written to.
+ // If the remove fails continue so that files in read only directories
+ // that do not allow file removal can be modified.
+ SystemTools::RemoveFile(destination);
+
+#if defined(_WIN32)
+ kwsys::ofstream fout(
+ Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(destination)).c_str(),
+ std::ios::out | std::ios::trunc | std::ios::binary);
+#else
+ kwsys::ofstream fout(destination.c_str(),
+ std::ios::out | std::ios::trunc | std::ios::binary);
+#endif
+ if (!fout) {
+ return false;
+ }
+
+ // This copy loop is very sensitive on certain platforms with
+ // slightly broken stream libraries (like HPUX). Normally, it is
+ // incorrect to not check the error condition on the fin.read()
+ // before using the data, but the fin.gcount() will be zero if an
+ // error occurred. Therefore, the loop should be safe everywhere.
+ while (fin) {
+ const int bufferSize = 4096;
+ char buffer[bufferSize];
+
+ fin.read(buffer, bufferSize);
+ if (fin.gcount()) {
+ fout.write(buffer, fin.gcount());
+ } else {
+ break;
+ }
+ }
+
+ // Make sure the operating system has finished writing the file
+ // before closing it. This will ensure the file is finished before
+ // the check below.
+ fout.flush();
+
+ fin.close();
+ fout.close();
+
+ if (!fout) {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Clone the source file to the destination file
+ *
+ * If available, the Linux FICLONE ioctl is used to create a check
+ * copy-on-write clone of the source file.
+ *
+ * The method returns false for the following cases:
+ * - The code has not been compiled on Linux or the ioctl was unknown
+ * - The source and destination is on different file systems
+ * - The underlying filesystem does not support file cloning
+ * - An unspecified error occurred
+ */
+static bool CloneFileContent(const std::string& source,
+ const std::string& destination)
+{
+#if defined(__linux) && defined(FICLONE)
+ int in = open(source.c_str(), O_RDONLY);
+ if (in < 0) {
+ return false;
+ }
+
+ SystemTools::RemoveFile(destination);
+
+ int out =
+ open(destination.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
+ if (out < 0) {
+ close(in);
+ return false;
+ }
+
+ int result = ioctl(out, FICLONE, in);
+ close(in);
+ close(out);
+
+ if (result < 0) {
+ return false;
+ }
+
+ return true;
+#else
+ (void)source;
+ (void)destination;
+ return false;
+#endif
+}
+
/**
* Copy a file named by "source" to the file named by "destination".
*/
bool SystemTools::CopyFileAlways(const std::string& source,
const std::string& destination)
{
- // If files are the same do not copy
- if (SystemTools::SameFile(source, destination)) {
- return true;
- }
mode_t perm = 0;
bool perms = SystemTools::GetPermissions(source, perm);
std::string real_destination = destination;
@@ -2198,9 +2314,6 @@ bool SystemTools::CopyFileAlways(const std::string& source,
if (SystemTools::FileIsDirectory(source)) {
SystemTools::MakeDirectory(destination);
} else {
- const int bufferSize = 4096;
- char buffer[bufferSize];
-
// If destination is a directory, try to create a file with the same
// name as the source in that directory.
@@ -2214,67 +2327,21 @@ bool SystemTools::CopyFileAlways(const std::string& source,
} else {
destination_dir = SystemTools::GetFilenamePath(destination);
}
+ // If files are the same do not copy
+ if (SystemTools::SameFile(source, real_destination)) {
+ return true;
+ }
// Create destination directory
SystemTools::MakeDirectory(destination_dir);
-// Open files
-#if defined(_WIN32)
- kwsys::ifstream fin(
- Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(source)).c_str(),
- std::ios::in | std::ios::binary);
-#else
- kwsys::ifstream fin(source.c_str(), std::ios::in | std::ios::binary);
-#endif
- if (!fin) {
- return false;
- }
-
- // try and remove the destination file so that read only destination files
- // can be written to.
- // If the remove fails continue so that files in read only directories
- // that do not allow file removal can be modified.
- SystemTools::RemoveFile(real_destination);
-
-#if defined(_WIN32)
- kwsys::ofstream fout(
- Encoding::ToNarrow(Encoding::ToWindowsExtendedPath(real_destination))
- .c_str(),
- std::ios::out | std::ios::trunc | std::ios::binary);
-#else
- kwsys::ofstream fout(real_destination.c_str(),
- std::ios::out | std::ios::trunc | std::ios::binary);
-#endif
- if (!fout) {
- return false;
- }
-
- // This copy loop is very sensitive on certain platforms with
- // slightly broken stream libraries (like HPUX). Normally, it is
- // incorrect to not check the error condition on the fin.read()
- // before using the data, but the fin.gcount() will be zero if an
- // error occurred. Therefore, the loop should be safe everywhere.
- while (fin) {
- fin.read(buffer, bufferSize);
- if (fin.gcount()) {
- fout.write(buffer, fin.gcount());
- } else {
- break;
+ if (!CloneFileContent(source, real_destination)) {
+ // if cloning did not succeed, fall back to blockwise copy
+ if (!CopyFileContentBlockwise(source, real_destination)) {
+ return false;
}
}
-
- // Make sure the operating system has finished writing the file
- // before closing it. This will ensure the file is finished before
- // the check below.
- fout.flush();
-
- fin.close();
- fout.close();
-
- if (!fout) {
- return false;
- }
}
if (perms) {
if (!SystemTools::SetPermissions(real_destination, perm)) {
@@ -2938,10 +3005,36 @@ bool SystemTools::FileIsDirectory(const std::string& inName)
bool SystemTools::FileIsSymlink(const std::string& name)
{
#if defined(_WIN32)
- DWORD attr =
- GetFileAttributesW(Encoding::ToWindowsExtendedPath(name).c_str());
+ std::wstring path = Encoding::ToWindowsExtendedPath(name);
+ DWORD attr = GetFileAttributesW(path.c_str());
if (attr != INVALID_FILE_ATTRIBUTES) {
- return (attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0;
+ if ((attr & FILE_ATTRIBUTE_REPARSE_POINT) != 0) {
+ // FILE_ATTRIBUTE_REPARSE_POINT means:
+ // * a file or directory that has an associated reparse point, or
+ // * a file that is a symbolic link.
+ HANDLE hFile = CreateFileW(
+ path.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (hFile == INVALID_HANDLE_VALUE) {
+ return false;
+ }
+ byte buffer[MAXIMUM_REPARSE_DATA_BUFFER_SIZE];
+ DWORD bytesReturned = 0;
+ if (!DeviceIoControl(hFile, FSCTL_GET_REPARSE_POINT, NULL, 0, buffer,
+ MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &bytesReturned,
+ NULL)) {
+ CloseHandle(hFile);
+ // Since FILE_ATTRIBUTE_REPARSE_POINT is set this file must be
+ // a symbolic link if it is not a reparse point.
+ return GetLastError() == ERROR_NOT_A_REPARSE_POINT;
+ }
+ CloseHandle(hFile);
+ ULONG reparseTag =
+ reinterpret_cast<PREPARSE_GUID_DATA_BUFFER>(&buffer[0])->ReparseTag;
+ return (reparseTag == IO_REPARSE_TAG_SYMLINK) ||
+ (reparseTag == IO_REPARSE_TAG_MOUNT_POINT);
+ }
+ return false;
} else {
return false;
}
diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in
index 8d1f78cf7..1967860ab 100644
--- a/Source/kwsys/SystemTools.hxx.in
+++ b/Source/kwsys/SystemTools.hxx.in
@@ -579,6 +579,13 @@ public:
const std::string& destination);
/**
+ * Compare the contents of two files, ignoring line ending differences.
+ * Return true if different
+ */
+ static bool TextFilesDiffer(const std::string& path1,
+ const std::string& path2);
+
+ /**
* Return true if the two files are the same file
*/
static bool SameFile(const std::string& file1, const std::string& file2);
diff --git a/Source/kwsys/kwsysPlatformTests.cmake b/Source/kwsys/kwsysPlatformTests.cmake
index 5386a49a3..28d3f68e2 100644
--- a/Source/kwsys/kwsysPlatformTests.cmake
+++ b/Source/kwsys/kwsysPlatformTests.cmake
@@ -7,11 +7,16 @@ SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx)
MACRO(KWSYS_PLATFORM_TEST lang var description invert)
IF(NOT DEFINED ${var}_COMPILED)
MESSAGE(STATUS "${description}")
+ set(maybe_cxx_standard "")
+ if(CMAKE_VERSION VERSION_LESS 3.8 AND CMAKE_CXX_STANDARD)
+ set(maybe_cxx_standard "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}")
+ endif()
TRY_COMPILE(${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}}
COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_TEST_DEFINES} ${KWSYS_PLATFORM_TEST_EXTRA_FLAGS}
CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${KWSYS_PLATFORM_TEST_LINK_LIBRARIES}"
+ ${maybe_cxx_standard}
OUTPUT_VARIABLE OUTPUT)
IF(${var}_COMPILED)
FILE(APPEND
diff --git a/Source/kwsys/testCommandLineArguments.cxx b/Source/kwsys/testCommandLineArguments.cxx
index ef874361f..15f9c02ba 100644
--- a/Source/kwsys/testCommandLineArguments.cxx
+++ b/Source/kwsys/testCommandLineArguments.cxx
@@ -165,25 +165,26 @@ int testCommandLineArguments(int argc, char* argv[])
}
size_t cc;
#define CompareTwoLists(list1, list_valid, lsize) \
- if (list1.size() != lsize) { \
- std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
- << " should be: " << lsize << std::endl; \
- res = 1; \
- } else { \
- std::cout << #list1 " argument set:"; \
- for (cc = 0; cc < lsize; ++cc) { \
- std::cout << " " << list1[cc]; \
- if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \
- std::cerr << "Problem setting " #list1 ". Value of " << cc \
- << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \
- << "]" << std::endl; \
- res = 1; \
- break; \
+ do { \
+ if (list1.size() != lsize) { \
+ std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \
+ << " should be: " << lsize << std::endl; \
+ res = 1; \
+ } else { \
+ std::cout << #list1 " argument set:"; \
+ for (cc = 0; cc < lsize; ++cc) { \
+ std::cout << " " << list1[cc]; \
+ if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \
+ std::cerr << "Problem setting " #list1 ". Value of " << cc \
+ << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \
+ << "]" << std::endl; \
+ res = 1; \
+ break; \
+ } \
} \
+ std::cout << std::endl; \
} \
- std::cout << std::endl; \
- }
-
+ } while (0)
CompareTwoLists(numbers_argument, valid_numbers, 10);
CompareTwoLists(doubles_argument, valid_doubles, 3);
CompareTwoLists(bools_argument, valid_bools, 3);
diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx
index 0477d5937..9a40b5330 100644
--- a/Source/kwsys/testSystemTools.cxx
+++ b/Source/kwsys/testSystemTools.cxx
@@ -984,6 +984,50 @@ static bool CheckGetLineFromStreamLongLine()
return true;
}
+static bool writeFile(const char* fileName, const char* data)
+{
+ kwsys::ofstream out(fileName, std::ios::binary);
+ out << data;
+ if (!out) {
+ std::cerr << "Failed to write file: " << fileName << std::endl;
+ return false;
+ }
+ return true;
+}
+
+static bool CheckTextFilesDiffer()
+{
+ struct
+ {
+ const char* a;
+ const char* b;
+ bool differ;
+ } test_cases[] = { { "one", "one", false },
+ { "one", "two", true },
+ { "", "", false },
+ { "\n", "\r\n", false },
+ { "one\n", "one\n", false },
+ { "one\r\n", "one\n", false },
+ { "one\n", "one", false },
+ { "one\ntwo", "one\ntwo", false },
+ { "one\ntwo", "one\r\ntwo", false } };
+ const int num_test_cases = sizeof(test_cases) / sizeof(test_cases[0]);
+ for (int i = 0; i < num_test_cases; ++i) {
+ if (!writeFile("file_a", test_cases[i].a) ||
+ !writeFile("file_b", test_cases[i].b)) {
+ return false;
+ }
+ if (kwsys::SystemTools::TextFilesDiffer("file_a", "file_b") !=
+ test_cases[i].differ) {
+ std::cerr << "Incorrect TextFilesDiffer result for test case " << i + 1
+ << "." << std::endl;
+ return false;
+ }
+ }
+
+ return true;
+}
+
int testSystemTools(int, char* [])
{
bool res = true;
@@ -1027,5 +1071,7 @@ int testSystemTools(int, char* [])
res &= CheckGetFilenameName();
+ res &= CheckTextFilesDiffer();
+
return res ? 0 : 1;
}
diff --git a/Templates/MSBuild/FlagTables/v10_CL.json b/Templates/MSBuild/FlagTables/v10_CL.json
new file mode 100644
index 000000000..06158bee7
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_CL.json
@@ -0,0 +1,981 @@
+[
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Z7",
+ "comment": "C7 compatible",
+ "value": "OldStyle",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Zi",
+ "comment": "Program Database",
+ "value": "ProgramDatabase",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "ZI",
+ "comment": "Program Database for Edit And Continue",
+ "value": "EditAndContinue",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "",
+ "comment": "No Common Language RunTime Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr",
+ "comment": "Common Language RunTime Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:pure",
+ "comment": "Pure MSIL Common Language RunTime Support",
+ "value": "Pure",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:safe",
+ "comment": "Safe MSIL Common Language RunTime Support",
+ "value": "Safe",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:oldSyntax",
+ "comment": "Common Language RunTime Support, Old Syntax",
+ "value": "OldSyntax",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Turn Off All Warnings",
+ "value": "TurnOffAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Level1",
+ "value": "Level1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Level2",
+ "value": "Level2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Level3",
+ "value": "Level3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W4",
+ "comment": "Level4",
+ "value": "Level4",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "Wall",
+ "comment": "EnableAllWarnings",
+ "value": "EnableAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Minimize Size",
+ "value": "MinSpace",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximize Speed",
+ "value": "MaxSpeed",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Full Optimization",
+ "value": "Full",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob0",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob1",
+ "comment": "Only __inline",
+ "value": "OnlyExplicitInline",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob2",
+ "comment": "Any Suitable",
+ "value": "AnySuitable",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Os",
+ "comment": "Favor small code",
+ "value": "Size",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Ot",
+ "comment": "Favor fast code",
+ "value": "Speed",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "",
+ "comment": "Neither",
+ "value": "Neither",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHa",
+ "comment": "Yes with SEH Exceptions",
+ "value": "Async",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHsc",
+ "comment": "Yes",
+ "value": "Sync",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHs",
+ "comment": "Yes with Extern C functions",
+ "value": "SyncCThrow",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "StackFrameRuntimeCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized variables",
+ "value": "UninitializedLocalUsageCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both (/RTC1, equiv. to /RTCsu)",
+ "value": "EnableFastChecks",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MT",
+ "comment": "Multi-threaded",
+ "value": "MultiThreaded",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MTd",
+ "comment": "Multi-threaded Debug",
+ "value": "MultiThreadedDebug",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MD",
+ "comment": "Multi-threaded DLL",
+ "value": "MultiThreadedDLL",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MultiThreadedDebugDLL",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp1",
+ "comment": "1 Byte",
+ "value": "1Byte",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp2",
+ "comment": "2 Bytes",
+ "value": "2Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp4",
+ "comment": "4 Byte",
+ "value": "4Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp8",
+ "comment": "8 Bytes",
+ "value": "8Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp16",
+ "comment": "16 Bytes",
+ "value": "16Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE",
+ "comment": "Streaming SIMD Extensions (/arch:SSE)",
+ "value": "StreamingSIMDExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE2",
+ "comment": "Streaming SIMD Extensions 2 (/arch:SSE2)",
+ "value": "StreamingSIMDExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:precise",
+ "comment": "Precise",
+ "value": "Precise",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:strict",
+ "comment": "Strict",
+ "value": "Strict",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:fast",
+ "comment": "Fast",
+ "value": "Fast",
+ "flags": []
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yc",
+ "comment": "Create",
+ "value": "Create",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yu",
+ "comment": "Use",
+ "value": "Use",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Y-",
+ "comment": "Not Using Precompiled Headers",
+ "value": "NotUsing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "",
+ "comment": "No Listing",
+ "value": "NoListing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FA",
+ "comment": "Assembly-Only Listing",
+ "value": "AssemblyCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAc",
+ "comment": "Assembly With Machine Code",
+ "value": "AssemblyAndMachineCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAs",
+ "comment": "Assembly With Source Code",
+ "value": "AssemblyAndSourceCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAcs",
+ "comment": "Assembly, Machine Code and Source",
+ "value": "All",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "__cdecl",
+ "value": "Cdecl",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gr",
+ "comment": "__fastcall",
+ "value": "FastCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "__stdcall",
+ "value": "StdCall",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TC",
+ "comment": "Compile as C Code",
+ "value": "CompileAsC",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TP",
+ "comment": "Compile as C++ Code",
+ "value": "CompileAsCpp",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do Not Send Report",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "Prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Queue For Next Login",
+ "value": "Queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Send Automatically",
+ "value": "Send",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo-",
+ "comment": "Suppress Startup Banner",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX-",
+ "comment": "Treat Warnings As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MultiProcessorCompilation",
+ "switch": "MP",
+ "comment": "Multi-processor Compilation",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "IntrinsicFunctions",
+ "switch": "Oi",
+ "comment": "Enable Intrinsic Functions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy-",
+ "comment": "Omit Frame Pointers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy",
+ "comment": "Omit Frame Pointers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFiberSafeOptimizations",
+ "switch": "GT",
+ "comment": "Enable Fiber-Safe Optimizations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WholeProgramOptimization",
+ "switch": "GL",
+ "comment": "Whole Program Optimization",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UndefineAllPreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine All Preprocessor Definitions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessToFile",
+ "switch": "P",
+ "comment": "Preprocess to a File",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessSuppressLineNumbers",
+ "switch": "EP",
+ "comment": "Preprocess Suppress Line Numbers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessKeepComments",
+ "switch": "C",
+ "comment": "Keep Comments",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF-",
+ "comment": "Enable String Pooling",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF",
+ "comment": "Enable String Pooling",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm-",
+ "comment": "Enable Minimal Rebuild",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm",
+ "comment": "Enable Minimal Rebuild",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SmallerTypeCheck",
+ "switch": "RTCc",
+ "comment": "Smaller Type Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS-",
+ "comment": "Buffer Security Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS",
+ "comment": "Buffer Security Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy-",
+ "comment": "Enable Function-Level Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy",
+ "comment": "Enable Function-Level Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except-",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CreateHotpatchableImage",
+ "switch": "hotpatch",
+ "comment": "Create Hotpatchable Image",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableLanguageExtensions",
+ "switch": "Za",
+ "comment": "Disable Language Extensions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t-",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope-",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR-",
+ "comment": "Enable Run-Time Type Information",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR",
+ "comment": "Enable Run-Time Type Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp-",
+ "comment": "Open MP Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp",
+ "comment": "Open MP Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ExpandAttributedSource",
+ "switch": "Fx",
+ "comment": "Expand Attributed Source",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateXMLDocumentationFiles",
+ "switch": "doc",
+ "comment": "Generate XML Documentation Files",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "BrowseInformation",
+ "switch": "FR",
+ "comment": "Enable Browse Information",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "ShowIncludes",
+ "switch": "showIncludes",
+ "comment": "Show Includes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze-",
+ "comment": "Enable Code Analysis",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze",
+ "comment": "Enable Code Analysis",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseFullPaths",
+ "switch": "FC",
+ "comment": "Use Full Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitDefaultLibName",
+ "switch": "Zl",
+ "comment": "Omit Default Library Name",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseUnicodeForAssemblerListing",
+ "switch": "FAu",
+ "comment": "Use Unicode For Assembler Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalUsingDirectories",
+ "switch": "AI",
+ "comment": "Resolve #using References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DisableSpecificWarnings",
+ "switch": "wd",
+ "comment": "Disable Specific Warnings",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedIncludeFiles",
+ "switch": "FI",
+ "comment": "Forced Include File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedUsingFiles",
+ "switch": "FU",
+ "comment": "Forced #using File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "TreatSpecificWarningsAsErrors",
+ "switch": "we",
+ "comment": "Treat Specific Warnings As Errors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessOutputPath",
+ "switch": "Fi",
+ "comment": "Preprocess Output Path",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yu",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yc",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderOutputFile",
+ "switch": "Fp",
+ "comment": "Precompiled Header Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssemblerListingLocation",
+ "switch": "Fa",
+ "comment": "ASM List Location",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDataBaseFileName",
+ "switch": "Fd",
+ "comment": "Program Database File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "XMLDocumentationFileName",
+ "switch": "doc",
+ "comment": "XML Documentation File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "BrowseInformationFile",
+ "switch": "FR",
+ "comment": "Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ProcessorNumber",
+ "switch": "MP",
+ "comment": "Number of processors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_CSharp.json b/Templates/MSBuild/FlagTables/v10_CSharp.json
new file mode 100644
index 000000000..5989aea1e
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_CSharp.json
@@ -0,0 +1,574 @@
+[
+ {
+ "name": "ProjectName",
+ "switch": "out:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:exe",
+ "comment": "",
+ "value": "Exe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:winexe",
+ "comment": "",
+ "value": "Winexe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:library",
+ "comment": "",
+ "value": "Library",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:module",
+ "comment": "",
+ "value": "Module",
+ "flags": []
+ },
+ {
+ "name": "DocumentationFile",
+ "switch": "doc",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x86",
+ "comment": "",
+ "value": "x86",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:Itanium",
+ "comment": "",
+ "value": "Itanium",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x64",
+ "comment": "",
+ "value": "x64",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:arm",
+ "comment": "",
+ "value": "arm",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu32bitpreferred",
+ "comment": "",
+ "value": "anycpu32bitpreferred",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu",
+ "comment": "",
+ "value": "anycpu",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "mit alias",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "dateiliste",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AddModules",
+ "switch": "addmodule:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Win32Resource",
+ "switch": "win32res:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationIcon",
+ "switch": "win32icon:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationManifest",
+ "switch": "win32manifest:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "NoWin32Manifest",
+ "switch": "nowin32manifest",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineDebug",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": [
+ "Continue"
+ ]
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:none",
+ "comment": "",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:full",
+ "comment": "",
+ "value": "full",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:pdbonly",
+ "comment": "",
+ "value": "pdbonly",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:0",
+ "comment": "",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:1",
+ "comment": "",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:2",
+ "comment": "",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "NoWarn",
+ "switch": "nowarn:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineConstants",
+ "switch": "define:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable",
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-1",
+ "comment": "",
+ "value": "ISO-1",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-2",
+ "comment": "",
+ "value": "ISO-2",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:5",
+ "comment": "",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:6",
+ "comment": "",
+ "value": "6",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:default",
+ "comment": "",
+ "value": "default",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyOriginatorKeyFile",
+ "switch": "keyfile",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "KeyContainerName",
+ "switch": "keycontainer",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoConfig",
+ "switch": "noconfig",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "baseaddress:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "CodePage",
+ "switch": "codepage",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "Utf8Output",
+ "switch": "utf8output",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "MainEntryPoint",
+ "switch": "main:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "GenerateFullPaths",
+ "switch": "fullpaths",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FileAlignment",
+ "switch": "filealign",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "PdbFile",
+ "switch": "pdb:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SubsystemVersion",
+ "switch": "subsystemversion",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibPaths",
+ "switch": "lib:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:none",
+ "comment": "Do Not Send Report",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:queue",
+ "comment": "Queue For Next Login",
+ "value": "queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:send",
+ "comment": "Send Automatically",
+ "value": "send",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_Cuda.json b/Templates/MSBuild/FlagTables/v10_Cuda.json
new file mode 100644
index 000000000..1831b8aaf
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_Cuda.json
@@ -0,0 +1,224 @@
+[
+ {
+ "name": "AdditionalCompilerOptions",
+ "switch": "Xcompiler=",
+ "comment": "Host compiler options",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalCompilerOptions",
+ "switch": "Xcompiler",
+ "comment": "Host compiler options",
+ "value": "",
+ "flags": [
+ "UserFollowing",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "CudaRuntime",
+ "switch": "cudart=none",
+ "comment": "No CUDA runtime library",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "CudaRuntime",
+ "switch": "cudart=shared",
+ "comment": "Shared/dynamic CUDA runtime library",
+ "value": "Shared",
+ "flags": []
+ },
+ {
+ "name": "CudaRuntime",
+ "switch": "cudart=static",
+ "comment": "Static CUDA runtime library",
+ "value": "Static",
+ "flags": []
+ },
+ {
+ "name": "CudaRuntime",
+ "switch": "cudart",
+ "comment": "CUDA runtime library",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "cmake-temp-gencode",
+ "switch": "gencode=",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "cmake-temp-gencode",
+ "switch": "gencode",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserFollowing",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "cmake-temp-gencode",
+ "switch": "-generate-code=",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "cmake-temp-gencode",
+ "switch": "-generate-code",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserFollowing",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "cmake-temp-code",
+ "switch": "code=",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "cmake-temp-code",
+ "switch": "code",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "cmake-temp-code",
+ "switch": "-gpu-code=",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "cmake-temp-code",
+ "switch": "-gpu-code",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "cmake-temp-arch",
+ "switch": "arch=",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "cmake-temp-arch",
+ "switch": "arch",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "cmake-temp-arch",
+ "switch": "-gpu-architecture=",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "cmake-temp-arch",
+ "switch": "-gpu-architecture",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "FastMath",
+ "switch": "use_fast_math",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FastMath",
+ "switch": "-use_fast_math",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GPUDebugInfo",
+ "switch": "G",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GPUDebugInfo",
+ "switch": "-device-debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "HostDebugInfo",
+ "switch": "g",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "HostDebugInfo",
+ "switch": "-debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MaxRegCount",
+ "switch": "maxrregcount=",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MaxRegCount",
+ "switch": "maxrregcount",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_CudaHost.json b/Templates/MSBuild/FlagTables/v10_CudaHost.json
new file mode 100644
index 000000000..2593ff146
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_CudaHost.json
@@ -0,0 +1,149 @@
+[
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Od",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Minimize Size",
+ "value": "O1",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximize Speed",
+ "value": "O2",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Full Optimization",
+ "value": "O3",
+ "flags": []
+ },
+ {
+ "name": "Runtime",
+ "switch": "MT",
+ "comment": "Multi-Threaded",
+ "value": "MT",
+ "flags": []
+ },
+ {
+ "name": "Runtime",
+ "switch": "MTd",
+ "comment": "Multi-Threaded Debug",
+ "value": "MTd",
+ "flags": []
+ },
+ {
+ "name": "Runtime",
+ "switch": "MD",
+ "comment": "Multi-Threaded DLL",
+ "value": "MD",
+ "flags": []
+ },
+ {
+ "name": "Runtime",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MDd",
+ "flags": []
+ },
+ {
+ "name": "Runtime",
+ "switch": "ML",
+ "comment": "Single-Threaded",
+ "value": "ML",
+ "flags": []
+ },
+ {
+ "name": "Runtime",
+ "switch": "MLd",
+ "comment": "Single-Threaded Debug",
+ "value": "MLd",
+ "flags": []
+ },
+ {
+ "name": "RuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "RTCs",
+ "flags": []
+ },
+ {
+ "name": "RuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized Variables",
+ "value": "RTCu",
+ "flags": []
+ },
+ {
+ "name": "RuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both",
+ "value": "RTC1",
+ "flags": []
+ },
+ {
+ "name": "TypeInfo",
+ "switch": "GR",
+ "comment": "Yes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TypeInfo",
+ "switch": "GR-",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "Warning",
+ "switch": "W0",
+ "comment": "Off: Turn Off All Warnings",
+ "value": "W0",
+ "flags": []
+ },
+ {
+ "name": "Warning",
+ "switch": "W1",
+ "comment": "Level 1",
+ "value": "W1",
+ "flags": []
+ },
+ {
+ "name": "Warning",
+ "switch": "W2",
+ "comment": "Level 2",
+ "value": "W2",
+ "flags": []
+ },
+ {
+ "name": "Warning",
+ "switch": "W3",
+ "comment": "Level 3",
+ "value": "W3",
+ "flags": []
+ },
+ {
+ "name": "Warning",
+ "switch": "W4",
+ "comment": "Level 4",
+ "value": "W4",
+ "flags": []
+ },
+ {
+ "name": "Warning",
+ "switch": "Wall",
+ "comment": "Enable All Warnings",
+ "value": "Wall",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_LIB.json b/Templates/MSBuild/FlagTables/v10_LIB.json
new file mode 100644
index 000000000..58a238c97
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_LIB.json
@@ -0,0 +1,297 @@
+[
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWSCE",
+ "comment": "WindowsCE",
+ "value": "WindowsCE",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Verbose",
+ "switch": "VERBOSE",
+ "comment": "Verbose",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Link Time Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ExportNamedFunctions",
+ "switch": "EXPORT:",
+ "comment": "Export Named Functions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "RemoveObjects",
+ "switch": "REMOVE:",
+ "comment": "Remove Objects",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "DisplayLibrary",
+ "switch": "LIST:",
+ "comment": "Display Library to standard output",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Name",
+ "switch": "NAME:",
+ "comment": "Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_Link.json b/Templates/MSBuild/FlagTables/v10_Link.json
new file mode 100644
index 000000000..ac5b8b16c
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_Link.json
@@ -0,0 +1,1137 @@
+[
+ {
+ "name": "ShowProgress",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE",
+ "comment": "Display all progress messages",
+ "value": "LinkVerbose",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:Lib",
+ "comment": "For Libraries Searched",
+ "value": "LinkVerboseLib",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:ICF",
+ "comment": "About COMDAT folding during optimized linking",
+ "value": "LinkVerboseICF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:REF",
+ "comment": "About data removed during optimized linking",
+ "value": "LinkVerboseREF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:SAFESEH",
+ "comment": "About Modules incompatible with SEH",
+ "value": "LinkVerboseSAFESEH",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:CLR",
+ "comment": "About linker activity related to managed code",
+ "value": "LinkVerboseCLR",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:MULTIPLE",
+ "comment": "Multiply Defined Symbol Only",
+ "value": "MultiplyDefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:UNRESOLVED",
+ "comment": "Undefined Symbol Only",
+ "value": "UndefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:5",
+ "comment": "X86 Image Only",
+ "value": "X86Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:6",
+ "comment": "X64 Image Only",
+ "value": "X64Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:16",
+ "comment": "Itanium Image Only",
+ "value": "ItaniumImage",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='asInvoker'",
+ "comment": "asInvoker",
+ "value": "AsInvoker",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='highestAvailable'",
+ "comment": "highestAvailable",
+ "value": "HighestAvailable",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='requireAdministrator'",
+ "comment": "requireAdministrator",
+ "value": "RequireAdministrator",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWSCE",
+ "comment": "WindowsCE",
+ "value": "WindowsCE",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "Driver",
+ "comment": "Driver",
+ "value": "Driver",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:UPONLY",
+ "comment": "UP Only",
+ "value": "UpOnly",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:WDM",
+ "comment": "WDM",
+ "value": "WDM",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Use Link Time Code Generation",
+ "value": "UseLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGInstrument",
+ "comment": "Profile Guided Optimization - Instrument",
+ "value": "PGInstrument",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGOptimize",
+ "comment": "Profile Guided Optimization - Optimization",
+ "value": "PGOptimization",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGUpdate",
+ "comment": "Profile Guided Optimization - Update",
+ "value": "PGUpdate",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:MTA",
+ "comment": "MTA threading attribute",
+ "value": "MTAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:STA",
+ "comment": "STA threading attribute",
+ "value": "STAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:NONE",
+ "comment": "Default threading attribute",
+ "value": "DefaultThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:IJW",
+ "comment": "Force IJW image",
+ "value": "ForceIJWImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:PURE",
+ "comment": "Force Pure IL Image",
+ "value": "ForcePureILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:SAFE",
+ "comment": "Force Safe IL Image",
+ "value": "ForceSafeILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "",
+ "comment": "Default image type",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:NO",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:SYSTEMDLL",
+ "comment": "System Dlls Only",
+ "value": "SystemDlls",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL:NO",
+ "comment": "Enable Incremental Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL",
+ "comment": "Enable Incremental Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:NOSTATUS",
+ "comment": "Link Status",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:STATUS",
+ "comment": "Link Status",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND:NO",
+ "comment": "Prevent Dll Binding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND",
+ "comment": "Prevent Dll Binding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST:NO",
+ "comment": "Generate Manifest",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST",
+ "comment": "Generate Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION:NO",
+ "comment": "Allow Isolation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION",
+ "comment": "Allow Isolation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableUAC",
+ "switch": "MANIFESTUAC:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='true'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG",
+ "comment": "Generate Debug Info",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateMapFile",
+ "switch": "MAP",
+ "comment": "Generate Map File",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "MapExports",
+ "switch": "MAPINFO:EXPORTS",
+ "comment": "Map Exports",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG:DISABLE",
+ "comment": "Debuggable Assembly",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG",
+ "comment": "Debuggable Assembly",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE:NO",
+ "comment": "Enable Large Addresses",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE",
+ "comment": "Enable Large Addresses",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE:NO",
+ "comment": "Terminal Server",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE",
+ "comment": "Terminal Server",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromCD",
+ "switch": "SWAPRUN:CD",
+ "comment": "Swap Run From CD",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromNET",
+ "switch": "SWAPRUN:NET",
+ "comment": "Swap Run From Network",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:NOREF",
+ "comment": "References",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:REF",
+ "comment": "References",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:NOICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:ICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreEmbeddedIDL",
+ "switch": "IGNOREIDL",
+ "comment": "Ignore Embedded IDL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoEntryPoint",
+ "switch": "NOENTRY",
+ "comment": "No Entry Point",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SetChecksum",
+ "switch": "RELEASE",
+ "comment": "Set Checksum",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE:NO",
+ "comment": "Randomized Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE",
+ "comment": "Randomized Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED:NO",
+ "comment": "Fixed Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED",
+ "comment": "Fixed Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT:NO",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TurnOffAssemblyGeneration",
+ "switch": "NOASSEMBLY",
+ "comment": "Turn Off Assembly Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportUnloadOfDelayLoadedDLL",
+ "switch": "DELAY:UNLOAD",
+ "comment": "Unload delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportNobindOfDelayLoadedDLL",
+ "switch": "DELAY:NOBIND",
+ "comment": "Nobind delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Profile",
+ "switch": "PROFILE",
+ "comment": "Profile",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN:NO",
+ "comment": "Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN",
+ "comment": "Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK:NO",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH:NO",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDLL",
+ "switch": "DLL",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AddModuleNamesToAssembly",
+ "switch": "ASSEMBLYMODULE:",
+ "comment": "Add Module to Assembly",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "EmbedManagedResourceFile",
+ "switch": "ASSEMBLYRESOURCE:",
+ "comment": "Embed Managed Resource File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DelayLoadDLLs",
+ "switch": "DELAYLOAD:",
+ "comment": "Delay Loaded Dlls",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AssemblyLinkResource",
+ "switch": "ASSEMBLYLINKRESOURCE:",
+ "comment": "Assembly Link Resource",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalManifestDependencies",
+ "switch": "MANIFESTDEPENDENCY:",
+ "comment": "Additional Manifest Dependencies",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Version",
+ "switch": "VERSION:",
+ "comment": "Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SpecifySectionAttributes",
+ "switch": "SECTION:",
+ "comment": "Specify Section Attributes",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MSDOSStubFileName",
+ "switch": "STUB:",
+ "comment": "MS-DOS Stub File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ManifestFile",
+ "switch": "ManifestFile:",
+ "comment": "Manifest File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDatabaseFile",
+ "switch": "PDB:",
+ "comment": "Generate Program Database File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StripPrivateSymbols",
+ "switch": "PDBSTRIPPED:",
+ "comment": "Strip Private Symbols",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MapFileName",
+ "switch": "MAP:",
+ "comment": "Map File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "HeapReserveSize",
+ "switch": "HEAP:",
+ "comment": "Heap Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "HeapCommitSize",
+ "switch": "HEAP",
+ "comment": "Heap Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "StackReserveSize",
+ "switch": "STACK:",
+ "comment": "Stack Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StackCommitSize",
+ "switch": "STACK",
+ "comment": "Stack Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "FunctionOrder",
+ "switch": "ORDER:@",
+ "comment": "Function Order",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProfileGuidedDatabase",
+ "switch": "PGD:",
+ "comment": "Profile Guided Database",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MidlCommandFile",
+ "switch": "MIDL:@",
+ "comment": "MIDL Commands",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergedIDLBaseFileName",
+ "switch": "IDLOUT:",
+ "comment": "Merged IDL Base File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryFile",
+ "switch": "TLBOUT:",
+ "comment": "Type Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "EntryPointSymbol",
+ "switch": "ENTRY:",
+ "comment": "Entry Point",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "BASE:",
+ "comment": "Base Address",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ImportLibrary",
+ "switch": "IMPLIB:",
+ "comment": "Import Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergeSections",
+ "switch": "MERGE:",
+ "comment": "Merge Sections",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LinkKeyFile",
+ "switch": "KEYFILE:",
+ "comment": "Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "KeyContainer",
+ "switch": "KEYCONTAINER:",
+ "comment": "Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryResourceID",
+ "switch": "TLBID:",
+ "comment": "TypeLib Resource ID",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SectionAlignment",
+ "switch": "ALIGN:",
+ "comment": "SectionAlignment",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_MASM.json b/Templates/MSBuild/FlagTables/v10_MASM.json
new file mode 100644
index 000000000..4634306b1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_MASM.json
@@ -0,0 +1,295 @@
+[
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cp",
+ "comment": "Preserves Identifier Case (/Cp)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cu",
+ "comment": "Maps all identifiers to upper case. (/Cu)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cx",
+ "comment": "Preserves case in public and extern symbols. (/Cx)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Warning Level 0 (/W0)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Warning Level 1 (/W1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Warning Level 2 (/W2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Warning Level 3 (/W3)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp1",
+ "comment": "One Byte Boundary (/Zp1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp2",
+ "comment": "Two Byte Boundary (/Zp2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp4",
+ "comment": "Four Byte Boundary (/Zp4)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp8",
+ "comment": "Eight Byte Boundary (/Zp8)",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp16",
+ "comment": "Sixteen Byte Boundary (/Zp16)",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "Use C-style Calling Convention (/Gd)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "Use stdcall Calling Convention (/Gz)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gc",
+ "comment": "Use Pascal Calling Convention (/Gc)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt to send report immediately (/errorReport:prompt)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Prompt to send report at the next logon (/errorReport:queue)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Automatically send report (/errorReport:send)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do not send report (/errorReport:none)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GeneratePreprocessedSourceListing",
+ "switch": "EP",
+ "comment": "Generate Preprocessed Source Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ListAllAvailableInformation",
+ "switch": "Sa",
+ "comment": "List All Available Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseSafeExceptionHandlers",
+ "switch": "safeseh",
+ "comment": "Use Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AddFirstPassListing",
+ "switch": "Sf",
+ "comment": "Add First Pass Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableAssemblyGeneratedCodeListing",
+ "switch": "Sg",
+ "comment": "Enable Assembly Generated Code Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableSymbolTable",
+ "switch": "Sn",
+ "comment": "Disable Symbol Table",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFalseConditionalsInListing",
+ "switch": "Sx",
+ "comment": "Enable False Conditionals In Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MakeAllSymbolsPublic",
+ "switch": "Zf",
+ "comment": "Make All Symbols Public",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "Zi",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableMASM51Compatibility",
+ "switch": "Zm",
+ "comment": "Enable MASM 5.1 Compatibility",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PerformSyntaxCheckOnly",
+ "switch": "Zs",
+ "comment": "Perform Syntax Check Only",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IncludePaths",
+ "switch": "I",
+ "comment": "Include Paths",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "BrowseFile",
+ "switch": "FR",
+ "comment": "Generate Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssembledCodeListingFile",
+ "switch": "Fl",
+ "comment": "Assembled Code Listing File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_NASM.json b/Templates/MSBuild/FlagTables/v10_NASM.json
new file mode 100644
index 000000000..434cd634e
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_NASM.json
@@ -0,0 +1,201 @@
+[
+ {
+ "name": "Outputswitch",
+ "switch": "fwin",
+ "comment": "Object File win32",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "Outputswitch",
+ "switch": "fwin32",
+ "comment": "Object File win32",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "Outputswitch",
+ "switch": "fwin64",
+ "comment": "Object File win64",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "Outputswitch",
+ "switch": "felf",
+ "comment": "ELF32 (i386) object files (e.g. Linux)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "Outputswitch",
+ "switch": "felf32",
+ "comment": "ELF32 (i386) object files (e.g. Linux)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "Outputswitch",
+ "switch": "felf64",
+ "comment": "ELF64 (x86_64) object files (e.g. Linux)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "ErrorReportingFormat",
+ "switch": "Xgnu",
+ "comment": "-Xgnu GNU format: Default format",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "ErrorReportingFormat",
+ "switch": "Xvc",
+ "comment": "-Xvc Style used by Microsoft Visual C++",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "tasmmode",
+ "switch": "t",
+ "comment": "SciTech TASM compatible mode",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "g",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "Werror",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "floatunderflow",
+ "switch": "w+float-underflow",
+ "comment": "float-underflow",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "macrodefaults",
+ "switch": "w-macro-defaults",
+ "comment": "Disable macro-defaults",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "user",
+ "switch": "w-user",
+ "comment": "Disable user",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "floatoverflow",
+ "switch": "w-float-overflow",
+ "comment": "Disable float-overflow",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "floatdenorm",
+ "switch": "w+float-denorm",
+ "comment": "float-denorm",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "numberoverflow",
+ "switch": "w-number-overflow",
+ "comment": "Disable number-overflow",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "macroselfref",
+ "switch": "w+macro-selfref",
+ "comment": "macro-selfref",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "floattoolong",
+ "switch": "w-float-toolong",
+ "comment": "Disable float-toolong",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "orphanlabels",
+ "switch": "w-orphan-labels",
+ "comment": "Disable orphan-labels",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssembledCodeListingFile",
+ "switch": "l",
+ "comment": "Assembled Code Listing File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "Z",
+ "comment": "Redirect Error Messages to File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IncludePaths",
+ "switch": "I",
+ "comment": "Include Paths",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFormat",
+ "switch": "o",
+ "comment": "Output File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v10_RC.json b/Templates/MSBuild/FlagTables/v10_RC.json
new file mode 100644
index 000000000..b8c0127d1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v10_RC.json
@@ -0,0 +1,69 @@
+[
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "v",
+ "comment": "Show Progress",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NullTerminateStrings",
+ "switch": "n",
+ "comment": "Null Terminate Strings",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ResourceOutputFileName",
+ "switch": "fo",
+ "comment": "Resource File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v11_CL.json b/Templates/MSBuild/FlagTables/v11_CL.json
new file mode 100644
index 000000000..b47ab2e98
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v11_CL.json
@@ -0,0 +1,1063 @@
+[
+ {
+ "name": "DebugInformationFormat",
+ "switch": "",
+ "comment": "None",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Z7",
+ "comment": "C7 compatible",
+ "value": "OldStyle",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Zi",
+ "comment": "Program Database",
+ "value": "ProgramDatabase",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "ZI",
+ "comment": "Program Database for Edit And Continue",
+ "value": "EditAndContinue",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "",
+ "comment": "No Common Language RunTime Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr",
+ "comment": "Common Language RunTime Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:pure",
+ "comment": "Pure MSIL Common Language RunTime Support",
+ "value": "Pure",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:safe",
+ "comment": "Safe MSIL Common Language RunTime Support",
+ "value": "Safe",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:oldSyntax",
+ "comment": "Common Language RunTime Support, Old Syntax",
+ "value": "OldSyntax",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Turn Off All Warnings",
+ "value": "TurnOffAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Level1",
+ "value": "Level1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Level2",
+ "value": "Level2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Level3",
+ "value": "Level3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W4",
+ "comment": "Level4",
+ "value": "Level4",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "Wall",
+ "comment": "EnableAllWarnings",
+ "value": "EnableAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Minimize Size",
+ "value": "MinSpace",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximize Speed",
+ "value": "MaxSpeed",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Full Optimization",
+ "value": "Full",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob0",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob1",
+ "comment": "Only __inline",
+ "value": "OnlyExplicitInline",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob2",
+ "comment": "Any Suitable",
+ "value": "AnySuitable",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Os",
+ "comment": "Favor small code",
+ "value": "Size",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Ot",
+ "comment": "Favor fast code",
+ "value": "Speed",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "",
+ "comment": "Neither",
+ "value": "Neither",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHa",
+ "comment": "Yes with SEH Exceptions",
+ "value": "Async",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHsc",
+ "comment": "Yes",
+ "value": "Sync",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHs",
+ "comment": "Yes with Extern C functions",
+ "value": "SyncCThrow",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "StackFrameRuntimeCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized variables",
+ "value": "UninitializedLocalUsageCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both (/RTC1, equiv. to /RTCsu)",
+ "value": "EnableFastChecks",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MT",
+ "comment": "Multi-threaded",
+ "value": "MultiThreaded",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MTd",
+ "comment": "Multi-threaded Debug",
+ "value": "MultiThreadedDebug",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MD",
+ "comment": "Multi-threaded DLL",
+ "value": "MultiThreadedDLL",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MultiThreadedDebugDLL",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp1",
+ "comment": "1 Byte",
+ "value": "1Byte",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp2",
+ "comment": "2 Bytes",
+ "value": "2Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp4",
+ "comment": "4 Byte",
+ "value": "4Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp8",
+ "comment": "8 Bytes",
+ "value": "8Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp16",
+ "comment": "16 Bytes",
+ "value": "16Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE",
+ "comment": "Streaming SIMD Extensions",
+ "value": "StreamingSIMDExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE2",
+ "comment": "Streaming SIMD Extensions 2",
+ "value": "StreamingSIMDExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX",
+ "comment": "Advanced Vector Extensions",
+ "value": "AdvancedVectorExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:IA32",
+ "comment": "No Enhanced Instructions",
+ "value": "NoExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:precise",
+ "comment": "Precise",
+ "value": "Precise",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:strict",
+ "comment": "Strict",
+ "value": "Strict",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:fast",
+ "comment": "Fast",
+ "value": "Fast",
+ "flags": []
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yc",
+ "comment": "Create",
+ "value": "Create",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yu",
+ "comment": "Use",
+ "value": "Use",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Y-",
+ "comment": "Not Using Precompiled Headers",
+ "value": "NotUsing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "",
+ "comment": "No Listing",
+ "value": "NoListing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FA",
+ "comment": "Assembly-Only Listing",
+ "value": "AssemblyCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAc",
+ "comment": "Assembly With Machine Code",
+ "value": "AssemblyAndMachineCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAs",
+ "comment": "Assembly With Source Code",
+ "value": "AssemblyAndSourceCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAcs",
+ "comment": "Assembly, Machine Code and Source",
+ "value": "All",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "__cdecl",
+ "value": "Cdecl",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gr",
+ "comment": "__fastcall",
+ "value": "FastCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "__stdcall",
+ "value": "StdCall",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TC",
+ "comment": "Compile as C Code",
+ "value": "CompileAsC",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TP",
+ "comment": "Compile as C++ Code",
+ "value": "CompileAsCpp",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do Not Send Report",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "Prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Queue For Next Login",
+ "value": "Queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Send Automatically",
+ "value": "Send",
+ "flags": []
+ },
+ {
+ "name": "CompileAsWinRT",
+ "switch": "ZW",
+ "comment": "Consume Windows Runtime Extension",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WinRTNoStdLib",
+ "switch": "ZW:nostdlib",
+ "comment": "No Standard WinRT Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo-",
+ "comment": "Suppress Startup Banner",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX-",
+ "comment": "Treat Warnings As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl-",
+ "comment": "SDL checks",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl",
+ "comment": "SDL checks",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MultiProcessorCompilation",
+ "switch": "MP",
+ "comment": "Multi-processor Compilation",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "IntrinsicFunctions",
+ "switch": "Oi",
+ "comment": "Enable Intrinsic Functions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy-",
+ "comment": "Omit Frame Pointers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy",
+ "comment": "Omit Frame Pointers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFiberSafeOptimizations",
+ "switch": "GT",
+ "comment": "Enable Fiber-Safe Optimizations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WholeProgramOptimization",
+ "switch": "GL",
+ "comment": "Whole Program Optimization",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UndefineAllPreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine All Preprocessor Definitions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessToFile",
+ "switch": "P",
+ "comment": "Preprocess to a File",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessSuppressLineNumbers",
+ "switch": "EP",
+ "comment": "Preprocess Suppress Line Numbers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessKeepComments",
+ "switch": "C",
+ "comment": "Keep Comments",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF-",
+ "comment": "Enable String Pooling",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF",
+ "comment": "Enable String Pooling",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm-",
+ "comment": "Enable Minimal Rebuild",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm",
+ "comment": "Enable Minimal Rebuild",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SmallerTypeCheck",
+ "switch": "RTCc",
+ "comment": "Smaller Type Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS-",
+ "comment": "Security Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS",
+ "comment": "Security Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy-",
+ "comment": "Enable Function-Level Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy",
+ "comment": "Enable Function-Level Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar-",
+ "comment": "Enable Parallel Code Generation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar",
+ "comment": "Enable Parallel Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except-",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CreateHotpatchableImage",
+ "switch": "hotpatch",
+ "comment": "Create Hotpatchable Image",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableLanguageExtensions",
+ "switch": "Za",
+ "comment": "Disable Language Extensions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t-",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope-",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR-",
+ "comment": "Enable Run-Time Type Information",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR",
+ "comment": "Enable Run-Time Type Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp-",
+ "comment": "Open MP Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp",
+ "comment": "Open MP Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ExpandAttributedSource",
+ "switch": "Fx",
+ "comment": "Expand Attributed Source",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseUnicodeForAssemblerListing",
+ "switch": "FAu",
+ "comment": "Use Unicode For Assembler Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateXMLDocumentationFiles",
+ "switch": "doc",
+ "comment": "Generate XML Documentation Files",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "BrowseInformation",
+ "switch": "FR",
+ "comment": "Enable Browse Information",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "ShowIncludes",
+ "switch": "showIncludes",
+ "comment": "Show Includes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze-",
+ "comment": "Enable Code Analysis",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze",
+ "comment": "Enable Code Analysis",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseFullPaths",
+ "switch": "FC",
+ "comment": "Use Full Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitDefaultLibName",
+ "switch": "Zl",
+ "comment": "Omit Default Library Name",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalUsingDirectories",
+ "switch": "AI",
+ "comment": "Additional #using Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DisableSpecificWarnings",
+ "switch": "wd",
+ "comment": "Disable Specific Warnings",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedIncludeFiles",
+ "switch": "FI",
+ "comment": "Forced Include File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedUsingFiles",
+ "switch": "FU",
+ "comment": "Forced #using File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PREfastLog",
+ "switch": "analyze:log",
+ "comment": "Code Analysis Log",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "PREfastAdditionalPlugins",
+ "switch": "analyze:plugin",
+ "comment": "Additional Code Analysis Native plugins",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "TreatSpecificWarningsAsErrors",
+ "switch": "we",
+ "comment": "Treat Specific Warnings As Errors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessOutputPath",
+ "switch": "Fi",
+ "comment": "Preprocess Output Path",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yu",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yc",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderOutputFile",
+ "switch": "Fp",
+ "comment": "Precompiled Header Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssemblerListingLocation",
+ "switch": "Fa",
+ "comment": "ASM List Location",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDataBaseFileName",
+ "switch": "Fd",
+ "comment": "Program Database File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "XMLDocumentationFileName",
+ "switch": "doc",
+ "comment": "XML Documentation File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "BrowseInformationFile",
+ "switch": "FR",
+ "comment": "Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ProcessorNumber",
+ "switch": "MP",
+ "comment": "Number of processors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v11_CSharp.json b/Templates/MSBuild/FlagTables/v11_CSharp.json
new file mode 100644
index 000000000..5989aea1e
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v11_CSharp.json
@@ -0,0 +1,574 @@
+[
+ {
+ "name": "ProjectName",
+ "switch": "out:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:exe",
+ "comment": "",
+ "value": "Exe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:winexe",
+ "comment": "",
+ "value": "Winexe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:library",
+ "comment": "",
+ "value": "Library",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:module",
+ "comment": "",
+ "value": "Module",
+ "flags": []
+ },
+ {
+ "name": "DocumentationFile",
+ "switch": "doc",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x86",
+ "comment": "",
+ "value": "x86",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:Itanium",
+ "comment": "",
+ "value": "Itanium",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x64",
+ "comment": "",
+ "value": "x64",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:arm",
+ "comment": "",
+ "value": "arm",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu32bitpreferred",
+ "comment": "",
+ "value": "anycpu32bitpreferred",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu",
+ "comment": "",
+ "value": "anycpu",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "mit alias",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "dateiliste",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AddModules",
+ "switch": "addmodule:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Win32Resource",
+ "switch": "win32res:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationIcon",
+ "switch": "win32icon:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationManifest",
+ "switch": "win32manifest:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "NoWin32Manifest",
+ "switch": "nowin32manifest",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineDebug",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": [
+ "Continue"
+ ]
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:none",
+ "comment": "",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:full",
+ "comment": "",
+ "value": "full",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:pdbonly",
+ "comment": "",
+ "value": "pdbonly",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:0",
+ "comment": "",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:1",
+ "comment": "",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:2",
+ "comment": "",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "NoWarn",
+ "switch": "nowarn:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineConstants",
+ "switch": "define:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable",
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-1",
+ "comment": "",
+ "value": "ISO-1",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-2",
+ "comment": "",
+ "value": "ISO-2",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:5",
+ "comment": "",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:6",
+ "comment": "",
+ "value": "6",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:default",
+ "comment": "",
+ "value": "default",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyOriginatorKeyFile",
+ "switch": "keyfile",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "KeyContainerName",
+ "switch": "keycontainer",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoConfig",
+ "switch": "noconfig",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "baseaddress:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "CodePage",
+ "switch": "codepage",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "Utf8Output",
+ "switch": "utf8output",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "MainEntryPoint",
+ "switch": "main:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "GenerateFullPaths",
+ "switch": "fullpaths",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FileAlignment",
+ "switch": "filealign",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "PdbFile",
+ "switch": "pdb:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SubsystemVersion",
+ "switch": "subsystemversion",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibPaths",
+ "switch": "lib:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:none",
+ "comment": "Do Not Send Report",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:queue",
+ "comment": "Queue For Next Login",
+ "value": "queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:send",
+ "comment": "Send Automatically",
+ "value": "send",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v11_LIB.json b/Templates/MSBuild/FlagTables/v11_LIB.json
new file mode 100644
index 000000000..58a238c97
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v11_LIB.json
@@ -0,0 +1,297 @@
+[
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWSCE",
+ "comment": "WindowsCE",
+ "value": "WindowsCE",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Verbose",
+ "switch": "VERBOSE",
+ "comment": "Verbose",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Link Time Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ExportNamedFunctions",
+ "switch": "EXPORT:",
+ "comment": "Export Named Functions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "RemoveObjects",
+ "switch": "REMOVE:",
+ "comment": "Remove Objects",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "DisplayLibrary",
+ "switch": "LIST:",
+ "comment": "Display Library to standard output",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Name",
+ "switch": "NAME:",
+ "comment": "Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v11_Link.json b/Templates/MSBuild/FlagTables/v11_Link.json
new file mode 100644
index 000000000..5d5c13f21
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v11_Link.json
@@ -0,0 +1,1272 @@
+[
+ {
+ "name": "ShowProgress",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE",
+ "comment": "Display all progress messages",
+ "value": "LinkVerbose",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:Lib",
+ "comment": "For Libraries Searched",
+ "value": "LinkVerboseLib",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:ICF",
+ "comment": "About COMDAT folding during optimized linking",
+ "value": "LinkVerboseICF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:REF",
+ "comment": "About data removed during optimized linking",
+ "value": "LinkVerboseREF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:SAFESEH",
+ "comment": "About Modules incompatible with SEH",
+ "value": "LinkVerboseSAFESEH",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:CLR",
+ "comment": "About linker activity related to managed code",
+ "value": "LinkVerboseCLR",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:MULTIPLE",
+ "comment": "Multiply Defined Symbol Only",
+ "value": "MultiplyDefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:UNRESOLVED",
+ "comment": "Undefined Symbol Only",
+ "value": "UndefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:5",
+ "comment": "X86 Image Only",
+ "value": "X86Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:6",
+ "comment": "X64 Image Only",
+ "value": "X64Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:16",
+ "comment": "Itanium Image Only",
+ "value": "ItaniumImage",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='asInvoker'",
+ "comment": "asInvoker",
+ "value": "AsInvoker",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='highestAvailable'",
+ "comment": "highestAvailable",
+ "value": "HighestAvailable",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='requireAdministrator'",
+ "comment": "requireAdministrator",
+ "value": "RequireAdministrator",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "Driver",
+ "comment": "Driver",
+ "value": "Driver",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:UPONLY",
+ "comment": "UP Only",
+ "value": "UpOnly",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:WDM",
+ "comment": "WDM",
+ "value": "WDM",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Use Link Time Code Generation",
+ "value": "UseLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGInstrument",
+ "comment": "Profile Guided Optimization - Instrument",
+ "value": "PGInstrument",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGOptimize",
+ "comment": "Profile Guided Optimization - Optimization",
+ "value": "PGOptimization",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGUpdate",
+ "comment": "Profile Guided Optimization - Update",
+ "value": "PGUpdate",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD",
+ "comment": "Yes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD:NO",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:MTA",
+ "comment": "MTA threading attribute",
+ "value": "MTAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:STA",
+ "comment": "STA threading attribute",
+ "value": "STAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:NONE",
+ "comment": "Default threading attribute",
+ "value": "DefaultThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:IJW",
+ "comment": "Force IJW image",
+ "value": "ForceIJWImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:PURE",
+ "comment": "Force Pure IL Image",
+ "value": "ForcePureILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:SAFE",
+ "comment": "Force Safe IL Image",
+ "value": "ForceSafeILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "",
+ "comment": "Default image type",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:NO",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:SYSTEMDLL",
+ "comment": "System Dlls Only",
+ "value": "SystemDlls",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL:NO",
+ "comment": "Enable Incremental Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL",
+ "comment": "Enable Incremental Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:NOSTATUS",
+ "comment": "Link Status",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:STATUS",
+ "comment": "Link Status",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND:NO",
+ "comment": "Prevent Dll Binding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND",
+ "comment": "Prevent Dll Binding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST:NO",
+ "comment": "Generate Manifest",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST",
+ "comment": "Generate Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION:NO",
+ "comment": "Allow Isolation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "",
+ "comment": "Allow Isolation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableUAC",
+ "switch": "MANIFESTUAC:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='true'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ManifestEmbed",
+ "switch": "manifest:embed",
+ "comment": "Embed Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG",
+ "comment": "Generate Debug Info",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateMapFile",
+ "switch": "MAP",
+ "comment": "Generate Map File",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "MapExports",
+ "switch": "MAPINFO:EXPORTS",
+ "comment": "Map Exports",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG:DISABLE",
+ "comment": "Debuggable Assembly",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG",
+ "comment": "Debuggable Assembly",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE:NO",
+ "comment": "Enable Large Addresses",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE",
+ "comment": "Enable Large Addresses",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE:NO",
+ "comment": "Terminal Server",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE",
+ "comment": "Terminal Server",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromCD",
+ "switch": "SWAPRUN:CD",
+ "comment": "Swap Run From CD",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromNET",
+ "switch": "SWAPRUN:NET",
+ "comment": "Swap Run From Network",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:NOREF",
+ "comment": "References",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:REF",
+ "comment": "References",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:NOICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:ICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreEmbeddedIDL",
+ "switch": "IGNOREIDL",
+ "comment": "Ignore Embedded IDL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AppContainer",
+ "switch": "APPCONTAINER",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN:NO",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoEntryPoint",
+ "switch": "NOENTRY",
+ "comment": "No Entry Point",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SetChecksum",
+ "switch": "RELEASE",
+ "comment": "Set Checksum",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE:NO",
+ "comment": "Randomized Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE",
+ "comment": "Randomized Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED:NO",
+ "comment": "Fixed Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED",
+ "comment": "Fixed Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT:NO",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TurnOffAssemblyGeneration",
+ "switch": "NOASSEMBLY",
+ "comment": "Turn Off Assembly Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportUnloadOfDelayLoadedDLL",
+ "switch": "DELAY:UNLOAD",
+ "comment": "Unload delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportNobindOfDelayLoadedDLL",
+ "switch": "DELAY:NOBIND",
+ "comment": "Nobind delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Profile",
+ "switch": "PROFILE",
+ "comment": "Profile",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN:NO",
+ "comment": "Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN",
+ "comment": "Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK:NO",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DetectOneDefinitionRule",
+ "switch": "ODR",
+ "comment": "Detect One Definition Rule violations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH:NO",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDLL",
+ "switch": "DLL",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AddModuleNamesToAssembly",
+ "switch": "ASSEMBLYMODULE:",
+ "comment": "Add Module to Assembly",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "EmbedManagedResourceFile",
+ "switch": "ASSEMBLYRESOURCE:",
+ "comment": "Embed Managed Resource File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DelayLoadDLLs",
+ "switch": "DELAYLOAD:",
+ "comment": "Delay Loaded Dlls",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AssemblyLinkResource",
+ "switch": "ASSEMBLYLINKRESOURCE:",
+ "comment": "Assembly Link Resource",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalManifestDependencies",
+ "switch": "MANIFESTDEPENDENCY:",
+ "comment": "Additional Manifest Dependencies",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ManifestInput",
+ "switch": "manifestinput:",
+ "comment": "Manifest Input",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Version",
+ "switch": "VERSION:",
+ "comment": "Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SpecifySectionAttributes",
+ "switch": "SECTION:",
+ "comment": "Specify Section Attributes",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MSDOSStubFileName",
+ "switch": "STUB:",
+ "comment": "MS-DOS Stub File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ManifestFile",
+ "switch": "ManifestFile:",
+ "comment": "Manifest File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDatabaseFile",
+ "switch": "PDB:",
+ "comment": "Generate Program Database File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StripPrivateSymbols",
+ "switch": "PDBSTRIPPED:",
+ "comment": "Strip Private Symbols",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MapFileName",
+ "switch": "MAP:",
+ "comment": "Map File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "HeapReserveSize",
+ "switch": "HEAP:",
+ "comment": "Heap Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "HeapCommitSize",
+ "switch": "HEAP",
+ "comment": "Heap Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "StackReserveSize",
+ "switch": "STACK:",
+ "comment": "Stack Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StackCommitSize",
+ "switch": "STACK",
+ "comment": "Stack Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "FunctionOrder",
+ "switch": "ORDER:@",
+ "comment": "Function Order",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProfileGuidedDatabase",
+ "switch": "PGD:",
+ "comment": "Profile Guided Database",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MidlCommandFile",
+ "switch": "MIDL:@",
+ "comment": "MIDL Commands",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergedIDLBaseFileName",
+ "switch": "IDLOUT:",
+ "comment": "Merged IDL Base File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryFile",
+ "switch": "TLBOUT:",
+ "comment": "Type Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataFile",
+ "switch": "WINMDFILE:",
+ "comment": "Windows Metadata File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataLinkKeyFile",
+ "switch": "WINMDKEYFILE:",
+ "comment": "Windows Metadata Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataKeyContainer",
+ "switch": "WINMDKEYCONTAINER:",
+ "comment": "Windows Metadata Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "EntryPointSymbol",
+ "switch": "ENTRY:",
+ "comment": "Entry Point",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "BASE:",
+ "comment": "Base Address",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ImportLibrary",
+ "switch": "IMPLIB:",
+ "comment": "Import Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergeSections",
+ "switch": "MERGE:",
+ "comment": "Merge Sections",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LinkKeyFile",
+ "switch": "KEYFILE:",
+ "comment": "Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "KeyContainer",
+ "switch": "KEYCONTAINER:",
+ "comment": "Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryResourceID",
+ "switch": "TLBID:",
+ "comment": "TypeLib Resource ID",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SectionAlignment",
+ "switch": "ALIGN:",
+ "comment": "SectionAlignment",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v11_MASM.json b/Templates/MSBuild/FlagTables/v11_MASM.json
new file mode 100644
index 000000000..4634306b1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v11_MASM.json
@@ -0,0 +1,295 @@
+[
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cp",
+ "comment": "Preserves Identifier Case (/Cp)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cu",
+ "comment": "Maps all identifiers to upper case. (/Cu)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cx",
+ "comment": "Preserves case in public and extern symbols. (/Cx)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Warning Level 0 (/W0)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Warning Level 1 (/W1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Warning Level 2 (/W2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Warning Level 3 (/W3)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp1",
+ "comment": "One Byte Boundary (/Zp1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp2",
+ "comment": "Two Byte Boundary (/Zp2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp4",
+ "comment": "Four Byte Boundary (/Zp4)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp8",
+ "comment": "Eight Byte Boundary (/Zp8)",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp16",
+ "comment": "Sixteen Byte Boundary (/Zp16)",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "Use C-style Calling Convention (/Gd)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "Use stdcall Calling Convention (/Gz)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gc",
+ "comment": "Use Pascal Calling Convention (/Gc)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt to send report immediately (/errorReport:prompt)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Prompt to send report at the next logon (/errorReport:queue)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Automatically send report (/errorReport:send)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do not send report (/errorReport:none)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GeneratePreprocessedSourceListing",
+ "switch": "EP",
+ "comment": "Generate Preprocessed Source Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ListAllAvailableInformation",
+ "switch": "Sa",
+ "comment": "List All Available Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseSafeExceptionHandlers",
+ "switch": "safeseh",
+ "comment": "Use Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AddFirstPassListing",
+ "switch": "Sf",
+ "comment": "Add First Pass Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableAssemblyGeneratedCodeListing",
+ "switch": "Sg",
+ "comment": "Enable Assembly Generated Code Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableSymbolTable",
+ "switch": "Sn",
+ "comment": "Disable Symbol Table",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFalseConditionalsInListing",
+ "switch": "Sx",
+ "comment": "Enable False Conditionals In Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MakeAllSymbolsPublic",
+ "switch": "Zf",
+ "comment": "Make All Symbols Public",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "Zi",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableMASM51Compatibility",
+ "switch": "Zm",
+ "comment": "Enable MASM 5.1 Compatibility",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PerformSyntaxCheckOnly",
+ "switch": "Zs",
+ "comment": "Perform Syntax Check Only",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IncludePaths",
+ "switch": "I",
+ "comment": "Include Paths",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "BrowseFile",
+ "switch": "FR",
+ "comment": "Generate Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssembledCodeListingFile",
+ "switch": "Fl",
+ "comment": "Assembled Code Listing File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v11_RC.json b/Templates/MSBuild/FlagTables/v11_RC.json
new file mode 100644
index 000000000..b8c0127d1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v11_RC.json
@@ -0,0 +1,69 @@
+[
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "v",
+ "comment": "Show Progress",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NullTerminateStrings",
+ "switch": "n",
+ "comment": "Null Terminate Strings",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ResourceOutputFileName",
+ "switch": "fo",
+ "comment": "Resource File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v12_CL.json b/Templates/MSBuild/FlagTables/v12_CL.json
new file mode 100644
index 000000000..771a5551c
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v12_CL.json
@@ -0,0 +1,1077 @@
+[
+ {
+ "name": "DebugInformationFormat",
+ "switch": "",
+ "comment": "None",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Z7",
+ "comment": "C7 compatible",
+ "value": "OldStyle",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Zi",
+ "comment": "Program Database",
+ "value": "ProgramDatabase",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "ZI",
+ "comment": "Program Database for Edit And Continue",
+ "value": "EditAndContinue",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "",
+ "comment": "No Common Language RunTime Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr",
+ "comment": "Common Language RunTime Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:pure",
+ "comment": "Pure MSIL Common Language RunTime Support",
+ "value": "Pure",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:safe",
+ "comment": "Safe MSIL Common Language RunTime Support",
+ "value": "Safe",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:oldSyntax",
+ "comment": "Common Language RunTime Support, Old Syntax",
+ "value": "OldSyntax",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Turn Off All Warnings",
+ "value": "TurnOffAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Level1",
+ "value": "Level1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Level2",
+ "value": "Level2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Level3",
+ "value": "Level3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W4",
+ "comment": "Level4",
+ "value": "Level4",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "Wall",
+ "comment": "EnableAllWarnings",
+ "value": "EnableAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "",
+ "comment": "Custom",
+ "value": "Custom",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Minimize Size",
+ "value": "MinSpace",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximize Speed",
+ "value": "MaxSpeed",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Full Optimization",
+ "value": "Full",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob0",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob1",
+ "comment": "Only __inline",
+ "value": "OnlyExplicitInline",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob2",
+ "comment": "Any Suitable",
+ "value": "AnySuitable",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Os",
+ "comment": "Favor small code",
+ "value": "Size",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Ot",
+ "comment": "Favor fast code",
+ "value": "Speed",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "",
+ "comment": "Neither",
+ "value": "Neither",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHa",
+ "comment": "Yes with SEH Exceptions",
+ "value": "Async",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHsc",
+ "comment": "Yes",
+ "value": "Sync",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHs",
+ "comment": "Yes with Extern C functions",
+ "value": "SyncCThrow",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "StackFrameRuntimeCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized variables",
+ "value": "UninitializedLocalUsageCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both (/RTC1, equiv. to /RTCsu)",
+ "value": "EnableFastChecks",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MT",
+ "comment": "Multi-threaded",
+ "value": "MultiThreaded",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MTd",
+ "comment": "Multi-threaded Debug",
+ "value": "MultiThreadedDebug",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MD",
+ "comment": "Multi-threaded DLL",
+ "value": "MultiThreadedDLL",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MultiThreadedDebugDLL",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp1",
+ "comment": "1 Byte",
+ "value": "1Byte",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp2",
+ "comment": "2 Bytes",
+ "value": "2Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp4",
+ "comment": "4 Byte",
+ "value": "4Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp8",
+ "comment": "8 Bytes",
+ "value": "8Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp16",
+ "comment": "16 Bytes",
+ "value": "16Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS-",
+ "comment": "Disable Security Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS",
+ "comment": "Enable Security Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE",
+ "comment": "Streaming SIMD Extensions",
+ "value": "StreamingSIMDExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE2",
+ "comment": "Streaming SIMD Extensions 2",
+ "value": "StreamingSIMDExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX",
+ "comment": "Advanced Vector Extensions",
+ "value": "AdvancedVectorExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX2",
+ "comment": "Advanced Vector Extensions 2",
+ "value": "AdvancedVectorExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:IA32",
+ "comment": "No Enhanced Instructions",
+ "value": "NoExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:precise",
+ "comment": "Precise",
+ "value": "Precise",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:strict",
+ "comment": "Strict",
+ "value": "Strict",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:fast",
+ "comment": "Fast",
+ "value": "Fast",
+ "flags": []
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yc",
+ "comment": "Create",
+ "value": "Create",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yu",
+ "comment": "Use",
+ "value": "Use",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Y-",
+ "comment": "Not Using Precompiled Headers",
+ "value": "NotUsing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "",
+ "comment": "No Listing",
+ "value": "NoListing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FA",
+ "comment": "Assembly-Only Listing",
+ "value": "AssemblyCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAc",
+ "comment": "Assembly With Machine Code",
+ "value": "AssemblyAndMachineCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAs",
+ "comment": "Assembly With Source Code",
+ "value": "AssemblyAndSourceCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAcs",
+ "comment": "Assembly, Machine Code and Source",
+ "value": "All",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "__cdecl",
+ "value": "Cdecl",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gr",
+ "comment": "__fastcall",
+ "value": "FastCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "__stdcall",
+ "value": "StdCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gv",
+ "comment": "__vectorcall",
+ "value": "VectorCall",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TC",
+ "comment": "Compile as C Code",
+ "value": "CompileAsC",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TP",
+ "comment": "Compile as C++ Code",
+ "value": "CompileAsCpp",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do Not Send Report",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "Prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Queue For Next Login",
+ "value": "Queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Send Automatically",
+ "value": "Send",
+ "flags": []
+ },
+ {
+ "name": "CompileAsWinRT",
+ "switch": "ZW",
+ "comment": "Consume Windows Runtime Extension",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WinRTNoStdLib",
+ "switch": "ZW:nostdlib",
+ "comment": "No Standard WinRT Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX-",
+ "comment": "Treat Warnings As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl-",
+ "comment": "SDL checks",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl",
+ "comment": "SDL checks",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MultiProcessorCompilation",
+ "switch": "MP",
+ "comment": "Multi-processor Compilation",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "IntrinsicFunctions",
+ "switch": "Oi",
+ "comment": "Enable Intrinsic Functions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy-",
+ "comment": "Omit Frame Pointers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy",
+ "comment": "Omit Frame Pointers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFiberSafeOptimizations",
+ "switch": "GT",
+ "comment": "Enable Fiber-Safe Optimizations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WholeProgramOptimization",
+ "switch": "GL",
+ "comment": "Whole Program Optimization",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UndefineAllPreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine All Preprocessor Definitions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessToFile",
+ "switch": "P",
+ "comment": "Preprocess to a File",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessSuppressLineNumbers",
+ "switch": "EP",
+ "comment": "Preprocess Suppress Line Numbers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessKeepComments",
+ "switch": "C",
+ "comment": "Keep Comments",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF-",
+ "comment": "Enable String Pooling",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF",
+ "comment": "Enable String Pooling",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm-",
+ "comment": "Enable Minimal Rebuild",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm",
+ "comment": "Enable Minimal Rebuild",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SmallerTypeCheck",
+ "switch": "RTCc",
+ "comment": "Smaller Type Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy-",
+ "comment": "Enable Function-Level Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy",
+ "comment": "Enable Function-Level Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar-",
+ "comment": "Enable Parallel Code Generation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar",
+ "comment": "Enable Parallel Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except-",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CreateHotpatchableImage",
+ "switch": "hotpatch",
+ "comment": "Create Hotpatchable Image",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableLanguageExtensions",
+ "switch": "Za",
+ "comment": "Disable Language Extensions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t-",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope-",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR-",
+ "comment": "Enable Run-Time Type Information",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR",
+ "comment": "Enable Run-Time Type Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp-",
+ "comment": "Open MP Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp",
+ "comment": "Open MP Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ExpandAttributedSource",
+ "switch": "Fx",
+ "comment": "Expand Attributed Source",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseUnicodeForAssemblerListing",
+ "switch": "FAu",
+ "comment": "Use Unicode For Assembler Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateXMLDocumentationFiles",
+ "switch": "doc",
+ "comment": "Generate XML Documentation Files",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "BrowseInformation",
+ "switch": "FR",
+ "comment": "Enable Browse Information",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "ShowIncludes",
+ "switch": "showIncludes",
+ "comment": "Show Includes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze-",
+ "comment": "Enable Code Analysis",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze",
+ "comment": "Enable Code Analysis",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseFullPaths",
+ "switch": "FC",
+ "comment": "Use Full Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitDefaultLibName",
+ "switch": "Zl",
+ "comment": "Omit Default Library Name",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalUsingDirectories",
+ "switch": "AI",
+ "comment": "Additional #using Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DisableSpecificWarnings",
+ "switch": "wd",
+ "comment": "Disable Specific Warnings",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedIncludeFiles",
+ "switch": "FI",
+ "comment": "Forced Include File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedUsingFiles",
+ "switch": "FU",
+ "comment": "Forced #using File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PREfastLog",
+ "switch": "analyze:log",
+ "comment": "Code Analysis Log",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "PREfastAdditionalPlugins",
+ "switch": "analyze:plugin",
+ "comment": "Additional Code Analysis Native plugins",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "TreatSpecificWarningsAsErrors",
+ "switch": "we",
+ "comment": "Treat Specific Warnings As Errors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessOutputPath",
+ "switch": "Fi",
+ "comment": "Preprocess Output Path",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yu",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yc",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderOutputFile",
+ "switch": "Fp",
+ "comment": "Precompiled Header Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssemblerListingLocation",
+ "switch": "Fa",
+ "comment": "ASM List Location",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDataBaseFileName",
+ "switch": "Fd",
+ "comment": "Program Database File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "XMLDocumentationFileName",
+ "switch": "doc",
+ "comment": "XML Documentation File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "BrowseInformationFile",
+ "switch": "FR",
+ "comment": "Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ProcessorNumber",
+ "switch": "MP",
+ "comment": "Number of processors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v12_CSharp.json b/Templates/MSBuild/FlagTables/v12_CSharp.json
new file mode 100644
index 000000000..5989aea1e
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v12_CSharp.json
@@ -0,0 +1,574 @@
+[
+ {
+ "name": "ProjectName",
+ "switch": "out:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:exe",
+ "comment": "",
+ "value": "Exe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:winexe",
+ "comment": "",
+ "value": "Winexe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:library",
+ "comment": "",
+ "value": "Library",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:module",
+ "comment": "",
+ "value": "Module",
+ "flags": []
+ },
+ {
+ "name": "DocumentationFile",
+ "switch": "doc",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x86",
+ "comment": "",
+ "value": "x86",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:Itanium",
+ "comment": "",
+ "value": "Itanium",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x64",
+ "comment": "",
+ "value": "x64",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:arm",
+ "comment": "",
+ "value": "arm",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu32bitpreferred",
+ "comment": "",
+ "value": "anycpu32bitpreferred",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu",
+ "comment": "",
+ "value": "anycpu",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "mit alias",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "dateiliste",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AddModules",
+ "switch": "addmodule:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Win32Resource",
+ "switch": "win32res:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationIcon",
+ "switch": "win32icon:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationManifest",
+ "switch": "win32manifest:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "NoWin32Manifest",
+ "switch": "nowin32manifest",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineDebug",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": [
+ "Continue"
+ ]
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:none",
+ "comment": "",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:full",
+ "comment": "",
+ "value": "full",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:pdbonly",
+ "comment": "",
+ "value": "pdbonly",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:0",
+ "comment": "",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:1",
+ "comment": "",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:2",
+ "comment": "",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "NoWarn",
+ "switch": "nowarn:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineConstants",
+ "switch": "define:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable",
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-1",
+ "comment": "",
+ "value": "ISO-1",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-2",
+ "comment": "",
+ "value": "ISO-2",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:5",
+ "comment": "",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:6",
+ "comment": "",
+ "value": "6",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:default",
+ "comment": "",
+ "value": "default",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyOriginatorKeyFile",
+ "switch": "keyfile",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "KeyContainerName",
+ "switch": "keycontainer",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoConfig",
+ "switch": "noconfig",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "baseaddress:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "CodePage",
+ "switch": "codepage",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "Utf8Output",
+ "switch": "utf8output",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "MainEntryPoint",
+ "switch": "main:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "GenerateFullPaths",
+ "switch": "fullpaths",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FileAlignment",
+ "switch": "filealign",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "PdbFile",
+ "switch": "pdb:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SubsystemVersion",
+ "switch": "subsystemversion",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibPaths",
+ "switch": "lib:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:none",
+ "comment": "Do Not Send Report",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:queue",
+ "comment": "Queue For Next Login",
+ "value": "queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:send",
+ "comment": "Send Automatically",
+ "value": "send",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v12_LIB.json b/Templates/MSBuild/FlagTables/v12_LIB.json
new file mode 100644
index 000000000..58a238c97
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v12_LIB.json
@@ -0,0 +1,297 @@
+[
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWSCE",
+ "comment": "WindowsCE",
+ "value": "WindowsCE",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Verbose",
+ "switch": "VERBOSE",
+ "comment": "Verbose",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Link Time Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ExportNamedFunctions",
+ "switch": "EXPORT:",
+ "comment": "Export Named Functions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "RemoveObjects",
+ "switch": "REMOVE:",
+ "comment": "Remove Objects",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "DisplayLibrary",
+ "switch": "LIST:",
+ "comment": "Display Library to standard output",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Name",
+ "switch": "NAME:",
+ "comment": "Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v12_Link.json b/Templates/MSBuild/FlagTables/v12_Link.json
new file mode 100644
index 000000000..5d5c13f21
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v12_Link.json
@@ -0,0 +1,1272 @@
+[
+ {
+ "name": "ShowProgress",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE",
+ "comment": "Display all progress messages",
+ "value": "LinkVerbose",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:Lib",
+ "comment": "For Libraries Searched",
+ "value": "LinkVerboseLib",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:ICF",
+ "comment": "About COMDAT folding during optimized linking",
+ "value": "LinkVerboseICF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:REF",
+ "comment": "About data removed during optimized linking",
+ "value": "LinkVerboseREF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:SAFESEH",
+ "comment": "About Modules incompatible with SEH",
+ "value": "LinkVerboseSAFESEH",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:CLR",
+ "comment": "About linker activity related to managed code",
+ "value": "LinkVerboseCLR",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:MULTIPLE",
+ "comment": "Multiply Defined Symbol Only",
+ "value": "MultiplyDefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:UNRESOLVED",
+ "comment": "Undefined Symbol Only",
+ "value": "UndefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:5",
+ "comment": "X86 Image Only",
+ "value": "X86Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:6",
+ "comment": "X64 Image Only",
+ "value": "X64Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:16",
+ "comment": "Itanium Image Only",
+ "value": "ItaniumImage",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='asInvoker'",
+ "comment": "asInvoker",
+ "value": "AsInvoker",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='highestAvailable'",
+ "comment": "highestAvailable",
+ "value": "HighestAvailable",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='requireAdministrator'",
+ "comment": "requireAdministrator",
+ "value": "RequireAdministrator",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "Driver",
+ "comment": "Driver",
+ "value": "Driver",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:UPONLY",
+ "comment": "UP Only",
+ "value": "UpOnly",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:WDM",
+ "comment": "WDM",
+ "value": "WDM",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Use Link Time Code Generation",
+ "value": "UseLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGInstrument",
+ "comment": "Profile Guided Optimization - Instrument",
+ "value": "PGInstrument",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGOptimize",
+ "comment": "Profile Guided Optimization - Optimization",
+ "value": "PGOptimization",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGUpdate",
+ "comment": "Profile Guided Optimization - Update",
+ "value": "PGUpdate",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD",
+ "comment": "Yes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD:NO",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:MTA",
+ "comment": "MTA threading attribute",
+ "value": "MTAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:STA",
+ "comment": "STA threading attribute",
+ "value": "STAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:NONE",
+ "comment": "Default threading attribute",
+ "value": "DefaultThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:IJW",
+ "comment": "Force IJW image",
+ "value": "ForceIJWImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:PURE",
+ "comment": "Force Pure IL Image",
+ "value": "ForcePureILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:SAFE",
+ "comment": "Force Safe IL Image",
+ "value": "ForceSafeILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "",
+ "comment": "Default image type",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:NO",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:SYSTEMDLL",
+ "comment": "System Dlls Only",
+ "value": "SystemDlls",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL:NO",
+ "comment": "Enable Incremental Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL",
+ "comment": "Enable Incremental Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:NOSTATUS",
+ "comment": "Link Status",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:STATUS",
+ "comment": "Link Status",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND:NO",
+ "comment": "Prevent Dll Binding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND",
+ "comment": "Prevent Dll Binding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST:NO",
+ "comment": "Generate Manifest",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST",
+ "comment": "Generate Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION:NO",
+ "comment": "Allow Isolation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "",
+ "comment": "Allow Isolation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableUAC",
+ "switch": "MANIFESTUAC:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='true'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ManifestEmbed",
+ "switch": "manifest:embed",
+ "comment": "Embed Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG",
+ "comment": "Generate Debug Info",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateMapFile",
+ "switch": "MAP",
+ "comment": "Generate Map File",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "MapExports",
+ "switch": "MAPINFO:EXPORTS",
+ "comment": "Map Exports",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG:DISABLE",
+ "comment": "Debuggable Assembly",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG",
+ "comment": "Debuggable Assembly",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE:NO",
+ "comment": "Enable Large Addresses",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE",
+ "comment": "Enable Large Addresses",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE:NO",
+ "comment": "Terminal Server",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE",
+ "comment": "Terminal Server",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromCD",
+ "switch": "SWAPRUN:CD",
+ "comment": "Swap Run From CD",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromNET",
+ "switch": "SWAPRUN:NET",
+ "comment": "Swap Run From Network",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:NOREF",
+ "comment": "References",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:REF",
+ "comment": "References",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:NOICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:ICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreEmbeddedIDL",
+ "switch": "IGNOREIDL",
+ "comment": "Ignore Embedded IDL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AppContainer",
+ "switch": "APPCONTAINER",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN:NO",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoEntryPoint",
+ "switch": "NOENTRY",
+ "comment": "No Entry Point",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SetChecksum",
+ "switch": "RELEASE",
+ "comment": "Set Checksum",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE:NO",
+ "comment": "Randomized Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE",
+ "comment": "Randomized Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED:NO",
+ "comment": "Fixed Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED",
+ "comment": "Fixed Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT:NO",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TurnOffAssemblyGeneration",
+ "switch": "NOASSEMBLY",
+ "comment": "Turn Off Assembly Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportUnloadOfDelayLoadedDLL",
+ "switch": "DELAY:UNLOAD",
+ "comment": "Unload delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportNobindOfDelayLoadedDLL",
+ "switch": "DELAY:NOBIND",
+ "comment": "Nobind delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Profile",
+ "switch": "PROFILE",
+ "comment": "Profile",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN:NO",
+ "comment": "Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN",
+ "comment": "Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK:NO",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DetectOneDefinitionRule",
+ "switch": "ODR",
+ "comment": "Detect One Definition Rule violations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH:NO",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDLL",
+ "switch": "DLL",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AddModuleNamesToAssembly",
+ "switch": "ASSEMBLYMODULE:",
+ "comment": "Add Module to Assembly",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "EmbedManagedResourceFile",
+ "switch": "ASSEMBLYRESOURCE:",
+ "comment": "Embed Managed Resource File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DelayLoadDLLs",
+ "switch": "DELAYLOAD:",
+ "comment": "Delay Loaded Dlls",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AssemblyLinkResource",
+ "switch": "ASSEMBLYLINKRESOURCE:",
+ "comment": "Assembly Link Resource",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalManifestDependencies",
+ "switch": "MANIFESTDEPENDENCY:",
+ "comment": "Additional Manifest Dependencies",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ManifestInput",
+ "switch": "manifestinput:",
+ "comment": "Manifest Input",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Version",
+ "switch": "VERSION:",
+ "comment": "Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SpecifySectionAttributes",
+ "switch": "SECTION:",
+ "comment": "Specify Section Attributes",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MSDOSStubFileName",
+ "switch": "STUB:",
+ "comment": "MS-DOS Stub File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ManifestFile",
+ "switch": "ManifestFile:",
+ "comment": "Manifest File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDatabaseFile",
+ "switch": "PDB:",
+ "comment": "Generate Program Database File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StripPrivateSymbols",
+ "switch": "PDBSTRIPPED:",
+ "comment": "Strip Private Symbols",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MapFileName",
+ "switch": "MAP:",
+ "comment": "Map File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "HeapReserveSize",
+ "switch": "HEAP:",
+ "comment": "Heap Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "HeapCommitSize",
+ "switch": "HEAP",
+ "comment": "Heap Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "StackReserveSize",
+ "switch": "STACK:",
+ "comment": "Stack Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StackCommitSize",
+ "switch": "STACK",
+ "comment": "Stack Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "FunctionOrder",
+ "switch": "ORDER:@",
+ "comment": "Function Order",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProfileGuidedDatabase",
+ "switch": "PGD:",
+ "comment": "Profile Guided Database",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MidlCommandFile",
+ "switch": "MIDL:@",
+ "comment": "MIDL Commands",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergedIDLBaseFileName",
+ "switch": "IDLOUT:",
+ "comment": "Merged IDL Base File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryFile",
+ "switch": "TLBOUT:",
+ "comment": "Type Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataFile",
+ "switch": "WINMDFILE:",
+ "comment": "Windows Metadata File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataLinkKeyFile",
+ "switch": "WINMDKEYFILE:",
+ "comment": "Windows Metadata Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataKeyContainer",
+ "switch": "WINMDKEYCONTAINER:",
+ "comment": "Windows Metadata Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "EntryPointSymbol",
+ "switch": "ENTRY:",
+ "comment": "Entry Point",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "BASE:",
+ "comment": "Base Address",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ImportLibrary",
+ "switch": "IMPLIB:",
+ "comment": "Import Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergeSections",
+ "switch": "MERGE:",
+ "comment": "Merge Sections",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LinkKeyFile",
+ "switch": "KEYFILE:",
+ "comment": "Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "KeyContainer",
+ "switch": "KEYCONTAINER:",
+ "comment": "Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryResourceID",
+ "switch": "TLBID:",
+ "comment": "TypeLib Resource ID",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SectionAlignment",
+ "switch": "ALIGN:",
+ "comment": "SectionAlignment",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v12_MASM.json b/Templates/MSBuild/FlagTables/v12_MASM.json
new file mode 100644
index 000000000..4634306b1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v12_MASM.json
@@ -0,0 +1,295 @@
+[
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cp",
+ "comment": "Preserves Identifier Case (/Cp)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cu",
+ "comment": "Maps all identifiers to upper case. (/Cu)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cx",
+ "comment": "Preserves case in public and extern symbols. (/Cx)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Warning Level 0 (/W0)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Warning Level 1 (/W1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Warning Level 2 (/W2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Warning Level 3 (/W3)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp1",
+ "comment": "One Byte Boundary (/Zp1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp2",
+ "comment": "Two Byte Boundary (/Zp2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp4",
+ "comment": "Four Byte Boundary (/Zp4)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp8",
+ "comment": "Eight Byte Boundary (/Zp8)",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp16",
+ "comment": "Sixteen Byte Boundary (/Zp16)",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "Use C-style Calling Convention (/Gd)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "Use stdcall Calling Convention (/Gz)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gc",
+ "comment": "Use Pascal Calling Convention (/Gc)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt to send report immediately (/errorReport:prompt)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Prompt to send report at the next logon (/errorReport:queue)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Automatically send report (/errorReport:send)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do not send report (/errorReport:none)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GeneratePreprocessedSourceListing",
+ "switch": "EP",
+ "comment": "Generate Preprocessed Source Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ListAllAvailableInformation",
+ "switch": "Sa",
+ "comment": "List All Available Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseSafeExceptionHandlers",
+ "switch": "safeseh",
+ "comment": "Use Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AddFirstPassListing",
+ "switch": "Sf",
+ "comment": "Add First Pass Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableAssemblyGeneratedCodeListing",
+ "switch": "Sg",
+ "comment": "Enable Assembly Generated Code Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableSymbolTable",
+ "switch": "Sn",
+ "comment": "Disable Symbol Table",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFalseConditionalsInListing",
+ "switch": "Sx",
+ "comment": "Enable False Conditionals In Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MakeAllSymbolsPublic",
+ "switch": "Zf",
+ "comment": "Make All Symbols Public",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "Zi",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableMASM51Compatibility",
+ "switch": "Zm",
+ "comment": "Enable MASM 5.1 Compatibility",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PerformSyntaxCheckOnly",
+ "switch": "Zs",
+ "comment": "Perform Syntax Check Only",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IncludePaths",
+ "switch": "I",
+ "comment": "Include Paths",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "BrowseFile",
+ "switch": "FR",
+ "comment": "Generate Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssembledCodeListingFile",
+ "switch": "Fl",
+ "comment": "Assembled Code Listing File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v12_RC.json b/Templates/MSBuild/FlagTables/v12_RC.json
new file mode 100644
index 000000000..b8c0127d1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v12_RC.json
@@ -0,0 +1,69 @@
+[
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "v",
+ "comment": "Show Progress",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NullTerminateStrings",
+ "switch": "n",
+ "comment": "Null Terminate Strings",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ResourceOutputFileName",
+ "switch": "fo",
+ "comment": "Resource File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v140_CL.json b/Templates/MSBuild/FlagTables/v140_CL.json
new file mode 100644
index 000000000..3dc9f353d
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v140_CL.json
@@ -0,0 +1,1184 @@
+[
+ {
+ "name": "DebugInformationFormat",
+ "switch": "",
+ "comment": "None",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Z7",
+ "comment": "C7 compatible",
+ "value": "OldStyle",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Zi",
+ "comment": "Program Database",
+ "value": "ProgramDatabase",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "ZI",
+ "comment": "Program Database for Edit And Continue",
+ "value": "EditAndContinue",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "",
+ "comment": "No Common Language RunTime Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr",
+ "comment": "Common Language RunTime Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:pure",
+ "comment": "Pure MSIL Common Language RunTime Support",
+ "value": "Pure",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:safe",
+ "comment": "Safe MSIL Common Language RunTime Support",
+ "value": "Safe",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Turn Off All Warnings",
+ "value": "TurnOffAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Level1",
+ "value": "Level1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Level2",
+ "value": "Level2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Level3",
+ "value": "Level3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W4",
+ "comment": "Level4",
+ "value": "Level4",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "Wall",
+ "comment": "EnableAllWarnings",
+ "value": "EnableAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "",
+ "comment": "Custom",
+ "value": "Custom",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Minimize Size",
+ "value": "MinSpace",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximize Speed",
+ "value": "MaxSpeed",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Full Optimization",
+ "value": "Full",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob0",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob1",
+ "comment": "Only __inline",
+ "value": "OnlyExplicitInline",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob2",
+ "comment": "Any Suitable",
+ "value": "AnySuitable",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Os",
+ "comment": "Favor small code",
+ "value": "Size",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Ot",
+ "comment": "Favor fast code",
+ "value": "Speed",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "",
+ "comment": "Neither",
+ "value": "Neither",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHa",
+ "comment": "Yes with SEH Exceptions",
+ "value": "Async",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHsc",
+ "comment": "Yes",
+ "value": "Sync",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHs",
+ "comment": "Yes with Extern C functions",
+ "value": "SyncCThrow",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "StackFrameRuntimeCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized variables",
+ "value": "UninitializedLocalUsageCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both (/RTC1, equiv. to /RTCsu)",
+ "value": "EnableFastChecks",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MT",
+ "comment": "Multi-threaded",
+ "value": "MultiThreaded",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MTd",
+ "comment": "Multi-threaded Debug",
+ "value": "MultiThreadedDebug",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MD",
+ "comment": "Multi-threaded DLL",
+ "value": "MultiThreadedDLL",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MultiThreadedDebugDLL",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp1",
+ "comment": "1 Byte",
+ "value": "1Byte",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp2",
+ "comment": "2 Bytes",
+ "value": "2Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp4",
+ "comment": "4 Byte",
+ "value": "4Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp8",
+ "comment": "8 Bytes",
+ "value": "8Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp16",
+ "comment": "16 Bytes",
+ "value": "16Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS-",
+ "comment": "Disable Security Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS",
+ "comment": "Enable Security Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "guard:cf",
+ "comment": "Yes",
+ "value": "Guard",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE",
+ "comment": "Streaming SIMD Extensions",
+ "value": "StreamingSIMDExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE2",
+ "comment": "Streaming SIMD Extensions 2",
+ "value": "StreamingSIMDExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX",
+ "comment": "Advanced Vector Extensions",
+ "value": "AdvancedVectorExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX2",
+ "comment": "Advanced Vector Extensions 2",
+ "value": "AdvancedVectorExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:IA32",
+ "comment": "No Enhanced Instructions",
+ "value": "NoExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:precise",
+ "comment": "Precise",
+ "value": "Precise",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:strict",
+ "comment": "Strict",
+ "value": "Strict",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:fast",
+ "comment": "Fast",
+ "value": "Fast",
+ "flags": []
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yc",
+ "comment": "Create",
+ "value": "Create",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yu",
+ "comment": "Use",
+ "value": "Use",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Y-",
+ "comment": "Not Using Precompiled Headers",
+ "value": "NotUsing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "",
+ "comment": "No Listing",
+ "value": "NoListing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FA",
+ "comment": "Assembly-Only Listing",
+ "value": "AssemblyCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAc",
+ "comment": "Assembly With Machine Code",
+ "value": "AssemblyAndMachineCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAs",
+ "comment": "Assembly With Source Code",
+ "value": "AssemblyAndSourceCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAcs",
+ "comment": "Assembly, Machine Code and Source",
+ "value": "All",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "__cdecl",
+ "value": "Cdecl",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gr",
+ "comment": "__fastcall",
+ "value": "FastCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "__stdcall",
+ "value": "StdCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gv",
+ "comment": "__vectorcall",
+ "value": "VectorCall",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TC",
+ "comment": "Compile as C Code",
+ "value": "CompileAsC",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TP",
+ "comment": "Compile as C++ Code",
+ "value": "CompileAsCpp",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do Not Send Report",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "Prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Queue For Next Login",
+ "value": "Queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Send Automatically",
+ "value": "Send",
+ "flags": []
+ },
+ {
+ "name": "CompileAsWinRT",
+ "switch": "ZW",
+ "comment": "Consume Windows Runtime Extension",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WinRTNoStdLib",
+ "switch": "ZW:nostdlib",
+ "comment": "No Standard WinRT Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX-",
+ "comment": "Treat Warnings As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl-",
+ "comment": "SDL checks",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl",
+ "comment": "SDL checks",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MultiProcessorCompilation",
+ "switch": "MP",
+ "comment": "Multi-processor Compilation",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "IntrinsicFunctions",
+ "switch": "Oi",
+ "comment": "Enable Intrinsic Functions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy-",
+ "comment": "Omit Frame Pointers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy",
+ "comment": "Omit Frame Pointers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFiberSafeOptimizations",
+ "switch": "GT",
+ "comment": "Enable Fiber-Safe Optimizations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WholeProgramOptimization",
+ "switch": "GL",
+ "comment": "Whole Program Optimization",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UndefineAllPreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine All Preprocessor Definitions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessToFile",
+ "switch": "P",
+ "comment": "Preprocess to a File",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessSuppressLineNumbers",
+ "switch": "EP",
+ "comment": "Preprocess Suppress Line Numbers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessKeepComments",
+ "switch": "C",
+ "comment": "Keep Comments",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF-",
+ "comment": "Enable String Pooling",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF",
+ "comment": "Enable String Pooling",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm-",
+ "comment": "Enable Minimal Rebuild",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm",
+ "comment": "Enable Minimal Rebuild",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SmallerTypeCheck",
+ "switch": "RTCc",
+ "comment": "Smaller Type Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy-",
+ "comment": "Enable Function-Level Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy",
+ "comment": "Enable Function-Level Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar-",
+ "comment": "Enable Parallel Code Generation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar",
+ "comment": "Enable Parallel Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except-",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CreateHotpatchableImage",
+ "switch": "hotpatch",
+ "comment": "Create Hotpatchable Image",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableLanguageExtensions",
+ "switch": "Za",
+ "comment": "Disable Language Extensions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t-",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope-",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline-",
+ "comment": "Remove unreferenced code and data",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline",
+ "comment": "Remove unreferenced code and data",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast-",
+ "comment": "Enforce type conversion rules",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast",
+ "comment": "Enforce type conversion rules",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR-",
+ "comment": "Enable Run-Time Type Information",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR",
+ "comment": "Enable Run-Time Type Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp-",
+ "comment": "Open MP Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp",
+ "comment": "Open MP Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ExpandAttributedSource",
+ "switch": "Fx",
+ "comment": "Expand Attributed Source",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseUnicodeForAssemblerListing",
+ "switch": "FAu",
+ "comment": "Use Unicode For Assembler Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateXMLDocumentationFiles",
+ "switch": "doc",
+ "comment": "Generate XML Documentation Files",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "BrowseInformation",
+ "switch": "FR",
+ "comment": "Enable Browse Information",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "ShowIncludes",
+ "switch": "showIncludes",
+ "comment": "Show Includes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze-",
+ "comment": "Enable Code Analysis",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze",
+ "comment": "Enable Code Analysis",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseFullPaths",
+ "switch": "FC",
+ "comment": "Use Full Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitDefaultLibName",
+ "switch": "Zl",
+ "comment": "Omit Default Library Name",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalUsingDirectories",
+ "switch": "AI",
+ "comment": "Additional #using Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DisableSpecificWarnings",
+ "switch": "wd",
+ "comment": "Disable Specific Warnings",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedIncludeFiles",
+ "switch": "FI",
+ "comment": "Forced Include File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedUsingFiles",
+ "switch": "FU",
+ "comment": "Forced #using File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PREfastLog",
+ "switch": "analyze:log",
+ "comment": "Code Analysis Log",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "PREfastAdditionalPlugins",
+ "switch": "analyze:plugin",
+ "comment": "Additional Code Analysis Native plugins",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "TreatSpecificWarningsAsErrors",
+ "switch": "we",
+ "comment": "Treat Specific Warnings As Errors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "WarningVersion",
+ "switch": "Wv:",
+ "comment": "Warning Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PreprocessOutputPath",
+ "switch": "Fi",
+ "comment": "Preprocess Output Path",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yu",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yc",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderOutputFile",
+ "switch": "Fp",
+ "comment": "Precompiled Header Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssemblerListingLocation",
+ "switch": "Fa",
+ "comment": "ASM List Location",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDataBaseFileName",
+ "switch": "Fd",
+ "comment": "Program Database File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "XMLDocumentationFileName",
+ "switch": "doc",
+ "comment": "XML Documentation File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "BrowseInformationFile",
+ "switch": "FR",
+ "comment": "Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ProcessorNumber",
+ "switch": "MP",
+ "comment": "Number of processors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++98",
+ "comment": "C++03",
+ "value": "c++98",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++11",
+ "comment": "C++11",
+ "value": "c++11",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++1y",
+ "comment": "C++14",
+ "value": "c++1y",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++14",
+ "comment": "C++14",
+ "value": "c++1y",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++98",
+ "comment": "C++03 (GNU Dialect)",
+ "value": "gnu++98",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++11",
+ "comment": "C++11 (GNU Dialect)",
+ "value": "gnu++11",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++1y",
+ "comment": "C++14 (GNU Dialect)",
+ "value": "gnu++1y",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++14",
+ "comment": "C++14 (GNU Dialect)",
+ "value": "gnu++1y",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v140_CSharp.json b/Templates/MSBuild/FlagTables/v140_CSharp.json
new file mode 100644
index 000000000..5989aea1e
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v140_CSharp.json
@@ -0,0 +1,574 @@
+[
+ {
+ "name": "ProjectName",
+ "switch": "out:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:exe",
+ "comment": "",
+ "value": "Exe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:winexe",
+ "comment": "",
+ "value": "Winexe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:library",
+ "comment": "",
+ "value": "Library",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:module",
+ "comment": "",
+ "value": "Module",
+ "flags": []
+ },
+ {
+ "name": "DocumentationFile",
+ "switch": "doc",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x86",
+ "comment": "",
+ "value": "x86",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:Itanium",
+ "comment": "",
+ "value": "Itanium",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x64",
+ "comment": "",
+ "value": "x64",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:arm",
+ "comment": "",
+ "value": "arm",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu32bitpreferred",
+ "comment": "",
+ "value": "anycpu32bitpreferred",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu",
+ "comment": "",
+ "value": "anycpu",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "mit alias",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "dateiliste",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AddModules",
+ "switch": "addmodule:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Win32Resource",
+ "switch": "win32res:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationIcon",
+ "switch": "win32icon:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationManifest",
+ "switch": "win32manifest:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "NoWin32Manifest",
+ "switch": "nowin32manifest",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineDebug",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": [
+ "Continue"
+ ]
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:none",
+ "comment": "",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:full",
+ "comment": "",
+ "value": "full",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:pdbonly",
+ "comment": "",
+ "value": "pdbonly",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:0",
+ "comment": "",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:1",
+ "comment": "",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:2",
+ "comment": "",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "NoWarn",
+ "switch": "nowarn:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineConstants",
+ "switch": "define:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable",
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-1",
+ "comment": "",
+ "value": "ISO-1",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-2",
+ "comment": "",
+ "value": "ISO-2",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:5",
+ "comment": "",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:6",
+ "comment": "",
+ "value": "6",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:default",
+ "comment": "",
+ "value": "default",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyOriginatorKeyFile",
+ "switch": "keyfile",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "KeyContainerName",
+ "switch": "keycontainer",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoConfig",
+ "switch": "noconfig",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "baseaddress:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "CodePage",
+ "switch": "codepage",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "Utf8Output",
+ "switch": "utf8output",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "MainEntryPoint",
+ "switch": "main:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "GenerateFullPaths",
+ "switch": "fullpaths",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FileAlignment",
+ "switch": "filealign",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "PdbFile",
+ "switch": "pdb:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SubsystemVersion",
+ "switch": "subsystemversion",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibPaths",
+ "switch": "lib:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:none",
+ "comment": "Do Not Send Report",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:queue",
+ "comment": "Queue For Next Login",
+ "value": "queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:send",
+ "comment": "Send Automatically",
+ "value": "send",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v140_Link.json b/Templates/MSBuild/FlagTables/v140_Link.json
new file mode 100644
index 000000000..3fb072c50
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v140_Link.json
@@ -0,0 +1,1316 @@
+[
+ {
+ "name": "ShowProgress",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE",
+ "comment": "Display all progress messages",
+ "value": "LinkVerbose",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:Lib",
+ "comment": "For Libraries Searched",
+ "value": "LinkVerboseLib",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:ICF",
+ "comment": "About COMDAT folding during optimized linking",
+ "value": "LinkVerboseICF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:REF",
+ "comment": "About data removed during optimized linking",
+ "value": "LinkVerboseREF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:SAFESEH",
+ "comment": "About Modules incompatible with SEH",
+ "value": "LinkVerboseSAFESEH",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:CLR",
+ "comment": "About linker activity related to managed code",
+ "value": "LinkVerboseCLR",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:MULTIPLE",
+ "comment": "Multiply Defined Symbol Only",
+ "value": "MultiplyDefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:UNRESOLVED",
+ "comment": "Undefined Symbol Only",
+ "value": "UndefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:5",
+ "comment": "X86 Image Only",
+ "value": "X86Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:6",
+ "comment": "X64 Image Only",
+ "value": "X64Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:16",
+ "comment": "Itanium Image Only",
+ "value": "ItaniumImage",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='asInvoker'",
+ "comment": "asInvoker",
+ "value": "AsInvoker",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='highestAvailable'",
+ "comment": "highestAvailable",
+ "value": "HighestAvailable",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='requireAdministrator'",
+ "comment": "requireAdministrator",
+ "value": "RequireAdministrator",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG",
+ "comment": "Optimize for debugging",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FASTLINK",
+ "comment": "Optimize for faster linking",
+ "value": "DebugFastLink",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FULL",
+ "comment": "Optimize for debugging",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:NONE",
+ "comment": "Produces no debugging information",
+ "value": "false",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "SubSystem",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "Driver",
+ "comment": "Driver",
+ "value": "Driver",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:UPONLY",
+ "comment": "UP Only",
+ "value": "UpOnly",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:WDM",
+ "comment": "WDM",
+ "value": "WDM",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:incremental",
+ "comment": "Use Fast Link Time Code Generation",
+ "value": "UseFastLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Use Link Time Code Generation",
+ "value": "UseLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGInstrument",
+ "comment": "Profile Guided Optimization - Instrument",
+ "value": "PGInstrument",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGOptimize",
+ "comment": "Profile Guided Optimization - Optimization",
+ "value": "PGOptimization",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGUpdate",
+ "comment": "Profile Guided Optimization - Update",
+ "value": "PGUpdate",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD",
+ "comment": "Yes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD:NO",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:MTA",
+ "comment": "MTA threading attribute",
+ "value": "MTAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:STA",
+ "comment": "STA threading attribute",
+ "value": "STAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:NONE",
+ "comment": "Default threading attribute",
+ "value": "DefaultThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:IJW",
+ "comment": "Force IJW image",
+ "value": "ForceIJWImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:PURE",
+ "comment": "Force Pure IL Image",
+ "value": "ForcePureILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:SAFE",
+ "comment": "Force Safe IL Image",
+ "value": "ForceSafeILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "",
+ "comment": "Default image type",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:NO",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:SYSTEMDLL",
+ "comment": "System Dlls Only",
+ "value": "SystemDlls",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL:NO",
+ "comment": "Enable Incremental Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL",
+ "comment": "Enable Incremental Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:NOSTATUS",
+ "comment": "Link Status",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:STATUS",
+ "comment": "Link Status",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND:NO",
+ "comment": "Prevent Dll Binding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND",
+ "comment": "Prevent Dll Binding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST:NO",
+ "comment": "Generate Manifest",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST",
+ "comment": "Generate Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION:NO",
+ "comment": "Allow Isolation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "",
+ "comment": "Allow Isolation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableUAC",
+ "switch": "MANIFESTUAC:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='true'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ManifestEmbed",
+ "switch": "manifest:embed",
+ "comment": "Embed Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateMapFile",
+ "switch": "MAP",
+ "comment": "Generate Map File",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "MapExports",
+ "switch": "MAPINFO:EXPORTS",
+ "comment": "Map Exports",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG:DISABLE",
+ "comment": "Debuggable Assembly",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG",
+ "comment": "Debuggable Assembly",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE:NO",
+ "comment": "Enable Large Addresses",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE",
+ "comment": "Enable Large Addresses",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE:NO",
+ "comment": "Terminal Server",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE",
+ "comment": "Terminal Server",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromCD",
+ "switch": "SWAPRUN:CD",
+ "comment": "Swap Run From CD",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromNET",
+ "switch": "SWAPRUN:NET",
+ "comment": "Swap Run From Network",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:NOREF",
+ "comment": "References",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:REF",
+ "comment": "References",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:NOICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:ICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreEmbeddedIDL",
+ "switch": "IGNOREIDL",
+ "comment": "Ignore Embedded IDL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AppContainer",
+ "switch": "APPCONTAINER",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN:NO",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoEntryPoint",
+ "switch": "NOENTRY",
+ "comment": "No Entry Point",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SetChecksum",
+ "switch": "RELEASE",
+ "comment": "Set Checksum",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE:NO",
+ "comment": "Randomized Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE",
+ "comment": "Randomized Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED:NO",
+ "comment": "Fixed Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED",
+ "comment": "Fixed Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT:NO",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TurnOffAssemblyGeneration",
+ "switch": "NOASSEMBLY",
+ "comment": "Turn Off Assembly Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportUnloadOfDelayLoadedDLL",
+ "switch": "DELAY:UNLOAD",
+ "comment": "Unload delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportNobindOfDelayLoadedDLL",
+ "switch": "DELAY:NOBIND",
+ "comment": "Nobind delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Profile",
+ "switch": "PROFILE",
+ "comment": "Profile",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN:NO",
+ "comment": "Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN",
+ "comment": "Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK:NO",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DetectOneDefinitionRule",
+ "switch": "ODR",
+ "comment": "Detect One Definition Rule violations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH:NO",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDLL",
+ "switch": "DLL",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Natvis",
+ "switch": "NATVIS:",
+ "comment": "Natvis files",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AddModuleNamesToAssembly",
+ "switch": "ASSEMBLYMODULE:",
+ "comment": "Add Module to Assembly",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "EmbedManagedResourceFile",
+ "switch": "ASSEMBLYRESOURCE:",
+ "comment": "Embed Managed Resource File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DelayLoadDLLs",
+ "switch": "DELAYLOAD:",
+ "comment": "Delay Loaded Dlls",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AssemblyLinkResource",
+ "switch": "ASSEMBLYLINKRESOURCE:",
+ "comment": "Assembly Link Resource",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalManifestDependencies",
+ "switch": "MANIFESTDEPENDENCY:",
+ "comment": "Additional Manifest Dependencies",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ManifestInput",
+ "switch": "manifestinput:",
+ "comment": "Manifest Input",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Version",
+ "switch": "VERSION:",
+ "comment": "Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SpecifySectionAttributes",
+ "switch": "SECTION:",
+ "comment": "Specify Section Attributes",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MSDOSStubFileName",
+ "switch": "STUB:",
+ "comment": "MS-DOS Stub File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ManifestFile",
+ "switch": "ManifestFile:",
+ "comment": "Manifest File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDatabaseFile",
+ "switch": "PDB:",
+ "comment": "Generate Program Database File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StripPrivateSymbols",
+ "switch": "PDBSTRIPPED:",
+ "comment": "Strip Private Symbols",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MapFileName",
+ "switch": "MAP:",
+ "comment": "Map File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "HeapReserveSize",
+ "switch": "HEAP:",
+ "comment": "Heap Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "HeapCommitSize",
+ "switch": "HEAP",
+ "comment": "Heap Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "StackReserveSize",
+ "switch": "STACK:",
+ "comment": "Stack Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StackCommitSize",
+ "switch": "STACK",
+ "comment": "Stack Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "FunctionOrder",
+ "switch": "ORDER:@",
+ "comment": "Function Order",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProfileGuidedDatabase",
+ "switch": "PGD:",
+ "comment": "Profile Guided Database",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MidlCommandFile",
+ "switch": "MIDL:@",
+ "comment": "MIDL Commands",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergedIDLBaseFileName",
+ "switch": "IDLOUT:",
+ "comment": "Merged IDL Base File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryFile",
+ "switch": "TLBOUT:",
+ "comment": "Type Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataFile",
+ "switch": "WINMDFILE:",
+ "comment": "Windows Metadata File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataLinkKeyFile",
+ "switch": "WINMDKEYFILE:",
+ "comment": "Windows Metadata Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataKeyContainer",
+ "switch": "WINMDKEYCONTAINER:",
+ "comment": "Windows Metadata Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "EntryPointSymbol",
+ "switch": "ENTRY:",
+ "comment": "Entry Point",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "BASE:",
+ "comment": "Base Address",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ImportLibrary",
+ "switch": "IMPLIB:",
+ "comment": "Import Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergeSections",
+ "switch": "MERGE:",
+ "comment": "Merge Sections",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LinkKeyFile",
+ "switch": "KEYFILE:",
+ "comment": "Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "KeyContainer",
+ "switch": "KEYCONTAINER:",
+ "comment": "Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryResourceID",
+ "switch": "TLBID:",
+ "comment": "TypeLib Resource ID",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SectionAlignment",
+ "switch": "ALIGN:",
+ "comment": "SectionAlignment",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v141_CL.json b/Templates/MSBuild/FlagTables/v141_CL.json
new file mode 100644
index 000000000..01fafe48d
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v141_CL.json
@@ -0,0 +1,1268 @@
+[
+ {
+ "name": "DebugInformationFormat",
+ "switch": "",
+ "comment": "None",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Z7",
+ "comment": "C7 compatible",
+ "value": "OldStyle",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Zi",
+ "comment": "Program Database",
+ "value": "ProgramDatabase",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "ZI",
+ "comment": "Program Database for Edit And Continue",
+ "value": "EditAndContinue",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "",
+ "comment": "No Common Language RunTime Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr",
+ "comment": "Common Language RunTime Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:pure",
+ "comment": "Pure MSIL Common Language RunTime Support",
+ "value": "Pure",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:safe",
+ "comment": "Safe MSIL Common Language RunTime Support",
+ "value": "Safe",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Turn Off All Warnings",
+ "value": "TurnOffAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Level1",
+ "value": "Level1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Level2",
+ "value": "Level2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Level3",
+ "value": "Level3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W4",
+ "comment": "Level4",
+ "value": "Level4",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "Wall",
+ "comment": "EnableAllWarnings",
+ "value": "EnableAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:caret",
+ "comment": "Caret",
+ "value": "Caret",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:column",
+ "comment": "Column Info",
+ "value": "Column",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:classic",
+ "comment": "Classic",
+ "value": "Classic",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "",
+ "comment": "Custom",
+ "value": "Custom",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Maximum Optimization (Favor Size)",
+ "value": "MinSpace",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximum Optimization (Favor Speed)",
+ "value": "MaxSpeed",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Optimizations (Favor Speed)",
+ "value": "Full",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob0",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob1",
+ "comment": "Only __inline",
+ "value": "OnlyExplicitInline",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob2",
+ "comment": "Any Suitable",
+ "value": "AnySuitable",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Os",
+ "comment": "Favor small code",
+ "value": "Size",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Ot",
+ "comment": "Favor fast code",
+ "value": "Speed",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "",
+ "comment": "Neither",
+ "value": "Neither",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHa",
+ "comment": "Yes with SEH Exceptions",
+ "value": "Async",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHsc",
+ "comment": "Yes",
+ "value": "Sync",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHs",
+ "comment": "Yes with Extern C functions",
+ "value": "SyncCThrow",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "StackFrameRuntimeCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized variables",
+ "value": "UninitializedLocalUsageCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both (/RTC1, equiv. to /RTCsu)",
+ "value": "EnableFastChecks",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MT",
+ "comment": "Multi-threaded",
+ "value": "MultiThreaded",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MTd",
+ "comment": "Multi-threaded Debug",
+ "value": "MultiThreadedDebug",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MD",
+ "comment": "Multi-threaded DLL",
+ "value": "MultiThreadedDLL",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MultiThreadedDebugDLL",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp1",
+ "comment": "1 Byte",
+ "value": "1Byte",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp2",
+ "comment": "2 Bytes",
+ "value": "2Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp4",
+ "comment": "4 Byte",
+ "value": "4Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp8",
+ "comment": "8 Bytes",
+ "value": "8Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp16",
+ "comment": "16 Bytes",
+ "value": "16Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS-",
+ "comment": "Disable Security Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS",
+ "comment": "Enable Security Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "guard:cf",
+ "comment": "Yes",
+ "value": "Guard",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE",
+ "comment": "Streaming SIMD Extensions",
+ "value": "StreamingSIMDExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE2",
+ "comment": "Streaming SIMD Extensions 2",
+ "value": "StreamingSIMDExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX",
+ "comment": "Advanced Vector Extensions",
+ "value": "AdvancedVectorExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX2",
+ "comment": "Advanced Vector Extensions 2",
+ "value": "AdvancedVectorExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:IA32",
+ "comment": "No Enhanced Instructions",
+ "value": "NoExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:precise",
+ "comment": "Precise",
+ "value": "Precise",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:strict",
+ "comment": "Strict",
+ "value": "Strict",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:fast",
+ "comment": "Fast",
+ "value": "Fast",
+ "flags": []
+ },
+ {
+ "name": "SpectreMitigation",
+ "switch": "Qspectre",
+ "comment": "Spectre mitigations",
+ "value": "Spectre",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++14",
+ "comment": "ISO C++14 Standard",
+ "value": "stdcpp14",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++17",
+ "comment": "ISO C++17 Standard",
+ "value": "stdcpp17",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++latest",
+ "comment": "ISO C++ Latest Draft Standard",
+ "value": "stdcpplatest",
+ "flags": []
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yc",
+ "comment": "Create",
+ "value": "Create",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yu",
+ "comment": "Use",
+ "value": "Use",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Y-",
+ "comment": "Not Using Precompiled Headers",
+ "value": "NotUsing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "",
+ "comment": "No Listing",
+ "value": "NoListing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FA",
+ "comment": "Assembly-Only Listing",
+ "value": "AssemblyCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAc",
+ "comment": "Assembly With Machine Code",
+ "value": "AssemblyAndMachineCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAs",
+ "comment": "Assembly With Source Code",
+ "value": "AssemblyAndSourceCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAcs",
+ "comment": "Assembly, Machine Code and Source",
+ "value": "All",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "__cdecl",
+ "value": "Cdecl",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gr",
+ "comment": "__fastcall",
+ "value": "FastCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "__stdcall",
+ "value": "StdCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gv",
+ "comment": "__vectorcall",
+ "value": "VectorCall",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TC",
+ "comment": "Compile as C Code",
+ "value": "CompileAsC",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TP",
+ "comment": "Compile as C++ Code",
+ "value": "CompileAsCpp",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do Not Send Report",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "Prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Queue For Next Login",
+ "value": "Queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Send Automatically",
+ "value": "Send",
+ "flags": []
+ },
+ {
+ "name": "CompileAsWinRT",
+ "switch": "ZW",
+ "comment": "Consume Windows Runtime Extension",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WinRTNoStdLib",
+ "switch": "ZW:nostdlib",
+ "comment": "No Standard WinRT Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX-",
+ "comment": "Treat Warnings As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl-",
+ "comment": "SDL checks",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl",
+ "comment": "SDL checks",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MultiProcessorCompilation",
+ "switch": "MP",
+ "comment": "Multi-processor Compilation",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "IntrinsicFunctions",
+ "switch": "Oi",
+ "comment": "Enable Intrinsic Functions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy-",
+ "comment": "Omit Frame Pointers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy",
+ "comment": "Omit Frame Pointers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFiberSafeOptimizations",
+ "switch": "GT",
+ "comment": "Enable Fiber-Safe Optimizations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WholeProgramOptimization",
+ "switch": "GL",
+ "comment": "Whole Program Optimization",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UndefineAllPreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine All Preprocessor Definitions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessToFile",
+ "switch": "P",
+ "comment": "Preprocess to a File",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessSuppressLineNumbers",
+ "switch": "EP",
+ "comment": "Preprocess Suppress Line Numbers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessKeepComments",
+ "switch": "C",
+ "comment": "Keep Comments",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF-",
+ "comment": "Enable String Pooling",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF",
+ "comment": "Enable String Pooling",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm-",
+ "comment": "Enable Minimal Rebuild",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm",
+ "comment": "Enable Minimal Rebuild",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SmallerTypeCheck",
+ "switch": "RTCc",
+ "comment": "Smaller Type Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy-",
+ "comment": "Enable Function-Level Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy",
+ "comment": "Enable Function-Level Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar-",
+ "comment": "Enable Parallel Code Generation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar",
+ "comment": "Enable Parallel Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except-",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CreateHotpatchableImage",
+ "switch": "hotpatch",
+ "comment": "Create Hotpatchable Image",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableLanguageExtensions",
+ "switch": "Za",
+ "comment": "Disable Language Extensions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ConformanceMode",
+ "switch": "permissive-",
+ "comment": "Conformance mode enabled",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ConformanceMode",
+ "switch": "permissive",
+ "comment": "Conformance mode disabled",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t-",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope-",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline-",
+ "comment": "Remove unreferenced code and data",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline",
+ "comment": "Remove unreferenced code and data",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast-",
+ "comment": "Enforce type conversion rules",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast",
+ "comment": "Enforce type conversion rules",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR-",
+ "comment": "Enable Run-Time Type Information",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR",
+ "comment": "Enable Run-Time Type Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp-",
+ "comment": "Open MP Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp",
+ "comment": "Open MP Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableModules",
+ "switch": "experimental:module",
+ "comment": "Enable C++ Modules (experimental)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ExpandAttributedSource",
+ "switch": "Fx",
+ "comment": "Expand Attributed Source",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseUnicodeForAssemblerListing",
+ "switch": "FAu",
+ "comment": "Use Unicode For Assembler Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateXMLDocumentationFiles",
+ "switch": "doc",
+ "comment": "Generate XML Documentation Files",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "BrowseInformation",
+ "switch": "FR",
+ "comment": "Enable Browse Information",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "ShowIncludes",
+ "switch": "showIncludes",
+ "comment": "Show Includes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze-",
+ "comment": "Enable Code Analysis",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze",
+ "comment": "Enable Code Analysis",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseFullPaths",
+ "switch": "FC",
+ "comment": "Use Full Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitDefaultLibName",
+ "switch": "Zl",
+ "comment": "Omit Default Library Name",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalUsingDirectories",
+ "switch": "AI",
+ "comment": "Additional #using Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DisableSpecificWarnings",
+ "switch": "wd",
+ "comment": "Disable Specific Warnings",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedIncludeFiles",
+ "switch": "FI",
+ "comment": "Forced Include File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedUsingFiles",
+ "switch": "FU",
+ "comment": "Forced #using File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PREfastLog",
+ "switch": "analyze:log",
+ "comment": "Code Analysis Log",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "PREfastAdditionalPlugins",
+ "switch": "analyze:plugin",
+ "comment": "Additional Code Analysis Native plugins",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "TreatSpecificWarningsAsErrors",
+ "switch": "we",
+ "comment": "Treat Specific Warnings As Errors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "WarningVersion",
+ "switch": "Wv:",
+ "comment": "Warning Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PreprocessOutputPath",
+ "switch": "Fi",
+ "comment": "Preprocess Output Path",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yu",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yc",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderOutputFile",
+ "switch": "Fp",
+ "comment": "Precompiled Header Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssemblerListingLocation",
+ "switch": "Fa",
+ "comment": "ASM List Location",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDataBaseFileName",
+ "switch": "Fd",
+ "comment": "Program Database File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "XMLDocumentationFileName",
+ "switch": "doc",
+ "comment": "XML Documentation File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "BrowseInformationFile",
+ "switch": "FR",
+ "comment": "Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ProcessorNumber",
+ "switch": "MP",
+ "comment": "Number of processors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++98",
+ "comment": "C++03",
+ "value": "c++98",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++11",
+ "comment": "C++11",
+ "value": "c++11",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++1y",
+ "comment": "C++14",
+ "value": "c++1y",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=c++14",
+ "comment": "C++14",
+ "value": "c++1y",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++98",
+ "comment": "C++03 (GNU Dialect)",
+ "value": "gnu++98",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++11",
+ "comment": "C++11 (GNU Dialect)",
+ "value": "gnu++11",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++1y",
+ "comment": "C++14 (GNU Dialect)",
+ "value": "gnu++1y",
+ "flags": []
+ },
+ {
+ "name": "CppLanguageStandard",
+ "switch": "std=gnu++14",
+ "comment": "C++14 (GNU Dialect)",
+ "value": "gnu++1y",
+ "flags": []
+ },
+ {
+ "name": "SupportJustMyCode",
+ "switch": "JMC-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SupportJustMyCode",
+ "switch": "JMC",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v141_CSharp.json b/Templates/MSBuild/FlagTables/v141_CSharp.json
new file mode 100644
index 000000000..5989aea1e
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v141_CSharp.json
@@ -0,0 +1,574 @@
+[
+ {
+ "name": "ProjectName",
+ "switch": "out:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:exe",
+ "comment": "",
+ "value": "Exe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:winexe",
+ "comment": "",
+ "value": "Winexe",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:library",
+ "comment": "",
+ "value": "Library",
+ "flags": []
+ },
+ {
+ "name": "OutputType",
+ "switch": "target:module",
+ "comment": "",
+ "value": "Module",
+ "flags": []
+ },
+ {
+ "name": "DocumentationFile",
+ "switch": "doc",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x86",
+ "comment": "",
+ "value": "x86",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:Itanium",
+ "comment": "",
+ "value": "Itanium",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:x64",
+ "comment": "",
+ "value": "x64",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:arm",
+ "comment": "",
+ "value": "arm",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu32bitpreferred",
+ "comment": "",
+ "value": "anycpu32bitpreferred",
+ "flags": []
+ },
+ {
+ "name": "Platform",
+ "switch": "platform:anycpu",
+ "comment": "",
+ "value": "anycpu",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "mit alias",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "References",
+ "switch": "reference:",
+ "comment": "dateiliste",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AddModules",
+ "switch": "addmodule:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Win32Resource",
+ "switch": "win32res:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationIcon",
+ "switch": "win32icon:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ApplicationManifest",
+ "switch": "win32manifest:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "NoWin32Manifest",
+ "switch": "nowin32manifest",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineDebug",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": [
+ "Continue"
+ ]
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DebugSymbols",
+ "switch": "debug+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:none",
+ "comment": "",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:full",
+ "comment": "",
+ "value": "full",
+ "flags": []
+ },
+ {
+ "name": "DebugType",
+ "switch": "debug:pdbonly",
+ "comment": "",
+ "value": "pdbonly",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "Optimize",
+ "switch": "optimize+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror-",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningsAsErrors",
+ "switch": "warnaserror+",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:0",
+ "comment": "",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:1",
+ "comment": "",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:2",
+ "comment": "",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "warn:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "NoWarn",
+ "switch": "nowarn:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "CommaAppendable"
+ ]
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CheckForOverflowUnderflow",
+ "switch": "checked+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowUnsafeBlocks",
+ "switch": "unsafe+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DefineConstants",
+ "switch": "define:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "SemicolonAppendable",
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-1",
+ "comment": "",
+ "value": "ISO-1",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:ISO-2",
+ "comment": "",
+ "value": "ISO-2",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:3",
+ "comment": "",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:4",
+ "comment": "",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:5",
+ "comment": "",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:6",
+ "comment": "",
+ "value": "6",
+ "flags": []
+ },
+ {
+ "name": "LangVersion",
+ "switch": "langversion:default",
+ "comment": "",
+ "value": "default",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DelaySign",
+ "switch": "delaysign+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyOriginatorKeyFile",
+ "switch": "keyfile",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "KeyContainerName",
+ "switch": "keycontainer",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoConfig",
+ "switch": "noconfig",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "baseaddress:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "CodePage",
+ "switch": "codepage",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "Utf8Output",
+ "switch": "utf8output",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "MainEntryPoint",
+ "switch": "main:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "GenerateFullPaths",
+ "switch": "fullpaths",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FileAlignment",
+ "switch": "filealign",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "PdbFile",
+ "switch": "pdb:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib-",
+ "comment": "",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "NoStandardLib",
+ "switch": "nostdlib+",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SubsystemVersion",
+ "switch": "subsystemversion",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibPaths",
+ "switch": "lib:",
+ "comment": "",
+ "value": "",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:none",
+ "comment": "Do Not Send Report",
+ "value": "none",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:queue",
+ "comment": "Queue For Next Login",
+ "value": "queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReport",
+ "switch": "errorreport:send",
+ "comment": "Send Automatically",
+ "value": "send",
+ "flags": []
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v141_Link.json b/Templates/MSBuild/FlagTables/v141_Link.json
new file mode 100644
index 000000000..66ee76fcb
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v141_Link.json
@@ -0,0 +1,1323 @@
+[
+ {
+ "name": "ShowProgress",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE",
+ "comment": "Display all progress messages",
+ "value": "LinkVerbose",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:Lib",
+ "comment": "For Libraries Searched",
+ "value": "LinkVerboseLib",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:ICF",
+ "comment": "About COMDAT folding during optimized linking",
+ "value": "LinkVerboseICF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:REF",
+ "comment": "About data removed during optimized linking",
+ "value": "LinkVerboseREF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:SAFESEH",
+ "comment": "About Modules incompatible with SEH",
+ "value": "LinkVerboseSAFESEH",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:CLR",
+ "comment": "About linker activity related to managed code",
+ "value": "LinkVerboseCLR",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:MULTIPLE",
+ "comment": "Multiply Defined Symbol Only",
+ "value": "MultiplyDefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:UNRESOLVED",
+ "comment": "Undefined Symbol Only",
+ "value": "UndefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:5",
+ "comment": "X86 Image Only",
+ "value": "X86Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:6",
+ "comment": "X64 Image Only",
+ "value": "X64Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:16",
+ "comment": "Itanium Image Only",
+ "value": "ItaniumImage",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='asInvoker'",
+ "comment": "asInvoker",
+ "value": "AsInvoker",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='highestAvailable'",
+ "comment": "highestAvailable",
+ "value": "HighestAvailable",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='requireAdministrator'",
+ "comment": "requireAdministrator",
+ "value": "RequireAdministrator",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FASTLINK",
+ "comment": "Generate Debug Information optimized for faster links",
+ "value": "DebugFastLink",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FULL",
+ "comment": "Generate Debug Information optimized for sharing and publishing",
+ "value": "DebugFull",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:NONE",
+ "comment": "Produces no debugging information",
+ "value": "false",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "SubSystem",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "Driver",
+ "comment": "Driver",
+ "value": "Driver",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:UPONLY",
+ "comment": "UP Only",
+ "value": "UpOnly",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:WDM",
+ "comment": "WDM",
+ "value": "WDM",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:incremental",
+ "comment": "Use Fast Link Time Code Generation",
+ "value": "UseFastLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Use Link Time Code Generation",
+ "value": "UseLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGInstrument",
+ "comment": "Profile Guided Optimization - Instrument",
+ "value": "PGInstrument",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGOptimize",
+ "comment": "Profile Guided Optimization - Optimization",
+ "value": "PGOptimization",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGUpdate",
+ "comment": "Profile Guided Optimization - Update",
+ "value": "PGUpdate",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD",
+ "comment": "Yes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD:NO",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM64",
+ "comment": "MachineARM64",
+ "value": "MachineARM64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:MTA",
+ "comment": "MTA threading attribute",
+ "value": "MTAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:STA",
+ "comment": "STA threading attribute",
+ "value": "STAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:NONE",
+ "comment": "Default threading attribute",
+ "value": "DefaultThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:IJW",
+ "comment": "Force IJW image",
+ "value": "ForceIJWImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:PURE",
+ "comment": "Force Pure IL Image",
+ "value": "ForcePureILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:SAFE",
+ "comment": "Force Safe IL Image",
+ "value": "ForceSafeILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "",
+ "comment": "Default image type",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:NO",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:SYSTEMDLL",
+ "comment": "System Dlls Only",
+ "value": "SystemDlls",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL:NO",
+ "comment": "Enable Incremental Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL",
+ "comment": "Enable Incremental Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:NOSTATUS",
+ "comment": "Link Status",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:STATUS",
+ "comment": "Link Status",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND:NO",
+ "comment": "Prevent Dll Binding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND",
+ "comment": "Prevent Dll Binding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST:NO",
+ "comment": "Generate Manifest",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST",
+ "comment": "Generate Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION:NO",
+ "comment": "Allow Isolation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "",
+ "comment": "Allow Isolation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableUAC",
+ "switch": "MANIFESTUAC:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='true'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ManifestEmbed",
+ "switch": "manifest:embed",
+ "comment": "Embed Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateMapFile",
+ "switch": "MAP",
+ "comment": "Generate Map File",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "MapExports",
+ "switch": "MAPINFO:EXPORTS",
+ "comment": "Map Exports",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG:DISABLE",
+ "comment": "Debuggable Assembly",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG",
+ "comment": "Debuggable Assembly",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE:NO",
+ "comment": "Enable Large Addresses",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE",
+ "comment": "Enable Large Addresses",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE:NO",
+ "comment": "Terminal Server",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE",
+ "comment": "Terminal Server",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromCD",
+ "switch": "SWAPRUN:CD",
+ "comment": "Swap Run From CD",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromNET",
+ "switch": "SWAPRUN:NET",
+ "comment": "Swap Run From Network",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:NOREF",
+ "comment": "References",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:REF",
+ "comment": "References",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:NOICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:ICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreEmbeddedIDL",
+ "switch": "IGNOREIDL",
+ "comment": "Ignore Embedded IDL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AppContainer",
+ "switch": "APPCONTAINER",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN:NO",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoEntryPoint",
+ "switch": "NOENTRY",
+ "comment": "No Entry Point",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SetChecksum",
+ "switch": "RELEASE",
+ "comment": "Set Checksum",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE:NO",
+ "comment": "Randomized Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE",
+ "comment": "Randomized Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED:NO",
+ "comment": "Fixed Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED",
+ "comment": "Fixed Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT:NO",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TurnOffAssemblyGeneration",
+ "switch": "NOASSEMBLY",
+ "comment": "Turn Off Assembly Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportUnloadOfDelayLoadedDLL",
+ "switch": "DELAY:UNLOAD",
+ "comment": "Unload delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportNobindOfDelayLoadedDLL",
+ "switch": "DELAY:NOBIND",
+ "comment": "Nobind delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Profile",
+ "switch": "PROFILE",
+ "comment": "Profile",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN:NO",
+ "comment": "Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN",
+ "comment": "Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK:NO",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DetectOneDefinitionRule",
+ "switch": "ODR",
+ "comment": "Detect One Definition Rule violations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH:NO",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDLL",
+ "switch": "DLL",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Natvis",
+ "switch": "NATVIS:",
+ "comment": "Natvis files",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AddModuleNamesToAssembly",
+ "switch": "ASSEMBLYMODULE:",
+ "comment": "Add Module to Assembly",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "EmbedManagedResourceFile",
+ "switch": "ASSEMBLYRESOURCE:",
+ "comment": "Embed Managed Resource File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DelayLoadDLLs",
+ "switch": "DELAYLOAD:",
+ "comment": "Delay Loaded Dlls",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AssemblyLinkResource",
+ "switch": "ASSEMBLYLINKRESOURCE:",
+ "comment": "Assembly Link Resource",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalManifestDependencies",
+ "switch": "MANIFESTDEPENDENCY:",
+ "comment": "Additional Manifest Dependencies",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ManifestInput",
+ "switch": "manifestinput:",
+ "comment": "Manifest Input",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Version",
+ "switch": "VERSION:",
+ "comment": "Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SpecifySectionAttributes",
+ "switch": "SECTION:",
+ "comment": "Specify Section Attributes",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MSDOSStubFileName",
+ "switch": "STUB:",
+ "comment": "MS-DOS Stub File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ManifestFile",
+ "switch": "ManifestFile:",
+ "comment": "Manifest File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDatabaseFile",
+ "switch": "PDB:",
+ "comment": "Generate Program Database File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StripPrivateSymbols",
+ "switch": "PDBSTRIPPED:",
+ "comment": "Strip Private Symbols",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MapFileName",
+ "switch": "MAP:",
+ "comment": "Map File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "HeapReserveSize",
+ "switch": "HEAP:",
+ "comment": "Heap Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "HeapCommitSize",
+ "switch": "HEAP",
+ "comment": "Heap Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "StackReserveSize",
+ "switch": "STACK:",
+ "comment": "Stack Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StackCommitSize",
+ "switch": "STACK",
+ "comment": "Stack Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "FunctionOrder",
+ "switch": "ORDER:@",
+ "comment": "Function Order",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProfileGuidedDatabase",
+ "switch": "PGD:",
+ "comment": "Profile Guided Database",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MidlCommandFile",
+ "switch": "MIDL:@",
+ "comment": "MIDL Commands",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergedIDLBaseFileName",
+ "switch": "IDLOUT:",
+ "comment": "Merged IDL Base File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryFile",
+ "switch": "TLBOUT:",
+ "comment": "Type Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataFile",
+ "switch": "WINMDFILE:",
+ "comment": "Windows Metadata File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataLinkKeyFile",
+ "switch": "WINMDKEYFILE:",
+ "comment": "Windows Metadata Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataKeyContainer",
+ "switch": "WINMDKEYCONTAINER:",
+ "comment": "Windows Metadata Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "EntryPointSymbol",
+ "switch": "ENTRY:",
+ "comment": "Entry Point",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "BASE:",
+ "comment": "Base Address",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ImportLibrary",
+ "switch": "IMPLIB:",
+ "comment": "Import Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergeSections",
+ "switch": "MERGE:",
+ "comment": "Merge Sections",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LinkKeyFile",
+ "switch": "KEYFILE:",
+ "comment": "Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "KeyContainer",
+ "switch": "KEYCONTAINER:",
+ "comment": "Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryResourceID",
+ "switch": "TLBID:",
+ "comment": "TypeLib Resource ID",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SectionAlignment",
+ "switch": "ALIGN:",
+ "comment": "SectionAlignment",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v142_CL.json b/Templates/MSBuild/FlagTables/v142_CL.json
new file mode 100644
index 000000000..95b9d14f6
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v142_CL.json
@@ -0,0 +1,1212 @@
+[
+ {
+ "name": "DebugInformationFormat",
+ "switch": "",
+ "comment": "None",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Z7",
+ "comment": "C7 compatible",
+ "value": "OldStyle",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "Zi",
+ "comment": "Program Database",
+ "value": "ProgramDatabase",
+ "flags": []
+ },
+ {
+ "name": "DebugInformationFormat",
+ "switch": "ZI",
+ "comment": "Program Database for Edit And Continue",
+ "value": "EditAndContinue",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "",
+ "comment": "No Common Language RunTime Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr",
+ "comment": "Common Language RunTime Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:pure",
+ "comment": "Pure MSIL Common Language RunTime Support",
+ "value": "Pure",
+ "flags": []
+ },
+ {
+ "name": "CompileAsManaged",
+ "switch": "clr:safe",
+ "comment": "Safe MSIL Common Language RunTime Support",
+ "value": "Safe",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Turn Off All Warnings",
+ "value": "TurnOffAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Level1",
+ "value": "Level1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Level2",
+ "value": "Level2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Level3",
+ "value": "Level3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W4",
+ "comment": "Level4",
+ "value": "Level4",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "Wall",
+ "comment": "EnableAllWarnings",
+ "value": "EnableAllWarnings",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:caret",
+ "comment": "Caret",
+ "value": "Caret",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:column",
+ "comment": "Column Info",
+ "value": "Column",
+ "flags": []
+ },
+ {
+ "name": "DiagnosticsFormat",
+ "switch": "diagnostics:classic",
+ "comment": "Classic",
+ "value": "Classic",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "",
+ "comment": "Custom",
+ "value": "Custom",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Od",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O1",
+ "comment": "Maximum Optimization (Favor Size)",
+ "value": "MinSpace",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "O2",
+ "comment": "Maximum Optimization (Favor Speed)",
+ "value": "MaxSpeed",
+ "flags": []
+ },
+ {
+ "name": "Optimization",
+ "switch": "Ox",
+ "comment": "Optimizations (Favor Speed)",
+ "value": "Full",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob0",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob1",
+ "comment": "Only __inline",
+ "value": "OnlyExplicitInline",
+ "flags": []
+ },
+ {
+ "name": "InlineFunctionExpansion",
+ "switch": "Ob2",
+ "comment": "Any Suitable",
+ "value": "AnySuitable",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Os",
+ "comment": "Favor small code",
+ "value": "Size",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "Ot",
+ "comment": "Favor fast code",
+ "value": "Speed",
+ "flags": []
+ },
+ {
+ "name": "FavorSizeOrSpeed",
+ "switch": "",
+ "comment": "Neither",
+ "value": "Neither",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHa",
+ "comment": "Yes with SEH Exceptions",
+ "value": "Async",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHsc",
+ "comment": "Yes",
+ "value": "Sync",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "EHs",
+ "comment": "Yes with Extern C functions",
+ "value": "SyncCThrow",
+ "flags": []
+ },
+ {
+ "name": "ExceptionHandling",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCs",
+ "comment": "Stack Frames",
+ "value": "StackFrameRuntimeCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTCu",
+ "comment": "Uninitialized variables",
+ "value": "UninitializedLocalUsageCheck",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "RTC1",
+ "comment": "Both (/RTC1, equiv. to /RTCsu)",
+ "value": "EnableFastChecks",
+ "flags": []
+ },
+ {
+ "name": "BasicRuntimeChecks",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MT",
+ "comment": "Multi-threaded",
+ "value": "MultiThreaded",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MTd",
+ "comment": "Multi-threaded Debug",
+ "value": "MultiThreadedDebug",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MD",
+ "comment": "Multi-threaded DLL",
+ "value": "MultiThreadedDLL",
+ "flags": []
+ },
+ {
+ "name": "RuntimeLibrary",
+ "switch": "MDd",
+ "comment": "Multi-threaded Debug DLL",
+ "value": "MultiThreadedDebugDLL",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp1",
+ "comment": "1 Byte",
+ "value": "1Byte",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp2",
+ "comment": "2 Bytes",
+ "value": "2Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp4",
+ "comment": "4 Byte",
+ "value": "4Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp8",
+ "comment": "8 Bytes",
+ "value": "8Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "Zp16",
+ "comment": "16 Bytes",
+ "value": "16Bytes",
+ "flags": []
+ },
+ {
+ "name": "StructMemberAlignment",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS-",
+ "comment": "Disable Security Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "BufferSecurityCheck",
+ "switch": "GS",
+ "comment": "Enable Security Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "guard:cf",
+ "comment": "Yes",
+ "value": "Guard",
+ "flags": []
+ },
+ {
+ "name": "ControlFlowGuard",
+ "switch": "",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE",
+ "comment": "Streaming SIMD Extensions",
+ "value": "StreamingSIMDExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:SSE2",
+ "comment": "Streaming SIMD Extensions 2",
+ "value": "StreamingSIMDExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX",
+ "comment": "Advanced Vector Extensions",
+ "value": "AdvancedVectorExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:AVX2",
+ "comment": "Advanced Vector Extensions 2",
+ "value": "AdvancedVectorExtensions2",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "arch:IA32",
+ "comment": "No Enhanced Instructions",
+ "value": "NoExtensions",
+ "flags": []
+ },
+ {
+ "name": "EnableEnhancedInstructionSet",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:precise",
+ "comment": "Precise",
+ "value": "Precise",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:strict",
+ "comment": "Strict",
+ "value": "Strict",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointModel",
+ "switch": "fp:fast",
+ "comment": "Fast",
+ "value": "Fast",
+ "flags": []
+ },
+ {
+ "name": "SpectreMitigation",
+ "switch": "Qspectre-",
+ "comment": "Spectre mitigations disabled",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SpectreMitigation",
+ "switch": "Qspectre",
+ "comment": "Spectre mitigations enabled",
+ "value": "Spectre",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++14",
+ "comment": "ISO C++14 Standard",
+ "value": "stdcpp14",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++17",
+ "comment": "ISO C++17 Standard",
+ "value": "stdcpp17",
+ "flags": []
+ },
+ {
+ "name": "LanguageStandard",
+ "switch": "std:c++latest",
+ "comment": "Preview - Features from the Latest C++ Working Draft",
+ "value": "stdcpplatest",
+ "flags": []
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yc",
+ "comment": "Create",
+ "value": "Create",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Yu",
+ "comment": "Use",
+ "value": "Use",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeader",
+ "switch": "Y-",
+ "comment": "Not Using Precompiled Headers",
+ "value": "NotUsing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "",
+ "comment": "No Listing",
+ "value": "NoListing",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FA",
+ "comment": "Assembly-Only Listing",
+ "value": "AssemblyCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAc",
+ "comment": "Assembly With Machine Code",
+ "value": "AssemblyAndMachineCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAs",
+ "comment": "Assembly With Source Code",
+ "value": "AssemblyAndSourceCode",
+ "flags": []
+ },
+ {
+ "name": "AssemblerOutput",
+ "switch": "FAcs",
+ "comment": "Assembly, Machine Code and Source",
+ "value": "All",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "__cdecl",
+ "value": "Cdecl",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gr",
+ "comment": "__fastcall",
+ "value": "FastCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "__stdcall",
+ "value": "StdCall",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gv",
+ "comment": "__vectorcall",
+ "value": "VectorCall",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TC",
+ "comment": "Compile as C Code",
+ "value": "CompileAsC",
+ "flags": []
+ },
+ {
+ "name": "CompileAs",
+ "switch": "TP",
+ "comment": "Compile as C++ Code",
+ "value": "CompileAsCpp",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do Not Send Report",
+ "value": "None",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt Immediately",
+ "value": "Prompt",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Queue For Next Login",
+ "value": "Queue",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Send Automatically",
+ "value": "Send",
+ "flags": []
+ },
+ {
+ "name": "SupportJustMyCode",
+ "switch": "JMC-",
+ "comment": "Support Just My Code Debugging",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SupportJustMyCode",
+ "switch": "JMC",
+ "comment": "Support Just My Code Debugging",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CompileAsWinRT",
+ "switch": "ZW",
+ "comment": "Consume Windows Runtime Extension",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WinRTNoStdLib",
+ "switch": "ZW:nostdlib",
+ "comment": "No Standard WinRT Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX-",
+ "comment": "Treat Warnings As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningAsError",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl-",
+ "comment": "SDL checks",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "SDLCheck",
+ "switch": "sdl",
+ "comment": "SDL checks",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MultiProcessorCompilation",
+ "switch": "MP",
+ "comment": "Multi-processor Compilation",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "IntrinsicFunctions",
+ "switch": "Oi",
+ "comment": "Enable Intrinsic Functions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy-",
+ "comment": "Omit Frame Pointers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OmitFramePointers",
+ "switch": "Oy",
+ "comment": "Omit Frame Pointers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFiberSafeOptimizations",
+ "switch": "GT",
+ "comment": "Enable Fiber-Safe Optimizations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WholeProgramOptimization",
+ "switch": "GL",
+ "comment": "Whole Program Optimization",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UndefineAllPreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine All Preprocessor Definitions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessToFile",
+ "switch": "P",
+ "comment": "Preprocess to a File",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessSuppressLineNumbers",
+ "switch": "EP",
+ "comment": "Preprocess Suppress Line Numbers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessKeepComments",
+ "switch": "C",
+ "comment": "Keep Comments",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF-",
+ "comment": "Enable String Pooling",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "StringPooling",
+ "switch": "GF",
+ "comment": "Enable String Pooling",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm-",
+ "comment": "Enable Minimal Rebuild",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "MinimalRebuild",
+ "switch": "Gm",
+ "comment": "Enable Minimal Rebuild",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SmallerTypeCheck",
+ "switch": "RTCc",
+ "comment": "Smaller Type Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy-",
+ "comment": "Enable Function-Level Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FunctionLevelLinking",
+ "switch": "Gy",
+ "comment": "Enable Function-Level Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar-",
+ "comment": "Enable Parallel Code Generation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableParallelCodeGeneration",
+ "switch": "Qpar",
+ "comment": "Enable Parallel Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except-",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FloatingPointExceptions",
+ "switch": "fp:except",
+ "comment": "Enable Floating Point Exceptions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CreateHotpatchableImage",
+ "switch": "hotpatch",
+ "comment": "Create Hotpatchable Image",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableLanguageExtensions",
+ "switch": "Za",
+ "comment": "Disable Language Extensions",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ConformanceMode",
+ "switch": "permissive-",
+ "comment": "Conformance mode enabled",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ConformanceMode",
+ "switch": "permissive",
+ "comment": "Conformance mode disabled",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t-",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatWChar_tAsBuiltInType",
+ "switch": "Zc:wchar_t",
+ "comment": "Treat WChar_t As Built in Type",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope-",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ForceConformanceInForLoopScope",
+ "switch": "Zc:forScope",
+ "comment": "Force Conformance in For Loop Scope",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline-",
+ "comment": "Remove unreferenced code and data",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RemoveUnreferencedCodeData",
+ "switch": "Zc:inline",
+ "comment": "Remove unreferenced code and data",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast-",
+ "comment": "Enforce type conversion rules",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnforceTypeConversionRules",
+ "switch": "Zc:rvalueCast",
+ "comment": "Enforce type conversion rules",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR-",
+ "comment": "Enable Run-Time Type Information",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RuntimeTypeInfo",
+ "switch": "GR",
+ "comment": "Enable Run-Time Type Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp-",
+ "comment": "Open MP Support",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OpenMPSupport",
+ "switch": "openmp",
+ "comment": "Open MP Support",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableModules",
+ "switch": "experimental:module",
+ "comment": "Enable C++ Modules (experimental)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ExpandAttributedSource",
+ "switch": "Fx",
+ "comment": "Expand Attributed Source",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseUnicodeForAssemblerListing",
+ "switch": "FAu",
+ "comment": "Use Unicode For Assembler Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateXMLDocumentationFiles",
+ "switch": "doc",
+ "comment": "Generate XML Documentation Files",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "BrowseInformation",
+ "switch": "FR",
+ "comment": "Enable Browse Information",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "ShowIncludes",
+ "switch": "showIncludes",
+ "comment": "Show Includes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze-",
+ "comment": "Enable Code Analysis",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnablePREfast",
+ "switch": "analyze",
+ "comment": "Enable Code Analysis",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseFullPaths",
+ "switch": "FC",
+ "comment": "Use Full Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OmitDefaultLibName",
+ "switch": "Zl",
+ "comment": "Omit Default Library Name",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalUsingDirectories",
+ "switch": "AI",
+ "comment": "Additional #using Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "U",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DisableSpecificWarnings",
+ "switch": "wd",
+ "comment": "Disable Specific Warnings",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedIncludeFiles",
+ "switch": "FI",
+ "comment": "Forced Include File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForcedUsingFiles",
+ "switch": "FU",
+ "comment": "Forced #using File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "PREfastLog",
+ "switch": "analyze:log",
+ "comment": "Code Analysis Log",
+ "value": "",
+ "flags": [
+ "UserFollowing"
+ ]
+ },
+ {
+ "name": "PREfastAdditionalPlugins",
+ "switch": "analyze:plugin",
+ "comment": "Additional Code Analysis Native plugins",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "TreatSpecificWarningsAsErrors",
+ "switch": "we",
+ "comment": "Treat Specific Warnings As Errors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "WarningVersion",
+ "switch": "Wv:",
+ "comment": "Warning Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PreprocessOutputPath",
+ "switch": "Fi",
+ "comment": "Preprocess Output Path",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yu",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderFile",
+ "switch": "Yc",
+ "comment": "Precompiled Header File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "PrecompiledHeaderOutputFile",
+ "switch": "Fp",
+ "comment": "Precompiled Header Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssemblerListingLocation",
+ "switch": "Fa",
+ "comment": "ASM List Location",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDataBaseFileName",
+ "switch": "Fd",
+ "comment": "Program Database File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "XMLDocumentationFileName",
+ "switch": "doc",
+ "comment": "XML Documentation File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "BrowseInformationFile",
+ "switch": "FR",
+ "comment": "Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "ProcessorNumber",
+ "switch": "MP",
+ "comment": "Number of processors",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v142_Link.json b/Templates/MSBuild/FlagTables/v142_Link.json
new file mode 100644
index 000000000..66ee76fcb
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v142_Link.json
@@ -0,0 +1,1323 @@
+[
+ {
+ "name": "ShowProgress",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE",
+ "comment": "Display all progress messages",
+ "value": "LinkVerbose",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:Lib",
+ "comment": "For Libraries Searched",
+ "value": "LinkVerboseLib",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:ICF",
+ "comment": "About COMDAT folding during optimized linking",
+ "value": "LinkVerboseICF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:REF",
+ "comment": "About data removed during optimized linking",
+ "value": "LinkVerboseREF",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:SAFESEH",
+ "comment": "About Modules incompatible with SEH",
+ "value": "LinkVerboseSAFESEH",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "VERBOSE:CLR",
+ "comment": "About linker activity related to managed code",
+ "value": "LinkVerboseCLR",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:MULTIPLE",
+ "comment": "Multiply Defined Symbol Only",
+ "value": "MultiplyDefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "ForceFileOutput",
+ "switch": "FORCE:UNRESOLVED",
+ "comment": "Undefined Symbol Only",
+ "value": "UndefinedSymbolOnly",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:5",
+ "comment": "X86 Image Only",
+ "value": "X86Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:6",
+ "comment": "X64 Image Only",
+ "value": "X64Image",
+ "flags": []
+ },
+ {
+ "name": "CreateHotPatchableImage",
+ "switch": "FUNCTIONPADMIN:16",
+ "comment": "Itanium Image Only",
+ "value": "ItaniumImage",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='asInvoker'",
+ "comment": "asInvoker",
+ "value": "AsInvoker",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='highestAvailable'",
+ "comment": "highestAvailable",
+ "value": "HighestAvailable",
+ "flags": []
+ },
+ {
+ "name": "UACExecutionLevel",
+ "switch": "level='requireAdministrator'",
+ "comment": "requireAdministrator",
+ "value": "RequireAdministrator",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FASTLINK",
+ "comment": "Generate Debug Information optimized for faster links",
+ "value": "DebugFastLink",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:FULL",
+ "comment": "Generate Debug Information optimized for sharing and publishing",
+ "value": "DebugFull",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "DEBUG:NONE",
+ "comment": "Produces no debugging information",
+ "value": "false",
+ "flags": [
+ "CaseInsensitive"
+ ]
+ },
+ {
+ "name": "SubSystem",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "Driver",
+ "comment": "Driver",
+ "value": "Driver",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:UPONLY",
+ "comment": "UP Only",
+ "value": "UpOnly",
+ "flags": []
+ },
+ {
+ "name": "Driver",
+ "switch": "DRIVER:WDM",
+ "comment": "WDM",
+ "value": "WDM",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "",
+ "comment": "Default",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:incremental",
+ "comment": "Use Fast Link Time Code Generation",
+ "value": "UseFastLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Use Link Time Code Generation",
+ "value": "UseLinkTimeCodeGeneration",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGInstrument",
+ "comment": "Profile Guided Optimization - Instrument",
+ "value": "PGInstrument",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGOptimize",
+ "comment": "Profile Guided Optimization - Optimization",
+ "value": "PGOptimization",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG:PGUpdate",
+ "comment": "Profile Guided Optimization - Update",
+ "value": "PGUpdate",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD",
+ "comment": "Yes",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateWindowsMetadata",
+ "switch": "WINMD:NO",
+ "comment": "No",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataSignHash",
+ "switch": "WINMDSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "",
+ "comment": "Not Set",
+ "value": "NotSet",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM64",
+ "comment": "MachineARM64",
+ "value": "MachineARM64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:MTA",
+ "comment": "MTA threading attribute",
+ "value": "MTAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:STA",
+ "comment": "STA threading attribute",
+ "value": "STAThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRThreadAttribute",
+ "switch": "CLRTHREADATTRIBUTE:NONE",
+ "comment": "Default threading attribute",
+ "value": "DefaultThreadingAttribute",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:IJW",
+ "comment": "Force IJW image",
+ "value": "ForceIJWImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:PURE",
+ "comment": "Force Pure IL Image",
+ "value": "ForcePureILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "CLRIMAGETYPE:SAFE",
+ "comment": "Force Safe IL Image",
+ "value": "ForceSafeILImage",
+ "flags": []
+ },
+ {
+ "name": "CLRImageType",
+ "switch": "",
+ "comment": "Default image type",
+ "value": "Default",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA1",
+ "comment": "SHA1",
+ "value": "SHA1",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA256",
+ "comment": "SHA256",
+ "value": "SHA256",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA384",
+ "comment": "SHA384",
+ "value": "SHA384",
+ "flags": []
+ },
+ {
+ "name": "SignHash",
+ "switch": "CLRSIGNHASH:SHA512",
+ "comment": "SHA512",
+ "value": "SHA512",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "LinkErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError",
+ "comment": "Enabled",
+ "value": "Enabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:NO",
+ "comment": "Disabled",
+ "value": "Disabled",
+ "flags": []
+ },
+ {
+ "name": "CLRSupportLastError",
+ "switch": "CLRSupportLastError:SYSTEMDLL",
+ "comment": "System Dlls Only",
+ "value": "SystemDlls",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL:NO",
+ "comment": "Enable Incremental Linking",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkIncremental",
+ "switch": "INCREMENTAL",
+ "comment": "Enable Incremental Linking",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:NOSTATUS",
+ "comment": "Link Status",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkStatus",
+ "switch": "LTCG:STATUS",
+ "comment": "Link Status",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND:NO",
+ "comment": "Prevent Dll Binding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "PreventDllBinding",
+ "switch": "ALLOWBIND",
+ "comment": "Prevent Dll Binding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLinkerWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Linker Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST:NO",
+ "comment": "Generate Manifest",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "GenerateManifest",
+ "switch": "MANIFEST",
+ "comment": "Generate Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "ALLOWISOLATION:NO",
+ "comment": "Allow Isolation",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AllowIsolation",
+ "switch": "",
+ "comment": "Allow Isolation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableUAC",
+ "switch": "MANIFESTUAC:",
+ "comment": "",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired",
+ "SpaceAppendable"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='false'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "UACUIAccess",
+ "switch": "uiAccess='true'",
+ "comment": "UAC Bypass UI Protection",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ManifestEmbed",
+ "switch": "manifest:embed",
+ "comment": "Embed Manifest",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateMapFile",
+ "switch": "MAP",
+ "comment": "Generate Map File",
+ "value": "true",
+ "flags": [
+ "UserValue",
+ "UserIgnored",
+ "Continue"
+ ]
+ },
+ {
+ "name": "MapExports",
+ "switch": "MAPINFO:EXPORTS",
+ "comment": "Map Exports",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG:DISABLE",
+ "comment": "Debuggable Assembly",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "AssemblyDebug",
+ "switch": "ASSEMBLYDEBUG",
+ "comment": "Debuggable Assembly",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE:NO",
+ "comment": "Enable Large Addresses",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LargeAddressAware",
+ "switch": "LARGEADDRESSAWARE",
+ "comment": "Enable Large Addresses",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE:NO",
+ "comment": "Terminal Server",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TerminalServerAware",
+ "switch": "TSAWARE",
+ "comment": "Terminal Server",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromCD",
+ "switch": "SWAPRUN:CD",
+ "comment": "Swap Run From CD",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SwapRunFromNET",
+ "switch": "SWAPRUN:NET",
+ "comment": "Swap Run From Network",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:NOREF",
+ "comment": "References",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "OptimizeReferences",
+ "switch": "OPT:REF",
+ "comment": "References",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:NOICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "EnableCOMDATFolding",
+ "switch": "OPT:ICF",
+ "comment": "Enable COMDAT Folding",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreEmbeddedIDL",
+ "switch": "IGNOREIDL",
+ "comment": "Ignore Embedded IDL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AppContainer",
+ "switch": "APPCONTAINER",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN:NO",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "WindowsMetadataLinkDelaySign",
+ "switch": "WINMDDELAYSIGN",
+ "comment": "Windows Metadata Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NoEntryPoint",
+ "switch": "NOENTRY",
+ "comment": "No Entry Point",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SetChecksum",
+ "switch": "RELEASE",
+ "comment": "Set Checksum",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE:NO",
+ "comment": "Randomized Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "RandomizedBaseAddress",
+ "switch": "DYNAMICBASE",
+ "comment": "Randomized Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED:NO",
+ "comment": "Fixed Base Address",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "FixedBaseAddress",
+ "switch": "FIXED",
+ "comment": "Fixed Base Address",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT:NO",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "DataExecutionPrevention",
+ "switch": "NXCOMPAT",
+ "comment": "Data Execution Prevention (DEP)",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TurnOffAssemblyGeneration",
+ "switch": "NOASSEMBLY",
+ "comment": "Turn Off Assembly Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportUnloadOfDelayLoadedDLL",
+ "switch": "DELAY:UNLOAD",
+ "comment": "Unload delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SupportNobindOfDelayLoadedDLL",
+ "switch": "DELAY:NOBIND",
+ "comment": "Nobind delay loaded DLL",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Profile",
+ "switch": "PROFILE",
+ "comment": "Profile",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN:NO",
+ "comment": "Delay Sign",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "LinkDelaySign",
+ "switch": "DELAYSIGN",
+ "comment": "Delay Sign",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK:NO",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "CLRUnmanagedCodeCheck",
+ "switch": "CLRUNMANAGEDCODECHECK",
+ "comment": "CLR Unmanaged Code Check",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DetectOneDefinitionRule",
+ "switch": "ODR",
+ "comment": "Detect One Definition Rule violations",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH:NO",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "ImageHasSafeExceptionHandlers",
+ "switch": "SAFESEH",
+ "comment": "Image Has Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkDLL",
+ "switch": "DLL",
+ "comment": "",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "Natvis",
+ "switch": "NATVIS:",
+ "comment": "Natvis files",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AddModuleNamesToAssembly",
+ "switch": "ASSEMBLYMODULE:",
+ "comment": "Add Module to Assembly",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "EmbedManagedResourceFile",
+ "switch": "ASSEMBLYRESOURCE:",
+ "comment": "Embed Managed Resource File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "DelayLoadDLLs",
+ "switch": "DELAYLOAD:",
+ "comment": "Delay Loaded Dlls",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AssemblyLinkResource",
+ "switch": "ASSEMBLYLINKRESOURCE:",
+ "comment": "Assembly Link Resource",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalManifestDependencies",
+ "switch": "MANIFESTDEPENDENCY:",
+ "comment": "Additional Manifest Dependencies",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ManifestInput",
+ "switch": "manifestinput:",
+ "comment": "Manifest Input",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Version",
+ "switch": "VERSION:",
+ "comment": "Version",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SpecifySectionAttributes",
+ "switch": "SECTION:",
+ "comment": "Specify Section Attributes",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MSDOSStubFileName",
+ "switch": "STUB:",
+ "comment": "MS-DOS Stub File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ManifestFile",
+ "switch": "ManifestFile:",
+ "comment": "Manifest File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProgramDatabaseFile",
+ "switch": "PDB:",
+ "comment": "Generate Program Database File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StripPrivateSymbols",
+ "switch": "PDBSTRIPPED:",
+ "comment": "Strip Private Symbols",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MapFileName",
+ "switch": "MAP:",
+ "comment": "Map File Name",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "HeapReserveSize",
+ "switch": "HEAP:",
+ "comment": "Heap Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "HeapCommitSize",
+ "switch": "HEAP",
+ "comment": "Heap Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "StackReserveSize",
+ "switch": "STACK:",
+ "comment": "Stack Reserve Size",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "StackCommitSize",
+ "switch": "STACK",
+ "comment": "Stack Commit Size",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "UserRequired"
+ ]
+ },
+ {
+ "name": "FunctionOrder",
+ "switch": "ORDER:@",
+ "comment": "Function Order",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ProfileGuidedDatabase",
+ "switch": "PGD:",
+ "comment": "Profile Guided Database",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MidlCommandFile",
+ "switch": "MIDL:@",
+ "comment": "MIDL Commands",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergedIDLBaseFileName",
+ "switch": "IDLOUT:",
+ "comment": "Merged IDL Base File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryFile",
+ "switch": "TLBOUT:",
+ "comment": "Type Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataFile",
+ "switch": "WINMDFILE:",
+ "comment": "Windows Metadata File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataLinkKeyFile",
+ "switch": "WINMDKEYFILE:",
+ "comment": "Windows Metadata Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "WindowsMetadataKeyContainer",
+ "switch": "WINMDKEYCONTAINER:",
+ "comment": "Windows Metadata Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "EntryPointSymbol",
+ "switch": "ENTRY:",
+ "comment": "Entry Point",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "BaseAddress",
+ "switch": "BASE:",
+ "comment": "Base Address",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ImportLibrary",
+ "switch": "IMPLIB:",
+ "comment": "Import Library",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "MergeSections",
+ "switch": "MERGE:",
+ "comment": "Merge Sections",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "LinkKeyFile",
+ "switch": "KEYFILE:",
+ "comment": "Key File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "KeyContainer",
+ "switch": "KEYCONTAINER:",
+ "comment": "Key Container",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "TypeLibraryResourceID",
+ "switch": "TLBID:",
+ "comment": "TypeLib Resource ID",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "SectionAlignment",
+ "switch": "ALIGN:",
+ "comment": "SectionAlignment",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v14_LIB.json b/Templates/MSBuild/FlagTables/v14_LIB.json
new file mode 100644
index 000000000..5990ed1b7
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v14_LIB.json
@@ -0,0 +1,304 @@
+[
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:PROMPT",
+ "comment": "PromptImmediately",
+ "value": "PromptImmediately",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:QUEUE",
+ "comment": "Queue For Next Login",
+ "value": "QueueForNextLogin",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:SEND",
+ "comment": "Send Error Report",
+ "value": "SendErrorReport",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "ERRORREPORT:NONE",
+ "comment": "No Error Report",
+ "value": "NoErrorReport",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM",
+ "comment": "MachineARM",
+ "value": "MachineARM",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:ARM64",
+ "comment": "MachineARM64",
+ "value": "MachineARM64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:EBC",
+ "comment": "MachineEBC",
+ "value": "MachineEBC",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:IA64",
+ "comment": "MachineIA64",
+ "value": "MachineIA64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS",
+ "comment": "MachineMIPS",
+ "value": "MachineMIPS",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPS16",
+ "comment": "MachineMIPS16",
+ "value": "MachineMIPS16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU",
+ "comment": "MachineMIPSFPU",
+ "value": "MachineMIPSFPU",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:MIPSFPU16",
+ "comment": "MachineMIPSFPU16",
+ "value": "MachineMIPSFPU16",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:SH4",
+ "comment": "MachineSH4",
+ "value": "MachineSH4",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:THUMB",
+ "comment": "MachineTHUMB",
+ "value": "MachineTHUMB",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X64",
+ "comment": "MachineX64",
+ "value": "MachineX64",
+ "flags": []
+ },
+ {
+ "name": "TargetMachine",
+ "switch": "MACHINE:X86",
+ "comment": "MachineX86",
+ "value": "MachineX86",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:CONSOLE",
+ "comment": "Console",
+ "value": "Console",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWS",
+ "comment": "Windows",
+ "value": "Windows",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:NATIVE",
+ "comment": "Native",
+ "value": "Native",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_APPLICATION",
+ "comment": "EFI Application",
+ "value": "EFI Application",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "comment": "EFI Boot Service Driver",
+ "value": "EFI Boot Service Driver",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_ROM",
+ "comment": "EFI ROM",
+ "value": "EFI ROM",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "comment": "EFI Runtime",
+ "value": "EFI Runtime",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:WINDOWSCE",
+ "comment": "WindowsCE",
+ "value": "WindowsCE",
+ "flags": []
+ },
+ {
+ "name": "SubSystem",
+ "switch": "SUBSYSTEM:POSIX",
+ "comment": "POSIX",
+ "value": "POSIX",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "NOLOGO",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "IgnoreAllDefaultLibraries",
+ "switch": "NODEFAULTLIB",
+ "comment": "Ignore All Default Libraries",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX:NO",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "false",
+ "flags": []
+ },
+ {
+ "name": "TreatLibWarningAsErrors",
+ "switch": "WX",
+ "comment": "Treat Lib Warning As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "Verbose",
+ "switch": "VERBOSE",
+ "comment": "Verbose",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "LinkTimeCodeGeneration",
+ "switch": "LTCG",
+ "comment": "Link Time Code Generation",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AdditionalLibraryDirectories",
+ "switch": "LIBPATH:",
+ "comment": "Additional Library Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IgnoreSpecificDefaultLibraries",
+ "switch": "NODEFAULTLIB:",
+ "comment": "Ignore Specific Default Libraries",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ExportNamedFunctions",
+ "switch": "EXPORT:",
+ "comment": "Export Named Functions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "RemoveObjects",
+ "switch": "REMOVE:",
+ "comment": "Remove Objects",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "OutputFile",
+ "switch": "OUT:",
+ "comment": "Output File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ModuleDefinitionFile",
+ "switch": "DEF:",
+ "comment": "Module Definition File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "ForceSymbolReferences",
+ "switch": "INCLUDE:",
+ "comment": "Force Symbol References",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "DisplayLibrary",
+ "switch": "LIST:",
+ "comment": "Display Library to standard output",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "Name",
+ "switch": "NAME:",
+ "comment": "Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v14_MASM.json b/Templates/MSBuild/FlagTables/v14_MASM.json
new file mode 100644
index 000000000..4634306b1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v14_MASM.json
@@ -0,0 +1,295 @@
+[
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cp",
+ "comment": "Preserves Identifier Case (/Cp)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cu",
+ "comment": "Maps all identifiers to upper case. (/Cu)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PreserveIdentifierCase",
+ "switch": "Cx",
+ "comment": "Preserves case in public and extern symbols. (/Cx)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W0",
+ "comment": "Warning Level 0 (/W0)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W1",
+ "comment": "Warning Level 1 (/W1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W2",
+ "comment": "Warning Level 2 (/W2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "WarningLevel",
+ "switch": "W3",
+ "comment": "Warning Level 3 (/W3)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp1",
+ "comment": "One Byte Boundary (/Zp1)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp2",
+ "comment": "Two Byte Boundary (/Zp2)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp4",
+ "comment": "Four Byte Boundary (/Zp4)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp8",
+ "comment": "Eight Byte Boundary (/Zp8)",
+ "value": "4",
+ "flags": []
+ },
+ {
+ "name": "PackAlignmentBoundary",
+ "switch": "Zp16",
+ "comment": "Sixteen Byte Boundary (/Zp16)",
+ "value": "5",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "",
+ "comment": "Default",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gd",
+ "comment": "Use C-style Calling Convention (/Gd)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gz",
+ "comment": "Use stdcall Calling Convention (/Gz)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "CallingConvention",
+ "switch": "Gc",
+ "comment": "Use Pascal Calling Convention (/Gc)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:prompt",
+ "comment": "Prompt to send report immediately (/errorReport:prompt)",
+ "value": "0",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:queue",
+ "comment": "Prompt to send report at the next logon (/errorReport:queue)",
+ "value": "1",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:send",
+ "comment": "Automatically send report (/errorReport:send)",
+ "value": "2",
+ "flags": []
+ },
+ {
+ "name": "ErrorReporting",
+ "switch": "errorReport:none",
+ "comment": "Do not send report (/errorReport:none)",
+ "value": "3",
+ "flags": []
+ },
+ {
+ "name": "NoLogo",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GeneratePreprocessedSourceListing",
+ "switch": "EP",
+ "comment": "Generate Preprocessed Source Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ListAllAvailableInformation",
+ "switch": "Sa",
+ "comment": "List All Available Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "UseSafeExceptionHandlers",
+ "switch": "safeseh",
+ "comment": "Use Safe Exception Handlers",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "AddFirstPassListing",
+ "switch": "Sf",
+ "comment": "Add First Pass Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableAssemblyGeneratedCodeListing",
+ "switch": "Sg",
+ "comment": "Enable Assembly Generated Code Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "DisableSymbolTable",
+ "switch": "Sn",
+ "comment": "Disable Symbol Table",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableFalseConditionalsInListing",
+ "switch": "Sx",
+ "comment": "Enable False Conditionals In Listing",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "TreatWarningsAsErrors",
+ "switch": "WX",
+ "comment": "Treat Warnings As Errors",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "MakeAllSymbolsPublic",
+ "switch": "Zf",
+ "comment": "Make All Symbols Public",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "GenerateDebugInformation",
+ "switch": "Zi",
+ "comment": "Generate Debug Information",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "EnableMASM51Compatibility",
+ "switch": "Zm",
+ "comment": "Enable MASM 5.1 Compatibility",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PerformSyntaxCheckOnly",
+ "switch": "Zs",
+ "comment": "Perform Syntax Check Only",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "IncludePaths",
+ "switch": "I",
+ "comment": "Include Paths",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "BrowseFile",
+ "switch": "FR",
+ "comment": "Generate Browse Information File",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ObjectFileName",
+ "switch": "Fo",
+ "comment": "Object File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ },
+ {
+ "name": "AssembledCodeListingFile",
+ "switch": "Fl",
+ "comment": "Assembled Code Listing File",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/MSBuild/FlagTables/v14_RC.json b/Templates/MSBuild/FlagTables/v14_RC.json
new file mode 100644
index 000000000..b8c0127d1
--- /dev/null
+++ b/Templates/MSBuild/FlagTables/v14_RC.json
@@ -0,0 +1,69 @@
+[
+ {
+ "name": "IgnoreStandardIncludePath",
+ "switch": "X",
+ "comment": "Ignore Standard Include Paths",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "ShowProgress",
+ "switch": "v",
+ "comment": "Show Progress",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "SuppressStartupBanner",
+ "switch": "nologo",
+ "comment": "Suppress Startup Banner",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "NullTerminateStrings",
+ "switch": "n",
+ "comment": "Null Terminate Strings",
+ "value": "true",
+ "flags": []
+ },
+ {
+ "name": "PreprocessorDefinitions",
+ "switch": "D",
+ "comment": "Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "UndefinePreprocessorDefinitions",
+ "switch": "u",
+ "comment": "Undefine Preprocessor Definitions",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "AdditionalIncludeDirectories",
+ "switch": "I",
+ "comment": "Additional Include Directories",
+ "value": "",
+ "flags": [
+ "UserValue",
+ "SemicolonAppendable"
+ ]
+ },
+ {
+ "name": "ResourceOutputFileName",
+ "switch": "fo",
+ "comment": "Resource File Name",
+ "value": "",
+ "flags": [
+ "UserValue"
+ ]
+ }
+]
diff --git a/Templates/Windows/ApplicationIcon.png b/Templates/Windows/ApplicationIcon.png
index 7d95d4e08..c715e1bc7 100644
--- a/Templates/Windows/ApplicationIcon.png
+++ b/Templates/Windows/ApplicationIcon.png
Binary files differ
diff --git a/Templates/Windows/Logo.png b/Templates/Windows/Logo.png
index e26771cb3..65f91ac0f 100644
--- a/Templates/Windows/Logo.png
+++ b/Templates/Windows/Logo.png
Binary files differ
diff --git a/Templates/Windows/SmallLogo.png b/Templates/Windows/SmallLogo.png
index 1eb0d9d52..460c0222d 100644
--- a/Templates/Windows/SmallLogo.png
+++ b/Templates/Windows/SmallLogo.png
Binary files differ
diff --git a/Templates/Windows/SmallLogo44x44.png b/Templates/Windows/SmallLogo44x44.png
index 28810b7c0..c2374581a 100644
--- a/Templates/Windows/SmallLogo44x44.png
+++ b/Templates/Windows/SmallLogo44x44.png
Binary files differ
diff --git a/Templates/Windows/SplashScreen.png b/Templates/Windows/SplashScreen.png
index c951e031b..834256580 100644
--- a/Templates/Windows/SplashScreen.png
+++ b/Templates/Windows/SplashScreen.png
Binary files differ
diff --git a/Templates/Windows/StoreLogo.png b/Templates/Windows/StoreLogo.png
index dcb672712..508c8a809 100644
--- a/Templates/Windows/StoreLogo.png
+++ b/Templates/Windows/StoreLogo.png
Binary files differ
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 5c704ac83..85ce1f785 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -134,15 +134,11 @@ assert_property(newsignature1 LINK_LIBRARIES "depC;depB;subdirlib")
#----------------------------------------------------------------------------
# Test cross-directory linking.
cmake_policy(PUSH)
-cmake_policy(SET CMP0022 NEW)
cmake_policy(SET CMP0079 NEW)
add_executable(TopDir TopDir.c)
add_subdirectory(SubDirA)
add_subdirectory(SubDirB)
target_link_libraries(SubDirB TopDirImported)
-add_subdirectory(SubDirC)
-target_link_libraries(SubDirC PRIVATE SubDirC2)
-target_link_libraries(TopDir SubDirC)
add_library(TopDirImported IMPORTED INTERFACE)
target_compile_definitions(TopDirImported INTERFACE DEF_TopDirImported)
cmake_policy(POP)
diff --git a/Tests/CMakeCommands/target_link_libraries/SubDirC/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/SubDirC/CMakeLists.txt
deleted file mode 100644
index 54bcc5174..000000000
--- a/Tests/CMakeCommands/target_link_libraries/SubDirC/CMakeLists.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-add_library(SubDirC STATIC SubDirC.c)
-
-add_library(SubDirC1 INTERFACE)
-target_compile_definitions(SubDirC1 INTERFACE DEF_SubDirC1)
-
-add_library(SubDirC2 INTERFACE)
-target_compile_definitions(SubDirC2 INTERFACE DEF_SubDirC2)
-
-target_link_libraries(SubDirC PRIVATE SubDirC1)
diff --git a/Tests/CMakeCommands/target_link_libraries/SubDirC/SubDirC.c b/Tests/CMakeCommands/target_link_libraries/SubDirC/SubDirC.c
deleted file mode 100644
index c5536dccd..000000000
--- a/Tests/CMakeCommands/target_link_libraries/SubDirC/SubDirC.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef DEF_SubDirC1
-# error "DEF_SubDirC1 not defined"
-#endif
-#ifndef DEF_SubDirC2
-# error "DEF_SubDirC2 not defined"
-#endif
-
-int SubDirC(void)
-{
- return 0;
-}
diff --git a/Tests/CMakeCommands/target_link_libraries/TopDir.c b/Tests/CMakeCommands/target_link_libraries/TopDir.c
index d8066e5ca..4706bb94e 100644
--- a/Tests/CMakeCommands/target_link_libraries/TopDir.c
+++ b/Tests/CMakeCommands/target_link_libraries/TopDir.c
@@ -7,12 +7,6 @@
#ifdef DEF_TopDirImported
# error "DEF_TopDirImported is defined but should not be!"
#endif
-#ifdef DEF_SubDirC1
-# error "DEF_SubDirC1 defined but should not be"
-#endif
-#ifdef DEF_SubDirC2
-# error "DEF_SubDirC2 defined but should not be"
-#endif
int main(void)
{
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index 126076d8d..f6a9153f9 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -7,6 +7,7 @@ include_directories(
set(CMakeLib_TESTS
testGeneratedFileStream.cxx
testRST.cxx
+ testString.cxx
testSystemTools.cxx
testUTF8.cxx
testXMLParser.cxx
diff --git a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
index b4c6fae44..3183bc0b6 100644
--- a/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
+++ b/Tests/CMakeLib/PseudoMemcheck/memtester.cxx.in
@@ -15,15 +15,15 @@ int main(int ac, char** av)
std::string logarg;
bool nextarg = false;
- if (exename.find("valgrind") != exename.npos) {
+ if (exename.find("valgrind") != std::string::npos) {
logarg = "--log-file=";
- } else if (exename.find("purify") != exename.npos) {
+ } else if (exename.find("purify") != std::string::npos) {
#ifdef _WIN32
logarg = "/SAVETEXTDATA=";
#else
logarg = "-log-file=";
#endif
- } else if (exename.find("BC") != exename.npos) {
+ } else if (exename.find("BC") != std::string::npos) {
nextarg = true;
logarg = "/X";
}
diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx
new file mode 100644
index 000000000..af5e41ed3
--- /dev/null
+++ b/Tests/CMakeLib/testString.cxx
@@ -0,0 +1,1347 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include "cmString.hxx"
+
+#include "cm_static_string_view.hxx"
+#include "cm_string_view.hxx"
+
+#include <cstring>
+#include <iostream>
+#include <iterator>
+#include <sstream>
+#include <stdexcept>
+#include <string>
+#include <type_traits>
+#include <utility>
+
+#define ASSERT_TRUE(x) \
+ do { \
+ if (!(x)) { \
+ std::cout << "ASSERT_TRUE(" #x ") failed on line " << __LINE__ << "\n"; \
+ return false; \
+ } \
+ } while (false)
+
+static bool testConstructDefault()
+{
+ std::cout << "testConstructDefault()\n";
+ cm::String str;
+ cm::String const& str_const = str;
+ ASSERT_TRUE(bool(str_const) == false);
+ ASSERT_TRUE(str_const.data() == nullptr);
+ ASSERT_TRUE(str_const.size() == 0);
+ ASSERT_TRUE(str_const.empty());
+ ASSERT_TRUE(str_const.is_stable());
+ ASSERT_TRUE(str.c_str() == nullptr);
+ ASSERT_TRUE(str.str().empty());
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testFromNullPtr(cm::String str)
+{
+ cm::String const& str_const = str;
+ ASSERT_TRUE(bool(str_const) == false);
+ ASSERT_TRUE(str_const.data() == nullptr);
+ ASSERT_TRUE(str_const.size() == 0);
+ ASSERT_TRUE(str_const.empty());
+ ASSERT_TRUE(str_const.is_stable());
+ ASSERT_TRUE(str.c_str() == nullptr);
+ ASSERT_TRUE(str.str().empty());
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testConstructFromNullPtr()
+{
+ std::cout << "testConstructFromNullPtr()\n";
+ return testFromNullPtr(nullptr);
+}
+
+static bool testAssignFromNullPtr()
+{
+ std::cout << "testAssignFromNullPtr()\n";
+ cm::String str;
+ str = nullptr;
+ return testFromNullPtr(str);
+}
+
+static bool testFromCStrNull(cm::String str)
+{
+ cm::String const& str_const = str;
+ ASSERT_TRUE(bool(str_const) == false);
+ ASSERT_TRUE(str_const.data() == nullptr);
+ ASSERT_TRUE(str_const.size() == 0);
+ ASSERT_TRUE(str_const.empty());
+ ASSERT_TRUE(str_const.is_stable());
+ ASSERT_TRUE(str.c_str() == nullptr);
+ ASSERT_TRUE(str.str().empty());
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testConstructFromCStrNull()
+{
+ std::cout << "testConstructFromCStrNull()\n";
+ const char* null = nullptr;
+ return testFromCStrNull(null);
+}
+
+static bool testAssignFromCStrNull()
+{
+ std::cout << "testAssignFromCStrNull()\n";
+ const char* null = nullptr;
+ cm::String str;
+ str = null;
+ return testFromCStrNull(str);
+}
+
+static char const charArray[] = "abc";
+
+static bool testFromCharArray(cm::String str)
+{
+ cm::String const& str_const = str;
+ ASSERT_TRUE(str_const.data() != charArray);
+ ASSERT_TRUE(str_const.size() == sizeof(charArray) - 1);
+ ASSERT_TRUE(str_const.is_stable());
+ ASSERT_TRUE(str.c_str() != charArray);
+ ASSERT_TRUE(str.is_stable());
+ cm::String substr = str.substr(1);
+ cm::String const& substr_const = substr;
+ ASSERT_TRUE(substr_const.data() != &charArray[1]);
+ ASSERT_TRUE(substr_const.size() == 2);
+ ASSERT_TRUE(!substr_const.is_stable());
+ ASSERT_TRUE(substr.c_str() != &charArray[1]);
+ ASSERT_TRUE(!substr.is_stable());
+ return true;
+}
+
+static bool testConstructFromCharArray()
+{
+ std::cout << "testConstructFromCharArray()\n";
+ return testFromCharArray(charArray);
+}
+
+static bool testAssignFromCharArray()
+{
+ std::cout << "testAssignFromCharArray()\n";
+ cm::String str;
+ str = charArray;
+ return testFromCharArray(str);
+}
+
+static const char* cstr = "abc";
+
+static bool testFromCStr(cm::String const& str)
+{
+ ASSERT_TRUE(str.data() != cstr);
+ ASSERT_TRUE(str.size() == 3);
+ ASSERT_TRUE(std::strncmp(str.data(), cstr, 3) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testConstructFromCStr()
+{
+ std::cout << "testConstructFromCStr()\n";
+ return testFromCStr(cstr);
+}
+
+static bool testAssignFromCStr()
+{
+ std::cout << "testAssignFromCStr()\n";
+ cm::String str;
+ str = cstr;
+ return testFromCStr(str);
+}
+
+static const std::string stdstr = "abc";
+
+static bool testFromStdString(cm::String const& str)
+{
+#if defined(_GLIBCXX_USE_CXX11_ABI) && _GLIBCXX_USE_CXX11_ABI
+ // It would be nice to check this everywhere, but several platforms
+ // still use a CoW implementation even in C++11.
+ ASSERT_TRUE(str.data() != stdstr.data());
+#endif
+ ASSERT_TRUE(str.size() == 3);
+ ASSERT_TRUE(std::strncmp(str.data(), stdstr.data(), 3) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testConstructFromStdString()
+{
+ std::cout << "testConstructFromStdString()\n";
+ return testFromStdString(stdstr);
+}
+
+static bool testAssignFromStdString()
+{
+ std::cout << "testAssignFromStdString()\n";
+ cm::String str;
+ str = stdstr;
+ return testFromStdString(str);
+}
+
+static bool testConstructFromView()
+{
+ std::cout << "testConstructFromView()\n";
+ cm::string_view view = cstr;
+ return testFromCStr(view);
+}
+
+static bool testAssignFromView()
+{
+ std::cout << "testAssignFromView()\n";
+ cm::string_view view = cstr;
+ cm::String str;
+ str = view;
+ return testFromCStr(str);
+}
+
+static bool testFromChar(cm::String const& str)
+{
+ ASSERT_TRUE(str.size() == 1);
+ ASSERT_TRUE(std::strncmp(str.data(), "a", 1) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testConstructFromChar()
+{
+ std::cout << "testConstructFromChar()\n";
+ return testFromChar('a');
+}
+
+static bool testAssignFromChar()
+{
+ std::cout << "testAssignFromChar()\n";
+ cm::String str;
+ str = 'a';
+ return testFromChar(str);
+}
+
+static bool testConstructFromInitList()
+{
+ std::cout << "testConstructFromInitList()\n";
+ cm::String const str{ 'a', 'b', 'c' };
+ ASSERT_TRUE(str.size() == 3);
+ ASSERT_TRUE(std::strncmp(str.data(), "abc", 3) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testAssignFromInitList()
+{
+ std::cout << "testAssignFromInitList()\n";
+ cm::String str;
+ str = { 'a', 'b', 'c' };
+ ASSERT_TRUE(str.size() == 3);
+ ASSERT_TRUE(std::strncmp(str.data(), "abc", 3) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testConstructFromBuffer()
+{
+ std::cout << "testConstructFromBuffer()\n";
+ cm::String const str(cstr, 3);
+ return testFromCStr(str);
+}
+
+static bool testConstructFromInputIterator()
+{
+ std::cout << "testConstructFromInputIterator()\n";
+ cm::String const str(cstr, cstr + 3);
+ ASSERT_TRUE(str.data() != cstr);
+ ASSERT_TRUE(str.size() == 3);
+ ASSERT_TRUE(std::strncmp(str.data(), cstr, 3) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testConstructFromN()
+{
+ std::cout << "testConstructFromN()\n";
+ cm::String const str(3, 'a');
+ ASSERT_TRUE(str.size() == 3);
+ ASSERT_TRUE(std::strncmp(str.data(), "aaa", 3) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static const auto staticStringView = "abc"_s;
+
+static bool testFromStaticStringView(cm::String str)
+{
+ cm::String const& str_const = str;
+ ASSERT_TRUE(str_const.data() == staticStringView.data());
+ ASSERT_TRUE(str_const.size() == staticStringView.size());
+ ASSERT_TRUE(!str_const.is_stable());
+ ASSERT_TRUE(str.c_str() == staticStringView);
+ ASSERT_TRUE(!str.is_stable());
+ cm::String substr = str.substr(1);
+ cm::String const& substr_const = substr;
+ ASSERT_TRUE(substr_const.data() == &staticStringView[1]);
+ ASSERT_TRUE(substr_const.size() == 2);
+ ASSERT_TRUE(!substr_const.is_stable());
+ ASSERT_TRUE(substr.c_str() == &staticStringView[1]);
+ ASSERT_TRUE(!substr.is_stable());
+ return true;
+}
+
+static bool testConstructFromStaticStringView()
+{
+ std::cout << "testConstructFromStaticStringView()\n";
+ return testFromStaticStringView(staticStringView);
+}
+
+static bool testAssignFromStaticStringView()
+{
+ std::cout << "testAssignFromStaticStringView()\n";
+ cm::String str;
+ str = staticStringView;
+ return testFromStaticStringView(str);
+}
+
+static bool testConstructCopy()
+{
+ std::cout << "testConstructCopy()\n";
+ cm::String s1 = std::string("abc");
+ cm::String s2 = s1;
+ ASSERT_TRUE(s1.data() == s2.data());
+ ASSERT_TRUE(s1.size() == 3);
+ ASSERT_TRUE(s2.size() == 3);
+ ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0);
+ ASSERT_TRUE(s1.is_stable());
+ ASSERT_TRUE(s2.is_stable());
+ return true;
+}
+
+static bool testConstructMove()
+{
+ std::cout << "testConstructMove()\n";
+ cm::String s1 = std::string("abc");
+ cm::String s2 = std::move(s1);
+ ASSERT_TRUE(s1.data() == nullptr);
+ ASSERT_TRUE(s1.size() == 0);
+ ASSERT_TRUE(s2.size() == 3);
+ ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0);
+ ASSERT_TRUE(s1.is_stable());
+ ASSERT_TRUE(s2.is_stable());
+ return true;
+}
+
+static bool testAssignCopy()
+{
+ std::cout << "testAssignCopy()\n";
+ cm::String s1 = std::string("abc");
+ cm::String s2;
+ s2 = s1;
+ ASSERT_TRUE(s1.data() == s2.data());
+ ASSERT_TRUE(s1.size() == 3);
+ ASSERT_TRUE(s2.size() == 3);
+ ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0);
+ ASSERT_TRUE(s1.is_stable());
+ ASSERT_TRUE(s2.is_stable());
+ return true;
+}
+
+static bool testAssignMove()
+{
+ std::cout << "testAssignMove()\n";
+ cm::String s1 = std::string("abc");
+ cm::String s2;
+ s2 = std::move(s1);
+ ASSERT_TRUE(s1.data() == nullptr);
+ ASSERT_TRUE(s1.size() == 0);
+ ASSERT_TRUE(s2.size() == 3);
+ ASSERT_TRUE(std::strncmp(s2.data(), "abc", 3) == 0);
+ ASSERT_TRUE(s1.is_stable());
+ ASSERT_TRUE(s2.is_stable());
+ return true;
+}
+
+static bool testOperatorBool()
+{
+ std::cout << "testOperatorBool()\n";
+ cm::String str;
+ ASSERT_TRUE(!str);
+ str = "";
+ ASSERT_TRUE(str);
+ str = static_cast<const char*>(nullptr);
+ ASSERT_TRUE(!str);
+ str = std::string();
+ ASSERT_TRUE(str);
+ str = nullptr;
+ ASSERT_TRUE(!str);
+ return true;
+}
+
+static bool testOperatorIndex()
+{
+ std::cout << "testOperatorIndex()\n";
+ cm::String str = "abc";
+ ASSERT_TRUE(str[0] == 'a');
+ ASSERT_TRUE(str[1] == 'b');
+ ASSERT_TRUE(str[2] == 'c');
+ return true;
+}
+
+static bool testOperatorPlusEqual()
+{
+ std::cout << "testOperatorPlusEqual()\n";
+ cm::String str = "a";
+ str += "b";
+ {
+ const char* c = "c";
+ str += c;
+ }
+ str += 'd';
+ str += std::string("e");
+ str += cm::string_view("f", 1);
+ str += cm::String("g");
+ ASSERT_TRUE(str.size() == 7);
+ ASSERT_TRUE(std::strncmp(str.data(), "abcdefg", 7) == 0);
+ ASSERT_TRUE(str.is_stable());
+ return true;
+}
+
+static bool testOperatorCompare()
+{
+ std::cout << "testOperatorCompare()\n";
+ cm::String str = "b";
+ {
+ ASSERT_TRUE(str == "b");
+ ASSERT_TRUE("b" == str);
+ ASSERT_TRUE(str != "a");
+ ASSERT_TRUE("a" != str);
+ ASSERT_TRUE(str < "c");
+ ASSERT_TRUE("a" < str);
+ ASSERT_TRUE(str > "a");
+ ASSERT_TRUE("c" > str);
+ ASSERT_TRUE(str <= "b");
+ ASSERT_TRUE("b" <= str);
+ ASSERT_TRUE(str >= "b");
+ ASSERT_TRUE("b" >= str);
+ }
+ {
+ const char* a = "a";
+ const char* b = "b";
+ const char* c = "c";
+ ASSERT_TRUE(str == b);
+ ASSERT_TRUE(b == str);
+ ASSERT_TRUE(str != a);
+ ASSERT_TRUE(a != str);
+ ASSERT_TRUE(str < c);
+ ASSERT_TRUE(a < str);
+ ASSERT_TRUE(str > a);
+ ASSERT_TRUE(c > str);
+ ASSERT_TRUE(str <= b);
+ ASSERT_TRUE(b <= str);
+ ASSERT_TRUE(str >= b);
+ ASSERT_TRUE(b >= str);
+ }
+ {
+ ASSERT_TRUE(str == 'b');
+ ASSERT_TRUE('b' == str);
+ ASSERT_TRUE(str != 'a');
+ ASSERT_TRUE('a' != str);
+ ASSERT_TRUE(str < 'c');
+ ASSERT_TRUE('a' < str);
+ ASSERT_TRUE(str > 'a');
+ ASSERT_TRUE('c' > str);
+ ASSERT_TRUE(str <= 'b');
+ ASSERT_TRUE('b' <= str);
+ ASSERT_TRUE(str >= 'b');
+ ASSERT_TRUE('b' >= str);
+ }
+ {
+ std::string const a = "a";
+ std::string const b = "b";
+ std::string const c = "c";
+ ASSERT_TRUE(str == b);
+ ASSERT_TRUE(b == str);
+ ASSERT_TRUE(str != a);
+ ASSERT_TRUE(a != str);
+ ASSERT_TRUE(str < c);
+ ASSERT_TRUE(a < str);
+ ASSERT_TRUE(str > a);
+ ASSERT_TRUE(c > str);
+ ASSERT_TRUE(str <= b);
+ ASSERT_TRUE(b <= str);
+ ASSERT_TRUE(str >= b);
+ ASSERT_TRUE(b >= str);
+ }
+ {
+ cm::string_view const a("a", 1);
+ cm::string_view const b("b", 1);
+ cm::string_view const c("c", 1);
+ ASSERT_TRUE(str == b);
+ ASSERT_TRUE(b == str);
+ ASSERT_TRUE(str != a);
+ ASSERT_TRUE(a != str);
+ ASSERT_TRUE(str < c);
+ ASSERT_TRUE(a < str);
+ ASSERT_TRUE(str > a);
+ ASSERT_TRUE(c > str);
+ ASSERT_TRUE(str <= b);
+ ASSERT_TRUE(b <= str);
+ ASSERT_TRUE(str >= b);
+ ASSERT_TRUE(b >= str);
+ }
+ {
+ cm::String const a("a");
+ cm::String const b("b");
+ cm::String const c("c");
+ ASSERT_TRUE(str == b);
+ ASSERT_TRUE(b == str);
+ ASSERT_TRUE(str != a);
+ ASSERT_TRUE(a != str);
+ ASSERT_TRUE(str < c);
+ ASSERT_TRUE(a < str);
+ ASSERT_TRUE(str > a);
+ ASSERT_TRUE(c > str);
+ ASSERT_TRUE(str <= b);
+ ASSERT_TRUE(b <= str);
+ ASSERT_TRUE(str >= b);
+ ASSERT_TRUE(b >= str);
+ }
+ return true;
+}
+
+static bool testOperatorStream()
+{
+ std::cout << "testOperatorStream()\n";
+ std::ostringstream ss;
+ ss << "a" << cm::String("b") << 'c';
+ ASSERT_TRUE(ss.str() == "abc");
+ return true;
+}
+
+static bool testOperatorStdStringPlusEqual()
+{
+ std::cout << "testOperatorStdStringPlusEqual()\n";
+ std::string s = "a";
+ s += cm::String("b");
+ ASSERT_TRUE(s == "ab");
+ return true;
+}
+
+static bool testMethod_borrow()
+{
+ std::cout << "testMethod_borrow()\n";
+ std::string s = "abc";
+ cm::String str = cm::String::borrow(s);
+ ASSERT_TRUE(str.data() == s.data());
+ ASSERT_TRUE(str.size() == s.size());
+ ASSERT_TRUE(str == s);
+ return true;
+}
+
+static bool testMethod_view()
+{
+ std::cout << "testMethod_view()\n";
+ cm::String str;
+ ASSERT_TRUE(str.view().data() == nullptr);
+ ASSERT_TRUE(str.view().size() == 0);
+ str = charArray;
+ ASSERT_TRUE(str.view().data() != charArray);
+ ASSERT_TRUE(str.view().size() == sizeof(charArray) - 1);
+ str = std::string("abc");
+ ASSERT_TRUE(str.view().size() == 3);
+ ASSERT_TRUE(strncmp(str.view().data(), "abc", 3) == 0);
+ return true;
+}
+
+static bool testMethod_empty()
+{
+ std::cout << "testMethod_empty()\n";
+ cm::String str;
+ ASSERT_TRUE(str.empty());
+ str = "";
+ ASSERT_TRUE(str.empty());
+ str = "abc";
+ ASSERT_TRUE(!str.empty());
+ str = std::string();
+ ASSERT_TRUE(str.empty());
+ str = std::string("abc");
+ ASSERT_TRUE(!str.empty());
+ return true;
+}
+
+static bool testMethod_length()
+{
+ std::cout << "testMethod_length()\n";
+ cm::String str;
+ ASSERT_TRUE(str.length() == 0);
+ str = "";
+ ASSERT_TRUE(str.length() == 0);
+ str = "abc";
+ ASSERT_TRUE(str.length() == 3);
+ str = std::string();
+ ASSERT_TRUE(str.length() == 0);
+ str = std::string("abc");
+ ASSERT_TRUE(str.length() == 3);
+ return true;
+}
+
+static bool testMethod_at()
+{
+ std::cout << "testMethod_at()\n";
+ cm::String str = "abc";
+ ASSERT_TRUE(str.at(0) == 'a');
+ ASSERT_TRUE(str.at(1) == 'b');
+ ASSERT_TRUE(str.at(2) == 'c');
+ bool except_out_of_range = false;
+ try {
+ str.at(3);
+ } catch (std::out_of_range&) {
+ except_out_of_range = true;
+ }
+ ASSERT_TRUE(except_out_of_range);
+ return true;
+}
+
+static bool testMethod_front_back()
+{
+ std::cout << "testMethod_front_back()\n";
+ cm::String str = "abc";
+ ASSERT_TRUE(str.front() == 'a');
+ ASSERT_TRUE(str.back() == 'c');
+ return true;
+}
+
+static bool testMethodIterators()
+{
+ std::cout << "testMethodIterators()\n";
+ cm::String str = "abc";
+ ASSERT_TRUE(*str.begin() == 'a');
+ ASSERT_TRUE(*(str.end() - 1) == 'c');
+ ASSERT_TRUE(str.end() - str.begin() == 3);
+ ASSERT_TRUE(*str.cbegin() == 'a');
+ ASSERT_TRUE(*(str.cend() - 1) == 'c');
+ ASSERT_TRUE(str.cend() - str.cbegin() == 3);
+ ASSERT_TRUE(*str.rbegin() == 'c');
+ ASSERT_TRUE(*(str.rend() - 1) == 'a');
+ ASSERT_TRUE(str.rend() - str.rbegin() == 3);
+ ASSERT_TRUE(*str.crbegin() == 'c');
+ ASSERT_TRUE(*(str.crend() - 1) == 'a');
+ ASSERT_TRUE(str.crend() - str.crbegin() == 3);
+ return true;
+}
+
+static bool testMethod_clear()
+{
+ std::cout << "testMethod_clear()\n";
+ cm::String str = "abc";
+ ASSERT_TRUE(!str.empty());
+ str.clear();
+ ASSERT_TRUE(str.empty());
+ return true;
+}
+
+static bool testMethod_insert()
+{
+ std::cout << "testMethod_insert()\n";
+ cm::String str = "abc";
+ str.insert(1, 2, 'd').insert(0, 1, '_');
+ ASSERT_TRUE(str.size() == 6);
+ ASSERT_TRUE(std::strncmp(str.data(), "_addbc", 6) == 0);
+ return true;
+}
+
+static bool testMethod_erase()
+{
+ std::cout << "testMethod_erase()\n";
+ cm::String str = "abcdefg";
+ str.erase(5).erase(1, 2);
+ ASSERT_TRUE(str.size() == 3);
+ ASSERT_TRUE(std::strncmp(str.data(), "ade", 3) == 0);
+ return true;
+}
+
+static bool testMethod_push_back()
+{
+ std::cout << "testMethod_push_back()\n";
+ cm::String str = "abc";
+ str.push_back('d');
+ ASSERT_TRUE(str == "abcd");
+ return true;
+}
+
+static bool testMethod_pop_back()
+{
+ std::cout << "testMethod_pop_back()\n";
+ cm::String str = "abc";
+ str.pop_back();
+ ASSERT_TRUE(str == "ab");
+ return true;
+}
+
+static bool testMethod_replace()
+{
+ std::cout << "testMethod_replace()\n";
+ {
+ cm::String str = "abcd";
+ const char* bc = "bc";
+ ASSERT_TRUE(str.replace(1, 2, "BC") == "aBCd");
+ ASSERT_TRUE(str.replace(1, 2, bc) == "abcd");
+ ASSERT_TRUE(str.replace(1, 2, 'x') == "axd");
+ ASSERT_TRUE(str.replace(1, 1, std::string("bc")) == "abcd");
+ ASSERT_TRUE(str.replace(1, 2, cm::string_view("BC", 2)) == "aBCd");
+ ASSERT_TRUE(str.replace(1, 2, cm::String("bc")) == "abcd");
+ }
+ {
+ cm::String str = "abcd";
+ const char* bc = "bc";
+ ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, "BC") == "aBCd");
+ ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, bc) == "abcd");
+ ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, 'x') == "axd");
+ ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 2,
+ std::string("bc")) == "abcd");
+ ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3,
+ cm::string_view("BC", 2)) == "aBCd");
+ ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3,
+ cm::String("bc")) == "abcd");
+ }
+ {
+ cm::String str = "abcd";
+ const char* bc = "_bc";
+ ASSERT_TRUE(str.replace(1, 2, "_BC_", 1, 2) == "aBCd");
+ ASSERT_TRUE(str.replace(1, 2, bc, 1) == "abcd");
+ ASSERT_TRUE(str.replace(1, 2, 'x', 0) == "axd");
+ ASSERT_TRUE(str.replace(1, 1, std::string("_bc_"), 1, 2) == "abcd");
+ ASSERT_TRUE(str.replace(1, 2, cm::string_view("_BC", 3), 1) == "aBCd");
+ ASSERT_TRUE(str.replace(1, 2, cm::String("_bc_"), 1, 2) == "abcd");
+ }
+ {
+ cm::String str = "abcd";
+ const char* bc = "_bc_";
+ ASSERT_TRUE(str.replace(1, 2, 2, 'x') == "axxd");
+ ASSERT_TRUE(str.replace(str.begin() + 1, str.begin() + 3, 2, 'y') ==
+ "ayyd");
+ ASSERT_TRUE(
+ str.replace(str.begin() + 1, str.begin() + 3, bc + 1, bc + 3) == "abcd");
+ }
+ return true;
+}
+
+static bool testMethod_copy()
+{
+ std::cout << "testMethod_copy()\n";
+ cm::String str = "abc";
+ char dest[2];
+ cm::String::size_type n = str.copy(dest, 2, 1);
+ ASSERT_TRUE(n == 2);
+ ASSERT_TRUE(std::strncmp(dest, "bc", 2) == 0);
+ n = str.copy(dest, 2);
+ ASSERT_TRUE(n == 2);
+ ASSERT_TRUE(std::strncmp(dest, "ab", 2) == 0);
+ return true;
+}
+
+static bool testMethod_resize()
+{
+ std::cout << "testMethod_resize()\n";
+ cm::String str = "abc";
+ str.resize(3);
+ ASSERT_TRUE(str == "abc");
+ str.resize(2);
+ ASSERT_TRUE(str == "ab");
+ str.resize(3, 'c');
+ ASSERT_TRUE(str == "abc");
+ return true;
+}
+
+static bool testMethod_swap()
+{
+ std::cout << "testMethod_swap()\n";
+ cm::String str1 = std::string("1");
+ cm::String str2 = std::string("2");
+ str1.swap(str2);
+ ASSERT_TRUE(str1 == "2");
+ ASSERT_TRUE(str2 == "1");
+ return true;
+}
+
+static bool testMethod_substr_AtEnd(cm::String str)
+{
+ cm::String substr = str.substr(1);
+ ASSERT_TRUE(substr.data() == str.data() + 1);
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(!substr.is_stable());
+
+ // c_str() at the end of the buffer does not internally mutate.
+ ASSERT_TRUE(std::strcmp(substr.c_str(), "bc") == 0);
+ ASSERT_TRUE(substr.c_str() == str.data() + 1);
+ ASSERT_TRUE(substr.data() == str.data() + 1);
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(!substr.is_stable());
+
+ // str() internally mutates.
+ ASSERT_TRUE(substr.str() == "bc");
+ ASSERT_TRUE(substr.is_stable());
+ ASSERT_TRUE(substr.data() != str.data() + 1);
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(substr.c_str() != str.data() + 1);
+ ASSERT_TRUE(std::strcmp(substr.c_str(), "bc") == 0);
+ return true;
+}
+
+static bool testMethod_substr_AtEndBorrowed()
+{
+ std::cout << "testMethod_substr_AtEndBorrowed()\n";
+ return testMethod_substr_AtEnd("abc"_s);
+}
+
+static bool testMethod_substr_AtEndOwned()
+{
+ std::cout << "testMethod_substr_AtEndOwned()\n";
+ return testMethod_substr_AtEnd(std::string("abc"));
+}
+
+static bool testMethod_substr_AtStart(cm::String str)
+{
+ {
+ cm::String substr = str.substr(0, 2);
+ ASSERT_TRUE(substr.data() == str.data());
+ ASSERT_TRUE(substr.size() == 2);
+
+ // c_str() not at the end of the buffer internally mutates.
+ const char* substr_c = substr.c_str();
+ ASSERT_TRUE(std::strcmp(substr_c, "ab") == 0);
+ ASSERT_TRUE(substr_c != str.data());
+ ASSERT_TRUE(substr.data() != str.data());
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(substr.is_stable());
+
+ // str() does not need to internally mutate after c_str() did so
+ ASSERT_TRUE(substr.str() == "ab");
+ ASSERT_TRUE(substr.is_stable());
+ ASSERT_TRUE(substr.data() == substr_c);
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(substr.c_str() == substr_c);
+ }
+
+ {
+ cm::String substr = str.substr(0, 2);
+ ASSERT_TRUE(substr.data() == str.data());
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(!substr.is_stable());
+
+ // str() internally mutates.
+ ASSERT_TRUE(substr.str() == "ab");
+ ASSERT_TRUE(substr.is_stable());
+ ASSERT_TRUE(substr.data() != str.data());
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(substr.c_str() != str.data());
+
+ // c_str() does not internally after str() did so
+ const char* substr_c = substr.c_str();
+ ASSERT_TRUE(std::strcmp(substr_c, "ab") == 0);
+ ASSERT_TRUE(substr_c == substr.data());
+ ASSERT_TRUE(substr.size() == 2);
+ ASSERT_TRUE(substr.is_stable());
+ }
+
+ return true;
+}
+
+static bool testMethod_substr_AtStartBorrowed()
+{
+ std::cout << "testMethod_substr_AtStartBorrowed()\n";
+ return testMethod_substr_AtStart("abc"_s);
+}
+
+static bool testMethod_substr_AtStartOwned()
+{
+ std::cout << "testMethod_substr_AtStartOwned()\n";
+ return testMethod_substr_AtStart(std::string("abc"));
+}
+
+static bool testMethod_compare()
+{
+ std::cout << "testMethod_compare()\n";
+ cm::String str = "b";
+ ASSERT_TRUE(str.compare("a") > 0);
+ ASSERT_TRUE(str.compare("b") == 0);
+ ASSERT_TRUE(str.compare("c") < 0);
+ {
+ const char* a = "a";
+ const char* b = "b";
+ const char* c = "c";
+ ASSERT_TRUE(str.compare(a) > 0);
+ ASSERT_TRUE(str.compare(b) == 0);
+ ASSERT_TRUE(str.compare(c) < 0);
+ }
+ ASSERT_TRUE(str.compare('a') > 0);
+ ASSERT_TRUE(str.compare('b') == 0);
+ ASSERT_TRUE(str.compare('c') < 0);
+ ASSERT_TRUE(str.compare(std::string("a")) > 0);
+ ASSERT_TRUE(str.compare(std::string("b")) == 0);
+ ASSERT_TRUE(str.compare(std::string("c")) < 0);
+ ASSERT_TRUE(str.compare(cm::string_view("a_", 1)) > 0);
+ ASSERT_TRUE(str.compare(cm::string_view("b_", 1)) == 0);
+ ASSERT_TRUE(str.compare(cm::string_view("c_", 1)) < 0);
+ ASSERT_TRUE(str.compare(cm::String("a")) > 0);
+ ASSERT_TRUE(str.compare(cm::String("b")) == 0);
+ ASSERT_TRUE(str.compare(cm::String("c")) < 0);
+ ASSERT_TRUE(str.compare(0, 1, cm::string_view("a", 1)) > 0);
+ ASSERT_TRUE(str.compare(1, 0, cm::string_view("", 0)) == 0);
+ ASSERT_TRUE(str.compare(0, 1, cm::string_view("ac", 2), 1, 1) < 0);
+ ASSERT_TRUE(str.compare(1, 0, "") == 0);
+ ASSERT_TRUE(str.compare(1, 0, "_", 0) == 0);
+ return true;
+}
+
+static bool testMethod_find()
+{
+ std::cout << "testMethod_find()\n";
+ cm::String str = "abcabc";
+ ASSERT_TRUE(str.find("a") == 0);
+ ASSERT_TRUE(str.find("a", 1) == 3);
+ {
+ const char* a = "a";
+ ASSERT_TRUE(str.find(a) == 0);
+ ASSERT_TRUE(str.find(a, 1) == 3);
+ }
+ ASSERT_TRUE(str.find('a') == 0);
+ ASSERT_TRUE(str.find('a', 1) == 3);
+ ASSERT_TRUE(str.find(std::string("a")) == 0);
+ ASSERT_TRUE(str.find(std::string("a"), 1) == 3);
+ ASSERT_TRUE(str.find(cm::string_view("a_", 1)) == 0);
+ ASSERT_TRUE(str.find(cm::string_view("a_", 1), 1) == 3);
+ ASSERT_TRUE(str.find(cm::String("a")) == 0);
+ ASSERT_TRUE(str.find(cm::String("a"), 1) == 3);
+ ASSERT_TRUE(str.find("ab_", 1, 2) == 3);
+ return true;
+}
+
+static bool testMethod_rfind()
+{
+ std::cout << "testMethod_rfind()\n";
+ cm::String str = "abcabc";
+ ASSERT_TRUE(str.rfind("a") == 3);
+ ASSERT_TRUE(str.rfind("a", 1) == 0);
+ {
+ const char* a = "a";
+ ASSERT_TRUE(str.rfind(a) == 3);
+ ASSERT_TRUE(str.rfind(a, 1) == 0);
+ }
+ ASSERT_TRUE(str.rfind('a') == 3);
+ ASSERT_TRUE(str.rfind('a', 1) == 0);
+ ASSERT_TRUE(str.rfind(std::string("a")) == 3);
+ ASSERT_TRUE(str.rfind(std::string("a"), 1) == 0);
+ ASSERT_TRUE(str.rfind(cm::string_view("a_", 1)) == 3);
+ ASSERT_TRUE(str.rfind(cm::string_view("a_", 1), 1) == 0);
+ ASSERT_TRUE(str.rfind(cm::String("a")) == 3);
+ ASSERT_TRUE(str.rfind(cm::String("a"), 1) == 0);
+ ASSERT_TRUE(str.rfind("ab_", 1, 2) == 0);
+ return true;
+}
+
+static bool testMethod_find_first_of()
+{
+ std::cout << "testMethod_find_first_of()\n";
+ cm::String str = "abcabc";
+ ASSERT_TRUE(str.find_first_of("_a") == 0);
+ ASSERT_TRUE(str.find_first_of("_a", 1) == 3);
+ {
+ const char* a = "_a";
+ ASSERT_TRUE(str.find_first_of(a) == 0);
+ ASSERT_TRUE(str.find_first_of(a, 1) == 3);
+ }
+ ASSERT_TRUE(str.find_first_of('a') == 0);
+ ASSERT_TRUE(str.find_first_of('a', 1) == 3);
+ ASSERT_TRUE(str.find_first_of(std::string("_a")) == 0);
+ ASSERT_TRUE(str.find_first_of(std::string("_a"), 1) == 3);
+ ASSERT_TRUE(str.find_first_of(cm::string_view("ba_", 1)) == 1);
+ ASSERT_TRUE(str.find_first_of(cm::string_view("ba_", 1), 2) == 4);
+ ASSERT_TRUE(str.find_first_of(cm::String("ab")) == 0);
+ ASSERT_TRUE(str.find_first_of(cm::String("ab"), 2) == 3);
+ ASSERT_TRUE(str.find_first_of("_ab", 1, 2) == 3);
+ return true;
+}
+
+static bool testMethod_find_first_not_of()
+{
+ std::cout << "testMethod_find_first_not_of()\n";
+ cm::String str = "abcabc";
+ ASSERT_TRUE(str.find_first_not_of("_a") == 1);
+ ASSERT_TRUE(str.find_first_not_of("_a", 2) == 2);
+ {
+ const char* a = "_a";
+ ASSERT_TRUE(str.find_first_not_of(a) == 1);
+ ASSERT_TRUE(str.find_first_not_of(a, 2) == 2);
+ }
+ ASSERT_TRUE(str.find_first_not_of('a') == 1);
+ ASSERT_TRUE(str.find_first_not_of('a', 2) == 2);
+ ASSERT_TRUE(str.find_first_not_of(std::string("_a")) == 1);
+ ASSERT_TRUE(str.find_first_not_of(std::string("_a"), 2) == 2);
+ ASSERT_TRUE(str.find_first_not_of(cm::string_view("ba_", 1)) == 0);
+ ASSERT_TRUE(str.find_first_not_of(cm::string_view("ba_", 1), 1) == 2);
+ ASSERT_TRUE(str.find_first_not_of(cm::String("_a")) == 1);
+ ASSERT_TRUE(str.find_first_not_of(cm::String("_a"), 2) == 2);
+ ASSERT_TRUE(str.find_first_not_of("_bca", 1, 3) == 3);
+ return true;
+}
+
+static bool testMethod_find_last_of()
+{
+ std::cout << "testMethod_find_last_of()\n";
+ cm::String str = "abcabc";
+ ASSERT_TRUE(str.find_last_of("_a") == 3);
+ ASSERT_TRUE(str.find_last_of("_a", 1) == 0);
+ {
+ const char* a = "_a";
+ ASSERT_TRUE(str.find_last_of(a) == 3);
+ ASSERT_TRUE(str.find_last_of(a, 1) == 0);
+ }
+ ASSERT_TRUE(str.find_last_of('a') == 3);
+ ASSERT_TRUE(str.find_last_of('a', 1) == 0);
+ ASSERT_TRUE(str.find_last_of(std::string("_a")) == 3);
+ ASSERT_TRUE(str.find_last_of(std::string("_a"), 1) == 0);
+ ASSERT_TRUE(str.find_last_of(cm::string_view("ba_", 1)) == 4);
+ ASSERT_TRUE(str.find_last_of(cm::string_view("ba_", 1), 2) == 1);
+ ASSERT_TRUE(str.find_last_of(cm::String("ab")) == 4);
+ ASSERT_TRUE(str.find_last_of(cm::String("ab"), 2) == 1);
+ ASSERT_TRUE(str.find_last_of("_ab", 1, 2) == 0);
+ return true;
+}
+
+static bool testMethod_find_last_not_of()
+{
+ std::cout << "testMethod_find_last_not_of()\n";
+ cm::String str = "abcabc";
+ ASSERT_TRUE(str.find_last_not_of("_a") == 5);
+ ASSERT_TRUE(str.find_last_not_of("_a", 1) == 1);
+ {
+ const char* a = "_a";
+ ASSERT_TRUE(str.find_last_not_of(a) == 5);
+ ASSERT_TRUE(str.find_last_not_of(a, 1) == 1);
+ }
+ ASSERT_TRUE(str.find_last_not_of('a') == 5);
+ ASSERT_TRUE(str.find_last_not_of('a', 1) == 1);
+ ASSERT_TRUE(str.find_last_not_of(std::string("_a")) == 5);
+ ASSERT_TRUE(str.find_last_not_of(std::string("_a"), 1) == 1);
+ ASSERT_TRUE(str.find_last_not_of(cm::string_view("cb_", 1)) == 4);
+ ASSERT_TRUE(str.find_last_not_of(cm::string_view("cb_", 1), 2) == 1);
+ ASSERT_TRUE(str.find_last_not_of(cm::String("_a")) == 5);
+ ASSERT_TRUE(str.find_last_not_of(cm::String("_a"), 1) == 1);
+ ASSERT_TRUE(str.find_last_not_of("cb_", 2, 2) == 0);
+ return true;
+}
+
+static bool testAddition()
+{
+ std::cout << "testAddition()\n";
+ {
+ ASSERT_TRUE(cm::String("a") + "b" == "ab");
+ ASSERT_TRUE("ab" == "a" + cm::String("b"));
+ ASSERT_TRUE("a" + cm::String("b") + "c" == "abc");
+ ASSERT_TRUE("abc" == "a" + cm::String("b") + "c");
+ ASSERT_TRUE("a" + (cm::String("b") + "c") + "d" == "abcd");
+ ASSERT_TRUE("abcd" == "a" + (cm::String("b") + "c") + "d");
+ }
+ {
+ ASSERT_TRUE(cm::String("a"_s) + "b"_s == "ab"_s);
+ ASSERT_TRUE("ab"_s == "a"_s + cm::String("b"_s));
+ ASSERT_TRUE("a"_s + cm::String("b"_s) + "c"_s == "abc"_s);
+ ASSERT_TRUE("abc"_s == "a"_s + cm::String("b"_s) + "c"_s);
+ ASSERT_TRUE("a"_s + (cm::String("b"_s) + "c"_s) + "d"_s == "abcd"_s);
+ ASSERT_TRUE("abcd"_s == "a"_s + (cm::String("b"_s) + "c"_s) + "d"_s);
+ }
+ {
+ const char* a = "a";
+ const char* b = "b";
+ const char* ab = "ab";
+ ASSERT_TRUE(cm::String(a) + b == ab);
+ ASSERT_TRUE(ab == a + cm::String(b));
+ const char* c = "c";
+ const char* abc = "abc";
+ ASSERT_TRUE(a + cm::String(b) + c == abc);
+ ASSERT_TRUE(abc == a + cm::String(b) + c);
+ const char* d = "d";
+ const char* abcd = "abcd";
+ ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd);
+ ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d);
+ }
+ {
+ ASSERT_TRUE(cm::String('a') + 'b' == "ab");
+ ASSERT_TRUE("ab" == 'a' + cm::String('b'));
+ ASSERT_TRUE('a' + cm::String('b') + 'c' == "abc");
+ ASSERT_TRUE("abc" == 'a' + cm::String('b') + 'c');
+ ASSERT_TRUE('a' + (cm::String('b') + 'c') + 'd' == "abcd");
+ ASSERT_TRUE("abcd" == 'a' + (cm::String('b') + 'c') + 'd');
+ }
+ {
+ std::string a = "a";
+ std::string b = "b";
+ std::string ab = "ab";
+ ASSERT_TRUE(cm::String(a) + b == ab);
+ ASSERT_TRUE(ab == a + cm::String(b));
+ std::string c = "c";
+ std::string abc = "abc";
+ ASSERT_TRUE(a + cm::String(b) + c == abc);
+ ASSERT_TRUE(abc == a + cm::String(b) + c);
+ std::string d = "d";
+ std::string abcd = "abcd";
+ ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd);
+ ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d);
+ }
+ {
+ cm::string_view a("a", 1);
+ cm::string_view b("b", 1);
+ cm::string_view ab("ab", 2);
+ ASSERT_TRUE(cm::String(a) + b == ab);
+ ASSERT_TRUE(ab == a + cm::String(b));
+ cm::string_view c("c", 1);
+ cm::string_view abc("abc", 3);
+ ASSERT_TRUE(a + cm::String(b) + c == abc);
+ ASSERT_TRUE(abc == a + cm::String(b) + c);
+ cm::string_view d("d", 1);
+ cm::string_view abcd("abcd", 4);
+ ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd);
+ ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d);
+ }
+ {
+ cm::String a = "a";
+ cm::String b = "b";
+ cm::String ab = "ab";
+ ASSERT_TRUE(a + b == ab);
+ ASSERT_TRUE(ab == a + b);
+ cm::String c = "c";
+ cm::String abc = "abc";
+ ASSERT_TRUE(a + cm::String(b) + c == abc);
+ ASSERT_TRUE(abc == a + cm::String(b) + c);
+ cm::String d = "d";
+ cm::String abcd = "abcd";
+ ASSERT_TRUE(a + (cm::String(b) + c) + d == abcd);
+ ASSERT_TRUE(abcd == a + (cm::String(b) + c) + d);
+ }
+ {
+ cm::String str;
+ str += "a" + cm::String("b") + 'c';
+ ASSERT_TRUE(str == "abc");
+ ASSERT_TRUE(str.is_stable());
+ }
+ {
+ std::string s;
+ s += "a" + cm::String("b") + 'c';
+ ASSERT_TRUE(s == "abc");
+ }
+ {
+ std::ostringstream ss;
+ ss << ("a" + cm::String("b") + 'c');
+ ASSERT_TRUE(ss.str() == "abc");
+ }
+ return true;
+}
+
+static bool testStability()
+{
+ std::cout << "testStability()\n";
+ cm::String str = "abc"_s;
+ ASSERT_TRUE(!str.is_stable());
+ ASSERT_TRUE(str.str_if_stable() == nullptr);
+ str.stabilize();
+ ASSERT_TRUE(str.is_stable());
+ std::string const* str_if_stable = str.str_if_stable();
+ ASSERT_TRUE(str_if_stable != nullptr);
+ ASSERT_TRUE(*str_if_stable == "abc");
+ str.stabilize();
+ ASSERT_TRUE(str.is_stable());
+ ASSERT_TRUE(str.str_if_stable() == str_if_stable);
+ return true;
+}
+
+int testString(int /*unused*/, char* /*unused*/ [])
+{
+ if (!testConstructDefault()) {
+ return 1;
+ }
+ if (!testConstructFromNullPtr()) {
+ return 1;
+ }
+ if (!testConstructFromCStrNull()) {
+ return 1;
+ }
+ if (!testConstructFromCharArray()) {
+ return 1;
+ }
+ if (!testConstructFromCStr()) {
+ return 1;
+ }
+ if (!testConstructFromStdString()) {
+ return 1;
+ }
+ if (!testConstructFromView()) {
+ return 1;
+ }
+ if (!testConstructFromChar()) {
+ return 1;
+ }
+ if (!testConstructFromInitList()) {
+ return 1;
+ }
+ if (!testConstructFromBuffer()) {
+ return 1;
+ }
+ if (!testConstructFromInputIterator()) {
+ return 1;
+ }
+ if (!testConstructFromN()) {
+ return 1;
+ }
+ if (!testConstructFromStaticStringView()) {
+ return 1;
+ }
+ if (!testConstructCopy()) {
+ return 1;
+ }
+ if (!testConstructMove()) {
+ return 1;
+ }
+ if (!testAssignCopy()) {
+ return 1;
+ }
+ if (!testAssignMove()) {
+ return 1;
+ }
+ if (!testAssignFromChar()) {
+ return 1;
+ }
+ if (!testAssignFromView()) {
+ return 1;
+ }
+ if (!testAssignFromStdString()) {
+ return 1;
+ }
+ if (!testAssignFromCStr()) {
+ return 1;
+ }
+ if (!testAssignFromCharArray()) {
+ return 1;
+ }
+ if (!testAssignFromCStrNull()) {
+ return 1;
+ }
+ if (!testAssignFromNullPtr()) {
+ return 1;
+ }
+ if (!testAssignFromInitList()) {
+ return 1;
+ }
+ if (!testAssignFromStaticStringView()) {
+ return 1;
+ }
+ if (!testOperatorBool()) {
+ return 1;
+ }
+ if (!testOperatorIndex()) {
+ return 1;
+ }
+ if (!testOperatorPlusEqual()) {
+ return 1;
+ }
+ if (!testOperatorCompare()) {
+ return 1;
+ }
+ if (!testOperatorStream()) {
+ return 1;
+ }
+ if (!testOperatorStdStringPlusEqual()) {
+ return 1;
+ }
+ if (!testMethod_borrow()) {
+ return 1;
+ }
+ if (!testMethod_view()) {
+ return 1;
+ }
+ if (!testMethod_empty()) {
+ return 1;
+ }
+ if (!testMethod_length()) {
+ return 1;
+ }
+ if (!testMethod_at()) {
+ return 1;
+ }
+ if (!testMethod_front_back()) {
+ return 1;
+ }
+ if (!testMethod_clear()) {
+ return 1;
+ }
+ if (!testMethod_insert()) {
+ return 1;
+ }
+ if (!testMethod_erase()) {
+ return 1;
+ }
+ if (!testMethod_push_back()) {
+ return 1;
+ }
+ if (!testMethod_pop_back()) {
+ return 1;
+ }
+ if (!testMethod_replace()) {
+ return 1;
+ }
+ if (!testMethod_copy()) {
+ return 1;
+ }
+ if (!testMethod_resize()) {
+ return 1;
+ }
+ if (!testMethod_swap()) {
+ return 1;
+ }
+ if (!testMethodIterators()) {
+ return 1;
+ }
+ if (!testMethod_substr_AtEndBorrowed()) {
+ return 1;
+ }
+ if (!testMethod_substr_AtEndOwned()) {
+ return 1;
+ }
+ if (!testMethod_substr_AtStartBorrowed()) {
+ return 1;
+ }
+ if (!testMethod_substr_AtStartOwned()) {
+ return 1;
+ }
+ if (!testMethod_compare()) {
+ return 1;
+ }
+ if (!testMethod_find()) {
+ return 1;
+ }
+ if (!testMethod_rfind()) {
+ return 1;
+ }
+ if (!testMethod_find_first_of()) {
+ return 1;
+ }
+ if (!testMethod_find_first_not_of()) {
+ return 1;
+ }
+ if (!testMethod_find_last_of()) {
+ return 1;
+ }
+ if (!testMethod_find_last_not_of()) {
+ return 1;
+ }
+ if (!testAddition()) {
+ return 1;
+ }
+ if (!testStability()) {
+ return 1;
+ }
+ return 0;
+}
diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx
index 623ad28d9..96a481953 100644
--- a/Tests/CMakeLib/testSystemTools.cxx
+++ b/Tests/CMakeLib/testSystemTools.cxx
@@ -16,11 +16,13 @@
failed = 1
#define cmAssert(exp, m) \
- if ((exp)) { \
- cmPassed(m); \
- } else { \
- cmFailed(m); \
- }
+ do { \
+ if ((exp)) { \
+ cmPassed(m); \
+ } else { \
+ cmFailed(m); \
+ } \
+ } while (false)
int testSystemTools(int /*unused*/, char* /*unused*/ [])
{
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index e165ff7c0..1c1da76a8 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -1,9 +1,9 @@
#include "cmUVHandlePtr.h"
-#include <algorithm>
#include <chrono>
#include <iostream>
#include <thread>
+#include <utility>
#include "cm_uv.h"
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 0de6c416e..431a4921e 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -163,6 +163,49 @@ if(BUILD_TESTING)
set(CPACK_BINARY_NUGET OFF)
endif()
+ if(WIN32)
+ # Macro to search for available Windows CE SDKs in the windows Registry
+ macro(select_wince_sdk selected_reg selected_sdk)
+ if(CMAKE_HOST_WIN32)
+ execute_process(COMMAND reg QUERY "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs"
+ OUTPUT_VARIABLE sdk_reg
+ ERROR_VARIABLE my_err)
+ string(REGEX REPLACE "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows CE Tools\\\\SDKs\\\\" ";" sdk_list "${sdk_reg}")
+ list(LENGTH sdk_list sdk_list_len)
+ if (${sdk_list_len} GREATER 1)
+ list(GET sdk_list 1 _sdk) # The first entry is always empty due to the regex replace above
+ string(STRIP ${_sdk} _sdk) # Make sure there is no newline in the SDK name
+ endif()
+ # Build a key to be used by get_filename_component that is pointing to the SDK directory
+ set(_reg "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs\\${_sdk}]")
+ # Set return values
+ set(${selected_reg} ${_reg})
+ set(${selected_sdk} ${_sdk})
+ endif(CMAKE_HOST_WIN32)
+ endmacro(select_wince_sdk)
+
+ set(reg_vs10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]")
+ set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]")
+ set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]")
+ set(reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]")
+ set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]")
+ set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]")
+ set(reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]")
+ set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]")
+ set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]")
+ select_wince_sdk(reg_wince wince_sdk)
+ set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
+ set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]")
+ foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm)
+ get_filename_component(r "${reg_${reg}}" ABSOLUTE)
+ if(IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry")
+ set(${reg} 1)
+ else()
+ set(${reg} 0)
+ endif()
+ endforeach()
+ endif()
+
#---------------------------------------------------------------------------
# Add tests below here.
@@ -393,6 +436,9 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(PolicyScope PolicyScope)
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
ADD_TEST_MACRO(CompileDefinitions CompileDefinitions)
+ if(CMAKE_Fortran_COMPILER)
+ set(CompileOptions_BUILD_OPTIONS -DTEST_FORTRAN=1)
+ endif()
ADD_TEST_MACRO(CompileOptions CompileOptions)
ADD_TEST_MACRO(CompatibleInterface CompatibleInterface)
ADD_TEST_MACRO(AliasTarget AliasTarget)
@@ -554,7 +600,6 @@ if(BUILD_TESTING)
else()
if (CMAKE_CXX_COMPILER_ID MATCHES "PGI"
OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale"
- OR CMAKE_SYSTEM_NAME MATCHES "IRIX64"
OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(run_pic_test 0)
else()
@@ -1320,18 +1365,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Targets")
if(Qt5Widgets_FOUND AND NOT Qt5Widgets_VERSION VERSION_LESS 5.1.0)
- add_test(Qt4And5Automoc ${CMAKE_CTEST_COMMAND}
+ add_test(Qt4And5AutomocForward ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Qt4And5Automoc"
- "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc"
+ "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward"
${build_generator_args}
--build-project Qt4And5Automoc
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc"
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward"
--force-new-ctest-process
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5Automoc")
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward")
add_test(Qt4And5AutomocReverse ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Qt4And5Automoc"
@@ -1376,10 +1421,26 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindEXPAT)
endif()
+ if(CMake_TEST_FindFontconfig)
+ add_subdirectory(FindFontconfig)
+ endif()
+
if(CMake_TEST_FindFreetype)
add_subdirectory(FindFreetype)
endif()
+ if(CMake_TEST_FindGDAL)
+ add_subdirectory(FindGDAL)
+ endif()
+
+ if(CMake_TEST_FindGIF)
+ add_subdirectory(FindGIF)
+ endif()
+
+ if(CMake_TEST_FindGit)
+ add_subdirectory(FindGit)
+ endif()
+
if(CMake_TEST_FindGSL)
add_subdirectory(FindGSL)
endif()
@@ -1405,10 +1466,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindJsonCpp)
endif()
+ if(CMake_TEST_FindLibLZMA)
+ add_subdirectory(FindLibLZMA)
+ endif()
+
if(CMake_TEST_FindLibRHash)
add_subdirectory(FindLibRHash)
endif()
+ if(CMake_TEST_FindLibinput)
+ add_subdirectory(FindLibinput)
+ endif()
+
if(CMake_TEST_FindLibUV)
add_subdirectory(FindLibUV)
endif()
@@ -1453,10 +1522,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindPatch)
endif()
+ if(CMake_TEST_FindPostgreSQL)
+ add_subdirectory(FindPostgreSQL)
+ endif()
+
if(CMake_TEST_FindProtobuf)
add_subdirectory(FindProtobuf)
endif()
+ if(CMake_TEST_FindSQLite3)
+ add_subdirectory(FindSQLite3)
+ endif()
+
if(CMake_TEST_FindTIFF)
add_subdirectory(FindTIFF)
endif()
@@ -1465,6 +1542,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindVulkan)
endif()
+ if(CMake_TEST_FindX11)
+ add_subdirectory(FindX11)
+ endif()
+
if(CMake_TEST_FindXalanC)
add_subdirectory(FindXalanC)
endif()
@@ -1473,7 +1554,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
add_subdirectory(FindXercesC)
endif()
- if(CMake_TEST_FindPython)
+ if(CMake_TEST_FindPython OR CMake_TEST_FindPython_NumPy)
add_subdirectory(FindPython)
endif()
@@ -1485,13 +1566,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
# Matlab module
# CMake_TEST_FindMatlab: indicates to look for Matlab (from PATH for Linux)
+ # CMake_TEST_FindMatlab_ROOT_DIR: indicates an optional root directory for Matlab, allows to select a version.
# CMake_TEST_FindMatlab_MCR: indicates the MCR is installed
# CMake_TEST_FindMatlab_MCR_ROOT_DIR: indicates an optional root directory for the MCR, required on Linux
- if(CMake_TEST_FindMatlab OR CMake_TEST_FindMatlab_MCR OR (NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL ""))
+ if(CMake_TEST_FindMatlab OR (NOT "${CMake_TEST_FindMatlab_ROOT_DIR}" STREQUAL "") OR
+ CMake_TEST_FindMatlab_MCR OR (NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL ""))
set(FindMatlab_additional_test_options )
if(CMake_TEST_FindMatlab_MCR OR NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL "")
set(FindMatlab_additional_test_options -DIS_MCR=TRUE)
endif()
+ if(NOT "${CMake_TEST_FindMatlab_ROOT_DIR}" STREQUAL "")
+ set(FindMatlab_additional_test_options ${FindMatlab_additional_test_options} "-DMatlab_ROOT_DIR=${CMake_TEST_FindMatlab_ROOT_DIR}")
+ endif()
if(NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL "")
set(FindMatlab_additional_test_options ${FindMatlab_additional_test_options} "-DMCR_ROOT:FILEPATH=${CMake_TEST_FindMatlab_MCR_ROOT_DIR}")
endif()
@@ -1503,6 +1589,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
ADD_TEST_MACRO(FindMatlab.components_checks ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>)
set(FindMatlab.failure_reports_BUILD_OPTIONS ${FindMatlab_additional_test_options})
ADD_TEST_MACRO(FindMatlab.failure_reports ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>)
+ set(FindMatlab.r2018a_check_BUILD_OPTIONS ${FindMatlab_additional_test_options})
+ ADD_TEST_MACRO(FindMatlab.r2018a_check ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>)
endif()
find_package(GTK2 QUIET)
@@ -1550,6 +1638,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir")
+ add_test(NAME ExternalProjectSourceSubdirNotCMake
+ COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/ExternalProjectSourceSubdirNotCMake"
+ "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdirNotCMake"
+ ${build_generator_args}
+ --build-project ExternalProjectSourceSubdirNotCMake
+ --force-new-ctest-process
+ --build-options ${build_options}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdirNotCMake")
+
add_test(ExternalProjectLocal ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/ExternalProjectLocal"
@@ -1600,18 +1700,37 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
DEPENDS ExternalProjectUpdateSetup )
# do each of the tutorial steps
- foreach(STP RANGE 1 7)
- add_test(TutorialStep${STP} ${CMAKE_CTEST_COMMAND}
+ function(add_tutorial_test step_name use_mymath)
+ set(tutorial_test_name Tutorial${step_name})
+ set(tutorial_build_dir "${CMake_BINARY_DIR}/Tests/Tutorial/${step_name}")
+ if (use_mymath)
+ set(tutorial_build_options "")
+ else()
+ set(tutorial_test_name ${tutorial_test_name}_MYMATH)
+ set(tutorial_build_dir "${tutorial_build_dir}_MYMATH")
+ set(tutorial_build_options -DUSE_MYMATH:BOOL=OFF)
+ endif()
+ add_test(${tutorial_test_name} ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}"
- "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}"
- --build-two-config
+ "${CMake_SOURCE_DIR}/Tests/Tutorial/${step_name}"
+ ${tutorial_build_dir}_Build
${build_generator_args}
--build-project Tutorial
- --build-options ${build_options}
+ --build-options ${build_options} ${tutorial_build_options}
--test-command Tutorial 25.0)
- endforeach()
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial")
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/${tutorial_build_dir}_Build")
+ endfunction()
+
+ if(NOT CMake_TEST_EXTERNAL_CMAKE)
+ foreach(STP RANGE 1 11)
+ add_tutorial_test(Step${STP} TRUE)
+ endforeach()
+ add_tutorial_test(Complete TRUE)
+ foreach(STP RANGE 3 11)
+ add_tutorial_test(Step${STP} FALSE)
+ endforeach()
+ add_tutorial_test(Complete FALSE)
+ endif()
add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
--build-and-test
@@ -2082,50 +2201,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
endif()
- if(WIN32)
- # Macro to search for available Windows CE SDKs in the windows Registry
- macro(select_wince_sdk selected_reg selected_sdk)
- if(CMAKE_HOST_WIN32)
- execute_process(COMMAND reg QUERY "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs"
- OUTPUT_VARIABLE sdk_reg
- ERROR_VARIABLE my_err)
- string(REGEX REPLACE "HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Wow6432Node\\\\Microsoft\\\\Windows CE Tools\\\\SDKs\\\\" ";" sdk_list "${sdk_reg}")
- list(LENGTH sdk_list sdk_list_len)
- if (${sdk_list_len} GREATER 1)
- list(GET sdk_list 1 _sdk) # The first entry is always empty due to the regex replace above
- string(STRIP ${_sdk} _sdk) # Make sure there is no newline in the SDK name
- endif()
- # Build a key to be used by get_filename_component that is pointing to the SDK directory
- set(_reg "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows CE Tools\\SDKs\\${_sdk}]")
-
- # Set return values
- set(${selected_reg} ${_reg})
- set(${selected_sdk} ${_sdk})
- endif(CMAKE_HOST_WIN32)
- endmacro(select_wince_sdk)
-
- set(reg_vs10 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;InstallDir]")
- set(reg_vs11 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;InstallDir]")
- set(reg_vs12 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0;InstallDir]")
- set(reg_vs14 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0;InstallDir]")
- set(reg_ws80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]")
- set(reg_ws81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]")
- set(reg_ws10_0 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\Build Tools for Windows 10;srcPath]")
- set(reg_wp80 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]")
- set(reg_wp81 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.1;InstallationFolder]")
- select_wince_sdk(reg_wince wince_sdk)
- set(reg_tegra "[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Nsight Tegra;sdkRoot]")
- set(reg_nasm "[HKEY_CURRENT_USER\\SOFTWARE\\nasm]")
- foreach(reg vs10 vs11 vs12 vs14 ws80 ws81 ws10_0 wp80 wp81 wince tegra nasm)
- get_filename_component(r "${reg_${reg}}" ABSOLUTE)
- if(IS_DIRECTORY "${r}" AND NOT "${r}" STREQUAL "/registry")
- set(${reg} 1)
- else()
- set(${reg} 0)
- endif()
- endforeach()
- endif()
-
get_filename_component(ntver "[HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\CurrentVersion;CurrentVersion]" NAME)
if(WIN32 AND ntver VERSION_GREATER 6.1) # Windows >= 8.0
macro(add_test_VSWinStorePhone name generator systemName systemVersion architecture)
@@ -2219,32 +2294,104 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
endif()
if (CMake_TEST_GreenHillsMULTI)
- macro(add_test_GhsMulti name primaryTarget bspName)
- add_test(NAME GhsMulti.${name} COMMAND ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/GhsMulti"
- "${CMake_BINARY_DIR}/Tests/GhsMulti/${name}"
- --build-generator "Green Hills MULTI"
- --build-project ReturnNum
- --build-config $<CONFIGURATION>
- --build-options -DGHS_PRIMARY_TARGET=${primaryTarget}
- -DGHS_BSP_NAME=${bspName}
- )
- endmacro ()
- add_test_GhsMulti("arm_integrity_simarm" "arm_integrity.tgt" "simarm")
- add_test_GhsMulti("arm64_integrity_simarm" "arm64_integrity.tgt" "simarm")
- add_test(NAME GhsMulti.duplicate_source_filenames
+ macro(add_test_GhsMulti test_name test_dir bin_sub_dir build_opts)
+ separate_arguments(_ghs_build_opts UNIX_COMMAND ${build_opts})
+ separate_arguments(_ghs_toolset_extra UNIX_COMMAND ${ghs_toolset_extra})
+ if(${ARGC} GREATER 4)
+ set(_ghs_test_command --test-command ${ARGN})
+ endif()
+ if(ghs_config_name STREQUAL "__default__")
+ set(_ghs_test_name "${test_name}")
+ else()
+ set(_ghs_test_name "${ghs_config_name}.${test_name}")
+ endif()
+ add_test(NAME GhsMulti.${_ghs_test_name}
COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/GhsMultiDuplicateSourceFilenames"
- "${CMake_BINARY_DIR}/Tests/GhsMultiDuplicateSourceFilenames"
+ "${CMake_SOURCE_DIR}/Tests/GhsMulti/${test_dir}"
+ "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}/${test_dir}/${bin_sub_dir}"
--build-generator "Green Hills MULTI"
- --build-project ReturnNum
+ --build-project test
--build-config $<CONFIGURATION>
- --build-options -DGHS_PRIMARY_TARGET=arm_integrity.tgt
- -DGHS_BSP_NAME="simarm"
+ --build-options ${ghs_target_arch} ${ghs_toolset_name} ${ghs_toolset_root} ${ghs_target_platform}
+ ${ghs_os_root} ${ghs_os_dir} ${ghs_bsp_name} ${_ghs_build_opts} ${_ghs_toolset_extra}
+ ${_ghs_test_command}
)
- endif ()
+ unset(_ghs_build_opts)
+ unset(_ghs_toolset_extra)
+ unset(_ghs_test_command)
+ unset(_ghs_test_name)
+ endmacro()
+ macro(add_test_GhsMulti_rename_install test_name)
+ add_test_GhsMulti( ${test_name} GhsMultiRenameInstall ${test_name}
+ "-DCMAKE_INSTALL_PREFIX=. -DRUN_TEST=${test_name}" ${CMAKE_CMAKE_COMMAND} -P ./cmake_install.cmake)
+ endmacro()
+ #unset ghs config variables
+ unset(ghs_config_name)
+ unset(ghs_target_arch)
+ unset(ghs_toolset_root)
+ unset(ghs_toolset_name)
+ unset(ghs_os_root)
+ unset(ghs_os_dir)
+ unset(ghs_target_platform)
+ unset(ghs_bsp_name)
+ unset(ghs_toolset_extra)
+ if(NOT CMake_TEST_GreenHillsMULTI_config)
+ #if list of config settings not defined then just run once as default
+ set(CMake_TEST_GreenHillsMULTI_config "__default__")
+ endif()
+ foreach(ghs_file IN LISTS CMake_TEST_GreenHillsMULTI_config)
+ # source GHS tools config file
+ if(NOT ghs_file STREQUAL "__default__")
+ if(IS_ABSOLUTE ${ghs_file})
+ include(${ghs_file})
+ else()
+ include(${CMAKE_BINARY_DIR}/${ghs_file})
+ endif()
+ endif()
+ if(NOT ghs_config_name)
+ set(ghs_config_name "__default__")
+ endif()
+ # test integrity build
+ if (NOT ghs_skip_integrity AND (NOT ghs_target_platform OR ghs_target_platform MATCHES "integrity"))
+ add_test_GhsMulti(integrityDDInt GhsMultiIntegrity/GhsMultiIntegrityDDInt "" "")
+ add_test_GhsMulti(integrityMonolith GhsMultiIntegrity/GhsMultiIntegrityMonolith "" "")
+ add_test_GhsMulti(integrityDD GhsMultiIntegrity/GhsMultiIntegrityDD "" "")
+ endif()
+ add_test_GhsMulti(duplicate_source_filenames GhsMultiDuplicateSourceFilenames "" "")
+ add_test_GhsMulti_rename_install(SINGLE_EXEC)
+ add_test_GhsMulti_rename_install(SINGLE_EXEC_RENAMED)
+ add_test_GhsMulti_rename_install(EXEC_AND_LIB)
+ add_test_GhsMulti(multiple_source_groups GhsMultiSrcGroups Default "")
+ add_test_GhsMulti(multiple_source_groups_folders GhsMultiSrcGroups PropFolders "-DTEST_PROP=ON")
+ add_test_GhsMulti(multiple_source_groups_all_folders GhsMultiSrcGroups AllFolders "-DCMAKE_GHS_NO_SOURCE_GROUP_FILE=ON")
+ add_test_GhsMulti(unsupported_targets GhsMultiUnsupportedTargets "" "")
+ add_test_GhsMulti(object_library GhsMultiObjectLibrary "" "")
+ add_test_GhsMulti(exclude GhsMultiExclude "" ""
+ ${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiExclude/verify.cmake)
+ add_test_GhsMulti(interface GhsMultiInterface "" "")
+ add_test_GhsMulti(transitive_link_test GhsMultiLinkTest TransitiveLink "-DRUN_TEST=NO_FLAGS")
+ add_test_GhsMulti(flags_link_test GhsMultiLinkTest FlagsCheck "-DRUN_TEST=CHECK_FLAGS")
+ add_test_GhsMulti(sub_link_test GhsMultiLinkTestSub "" "")
+ add_test_GhsMulti(multiple_projects GhsMultiMultipleProjects "" ""
+ ${CMAKE_CMAKE_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake)
+ add_test_GhsMulti(compiler_options_none GhsMultiCompilerOptions None "-DRUN_TEST=RELEASE_FLAGS -DRUN_TEST_BUILD_TYPE=\"\"")
+ add_test_GhsMulti(compiler_options_kernel GhsMultiCompilerOptions Kernel "-DRUN_TEST=KERNEL_FLAGS -DRUN_TEST_BUILD_TYPE=DEBUG")
+ add_test_GhsMulti(try_compile_copy GhsMultiCopyFile "" "")
+ add_test_GhsMulti(ghs_platform GhsMultiPlatform "" "")
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GhsMulti/${ghs_config_name}")
+ #unset ghs config variables
+ unset(ghs_config_name)
+ unset(ghs_target_arch)
+ unset(ghs_toolset_root)
+ unset(ghs_toolset_name)
+ unset(ghs_os_root)
+ unset(ghs_os_dir)
+ unset(ghs_target_platform)
+ unset(ghs_bsp_name)
+ unset(ghs_toolset_extra)
+ endforeach()
+ endif()
if(tegra AND NOT "${CMake_SOURCE_DIR};${CMake_BINARY_DIR}" MATCHES " ")
macro(add_test_VSNsightTegra name generator)
@@ -2665,7 +2812,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestGTMCoverage PROPERTIES
PASS_REGULAR_EXPRESSION
- "Process file.*ZZCOVTST.m.*Total LOC:.*30.*Percentage Coverage: 80.00*"
+ "Process file.*ZZCOVTST.m.*Total LOC:.*32.*Percentage Coverage: 81.25*"
ENVIRONMENT COVFILE=)
configure_file(
@@ -2683,7 +2830,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
$<TARGET_FILE:ctest> -T Coverage --debug)
set_tests_properties(CTestCacheCoverage PROPERTIES
PASS_REGULAR_EXPRESSION
- "Process file.*ZZCOVTST.m.*Total LOC:.*29.*Percentage Coverage: 86.21.*"
+ "Process file.*ZZCOVTST.m.*Total LOC:.*32.*Percentage Coverage: 87.50.*"
ENVIRONMENT COVFILE=)
# Adding a test case for Python Coverage
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 204d54c2b..f40524faa 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -56,7 +56,7 @@ add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND}
-P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
)
-include(${CMAKE_SOURCE_DIR}/Modules/CMakeParseArguments.cmake)
+include(CMakeParseArguments)
function(add_major_test module)
cmake_parse_arguments(MAJOR_TEST "NOLANG" "VERSION_VAR" "VERSIONS" ${ARGN})
diff --git a/Tests/CMakeTests/FileDownloadInput.png b/Tests/CMakeTests/FileDownloadInput.png
index 7bbcee413..9ab565a1b 100644
--- a/Tests/CMakeTests/FileDownloadInput.png
+++ b/Tests/CMakeTests/FileDownloadInput.png
Binary files differ
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
index f6d9ad99b..39354490b 100644
--- a/Tests/CMakeTests/FileDownloadTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -32,7 +32,7 @@ file(DOWNLOAD
${url}
${dir}/file3.png
TIMEOUT 2
- EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1
+ EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92
)
message(STATUS "FileDownload:4")
@@ -41,7 +41,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA1=50c614fc28b39c1281d0517bb6d5858b4359c9b7
+ EXPECTED_HASH SHA1=67eee17f79d9ac557284fc0b8ad19f25723fb578
)
message(STATUS "FileDownload:5")
@@ -50,7 +50,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA224=73cd5f442b04e8320e4f907f8e1b21d4befff98b5bd77bc32526ea68
+ EXPECTED_HASH SHA224=ba283726bbb602776818b463943189afd91836cb7ee5dd6e2c7b5ae4
)
message(STATUS "FileDownload:6")
@@ -59,7 +59,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA256=2e067f6c09cbc7cd619c8fbcc44eb64cd6b45a95e4cddb3a585eee1f731c4da9
+ EXPECTED_HASH SHA256=cf3334b1275071e1da6e8c396ccb72cf1b2388d8c937526f3af26230affb9423
)
message(STATUS "FileDownload:7")
@@ -68,7 +68,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA384=398bf41902a7251c30e522b307e3e41e3fb617c765b3feaa99b2f7d063894708ad399267ccc25d877437a10e5e890d35
+ EXPECTED_HASH SHA384=43a5d13978d97c660db44481aee0604cb4ff6ca0775cd5c2cd68cd8000e107e507c4caf6c228941231041e282ffb8950
)
message(STATUS "FileDownload:8")
@@ -77,7 +77,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA512=c51854d21052713968b849c2b4263cf54be03bc3a7e9847a6c71c6c8d1d13cd805fe1b9fa95f9ba1d0a5631513974f6fae21e34ab5b171d94bad48df5f073e48
+ EXPECTED_HASH SHA512=6984e0909a1018030ccaa418e3be1654223cdccff0fe6adc745f9aea7e377f178be53b9fc7d54a6f81c2b62ef9ddcd38ba1978fedf4c5e7139baaf355eefad5b
)
message(STATUS "FileDownload:9")
file(DOWNLOAD
@@ -85,7 +85,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH MD5=d16778650db435bda3a8c3435c3ff5d1
+ EXPECTED_HASH MD5=dbd330d52f4dbd60115d4191904ded92
)
message(STATUS "FileDownload:10")
@@ -94,7 +94,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1
+ EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92
)
message(STATUS "${status}")
diff --git a/Tests/CMakeTests/FileUploadTest.cmake.in b/Tests/CMakeTests/FileUploadTest.cmake.in
index 9e2290988..0e6f08048 100644
--- a/Tests/CMakeTests/FileUploadTest.cmake.in
+++ b/Tests/CMakeTests/FileUploadTest.cmake.in
@@ -35,7 +35,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum
"@CMAKE_CURRENT_BINARY_DIR@/uploads/file1.png"
OUTPUT_VARIABLE sum1
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT sum1 MATCHES "^d16778650db435bda3a8c3435c3ff5d1 .*/uploads/file1.png$")
+if(NOT sum1 MATCHES "^dbd330d52f4dbd60115d4191904ded92 .*/uploads/file1.png$")
message(FATAL_ERROR "file1.png did not upload correctly (sum1='${sum1}')")
endif()
@@ -43,7 +43,7 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E md5sum
"@CMAKE_CURRENT_BINARY_DIR@/uploads/file2.png"
OUTPUT_VARIABLE sum2
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT sum2 MATCHES "^d16778650db435bda3a8c3435c3ff5d1 .*/uploads/file2.png$")
+if(NOT sum2 MATCHES "^dbd330d52f4dbd60115d4191904ded92 .*/uploads/file2.png$")
message(FATAL_ERROR "file2.png did not upload correctly (sum2='${sum2}')")
endif()
diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
index 9157c760b..f01e616f0 100644
--- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
+++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in
@@ -415,78 +415,6 @@ set(hp_f90_64_dirs "/usr/lib/hpux64;/opt/langtools/lib/hpux64")
list(APPEND platforms hp_f90_64)
#-----------------------------------------------------------------------------
-# IRIX
-
-# cc -o32 dummy.c -v
-set(irix64_cc_o32_text "/usr/lib/ld -elf -_SYSTYPE_SVR4 -require_dynamic_link _rld_new_interface -no_unresolved -Wx,-G 0 -o32 -mips2 -call_shared -g0 -KPIC -L/usr/lib/ -nocount /usr/lib/crt1.o -count dummy.o -nocount -lc /usr/lib/crtn.o")
-set(irix64_cc_o32_libs "c")
-set(irix64_cc_o32_dirs "/usr/lib")
-list(APPEND platforms irix64_cc_o32)
-
-# cc -n32 dummy.c -v
-set(irix64_cc_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 /usr/lib32/mips4/crt1.o dummy.o -dont_warn_unused -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_cc_n32_libs "c")
-set(irix64_cc_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_cc_n32)
-
-# cc -64 dummy.c -v
-set(irix64_cc_64_text "/usr/lib32/cmplrs/ld64 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 /usr/lib64/mips4/crt1.o dummy.o -dont_warn_unused -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_cc_64_libs "c")
-set(irix64_cc_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_cc_64)
-
-# CC -o32 dummy.cxx -v
-set(irix64_CC_o32_text "/usr/lib/ld -elf -cxx -woff 134 -_SYSTYPE_SVR4 -require_dynamic_link _rld_new_interface -no_unresolved -Wx,-G 0 -o32 -mips2 -call_shared -g0 -KPIC -L/usr/lib/ -nocount /usr/lib/crt1.o /usr/lib/c++init.o -count dummy.o -nocount -dont_warn_unused -lC -warn_unused -lc /usr/lib/crtn.o")
-set(irix64_CC_o32_libs "C;c")
-set(irix64_CC_o32_dirs "/usr/lib")
-list(APPEND platforms irix64_CC_o32)
-
-# CC -n32 dummy.cxx -v
-set(irix64_CC_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -init _main -fini _fini -no_unresolved -transitive_link -demangle -elf -_SYSTYPE_SVR4 -LANG:std -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 -cxx -woff 134 /usr/lib32/mips4/crt1.o /usr/lib32/c++init.o dummy.o -dont_warn_unused -lCsup -lC -lCio -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_CC_n32_libs "Csup;C;Cio;c")
-set(irix64_CC_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_CC_n32)
-
-# CC -64 dummy.cxx -v
-set(irix64_CC_64_text "/usr/lib32/cmplrs/ld64 -call_shared -init _main -fini _fini -no_unresolved -transitive_link -demangle -elf -_SYSTYPE_SVR4 -LANG:std -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 -cxx -woff 134 /usr/lib64/mips4/crt1.o /usr/lib64/c++init.o dummy.o -dont_warn_unused -lCsup -lC -lCio -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_CC_64_libs "Csup;C;Cio;c")
-set(irix64_CC_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_CC_64)
-
-# f77 -o32 dummy.f -v
-set(irix64_f77_o32_text "/usr/lib/ld -elf -_SYSTYPE_SVR4 -require_dynamic_link _rld_new_interface -no_unresolved -Wx,-G 0 -o32 -mips2 -call_shared -g0 -KPIC -L/usr/lib/ -nocount /usr/lib/crt1.o -count dummy.o -nocount -lftn -lm -lc /usr/lib/crtn.o")
-set(irix64_f77_o32_libs "ftn;m;c")
-set(irix64_f77_o32_dirs "/usr/lib")
-list(APPEND platforms irix64_f77_o32)
-
-# f77 -n32 dummy.f -v
-set(irix64_f77_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 /usr/lib32/mips4/crt1.o dummy.o -dont_warn_unused -lftn -lm -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_f77_n32_libs "ftn;m;c")
-set(irix64_f77_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_f77_n32)
-
-# f77 -64 dummy.f -v
-set(irix64_f77_64_text "/usr/lib32/cmplrs/ld64 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 /usr/lib64/mips4/crt1.o dummy.o -dont_warn_unused -lftn -lm -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_f77_64_libs "ftn;m;c")
-set(irix64_f77_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_f77_64)
-
-# f90 -o32 dummy.f -v
-#f90 ERROR: specified abi -o32 not supported.
-
-# f90 -n32 dummy.f -v
-set(irix64_f90_n32_text "/usr/lib32/cmplrs/ld32 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -n32 -L/usr/lib32/mips4/r10000 -L/usr/lib32/mips4 -L/usr/lib32 /usr/lib32/mips4/crt1.o dummy.o -dont_warn_unused -lfortran -lffio -lftn -lm -Bdynamic -lc /usr/lib32/mips4/crtn.o -warn_unused")
-set(irix64_f90_n32_libs "fortran;ffio;ftn;m;c")
-set(irix64_f90_n32_dirs "/usr/lib32/mips4/r10000;/usr/lib32/mips4;/usr/lib32")
-list(APPEND platforms irix64_f90_n32)
-
-# f90 -64 dummy.f -v
-set(irix64_f90_64_text "/usr/lib32/cmplrs/ld64 -call_shared -no_unresolved -transitive_link -elf -_SYSTYPE_SVR4 -show -mips4 -64 -L/usr/lib64/mips4/r10000 -L/usr/lib64/mips4 -L/usr/lib64 /usr/lib64/mips4/crt1.o dummy.o -dont_warn_unused -lfortran -lffio -lftn -lm -Bdynamic -lc /usr/lib64/mips4/crtn.o -warn_unused")
-set(irix64_f90_64_libs "fortran;ffio;ftn;m;c")
-set(irix64_f90_64_dirs "/usr/lib64/mips4/r10000;/usr/lib64/mips4;/usr/lib64")
-list(APPEND platforms irix64_f90_64)
-
-#-----------------------------------------------------------------------------
# Cygwin
# gcc dummy.c -v
diff --git a/Tests/CMakeTests/StringTest.cmake.in b/Tests/CMakeTests/StringTest.cmake.in
index 566f4b1e2..154afa7f8 100644
--- a/Tests/CMakeTests/StringTest.cmake.in
+++ b/Tests/CMakeTests/StringTest.cmake.in
@@ -81,7 +81,7 @@ check_cmake_test(String
# Execute each test listed in StringTestScript.cmake:
#
set(scriptname "@CMAKE_CURRENT_SOURCE_DIR@/StringTestScript.cmake")
-set(number_of_tests_expected 70)
+set(number_of_tests_expected 74)
include("@CMAKE_CURRENT_SOURCE_DIR@/ExecuteScriptTests.cmake")
execute_all_script_tests(${scriptname} number_of_tests_executed)
diff --git a/Tests/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake
index 44d56531f..e069897b6 100644
--- a/Tests/CMakeTests/StringTestScript.cmake
+++ b/Tests/CMakeTests/StringTestScript.cmake
@@ -1,5 +1,18 @@
message(STATUS "testname='${testname}'")
+function(test_configure_line_number EXPRESSION POLICY)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0053 ${POLICY})
+ string(CONFIGURE
+ "${EXPRESSION}" v) # line should indicate string() call
+ math(EXPR vplus3 "${v} + 3")
+ if(NOT ${CMAKE_CURRENT_LIST_LINE} EQUAL ${vplus3})
+ message(SEND_ERROR "Couldn't configure CMAKE_CURRENT_LIST_LINE, evaluated into '${v}'")
+ endif()
+ message(STATUS "v='${v}'")
+ cmake_policy(POP)
+endfunction()
+
if(testname STREQUAL empty) # fail
string()
@@ -32,6 +45,18 @@ elseif(testname STREQUAL configure_escape_quotes) # pass
string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES)
message(STATUS "v='${v}'")
+elseif(testname STREQUAL configure_line_number_CMP0053_old) # pass
+ test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" OLD)
+
+elseif(testname STREQUAL configure_line_number_CMP0053_new) # pass
+ test_configure_line_number("\${CMAKE_CURRENT_LIST_LINE}" NEW)
+
+elseif(testname STREQUAL configure_line_number_CMP0053_old_use_at) # pass
+ test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" OLD)
+
+elseif(testname STREQUAL configure_line_number_CMP0053_new_use_at) # pass
+ test_configure_line_number("\@CMAKE_CURRENT_LIST_LINE\@" NEW)
+
elseif(testname STREQUAL configure_bogus) # fail
string(CONFIGURE "this is @testname@" v ESCAPE_QUOTES BOGUS)
diff --git a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in
index 670a8745f..0f5678160 100644
--- a/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in
+++ b/Tests/CTestBuildCommandProjectInSubdir/CTestBuildCommandProjectInSubdir.cmake.in
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 2.8.10)
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/VSProjectInSubdir")
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestBuildCommandProjectInSubdir/Nested")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set(CTEST_PROJECT_NAME "VSProjectInSubdir")
set(CTEST_BUILD_CONFIGURATION "@CTestTest_CONFIG@")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
diff --git a/Tests/CTestConfig/script.cmake.in b/Tests/CTestConfig/script.cmake.in
index b6ccedb57..973c7b8c4 100644
--- a/Tests/CTestConfig/script.cmake.in
+++ b/Tests/CTestConfig/script.cmake.in
@@ -1,7 +1,6 @@
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@CMAKE_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@CMAKE_GENERATOR_TOOLSET@")
-set(CTEST_PROJECT_NAME "CTestConfig")
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestConfig")
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestConfig/@cfg@-script")
diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in
index d48ef6130..2c98876b3 100644
--- a/Tests/CTestCoverageCollectGCOV/test.cmake.in
+++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 2.8.12)
-set(CTEST_PROJECT_NAME "TestProject")
set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/TestProject")
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV/TestProject")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
diff --git a/Tests/CTestTestBadExe/CTestConfig.cmake b/Tests/CTestTestBadExe/CTestConfig.cmake
index c7286e2c5..5bc1e9e16 100644
--- a/Tests/CTestTestBadExe/CTestConfig.cmake
+++ b/Tests/CTestTestBadExe/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestBadExe")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestBadGenerator/CTestConfig.cmake b/Tests/CTestTestBadGenerator/CTestConfig.cmake
index 1e61bf441..5bc1e9e16 100644
--- a/Tests/CTestTestBadGenerator/CTestConfig.cmake
+++ b/Tests/CTestTestBadGenerator/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestBadGenerator")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestCostSerial/CTestConfig.cmake b/Tests/CTestTestCostSerial/CTestConfig.cmake
index 3ab99ac5e..bd265f981 100644
--- a/Tests/CTestTestCostSerial/CTestConfig.cmake
+++ b/Tests/CTestTestCostSerial/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestCostSerial")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestCrash/CTestConfig.cmake b/Tests/CTestTestCrash/CTestConfig.cmake
index 5c2ca0ea9..5bc1e9e16 100644
--- a/Tests/CTestTestCrash/CTestConfig.cmake
+++ b/Tests/CTestTestCrash/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestCrash")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestCycle/CTestConfig.cmake b/Tests/CTestTestCycle/CTestConfig.cmake
index 8aeb09b70..5bc1e9e16 100644
--- a/Tests/CTestTestCycle/CTestConfig.cmake
+++ b/Tests/CTestTestCycle/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestCycle")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestDepends/CTestConfig.cmake b/Tests/CTestTestDepends/CTestConfig.cmake
index 7af9200e2..5bc1e9e16 100644
--- a/Tests/CTestTestDepends/CTestConfig.cmake
+++ b/Tests/CTestTestDepends/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestDepends")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestFailure/CTestConfig.cmake b/Tests/CTestTestFailure/CTestConfig.cmake
index 07e1be00c..5bc1e9e16 100644
--- a/Tests/CTestTestFailure/CTestConfig.cmake
+++ b/Tests/CTestTestFailure/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestFailure")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestFdSetSize/CTestConfig.cmake b/Tests/CTestTestFdSetSize/CTestConfig.cmake
deleted file mode 100644
index b5f3c3363..000000000
--- a/Tests/CTestTestFdSetSize/CTestConfig.cmake
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestTestFdSetSize")
diff --git a/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake
index 669b0fb68..c08eded76 100644
--- a/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake
+++ b/Tests/CTestTestLaunchers/launcher_compiler_test_project/CTestConfig.cmake
@@ -1,8 +1,5 @@
set(CTEST_USE_LAUNCHERS 1)
-set(CTEST_PROJECT_NAME "CTestTestLaunchers")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake
index 669b0fb68..c08eded76 100644
--- a/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake
+++ b/Tests/CTestTestLaunchers/launcher_custom_command_test_project/CTestConfig.cmake
@@ -1,8 +1,5 @@
set(CTEST_USE_LAUNCHERS 1)
-set(CTEST_PROJECT_NAME "CTestTestLaunchers")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake b/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake
index 669b0fb68..c08eded76 100644
--- a/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake
+++ b/Tests/CTestTestLaunchers/launcher_linker_test_project/CTestConfig.cmake
@@ -1,8 +1,5 @@
set(CTEST_USE_LAUNCHERS 1)
-set(CTEST_PROJECT_NAME "CTestTestLaunchers")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestParallel/CTestConfig.cmake b/Tests/CTestTestParallel/CTestConfig.cmake
index fc5b6668e..bd265f981 100644
--- a/Tests/CTestTestParallel/CTestConfig.cmake
+++ b/Tests/CTestTestParallel/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestParallel")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestResourceLock/CTestConfig.cmake b/Tests/CTestTestResourceLock/CTestConfig.cmake
index c1187778d..bd265f981 100644
--- a/Tests/CTestTestResourceLock/CTestConfig.cmake
+++ b/Tests/CTestTestResourceLock/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestResourceLock")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestScheduler/CTestConfig.cmake b/Tests/CTestTestScheduler/CTestConfig.cmake
index 797387bdd..bd265f981 100644
--- a/Tests/CTestTestScheduler/CTestConfig.cmake
+++ b/Tests/CTestTestScheduler/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestScheduler")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake
index da0c76b73..5bc1e9e16 100644
--- a/Tests/CTestTestSkipReturnCode/CTestConfig.cmake
+++ b/Tests/CTestTestSkipReturnCode/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestSkipReturnCode")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestStopTime/CTestConfig.cmake b/Tests/CTestTestStopTime/CTestConfig.cmake
index 412283e69..5bc1e9e16 100644
--- a/Tests/CTestTestStopTime/CTestConfig.cmake
+++ b/Tests/CTestTestStopTime/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestStopTime")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestSubdir/CTestConfig.cmake b/Tests/CTestTestSubdir/CTestConfig.cmake
index 47ebb925c..bd265f981 100644
--- a/Tests/CTestTestSubdir/CTestConfig.cmake
+++ b/Tests/CTestTestSubdir/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestSubdir")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestTimeout/CTestConfig.cmake b/Tests/CTestTestTimeout/CTestConfig.cmake
index 13114f1ca..bd265f981 100644
--- a/Tests/CTestTestTimeout/CTestConfig.cmake
+++ b/Tests/CTestTestTimeout/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestTimeout")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestUpload/CTestConfig.cmake b/Tests/CTestTestUpload/CTestConfig.cmake
index a54708838..21318b4fc 100644
--- a/Tests/CTestTestUpload/CTestConfig.cmake
+++ b/Tests/CTestTestUpload/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set (CTEST_PROJECT_NAME "CTestTestUpload")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set (CTEST_DROP_METHOD "http")
set (CTEST_DROP_SITE "open.cdash.org")
set (CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set (CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestVerboseOutput/CTestConfig.cmake b/Tests/CTestTestVerboseOutput/CTestConfig.cmake
index 4f96c79a9..bd265f981 100644
--- a/Tests/CTestTestVerboseOutput/CTestConfig.cmake
+++ b/Tests/CTestTestVerboseOutput/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestVerboseOutput")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestZeroTimeout/CTestConfig.cmake b/Tests/CTestTestZeroTimeout/CTestConfig.cmake
index 60948647f..bd265f981 100644
--- a/Tests/CTestTestZeroTimeout/CTestConfig.cmake
+++ b/Tests/CTestTestZeroTimeout/CTestConfig.cmake
@@ -1,7 +1,4 @@
-set(CTEST_PROJECT_NAME "CTestTestZeroTimeout")
set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set(CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake
index 61aa13b94..0f8ec8e27 100644
--- a/Tests/CTestUpdateCommon.cmake
+++ b/Tests/CTestUpdateCommon.cmake
@@ -130,7 +130,6 @@ function(create_content dir)
# An example CTest project configuration file.
file(WRITE ${TOP}/${dir}/CTestConfig.cmake
"# CTest Configuration File
-set(CTEST_PROJECT_NAME TestProject)
set(CTEST_NIGHTLY_START_TIME \"21:00:00 EDT\")
")
diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt
index c9f171076..15a993c68 100644
--- a/Tests/CompileOptions/CMakeLists.txt
+++ b/Tests/CompileOptions/CMakeLists.txt
@@ -4,6 +4,10 @@ project(CompileOptions)
add_library(testlib other.cpp)
+if(TEST_FORTRAN)
+ enable_language(Fortran)
+endif()
+
add_executable(CompileOptions main.cpp)
macro(get_compiler_test_genex lst lang)
@@ -13,6 +17,9 @@ endmacro()
get_compiler_test_genex(c_tests C)
get_compiler_test_genex(cxx_tests CXX)
+if(TEST_FORTRAN)
+ get_compiler_test_genex(fortran_tests Fortran)
+endif()
set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS
"-DTEST_DEFINE"
@@ -21,6 +28,7 @@ set_property(TARGET CompileOptions PROPERTY COMPILE_OPTIONS
"SHELL:" # produces no options
${c_tests}
${cxx_tests}
+ ${fortran_tests}
)
if(BORLAND OR WATCOM)
# these compilers do not support separate -D flags
@@ -54,3 +62,12 @@ target_compile_definitions(CompileOptions
"EXPECTED_C_COMPILER_VERSION=\"${CMAKE_C_COMPILER_VERSION}\""
"EXPECTED_CXX_COMPILER_VERSION=\"${CMAKE_CXX_COMPILER_VERSION}\""
)
+
+if(TEST_FORTRAN)
+ # Definitions for the C++ code to test the values
+ target_compile_definitions(CompileOptions
+ PRIVATE
+ "TEST_FORTRAN"
+ "EXPECTED_Fortran_COMPILER_VERSION=\"${CMAKE_Fortran_COMPILER_VERSION}\""
+ )
+endif()
diff --git a/Tests/CompileOptions/main.cpp b/Tests/CompileOptions/main.cpp
index 1379940c7..d94a169c7 100644
--- a/Tests/CompileOptions/main.cpp
+++ b/Tests/CompileOptions/main.cpp
@@ -47,10 +47,17 @@ int main()
#endif
&&
strcmp(EXPECTED_C_COMPILER_VERSION, TEST_C_COMPILER_VERSION) == 0 &&
- strcmp(EXPECTED_CXX_COMPILER_VERSION, TEST_CXX_COMPILER_VERSION) ==
- 0 &&
- TEST_C_COMPILER_VERSION_EQUALITY == 1 &&
- TEST_CXX_COMPILER_VERSION_EQUALITY == 1)
+ strcmp(EXPECTED_CXX_COMPILER_VERSION, TEST_CXX_COMPILER_VERSION) == 0
+#ifdef TEST_FORTRAN
+ && strcmp(EXPECTED_Fortran_COMPILER_VERSION,
+ TEST_Fortran_COMPILER_VERSION) == 0
+#endif
+ && TEST_C_COMPILER_VERSION_EQUALITY == 1 &&
+ TEST_CXX_COMPILER_VERSION_EQUALITY == 1
+#ifdef TEST_FORTRAN
+ && TEST_Fortran_COMPILER_VERSION_EQUALITY == 1
+#endif
+ )
? 0
: 1;
}
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 9c4f86a31..f1fd34487 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -7,6 +7,17 @@ ADD_TEST_MACRO(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
ADD_TEST_MACRO(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation)
ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs)
+add_test(NAME CudaOnly.DontResolveDeviceSymbols COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/DontResolveDeviceSymbols/"
+ "${CMAKE_CURRENT_BINARY_DIR}/DontResolveDeviceSymbols/"
+ ${build_generator_args}
+ --build-project DontResolveDeviceSymbols
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
if(MSVC)
ADD_TEST_MACRO(CudaOnly.PDB CudaOnlyPDB)
endif()
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
new file mode 100644
index 000000000..619008902
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
@@ -0,0 +1,50 @@
+cmake_minimum_required(VERSION 3.13)
+project (DontResolveDeviceSymbols CUDA)
+
+# Find nm and dumpbin
+if(CMAKE_NM)
+ set(dump_command ${CMAKE_NM})
+ set(dump_args --defined-only)
+ set(symbol_name cudaRegisterLinkedBinary)
+else()
+ include(GetPrerequisites)
+ message(STATUS "calling list_prerequisites to find dumpbin")
+ list_prerequisites("${CMAKE_COMMAND}" 0 0 0)
+ if(gp_dumpbin)
+ set(dump_command ${gp_dumpbin})
+ set(dump_args /SYMBOLS)
+ set(symbol_name nv_fatb)
+ endif()
+endif()
+
+
+#Goal for this example:
+# Build a static library that defines multiple methods and kernels that
+# use each other.
+# Don't resolve the device symbols in the static library
+# Don't resolve the device symbols in the executable library
+# Verify that we can't use those device symbols from anything
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CUDA_STANDARD 11)
+
+add_library(CUDANoDeviceResolve SHARED file1.cu)
+set_target_properties(CUDANoDeviceResolve
+ PROPERTIES
+ CUDA_SEPARABLE_COMPILATION ON
+ CUDA_RESOLVE_DEVICE_SYMBOLS OFF
+ POSITION_INDEPENDENT_CODE ON)
+if(MSVC)
+ target_link_options(CUDANoDeviceResolve PRIVATE "/FORCE:UNRESOLVED")
+endif()
+
+if(dump_command)
+add_custom_command(TARGET CUDANoDeviceResolve POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ -DDUMP_COMMAND=${dump_command}
+ -DDUMP_ARGS=${dump_args}
+ -DSYMBOL_NAME=${symbol_name}
+ -DTEST_LIBRARY_PATH=$<TARGET_FILE:CUDANoDeviceResolve>
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/verify.cmake
+ )
+endif()
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu b/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu
new file mode 100644
index 000000000..3924f67c6
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/file1.cu
@@ -0,0 +1,69 @@
+
+#include <iostream>
+
+static __global__ void file1_kernel(int in, int* out)
+{
+ *out = in * in;
+}
+
+int choose_cuda_device()
+{
+ int nDevices = 0;
+ cudaError_t err = cudaGetDeviceCount(&nDevices);
+ if (err != cudaSuccess) {
+ std::cerr << "Failed to retrieve the number of CUDA enabled devices"
+ << std::endl;
+ return 1;
+ }
+ for (int i = 0; i < nDevices; ++i) {
+ cudaDeviceProp prop;
+ cudaError_t err = cudaGetDeviceProperties(&prop, i);
+ if (err != cudaSuccess) {
+ std::cerr << "Could not retrieve properties from CUDA device " << i
+ << std::endl;
+ return 1;
+ }
+ std::cout << "prop.major: " << prop.major << std::endl;
+ if (prop.major >= 3) {
+ err = cudaSetDevice(i);
+ if (err != cudaSuccess) {
+ std::cout << "Could not select CUDA device " << i << std::endl;
+ } else {
+ return 0;
+ }
+ }
+ }
+
+ std::cout << "Could not find a CUDA enabled card supporting compute >=3.0"
+ << std::endl;
+
+ return 1;
+}
+
+int file1_launch_kernel()
+{
+ int ret = choose_cuda_device();
+ if (ret) {
+ return 0;
+ }
+
+ int input = 4;
+
+ int* output;
+ cudaError_t err = cudaMallocManaged(&output, sizeof(int));
+ cudaDeviceSynchronize();
+ if (err != cudaSuccess) {
+ return 1;
+ }
+
+ file1_kernel<<<1, 1>>>(input, output);
+ cudaDeviceSynchronize();
+ err = cudaGetLastError();
+ std::cout << err << " " << cudaGetErrorString(err) << std::endl;
+ if (err == cudaSuccess) {
+ // This kernel launch should failed as the device linking never occured
+ std::cerr << "file1_kernel: kernel launch should have failed" << std::endl;
+ return 1;
+ }
+ return 0;
+}
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu
new file mode 100644
index 000000000..84a7a19eb
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/main.cu
@@ -0,0 +1,7 @@
+
+#include <iostream>
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake b/Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake
new file mode 100644
index 000000000..9bb426da0
--- /dev/null
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/verify.cmake
@@ -0,0 +1,14 @@
+execute_process(COMMAND ${DUMP_COMMAND} ${DUMP_ARGS} ${TEST_LIBRARY_PATH}
+ RESULT_VARIABLE RESULT
+ OUTPUT_VARIABLE OUTPUT
+ ERROR_VARIABLE ERROR
+)
+
+if(NOT "${RESULT}" STREQUAL "0")
+ message(FATAL_ERROR "${DUMP_COMMAND} failed [${RESULT}] [${OUTPUT}] [${ERROR}]")
+endif()
+
+if("${OUTPUT}" MATCHES "${SYMBOL_NAME}")
+ message(FATAL_ERROR
+ "The '${SYMBOL_NAME}' symbol is defined; device linking occurred!")
+endif()
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 67fcc0292..811fff340 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -332,7 +332,6 @@ if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
else()
if (CMAKE_CXX_COMPILER_ID MATCHES "PGI"
OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale"
- OR CMAKE_SYSTEM_NAME MATCHES "IRIX64"
OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
set(run_pic_test 0)
else()
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 6b7356340..5adcbd9e2 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -631,3 +631,21 @@ ExternalProject_Add(${proj}
LOG_BUILD 1
LOG_INSTALL 1
)
+
+set(proj ExternalProject-log-dir)
+ExternalProject_Add(${proj}
+ DOWNLOAD_COMMAND "${download_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "download"
+ PATCH_COMMAND "${patch_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "patch"
+ UPDATE_COMMAND "${update_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "update"
+ CONFIGURE_COMMAND "${configure_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "configure"
+ BUILD_COMMAND "${build_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "build"
+ INSTALL_COMMAND "${install_cmd}" COMMAND "${CMAKE_COMMAND}" -E echo "install"
+ LOG_MERGED_STDOUTERR 1
+ LOG_DIR ${CMAKE_CURRENT_BINARY_DIR}/different_log
+ LOG_DOWNLOAD 1
+ LOG_PATCH 1
+ LOG_UPDATE 1
+ LOG_CONFIGURE 1
+ LOG_BUILD 1
+ LOG_INSTALL 1
+ )
diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt
index 5b941630a..1075a9d07 100644
--- a/Tests/ExternalProjectLocal/CMakeLists.txt
+++ b/Tests/ExternalProjectLocal/CMakeLists.txt
@@ -20,71 +20,55 @@ set(binary_base "${base}/Build")
set_property(DIRECTORY PROPERTY EP_BASE ${base})
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure build test)
-if(NOT DEFINED can_build_tutorial_step5)
- set(can_build_tutorial_step5 1)
-
- # The ExternalProject builds of Tutorial Step5 cannot be built
- # correctly 2nd and later times in an in-source build...
- # (because the CMakeCache.txt from the real in-source build of
- # the Tests/Tutorial/Step5 directory gets copied when we do
- # the "source directory copy" step... but it still refers to
- # its original path which yields a configure error.) So:
- #
- if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
- set(can_build_tutorial_step5 0)
- endif()
-endif()
# Local DIR:
#
-if(can_build_tutorial_step5)
- set(proj TutorialStep5-Local)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
- CMAKE_ARGS -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- TEST_BEFORE_INSTALL 1
- LOG_INSTALL 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
- ExternalProject_Get_Property(${proj} install_dir)
- set(TutorialStep5_install_dir ${install_dir})
-
- set(proj TutorialStep5-Local-TestAfterInstall)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
- TEST_AFTER_INSTALL 1
- LOG_TEST 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
-
- set(proj TutorialStep5-Local-TestExcludeFromMainBefore)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
- TEST_BEFORE_INSTALL 1
- TEST_EXCLUDE_FROM_MAIN 1
- STEP_TARGETS test
- LOG_TEST 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
-
- set(proj TutorialStep5-Local-TestExcludeFromMainAfter)
- ExternalProject_Add(${proj}
- URL "${CMAKE_CURRENT_SOURCE_DIR}/../Tutorial/Step5"
- CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
- CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
- TEST_AFTER_INSTALL 1
- TEST_EXCLUDE_FROM_MAIN 1
- STEP_TARGETS test
- LOG_TEST 1
- )
- set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+set(proj TutorialStep5-Local)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+CMAKE_ARGS -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+TEST_BEFORE_INSTALL 1
+LOG_INSTALL 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+ExternalProject_Get_Property(${proj} install_dir)
+set(TutorialStep5_install_dir ${install_dir})
+
+set(proj TutorialStep5-Local-TestAfterInstall)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
+TEST_AFTER_INSTALL 1
+LOG_TEST 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+
+set(proj TutorialStep5-Local-TestExcludeFromMainBefore)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
+TEST_BEFORE_INSTALL 1
+TEST_EXCLUDE_FROM_MAIN 1
+STEP_TARGETS test
+LOG_TEST 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
+
+set(proj TutorialStep5-Local-TestExcludeFromMainAfter)
+ExternalProject_Add(${proj}
+URL "${CMAKE_CURRENT_SOURCE_DIR}/Step5"
+CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -G ${CMAKE_GENERATOR} <SOURCE_DIR>
+CMAKE_CACHE_DEFAULT_ARGS -DUSE_MYMATH:BOOL=OFF
+TEST_AFTER_INSTALL 1
+TEST_EXCLUDE_FROM_MAIN 1
+STEP_TARGETS test
+LOG_TEST 1
+)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local")
-endif()
# Local TAR:
@@ -100,6 +84,7 @@ ExternalProject_Add(${proj}
-DTEST_LIST:STRING=A::B::C
INSTALL_COMMAND ""
LOG_CONFIGURE 1
+ LOG_PATCH 1
)
set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR")
@@ -208,12 +193,10 @@ enable_testing()
#
# BuildTree tests:
#
-if(can_build_tutorial_step5)
- add_test(TutorialStep5-Local-BuildTreeTest
- "${binary_base}/TutorialStep5-Local/Tutorial" 42)
- set_property(TEST TutorialStep5-Local-BuildTreeTest
- APPEND PROPERTY LABELS Step5 BuildTree)
-endif()
+add_test(TutorialStep5-Local-BuildTreeTest
+"${binary_base}/TutorialStep5-Local/Tutorial" 42)
+set_property(TEST TutorialStep5-Local-BuildTreeTest
+APPEND PROPERTY LABELS Step5 BuildTree)
add_test(TutorialStep1-LocalTAR-BuildTreeTest
"${binary_base}/TutorialStep1-LocalTAR/EP-Tutorial" 36)
@@ -233,12 +216,7 @@ add_test(TutorialStep1-LocalNoDirTGZ-BuildTreeTest
# InstallTree tests:
#
-if(can_build_tutorial_step5)
- add_test(TutorialStep5-InstallTreeTest
- "${TutorialStep5_install_dir}/bin/Tutorial" 49)
- set_property(TEST TutorialStep5-InstallTreeTest
- APPEND PROPERTY LABELS Step5 InstallTree)
-endif()
-
-
-message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
+add_test(TutorialStep5-InstallTreeTest
+"${TutorialStep5_install_dir}/bin/Tutorial" 49)
+set_property(TEST TutorialStep5-InstallTreeTest
+APPEND PROPERTY LABELS Step5 InstallTree)
diff --git a/Tests/ExternalProjectLocal/Step5/CMakeLists.txt b/Tests/ExternalProjectLocal/Step5/CMakeLists.txt
new file mode 100644
index 000000000..93b3880f0
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/CMakeLists.txt
@@ -0,0 +1,71 @@
+cmake_minimum_required (VERSION 2.6)
+project (Tutorial)
+
+# The version number.
+set (Tutorial_VERSION_MAJOR 1)
+set (Tutorial_VERSION_MINOR 0)
+
+# does this system provide the log and exp functions?
+include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
+check_function_exists (log HAVE_LOG)
+check_function_exists (exp HAVE_EXP)
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+# configure a header file to pass some of the CMake settings
+# to the source code
+configure_file (
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+include_directories ("${PROJECT_BINARY_DIR}")
+
+# add the MathFunctions library?
+if (USE_MYMATH)
+ include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
+ add_subdirectory (MathFunctions)
+ set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
+endif ()
+
+# add the executable
+add_executable (Tutorial tutorial.cxx)
+target_link_libraries (Tutorial ${EXTRA_LIBS})
+
+# add the install targets
+install (TARGETS Tutorial DESTINATION bin)
+install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include)
+
+# enable testing
+enable_testing ()
+
+# does the application run
+add_test (TutorialRuns Tutorial 25)
+
+# does the usage message work?
+add_test (TutorialUsage Tutorial)
+set_tests_properties (TutorialUsage
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+#define a macro to simplify adding tests
+macro (do_test arg result)
+ add_test (TutorialComp${arg} Tutorial ${arg})
+ set_tests_properties (TutorialComp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endmacro ()
+
+# do a bunch of result based tests
+do_test (4 "4 is 2")
+do_test (9 "9 is 3")
+do_test (5 "5 is 2.236")
+do_test (7 "7 is 2.645")
+do_test (25 "25 is 5")
+do_test (-25 "-25 is 0")
+do_test (0.0001 "0.0001 is 0.01")
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt b/Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt
new file mode 100644
index 000000000..453a46332
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/CMakeLists.txt
@@ -0,0 +1,17 @@
+# first we add the executable that generates the table
+# add the binary tree directory to the search path for include files
+include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
+
+add_executable(MakeTable MakeTable.cxx )
+# add the command to generate the source code
+add_custom_command (
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+# add the main library
+add_library(MathFunctions mysqrt.cxx ${CMAKE_CURRENT_BINARY_DIR}/Table.h )
+
+install (TARGETS MathFunctions DESTINATION bin)
+install (FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx b/Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx
new file mode 100644
index 000000000..cebd50fcc
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/MakeTable.cxx
@@ -0,0 +1,32 @@
+// A simple program that builds a sqrt table
+#include <math.h>
+#include <stdio.h>
+
+int main(int argc, char* argv[])
+{
+ int i;
+ double result;
+
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ // open the output file
+ FILE* fout = fopen(argv[1], "w");
+ if (!fout) {
+ return 1;
+ }
+
+ // create a source file with a table of square roots
+ fprintf(fout, "double sqrtTable[] = {\n");
+ for (i = 0; i < 10; ++i) {
+ result = sqrt(static_cast<double>(i));
+ fprintf(fout, "%g,\n", result);
+ }
+
+ // close the table with a zero
+ fprintf(fout, "0};\n");
+ fclose(fout);
+ return 0;
+}
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h b/Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h
new file mode 100644
index 000000000..cd36bccff
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/MathFunctions.h
@@ -0,0 +1 @@
+double mysqrt(double x);
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx b/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx
new file mode 100644
index 000000000..458ed63a1
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx
@@ -0,0 +1,40 @@
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+#include <stdio.h>
+
+// include the generated table
+#include "Table.h"
+
+#include <math.h>
+
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ double result;
+
+ // if we have both log and exp then use them
+ double delta;
+
+ // use the table to help find an initial value
+ result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // do ten iterations
+ int i;
+ for (i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ }
+
+ return result;
+}
diff --git a/Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in b/Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in
new file mode 100644
index 000000000..e97ce24ea
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/TutorialConfig.h.in
@@ -0,0 +1,8 @@
+// the configured options and settings for Tutorial
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+#cmakedefine USE_MYMATH
+
+// does the platform provide exp and log functions?
+#cmakedefine HAVE_LOG
+#cmakedefine HAVE_EXP
diff --git a/Tests/ExternalProjectLocal/Step5/tutorial.cxx b/Tests/ExternalProjectLocal/Step5/tutorial.cxx
new file mode 100644
index 000000000..37f6ac456
--- /dev/null
+++ b/Tests/ExternalProjectLocal/Step5/tutorial.cxx
@@ -0,0 +1,33 @@
+// A simple program that computes the square root of a number
+#include "TutorialConfig.h"
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#ifdef USE_MYMATH
+# include "MathFunctions.h"
+#endif
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
+ Tutorial_VERSION_MINOR);
+ fprintf(stdout, "Usage: %s number\n", argv[0]);
+ return 1;
+ }
+
+ double inputValue = atof(argv[1]);
+ double outputValue = 0;
+
+ if (inputValue >= 0) {
+#ifdef USE_MYMATH
+ outputValue = mysqrt(inputValue);
+#else
+ outputValue = sqrt(inputValue);
+#endif
+ }
+
+ fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ return 0;
+}
diff --git a/Tests/ExternalProjectSourceSubdirNotCMake/CMakeLists.txt b/Tests/ExternalProjectSourceSubdirNotCMake/CMakeLists.txt
new file mode 100644
index 000000000..f64df1a77
--- /dev/null
+++ b/Tests/ExternalProjectSourceSubdirNotCMake/CMakeLists.txt
@@ -0,0 +1,20 @@
+cmake_minimum_required(VERSION 3.6)
+project(ExternalProjectSourceSubdirNotCMake NONE)
+include(ExternalProject)
+
+find_program(MAKE_EXECUTABLE
+ NAMES gmake make)
+
+if (NOT MAKE_EXECUTABLE)
+ message("No `make` executable found; skipping")
+ return ()
+endif ()
+
+ExternalProject_Add(Example
+ SOURCE_SUBDIR subdir
+ BUILD_IN_SOURCE 1
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Example
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND "${MAKE_EXECUTABLE}"
+ INSTALL_COMMAND ""
+ )
diff --git a/Tests/ExternalProjectSourceSubdirNotCMake/Example/subdir/Makefile b/Tests/ExternalProjectSourceSubdirNotCMake/Example/subdir/Makefile
new file mode 100644
index 000000000..cab3b8f4b
--- /dev/null
+++ b/Tests/ExternalProjectSourceSubdirNotCMake/Example/subdir/Makefile
@@ -0,0 +1,2 @@
+all:
+ echo "complete"
diff --git a/Tests/FindBoost/Test/CMakeLists.txt b/Tests/FindBoost/Test/CMakeLists.txt
index 663f41472..39e92c1d3 100644
--- a/Tests/FindBoost/Test/CMakeLists.txt
+++ b/Tests/FindBoost/Test/CMakeLists.txt
@@ -13,6 +13,9 @@ if(NOT Boost_PROGRAM_OPTIONS_FOUND)
message(FATAL_ERROR "Optional Boost component \"program_options\" not found which is unexpected")
endif(NOT Boost_PROGRAM_OPTIONS_FOUND)
+add_definitions(-DCMAKE_EXPECTED_BOOST_VERSION="${Boost_VERSION}")
+add_definitions(-DCMAKE_EXPECTED_BOOST_VERSION_COMPONENTS="${Boost_VERSION_STRING}")
+
add_executable(test_boost_tgt main.cxx)
target_link_libraries(test_boost_tgt
Boost::dynamic_linking
diff --git a/Tests/FindBoost/Test/main.cxx b/Tests/FindBoost/Test/main.cxx
index 6e8b5da63..50ddadfba 100644
--- a/Tests/FindBoost/Test/main.cxx
+++ b/Tests/FindBoost/Test/main.cxx
@@ -20,5 +20,20 @@ int main()
boost::thread foo(threadmain);
foo.join();
- return 0;
+ int version = BOOST_VERSION;
+ int major = version / 100000;
+ int minor = version / 100 % 1000;
+ int patch = version % 100;
+ char version_string[100];
+ snprintf(version_string, sizeof(version_string), "%d.%d.%d", major, minor,
+ patch);
+ printf("Found Boost version %s, expected version %s\n", version_string,
+ CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS);
+ int ret = strcmp(version_string, CMAKE_EXPECTED_BOOST_VERSION_COMPONENTS);
+ char raw_version_string[100];
+ snprintf(raw_version_string, sizeof(raw_version_string), "%d",
+ BOOST_VERSION);
+ printf("Found Boost version %s, expected version %s\n", raw_version_string,
+ CMAKE_EXPECTED_BOOST_VERSION);
+ return ret | strcmp(raw_version_string, CMAKE_EXPECTED_BOOST_VERSION);
}
diff --git a/Tests/FindCURL/Test/CMakeLists.txt b/Tests/FindCURL/Test/CMakeLists.txt
index c3c719b5d..cbf2866b0 100644
--- a/Tests/FindCURL/Test/CMakeLists.txt
+++ b/Tests/FindCURL/Test/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(TestFindCURL C)
include(CTest)
-find_package(CURL REQUIRED)
+find_package(CURL REQUIRED COMPONENTS HTTP)
add_definitions(-DCMAKE_EXPECTED_CURL_VERSION="${CURL_VERSION_STRING}")
diff --git a/Tests/FindFontconfig/CMakeLists.txt b/Tests/FindFontconfig/CMakeLists.txt
new file mode 100644
index 000000000..d683d8746
--- /dev/null
+++ b/Tests/FindFontconfig/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindFontconfig.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindFontconfig/Test"
+ "${CMake_BINARY_DIR}/Tests/FindFontconfig/Test"
+ ${build_generator_args}
+ --build-project TestFindFontconfig
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindFontconfig/Test/CMakeLists.txt b/Tests/FindFontconfig/Test/CMakeLists.txt
new file mode 100644
index 000000000..36c76b104
--- /dev/null
+++ b/Tests/FindFontconfig/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.10)
+project(TestFindFontconfig C)
+include(CTest)
+
+find_package(Fontconfig REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_FONTCONFIG_VERSION="${Fontconfig_VERSION}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt Fontconfig::Fontconfig)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${Fontconfig_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${Fontconfig_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindFontconfig/Test/main.c b/Tests/FindFontconfig/Test/main.c
new file mode 100644
index 000000000..c5b596304
--- /dev/null
+++ b/Tests/FindFontconfig/Test/main.c
@@ -0,0 +1,17 @@
+#include <assert.h>
+#include <fontconfig/fontconfig.h>
+#include <stdio.h>
+#include <string.h>
+
+int main()
+{
+ FcInit();
+ printf("Found Fontconfig.\n");
+
+ char fontconfig_version_string[16];
+ snprintf(fontconfig_version_string, 16, "%i.%i.%i", FC_MAJOR, FC_MINOR,
+ FC_REVISION);
+ assert(
+ strcmp(fontconfig_version_string, CMAKE_EXPECTED_FONTCONFIG_VERSION) == 0);
+ return 0;
+}
diff --git a/Tests/FindGDAL/CMakeLists.txt b/Tests/FindGDAL/CMakeLists.txt
new file mode 100644
index 000000000..12f95e11e
--- /dev/null
+++ b/Tests/FindGDAL/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindGDAL.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindGDAL/Test"
+ "${CMake_BINARY_DIR}/Tests/FindGDAL/Test"
+ ${build_generator_args}
+ --build-project TestFindGDAL
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindGDAL/Test/CMakeLists.txt b/Tests/FindGDAL/Test/CMakeLists.txt
new file mode 100644
index 000000000..8bdc57c91
--- /dev/null
+++ b/Tests/FindGDAL/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.10)
+project(TestFindGDAL C)
+include(CTest)
+
+find_package(GDAL REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_GDAL_VERSION="${GDAL_VERSION}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt GDAL::GDAL)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${GDAL_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${GDAL_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindGDAL/Test/main.c b/Tests/FindGDAL/Test/main.c
new file mode 100644
index 000000000..7b31a1362
--- /dev/null
+++ b/Tests/FindGDAL/Test/main.c
@@ -0,0 +1,11 @@
+#include <gdal.h>
+#include <stdio.h>
+#include <string.h>
+
+int main()
+{
+ printf("Found GDAL version %s, expected version %s\n", GDAL_RELEASE_NAME,
+ CMAKE_EXPECTED_GDAL_VERSION);
+ GDALAllRegister();
+ return strcmp(GDAL_RELEASE_NAME, CMAKE_EXPECTED_GDAL_VERSION);
+}
diff --git a/Tests/FindGIF/CMakeLists.txt b/Tests/FindGIF/CMakeLists.txt
new file mode 100644
index 000000000..bac64afd0
--- /dev/null
+++ b/Tests/FindGIF/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindGIF.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindGIF/Test"
+ "${CMake_BINARY_DIR}/Tests/FindGIF/Test"
+ ${build_generator_args}
+ --build-project TestFindGIF
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindGIF/Test/CMakeLists.txt b/Tests/FindGIF/Test/CMakeLists.txt
new file mode 100644
index 000000000..961e636fa
--- /dev/null
+++ b/Tests/FindGIF/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindGIF C)
+include(CTest)
+
+find_package(GIF REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_GIF_VERSION="${GIF_VERSION}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt GIF::GIF)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${GIF_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${GIF_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindGIF/Test/main.c b/Tests/FindGIF/Test/main.c
new file mode 100644
index 000000000..4ed72ec1b
--- /dev/null
+++ b/Tests/FindGIF/Test/main.c
@@ -0,0 +1,35 @@
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <gif_lib.h>
+
+// GIFLIB before version 5 didn't know this macro
+#ifndef GIFLIB_MAJOR
+# define GIFLIB_MAJOR 4
+#endif
+
+int main()
+{
+ // because of the API changes we have to test different functions depending
+ // on the version of GIFLIB
+#if GIFLIB_MAJOR >= 5
+ // test the linker
+ GifErrorString(D_GIF_SUCCEEDED);
+
+ // check the version
+ char gif_version_string[16];
+ snprintf(gif_version_string, 16, "%i.%i.%i", GIFLIB_MAJOR, GIFLIB_MINOR,
+ GIFLIB_RELEASE);
+
+ assert(strcmp(gif_version_string, CMAKE_EXPECTED_GIF_VERSION) == 0);
+#else
+ // test the linker
+ GifLastError();
+
+ // unfortunately there is no way to check the version in older version of
+ // GIFLIB
+#endif
+
+ return 0;
+}
diff --git a/Tests/FindGit/CMakeLists.txt b/Tests/FindGit/CMakeLists.txt
new file mode 100644
index 000000000..5d061f469
--- /dev/null
+++ b/Tests/FindGit/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindGit.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindGit/Test"
+ "${CMake_BINARY_DIR}/Tests/FindGit/Test"
+ ${build_generator_args}
+ --build-project TestFindGit
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindGit/Test/CMakeLists.txt b/Tests/FindGit/Test/CMakeLists.txt
new file mode 100644
index 000000000..26fb372e6
--- /dev/null
+++ b/Tests/FindGit/Test/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.12)
+project(TestFindGit NONE)
+include(CTest)
+
+find_package(Git REQUIRED)
+
+add_test(NAME test_git
+ COMMAND ${CMAKE_COMMAND}
+ "-DGIT_EXECUTABLE=${GIT_EXECUTABLE}"
+ "-DGIT_EXECUTABLE_TARGET=$<TARGET_FILE:Git::Git>"
+ "-DGIT_VERSION_STRING=${GIT_VERSION_STRING}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/RunGit.cmake"
+ )
diff --git a/Tests/FindGit/Test/RunGit.cmake b/Tests/FindGit/Test/RunGit.cmake
new file mode 100644
index 000000000..f798cd355
--- /dev/null
+++ b/Tests/FindGit/Test/RunGit.cmake
@@ -0,0 +1,20 @@
+cmake_minimum_required(VERSION 3.12)
+
+function(run_git exe exe_display)
+ execute_process(COMMAND ${exe} --version
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ RESULT_VARIABLE result
+ )
+
+ if(NOT result EQUAL 0)
+ message(SEND_ERROR "Result of ${exe_display} --version is ${result}, should be 0")
+ endif()
+
+ if(NOT output STREQUAL "git version ${GIT_VERSION_STRING}")
+ message(SEND_ERROR "Output of ${exe_display} --version is \"${output}\", should be \"git version ${GIT_VERSION_STRING}\"")
+ endif()
+endfunction()
+
+run_git("${GIT_EXECUTABLE}" "\${GIT_EXECUTABLE}")
+run_git("${GIT_EXECUTABLE_TARGET}" "Git::Git")
diff --git a/Tests/FindJPEG/Test/CMakeLists.txt b/Tests/FindJPEG/Test/CMakeLists.txt
index a744f8563..912c7a19b 100644
--- a/Tests/FindJPEG/Test/CMakeLists.txt
+++ b/Tests/FindJPEG/Test/CMakeLists.txt
@@ -4,6 +4,8 @@ include(CTest)
find_package(JPEG)
+add_definitions(-DCMAKE_EXPECTED_JPEG_VERSION=${JPEG_VERSION})
+
add_executable(test_jpeg_tgt main.c)
target_link_libraries(test_jpeg_tgt JPEG::JPEG)
add_test(NAME test_jpeg_tgt COMMAND test_jpeg_tgt)
diff --git a/Tests/FindJPEG/Test/main.c b/Tests/FindJPEG/Test/main.c
index c6e48f0d6..0e23eff5f 100644
--- a/Tests/FindJPEG/Test/main.c
+++ b/Tests/FindJPEG/Test/main.c
@@ -12,5 +12,5 @@ int main()
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_decompress(&cinfo);
- return 0;
+ return (JPEG_LIB_VERSION != CMAKE_EXPECTED_JPEG_VERSION);
}
diff --git a/Tests/FindLibLZMA/CMakeLists.txt b/Tests/FindLibLZMA/CMakeLists.txt
new file mode 100644
index 000000000..6dff0ef22
--- /dev/null
+++ b/Tests/FindLibLZMA/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLibLZMA.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindLibLZMA/Test"
+ "${CMake_BINARY_DIR}/Tests/FindLibLZMA/Test"
+ ${build_generator_args}
+ --build-project TestFindLibLZMA
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindLibLZMA/Test/CMakeLists.txt b/Tests/FindLibLZMA/Test/CMakeLists.txt
new file mode 100644
index 000000000..c59dcdbdd
--- /dev/null
+++ b/Tests/FindLibLZMA/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindLZMA C)
+include(CTest)
+
+find_package(LibLZMA REQUIRED)
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt LibLZMA::LibLZMA)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${LIBLZMA_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${LIBLZMA_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindLibLZMA/Test/main.c b/Tests/FindLibLZMA/Test/main.c
new file mode 100644
index 000000000..06e806554
--- /dev/null
+++ b/Tests/FindLibLZMA/Test/main.c
@@ -0,0 +1,15 @@
+#include <assert.h>
+#include <lzma.h>
+#include <string.h>
+
+static const uint8_t test_string[9] = "123456789";
+
+int main()
+{
+ static const uint32_t test_vector = 0xCBF43926;
+
+ uint32_t crc = lzma_crc32(test_string, sizeof(test_string), 0);
+ assert(crc == test_vector);
+
+ return 0;
+}
diff --git a/Tests/FindLibinput/CMakeLists.txt b/Tests/FindLibinput/CMakeLists.txt
new file mode 100644
index 000000000..8538a55ed
--- /dev/null
+++ b/Tests/FindLibinput/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLibinput.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindLibinput/Test"
+ "${CMake_BINARY_DIR}/Tests/FindLibinput/Test"
+ ${build_generator_args}
+ --build-project TestFindLibinput
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindLibinput/Test/CMakeLists.txt b/Tests/FindLibinput/Test/CMakeLists.txt
new file mode 100644
index 000000000..1cc68d48e
--- /dev/null
+++ b/Tests/FindLibinput/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.10)
+project(TestFindLibinput C)
+include(CTest)
+
+find_package(Libinput REQUIRED)
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt Libinput::Libinput)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${Libinput_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${Libinput_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindLibinput/Test/main.c b/Tests/FindLibinput/Test/main.c
new file mode 100644
index 000000000..391996280
--- /dev/null
+++ b/Tests/FindLibinput/Test/main.c
@@ -0,0 +1,13 @@
+#include <libinput.h>
+#include <stdio.h>
+
+int main()
+{
+ struct libinput_interface interface;
+ interface.open_restricted = 0;
+ interface.close_restricted = 0;
+ struct libinput* li;
+ li = libinput_udev_create_context(&interface, NULL, NULL);
+ printf("Found Libinput.\n");
+ return 0;
+}
diff --git a/Tests/FindMatlab/basic_checks/CMakeLists.txt b/Tests/FindMatlab/basic_checks/CMakeLists.txt
index 4a74d93f1..c5be1ea25 100644
--- a/Tests/FindMatlab/basic_checks/CMakeLists.txt
+++ b/Tests/FindMatlab/basic_checks/CMakeLists.txt
@@ -10,11 +10,10 @@ set(MATLAB_FIND_DEBUG TRUE)
# - on 64bits builds (cmake is building with 64 bits), it looks for 64 bits Matlab
if(IS_MCR)
- set(components MX_LIBRARY)
set(RUN_UNIT_TESTS FALSE)
else()
set(RUN_UNIT_TESTS TRUE)
- set(components MX_LIBRARY MAIN_PROGRAM)
+ set(components MAIN_PROGRAM)
endif()
if(NOT "${MCR_ROOT}" STREQUAL "")
@@ -34,7 +33,7 @@ matlab_add_mex(
OUTPUT_NAME cmake_matlab_mex1
SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper1.cpp
DOCUMENTATION ${CMAKE_CURRENT_SOURCE_DIR}/../help_text1.m.txt
- )
+ )
if(RUN_UNIT_TESTS)
matlab_add_unit_test(
diff --git a/Tests/FindMatlab/cmake_matlab_unit_tests4.m b/Tests/FindMatlab/cmake_matlab_unit_tests4.m
new file mode 100644
index 000000000..6a7b04d14
--- /dev/null
+++ b/Tests/FindMatlab/cmake_matlab_unit_tests4.m
@@ -0,0 +1,28 @@
+
+classdef cmake_matlab_unit_tests4 < matlab.unittest.TestCase
+ % Testing R2017b and R2018a APIs
+ properties
+ end
+
+ methods (Test)
+ function testR2017b(testCase)
+ ret = cmake_matlab_mex2a(5+6i);
+ testCase.verifyEqual(ret, 8);
+ end
+
+ function testR2018a(testCase)
+ ret = cmake_matlab_mex2b(5+6i);
+ v = version;
+ n = find(v=='.');
+ v = str2double(v(1:n(2)-1));
+ disp(v)
+ if v>= 9.4 % R2018a
+ testCase.verifyEqual(ret, 16);
+ disp('TESTING version >= 9.4')
+ else
+ testCase.verifyEqual(ret, 8);
+ end
+ end
+
+ end
+end
diff --git a/Tests/FindMatlab/cmake_matlab_unit_tests5.m b/Tests/FindMatlab/cmake_matlab_unit_tests5.m
new file mode 100644
index 000000000..b1936e354
--- /dev/null
+++ b/Tests/FindMatlab/cmake_matlab_unit_tests5.m
@@ -0,0 +1,20 @@
+
+classdef cmake_matlab_unit_tests5 < matlab.unittest.TestCase
+ % C++ API test
+ properties
+ end
+
+ methods (Test)
+ function testDummyCall(testCase)
+ % very simple call test
+ disp('TESTING C++')
+ ret = cmake_matlab_mex3(162);
+ testCase.verifyEqual(ret, 162);
+ end
+
+ function testFailTest(testCase)
+ testCase.verifyError(@() cmake_matlab_mex3, 'MATLAB:mex:CppMexException');
+ end
+
+ end
+end
diff --git a/Tests/FindMatlab/components_checks/CMakeLists.txt b/Tests/FindMatlab/components_checks/CMakeLists.txt
index da6a2b00e..f5d488060 100644
--- a/Tests/FindMatlab/components_checks/CMakeLists.txt
+++ b/Tests/FindMatlab/components_checks/CMakeLists.txt
@@ -15,7 +15,7 @@ endif()
# the success of the following command is dependent on the current configuration:
# - on 32bits builds (cmake is building with 32 bits), it looks for 32 bits Matlab
# - on 64bits builds (cmake is building with 64 bits), it looks for 64 bits Matlab
-find_package(Matlab REQUIRED COMPONENTS MX_LIBRARY ENG_LIBRARY MAT_LIBRARY
+find_package(Matlab REQUIRED COMPONENTS ENG_LIBRARY MAT_LIBRARY
OPTIONAL_COMPONENTS MAIN_PROGRAM)
message(STATUS "FindMatlab libraries: ${Matlab_LIBRARIES}")
@@ -28,4 +28,4 @@ matlab_add_mex(
SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper1.cpp
DOCUMENTATION ${CMAKE_CURRENT_SOURCE_DIR}/../help_text1.m.txt
LINK_TO ${Matlab_LIBRARIES}
- )
+ )
diff --git a/Tests/FindMatlab/failure_reports/CMakeLists.txt b/Tests/FindMatlab/failure_reports/CMakeLists.txt
index e597a4a05..4b092cd28 100644
--- a/Tests/FindMatlab/failure_reports/CMakeLists.txt
+++ b/Tests/FindMatlab/failure_reports/CMakeLists.txt
@@ -8,11 +8,10 @@ project(failure_reports)
set(MATLAB_FIND_DEBUG TRUE)
if(IS_MCR)
- set(components MX_LIBRARY)
set(RUN_UNIT_TESTS FALSE)
else()
set(RUN_UNIT_TESTS TRUE)
- set(components MX_LIBRARY MAIN_PROGRAM)
+ set(components MAIN_PROGRAM)
endif()
if(NOT "${MCR_ROOT}" STREQUAL "")
@@ -32,7 +31,7 @@ matlab_add_mex(
OUTPUT_NAME cmake_matlab_mex1
SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper1.cpp
DOCUMENTATION ${CMAKE_CURRENT_SOURCE_DIR}/../help_text1.m.txt
- )
+ )
if(RUN_UNIT_TESTS)
# the unit test file does not exist: the failure should be properly reported
diff --git a/Tests/FindMatlab/matlab_wrapper2.cpp b/Tests/FindMatlab/matlab_wrapper2.cpp
new file mode 100644
index 000000000..e768fbfbe
--- /dev/null
+++ b/Tests/FindMatlab/matlab_wrapper2.cpp
@@ -0,0 +1,22 @@
+
+// simple workaround to some compiler specific problems
+// see
+// http://stackoverflow.com/questions/22367516/mex-compile-error-unknown-type-name-char16-t/23281916#23281916
+#include <algorithm>
+
+#include "mex.h"
+
+// This test uses the new complex-interleaved C API (R2018a and newer)
+
+// The input should be a complex array (scalar is OK). It returns the number of
+// bytes in a matrix element. For the old (R2017b) API, this is 8. For the new
+// (R2018a) API, this is 16.
+
+void mexFunction(const int nlhs, mxArray* plhs[], const int nrhs,
+ const mxArray* prhs[])
+{
+ if (nrhs != 1 || !mxIsComplex(prhs[0])) {
+ mexErrMsgTxt("Incorrect arguments");
+ }
+ plhs[0] = mxCreateDoubleScalar(mxGetElementSize(prhs[0]));
+}
diff --git a/Tests/FindMatlab/matlab_wrapper3.cpp b/Tests/FindMatlab/matlab_wrapper3.cpp
new file mode 100644
index 000000000..667081542
--- /dev/null
+++ b/Tests/FindMatlab/matlab_wrapper3.cpp
@@ -0,0 +1,29 @@
+#include "mex.hpp"
+#include "mexAdapter.hpp"
+
+// This test uses the new C++ API (R2018a and newer)
+
+// The input should be a scalar double array. The output is a copy of that
+// array.
+
+using namespace matlab::data;
+using matlab::mex::ArgumentList;
+
+class MexFunction : public matlab::mex::Function
+{
+public:
+ void operator()(ArgumentList outputs, ArgumentList inputs)
+ {
+ std::shared_ptr<matlab::engine::MATLABEngine> matlabPtr = getEngine();
+ ArrayFactory factory;
+ if (inputs[0].getType() != ArrayType::DOUBLE ||
+ inputs[0].getType() == ArrayType::COMPLEX_DOUBLE ||
+ inputs[0].getNumberOfElements() != 1) {
+ matlabPtr->feval(
+ u"error", 0,
+ std::vector<Array>({ factory.createScalar("Incorrect arguments") }));
+ }
+ double a = inputs[0][0];
+ outputs[0] = factory.createScalar(a);
+ }
+};
diff --git a/Tests/FindMatlab/r2018a_check/CMakeLists.txt b/Tests/FindMatlab/r2018a_check/CMakeLists.txt
new file mode 100644
index 000000000..c732be151
--- /dev/null
+++ b/Tests/FindMatlab/r2018a_check/CMakeLists.txt
@@ -0,0 +1,84 @@
+
+cmake_minimum_required (VERSION 2.8.12)
+enable_testing()
+project(r2018a_checks)
+
+set(MATLAB_FIND_DEBUG TRUE)
+
+# this test doesn't do much if MATLAB version < R2018a
+
+if(IS_MCR)
+ set(RUN_UNIT_TESTS FALSE)
+else()
+ set(RUN_UNIT_TESTS TRUE)
+ set(components MAIN_PROGRAM)
+endif()
+
+if(NOT "${MCR_ROOT}" STREQUAL "")
+ set(Matlab_ROOT_DIR "${MCR_ROOT}")
+ if(NOT EXISTS "${MCR_ROOT}")
+ message(FATAL_ERROR "MCR does not exist ${MCR_ROOT}")
+ endif()
+endif()
+
+find_package(Matlab REQUIRED COMPONENTS ${components})
+
+set(IS_R2018a 1)
+if(${Matlab_VERSION_STRING} VERSION_LESS "9.4")
+ # This is an older version of MATLAB, tests will fail
+ set(IS_R2018a 0)
+endif()
+
+matlab_add_mex(
+ # target name
+ NAME cmake_matlab_test_wrapper2a
+ # output name
+ OUTPUT_NAME cmake_matlab_mex2a
+ SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper2.cpp
+ R2017b
+ )
+
+matlab_add_mex(
+ # target name
+ NAME cmake_matlab_test_wrapper2b
+ # output name
+ OUTPUT_NAME cmake_matlab_mex2b
+ SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper2.cpp
+ R2018a
+ )
+
+if(IS_R2018a)
+ matlab_add_mex(
+ # target name
+ NAME cmake_matlab_test_wrapper3
+ # output name
+ OUTPUT_NAME cmake_matlab_mex3
+ SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper3.cpp
+ )
+ set_target_properties(
+ cmake_matlab_test_wrapper3
+ PROPERTIES
+ CXX_STANDARD 11
+ CXX_STANDARD_REQUIRED ON
+ )
+endif()
+
+if(RUN_UNIT_TESTS)
+ # Check that the R2017b and R2018a APIs work.
+ matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-1
+ TIMEOUT 300
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake_matlab_unit_tests4.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper2a>
+ )
+
+ # Check that the C++ API works (test run only on R2018a and newer)
+ if(IS_R2018a)
+ matlab_add_unit_test(
+ NAME ${PROJECT_NAME}_matlabtest-3
+ TIMEOUT 300
+ UNITTEST_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../cmake_matlab_unit_tests5.m
+ ADDITIONAL_PATH $<TARGET_FILE_DIR:cmake_matlab_test_wrapper3>
+ )
+ endif()
+endif()
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 3fd55413e..f8b36c555 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -188,6 +188,37 @@ find_package(ArchC 3.1 EXACT NAMES zot)
find_package(ArchD 4.0 EXACT NAMES zot)
unset(CMAKE_LIBRARY_ARCHITECTURE)
+# Test find_package() with CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS enabled
+if(UNIX)
+ # Create ./symlink pointing back here.
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+ . "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
+ # Make find_package search through the symlink
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
+
+ # First, test the default behavior where symlinks are preserved.
+ set(SetFoundResolved_DIR "")
+ find_package(SetFoundResolved)
+ # The result must preserve the /symlink/ path.
+ set(SetFoundResolved_EXPECTED "${CMAKE_CURRENT_SOURCE_DIR}/symlink/cmake")
+ if(NOT "${SetFoundResolved_DIR}" STREQUAL "${SetFoundResolved_EXPECTED}")
+ message(SEND_ERROR "SetFoundResolved_DIR set by find_package() is set to \"${SetFoundResolved_DIR}\" (expected \"${SetFoundResolved_EXPECTED}\")")
+ endif()
+
+ # Resolve symlinks when finding the package.
+ set(CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS TRUE)
+ set(SetFoundResolved_DIR "")
+ find_package(SetFoundResolved)
+ # ./symlink points back here so it should be gone when resolved.
+ set(SetFoundResolved_EXPECTED "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+ if(NOT "${SetFoundResolved_DIR}" STREQUAL "${SetFoundResolved_EXPECTED}")
+ message(SEND_ERROR "SetFoundResolved_DIR set by find_package() is set to \"${SetFoundResolved_DIR}\" (expected \"${SetFoundResolved_EXPECTED}\")")
+ endif()
+ # Cleanup.
+ unset(CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS)
+ file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
+endif()
+
# Test <PackageName>_DIR environment variable.
# We erase the main prefix path to ensure the env var is used.
set(CMAKE_PREFIX_PATH)
@@ -461,912 +492,6 @@ if(Relocatable_FOUND)
endif()
-#-----------------------------------------------------------------------------
-# Test write_basic_config_version_file().
-
-include(WriteBasicConfigVersionFile)
-
-set(_compatibilities AnyNewerVersion
- SameMajorVersion
- SameMinorVersion
- ExactVersion)
-
-function(TEST_WRITE_BASIC_CONFIG_VERSION_FILE_PREPARE _version_installed)
- set(_same_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
- set(_no_CMAKE_SIZEOF_VOID_P "")
- math(EXPR _diff_CMAKE_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P} + 1")
- foreach(_compat ${_compatibilities})
- set(_pkg ${_compat}${_version_installed})
- string(REPLACE "." "" _pkg ${_pkg})
- set(_filename "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}ConfigVersion.cmake")
- set(_filename_novoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}NoVoidConfigVersion.cmake")
- set(_filename_diffvoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}DiffVoidConfigVersion.cmake")
-
- set(CMAKE_SIZEOF_VOID_P ${_same_CMAKE_SIZEOF_VOID_P})
- write_basic_config_version_file("${_filename}"
- VERSION ${_version_installed}
- COMPATIBILITY ${_compat})
-
- # Test that an empty CMAKE_SIZEOF_VOID_P is accepted:
- set(CMAKE_SIZEOF_VOID_P ${_no_CMAKE_SIZEOF_VOID_P})
- write_basic_config_version_file("${_filename_novoid}"
- VERSION ${_version_installed}
- COMPATIBILITY ${_compat})
-
- # Test that a different CMAKE_SIZEOF_VOID_P results in
- # PACKAGE_VERSION_UNSUITABLE
- set(CMAKE_SIZEOF_VOID_P ${_diff_CMAKE_SIZEOF_VOID_P})
- write_basic_config_version_file("${_filename_diffvoid}"
- VERSION ${_version_installed}
- COMPATIBILITY ${_compat})
- endforeach()
-endfunction()
-
-macro(TEST_WRITE_BASIC_CONFIG_VERSION_FILE_CHECK _filename)
- include("${_filename}")
-
- if(_expected_compatible AND NOT PACKAGE_VERSION_COMPATIBLE)
- message(SEND_ERROR "Did not find package with version ${_version_installed} (${_version_requested} was requested)!")
- elseif(NOT _expected_compatible AND PACKAGE_VERSION_COMPATIBLE)
- message(SEND_ERROR "Found package with version ${_version_installed}, but ${_version_requested} was requested!")
- endif()
-
- if(${_expected_exact} AND NOT PACKAGE_VERSION_EXACT)
- message(SEND_ERROR "PACKAGE_VERSION_EXACT not set, although it should be!")
- elseif(NOT ${_expected_exact} AND PACKAGE_VERSION_EXACT)
- message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be!")
- endif()
-
- if(${_expected_unsuitable} AND NOT PACKAGE_VERSION_UNSUITABLE)
- message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE set, although it should not be!")
- elseif(NOT ${_expected_unsuitable} AND PACKAGE_VERSION_UNSUITABLE)
- message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE not set, although it should be!")
- endif()
-
- unset(PACKAGE_VERSION_COMPATIBLE)
- unset(PACKAGE_VERSION_EXACT)
- unset(PACKAGE_VERSION_UNSUITABLE)
-endmacro()
-
-function(TEST_WRITE_BASIC_CONFIG_VERSION_FILE _version_installed
- _version_requested
- _expected_compatible_AnyNewerVersion
- _expected_compatible_SameMajorVersion
- _expected_compatible_SameMinorVersion
- _expected_compatible_ExactVersion)
- set(PACKAGE_FIND_VERSION ${_version_requested})
- if("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
- set(PACKAGE_FIND_VERSION_MAJOR "${CMAKE_MATCH_1}")
- set(PACKAGE_FIND_VERSION_MINOR "${CMAKE_MATCH_2}")
- set(PACKAGE_FIND_VERSION_PATCH "${CMAKE_MATCH_3}")
- set(PACKAGE_FIND_VERSION_TWEAK "${CMAKE_MATCH_4}")
- elseif("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$")
- set(PACKAGE_FIND_VERSION_MAJOR "${CMAKE_MATCH_1}")
- set(PACKAGE_FIND_VERSION_MINOR "${CMAKE_MATCH_2}")
- set(PACKAGE_FIND_VERSION_PATCH "${CMAKE_MATCH_3}")
- set(PACKAGE_FIND_VERSION_TWEAK "")
- elseif("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)$")
- set(PACKAGE_FIND_VERSION_MAJOR "${CMAKE_MATCH_1}")
- set(PACKAGE_FIND_VERSION_MINOR "${CMAKE_MATCH_2}")
- set(PACKAGE_FIND_VERSION_PATCH "")
- set(PACKAGE_FIND_VERSION_TWEAK "")
- elseif("${PACKAGE_FIND_VERSION}" MATCHES "^([0-9]+)$")
- set(PACKAGE_FIND_VERSION_MAJOR "${CMAKE_MATCH_1}")
- set(PACKAGE_FIND_VERSION_MINOR "")
- set(PACKAGE_FIND_VERSION_PATCH "")
- set(PACKAGE_FIND_VERSION_TWEAK "")
- elseif("${PACKAGE_FIND_VERSION}" STREQUAL "")
- set(PACKAGE_FIND_VERSION_MAJOR "")
- set(PACKAGE_FIND_VERSION_MINOR "")
- set(PACKAGE_FIND_VERSION_PATCH "")
- set(PACKAGE_FIND_VERSION_TWEAK "")
- else()
- message(FATAL_ERROR "_version_requested (${_version_requested}) should be a version number")
- endif()
-
- if ("${_version_installed}" STREQUAL "${_version_requested}")
- set(_expected_exact 1)
- else()
- set(_expected_exact 0)
- endif()
-
- unset(PACKAGE_VERSION_COMPATIBLE)
- unset(PACKAGE_VERSION_EXACT)
- unset(PACKAGE_VERSION_UNSUITABLE)
-
- foreach(_compat ${_compatibilities})
- set(_pkg ${_compat}${_version_installed})
- string(REPLACE "." "" _pkg ${_pkg})
- set(_filename "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}ConfigVersion.cmake")
- set(_filename_novoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}NoVoidConfigVersion.cmake")
- set(_filename_diffvoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}DiffVoidConfigVersion.cmake")
-
- set(_expected_compatible ${_expected_compatible_${_compat}})
-
- # Test "normal" version
- set(_expected_unsuitable 0)
- message("TEST write_basic_config_version_file(VERSION ${_version_installed} \
-COMPATIBILITY ${_compat}) vs. ${_version_requested} \
-(expected compatible = ${_expected_compatible}, exact = ${_expected_exact}, unsuitable = ${_expected_unsuitable})")
- test_write_basic_config_version_file_check("${_filename}")
-
- # test empty CMAKE_SIZEOF_VOID_P version:
- set(_expected_unsuitable 0)
- message("TEST write_basic_config_version_file(VERSION ${_version_installed} \
-COMPATIBILITY ${_compat}) vs. ${_version_requested} (no CMAKE_SIZEOF_VOID_P) \
-(expected compatible = ${_expected_compatible}, exact = ${_expected_exact}, unsuitable = ${_expected_unsuitable})")
- test_write_basic_config_version_file_check("${_filename_novoid}")
-
- # test different CMAKE_SIZEOF_VOID_P version:
- set(_expected_unsuitable 1)
- message("TEST write_basic_config_version_file(VERSION ${_version_installed} \
-COMPATIBILITY ${_compat}) vs. ${_version_requested} (different CMAKE_SIZEOF_VOID_P) \
-(expected compatible = ${_expected_compatible}, exact = ${_expected_exact}, unsuitable = ${_expected_unsuitable})")
- test_write_basic_config_version_file_check("${_filename_diffvoid}")
-
- endforeach()
-endfunction()
-
-
-test_write_basic_config_version_file_prepare(4)
-test_write_basic_config_version_file_prepare(4.5)
-test_write_basic_config_version_file_prepare(4.5.6)
-test_write_basic_config_version_file_prepare(4.5.6.7)
-
-# AnyNewerVersion
-# | SameMajorVersion
-# | | SameMinorVersion
-# | | | ExactVersion
-# | | | |
-test_write_basic_config_version_file(4 0 1 0 0 0) # Request 0
-test_write_basic_config_version_file(4 2 1 0 0 0) # Request [older major]
-test_write_basic_config_version_file(4 4 1 1 1 1) # Request [same major]
-test_write_basic_config_version_file(4 9 0 0 0 0) # Request [newer major]
-
-test_write_basic_config_version_file(4 0.0 1 0 0 0) # Request 0.0
-test_write_basic_config_version_file(4 0.9 1 0 0 0) # Request 0.[newer minor]
-test_write_basic_config_version_file(4 2.0 1 0 0 0) # Request [older major].0
-test_write_basic_config_version_file(4 2.9 1 0 0 0) # Request [older major].[newer minor]
-test_write_basic_config_version_file(4 4.0 1 1 0 0) # Request [same major].0
-test_write_basic_config_version_file(4 4.9 0 0 0 0) # Request [same major].[newer minor]
-test_write_basic_config_version_file(4 9.0 0 0 0 0) # Request [newer major].0
-test_write_basic_config_version_file(4 9.9 0 0 0 0) # Request [newer major].[newer minor]
-
-test_write_basic_config_version_file(4 0.0.0 1 0 0 0) # Request 0.0.0
-test_write_basic_config_version_file(4 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
-test_write_basic_config_version_file(4 0.9.0 1 0 0 0) # Request 0.[newer minor].0
-test_write_basic_config_version_file(4 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
-test_write_basic_config_version_file(4 2.0.0 1 0 0 0) # Request [older major].0.0
-test_write_basic_config_version_file(4 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
-test_write_basic_config_version_file(4 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
-test_write_basic_config_version_file(4 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4 4.0.0 1 1 0 0) # Request [same major].0.0
-test_write_basic_config_version_file(4 4.0.9 0 0 0 0) # Request [same major].0.[newer patch]
-test_write_basic_config_version_file(4 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
-test_write_basic_config_version_file(4 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4 9.0.0 0 0 0 0) # Request [newer major].0.0
-test_write_basic_config_version_file(4 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
-test_write_basic_config_version_file(4 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
-test_write_basic_config_version_file(4 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
-
-test_write_basic_config_version_file(4 0.0.0.0 1 0 0 0) # Request 0.0.0.0
-test_write_basic_config_version_file(4 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
-test_write_basic_config_version_file(4 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
-test_write_basic_config_version_file(4 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
-test_write_basic_config_version_file(4 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
-test_write_basic_config_version_file(4 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
-test_write_basic_config_version_file(4 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
-test_write_basic_config_version_file(4 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
-test_write_basic_config_version_file(4 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
-test_write_basic_config_version_file(4 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
-test_write_basic_config_version_file(4 4.0.0.9 0 0 0 0) # Request [same major].0.0.[newer tweak]
-test_write_basic_config_version_file(4 4.0.9.0 0 0 0 0) # Request [same major].0.[newer patch].0
-test_write_basic_config_version_file(4 4.0.9.9 0 0 0 0) # Request [same major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
-test_write_basic_config_version_file(4 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
-test_write_basic_config_version_file(4 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
-test_write_basic_config_version_file(4 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
-test_write_basic_config_version_file(4 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
-test_write_basic_config_version_file(4 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
-
-
-
-test_write_basic_config_version_file(4.5 0 1 0 0 0) # Request 0
-test_write_basic_config_version_file(4.5 2 1 0 0 0) # Request [older major]
-test_write_basic_config_version_file(4.5 4 1 1 0 0) # Request [same major]
-test_write_basic_config_version_file(4.5 9 0 0 0 0) # Request [newer major]
-
-test_write_basic_config_version_file(4.5 0.0 1 0 0 0) # Request 0.0
-test_write_basic_config_version_file(4.5 0.2 1 0 0 0) # Request 0.[older minor]
-test_write_basic_config_version_file(4.5 0.5 1 0 0 0) # Request 0.[same minor]
-test_write_basic_config_version_file(4.5 0.9 1 0 0 0) # Request 0.[newer minor]
-test_write_basic_config_version_file(4.5 2.0 1 0 0 0) # Request [older major].0
-test_write_basic_config_version_file(4.5 2.2 1 0 0 0) # Request [older major].[older minor]
-test_write_basic_config_version_file(4.5 2.5 1 0 0 0) # Request [older major].[same minor]
-test_write_basic_config_version_file(4.5 2.9 1 0 0 0) # Request [older major].[newer minor]
-test_write_basic_config_version_file(4.5 4.0 1 1 0 0) # Request [same major].0
-test_write_basic_config_version_file(4.5 4.2 1 1 0 0) # Request [same major].[older minor]
-test_write_basic_config_version_file(4.5 4.5 1 1 1 1) # Request [same major].[same minor]
-test_write_basic_config_version_file(4.5 4.9 0 0 0 0) # Request [same major].[newer minor]
-test_write_basic_config_version_file(4.5 9.0 0 0 0 0) # Request [newer major].0
-test_write_basic_config_version_file(4.5 9.1 0 0 0 0) # Request [newer major].[older minor]
-test_write_basic_config_version_file(4.5 9.5 0 0 0 0) # Request [newer major].[same minor]
-test_write_basic_config_version_file(4.5 9.9 0 0 0 0) # Request [newer major].[newer minor]
-
-test_write_basic_config_version_file(4.5 0.0.0 1 0 0 0) # Request 0.0.0
-test_write_basic_config_version_file(4.5 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
-test_write_basic_config_version_file(4.5 0.2.0 1 0 0 0) # Request 0.[older minor].0
-test_write_basic_config_version_file(4.5 0.2.9 1 0 0 0) # Request 0.[older minor].[newer patch]
-test_write_basic_config_version_file(4.5 0.5.0 1 0 0 0) # Request 0.[same minor].0
-test_write_basic_config_version_file(4.5 0.5.9 1 0 0 0) # Request 0.[same minor].[newer patch]
-test_write_basic_config_version_file(4.5 0.9.0 1 0 0 0) # Request 0.[newer minor].0
-test_write_basic_config_version_file(4.5 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5 2.0.0 1 0 0 0) # Request [older major].0.0
-test_write_basic_config_version_file(4.5 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
-test_write_basic_config_version_file(4.5 2.2.0 1 0 0 0) # Request [older major].[older minor].0
-test_write_basic_config_version_file(4.5 2.2.9 1 0 0 0) # Request [older major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5 2.5.0 1 0 0 0) # Request [older major].[same minor].0
-test_write_basic_config_version_file(4.5 2.5.9 1 0 0 0) # Request [older major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
-test_write_basic_config_version_file(4.5 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5 4.0.0 1 1 0 0) # Request [same major].0.0
-test_write_basic_config_version_file(4.5 4.0.9 1 1 0 0) # Request [same major].0.[newer patch]
-test_write_basic_config_version_file(4.5 4.2.0 1 1 0 0) # Request [same major].[older minor].0
-test_write_basic_config_version_file(4.5 4.2.9 1 1 0 0) # Request [same major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5 4.5.0 1 1 1 0) # Request [same major].[same minor].0
-test_write_basic_config_version_file(4.5 4.5.9 0 0 0 0) # Request [same major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
-test_write_basic_config_version_file(4.5 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5 9.0.0 0 0 0 0) # Request [newer major].0.0
-test_write_basic_config_version_file(4.5 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
-test_write_basic_config_version_file(4.5 9.2.0 0 0 0 0) # Request [newer major].[older minor].0
-test_write_basic_config_version_file(4.5 9.2.9 0 0 0 0) # Request [newer major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5 9.5.0 0 0 0 0) # Request [newer major].[same minor].0
-test_write_basic_config_version_file(4.5 9.5.9 0 0 0 0) # Request [newer major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
-test_write_basic_config_version_file(4.5 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
-
-test_write_basic_config_version_file(4.5 0.0.0.0 1 0 0 0) # Request 0.0.0.0
-test_write_basic_config_version_file(4.5 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
-test_write_basic_config_version_file(4.5 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
-test_write_basic_config_version_file(4.5 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 0.2.0.0 1 0 0 0) # Request 0.[older minor].0.0
-test_write_basic_config_version_file(4.5 0.2.0.9 1 0 0 0) # Request 0.[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 0.2.9.0 1 0 0 0) # Request 0.[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5 0.2.9.9 1 0 0 0) # Request 0.[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 0.5.0.0 1 0 0 0) # Request 0.[same minor].0.0
-test_write_basic_config_version_file(4.5 0.5.0.9 1 0 0 0) # Request 0.[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 0.5.9.0 1 0 0 0) # Request 0.[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5 0.5.9.9 1 0 0 0) # Request 0.[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
-test_write_basic_config_version_file(4.5 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
-test_write_basic_config_version_file(4.5 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
-test_write_basic_config_version_file(4.5 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 2.2.0.0 1 0 0 0) # Request [older major].[older minor].0.0
-test_write_basic_config_version_file(4.5 2.2.0.9 1 0 0 0) # Request [older major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 2.2.9.0 1 0 0 0) # Request [older major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5 2.2.9.9 1 0 0 0) # Request [older major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 2.5.0.0 1 0 0 0) # Request [older major].[same minor].0.0
-test_write_basic_config_version_file(4.5 2.5.0.9 1 0 0 0) # Request [older major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 2.5.9.0 1 0 0 0) # Request [older major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5 2.5.9.9 1 0 0 0) # Request [older major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
-test_write_basic_config_version_file(4.5 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
-test_write_basic_config_version_file(4.5 4.0.0.9 1 1 0 0) # Request [same major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5 4.0.9.0 1 1 0 0) # Request [same major].0.[newer patch].0
-test_write_basic_config_version_file(4.5 4.0.9.9 1 1 0 0) # Request [same major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 4.2.0.0 1 1 0 0) # Request [same major].[older minor].0.0
-test_write_basic_config_version_file(4.5 4.2.0.9 1 1 0 0) # Request [same major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 4.2.9.0 1 1 0 0) # Request [same major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5 4.2.9.9 1 1 0 0) # Request [same major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 4.5.0.0 1 1 1 0) # Request [same major].[same minor].0.0
-test_write_basic_config_version_file(4.5 4.5.0.9 0 0 0 0) # Request [same major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 4.5.9.0 0 0 0 0) # Request [same major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5 4.5.9.9 0 0 0 0) # Request [same major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
-test_write_basic_config_version_file(4.5 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
-test_write_basic_config_version_file(4.5 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
-test_write_basic_config_version_file(4.5 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 9.2.0.0 0 0 0 0) # Request [newer major].[older minor].0.0
-test_write_basic_config_version_file(4.5 9.2.0.9 0 0 0 0) # Request [newer major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 9.2.9.0 0 0 0 0) # Request [newer major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5 9.2.9.9 0 0 0 0) # Request [newer major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 9.5.0.0 0 0 0 0) # Request [newer major].[same minor].0.0
-test_write_basic_config_version_file(4.5 9.5.0.9 0 0 0 0) # Request [newer major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 9.5.9.0 0 0 0 0) # Request [newer major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5 9.5.9.9 0 0 0 0) # Request [newer major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
-test_write_basic_config_version_file(4.5 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
-
-
-test_write_basic_config_version_file(4.5.6 0 1 0 0 0) # Request 0
-test_write_basic_config_version_file(4.5.6 2 1 0 0 0) # Request [older major]
-test_write_basic_config_version_file(4.5.6 4 1 1 0 0) # Request [same major]
-test_write_basic_config_version_file(4.5.6 9 0 0 0 0) # Request [newer major]
-
-test_write_basic_config_version_file(4.5.6 0.0 1 0 0 0) # Request 0.0
-test_write_basic_config_version_file(4.5.6 0.2 1 0 0 0) # Request 0.[older minor]
-test_write_basic_config_version_file(4.5.6 0.5 1 0 0 0) # Request 0.[same minor]
-test_write_basic_config_version_file(4.5.6 0.9 1 0 0 0) # Request 0.[newer minor]
-test_write_basic_config_version_file(4.5.6 2.0 1 0 0 0) # Request [older major].0
-test_write_basic_config_version_file(4.5.6 2.2 1 0 0 0) # Request [older major].[older minor]
-test_write_basic_config_version_file(4.5.6 2.5 1 0 0 0) # Request [older major].[same minor]
-test_write_basic_config_version_file(4.5.6 2.9 1 0 0 0) # Request [older major].[newer minor]
-test_write_basic_config_version_file(4.5.6 4.0 1 1 0 0) # Request [same major].0
-test_write_basic_config_version_file(4.5.6 4.2 1 1 0 0) # Request [same major].[older minor]
-test_write_basic_config_version_file(4.5.6 4.5 1 1 1 0) # Request [same major].[same minor]
-test_write_basic_config_version_file(4.5.6 4.9 0 0 0 0) # Request [same major].[newer minor]
-test_write_basic_config_version_file(4.5.6 9.0 0 0 0 0) # Request [newer major].0
-test_write_basic_config_version_file(4.5.6 9.1 0 0 0 0) # Request [newer major].[older minor]
-test_write_basic_config_version_file(4.5.6 9.5 0 0 0 0) # Request [newer major].[same minor]
-test_write_basic_config_version_file(4.5.6 9.9 0 0 0 0) # Request [newer major].[newer minor]
-
-test_write_basic_config_version_file(4.5.6 0.0.0 1 0 0 0) # Request 0.0.0
-test_write_basic_config_version_file(4.5.6 0.0.2 1 0 0 0) # Request 0.0.[older patch]
-test_write_basic_config_version_file(4.5.6 0.0.6 1 0 0 0) # Request 0.0.[same patch]
-test_write_basic_config_version_file(4.5.6 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
-test_write_basic_config_version_file(4.5.6 0.2.0 1 0 0 0) # Request 0.[older minor].0
-test_write_basic_config_version_file(4.5.6 0.2.2 1 0 0 0) # Request 0.[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6 0.2.6 1 0 0 0) # Request 0.[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6 0.2.9 1 0 0 0) # Request 0.[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 0.5.0 1 0 0 0) # Request 0.[same minor].0
-test_write_basic_config_version_file(4.5.6 0.5.2 1 0 0 0) # Request 0.[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6 0.5.6 1 0 0 0) # Request 0.[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6 0.5.9 1 0 0 0) # Request 0.[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 0.9.0 1 0 0 0) # Request 0.[newer minor].0
-test_write_basic_config_version_file(4.5.6 0.9.2 1 0 0 0) # Request 0.[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6 0.9.6 1 0 0 0) # Request 0.[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 2.0.0 1 0 0 0) # Request [older major].0.0
-test_write_basic_config_version_file(4.5.6 2.0.2 1 0 0 0) # Request [older major].0.[older patch]
-test_write_basic_config_version_file(4.5.6 2.0.6 1 0 0 0) # Request [older major].0.[same patch]
-test_write_basic_config_version_file(4.5.6 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
-test_write_basic_config_version_file(4.5.6 2.2.0 1 0 0 0) # Request [older major].[older minor].0
-test_write_basic_config_version_file(4.5.6 2.2.2 1 0 0 0) # Request [older major].[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6 2.2.6 1 0 0 0) # Request [older major].[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6 2.2.9 1 0 0 0) # Request [older major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 2.5.0 1 0 0 0) # Request [older major].[same minor].0
-test_write_basic_config_version_file(4.5.6 2.5.2 1 0 0 0) # Request [older major].[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6 2.5.6 1 0 0 0) # Request [older major].[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6 2.5.9 1 0 0 0) # Request [older major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
-test_write_basic_config_version_file(4.5.6 2.9.2 1 0 0 0) # Request [older major].[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6 2.9.6 1 0 0 0) # Request [older major].[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 4.0.0 1 1 0 0) # Request [same major].0.0
-test_write_basic_config_version_file(4.5.6 4.0.2 1 1 0 0) # Request [same major].0.[older patch]
-test_write_basic_config_version_file(4.5.6 4.0.6 1 1 0 0) # Request [same major].0.[same patch]
-test_write_basic_config_version_file(4.5.6 4.0.9 1 1 0 0) # Request [same major].0.[newer patch]
-test_write_basic_config_version_file(4.5.6 4.2.0 1 1 0 0) # Request [same major].[older minor].0
-test_write_basic_config_version_file(4.5.6 4.2.2 1 1 0 0) # Request [same major].[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6 4.2.6 1 1 0 0) # Request [same major].[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6 4.2.9 1 1 0 0) # Request [same major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 4.5.0 1 1 1 0) # Request [same major].[same minor].0
-test_write_basic_config_version_file(4.5.6 4.5.2 1 1 1 0) # Request [same major].[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6 4.5.6 1 1 1 1) # Request [same major].[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6 4.5.9 0 0 0 0) # Request [same major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
-test_write_basic_config_version_file(4.5.6 4.9.2 0 0 0 0) # Request [same major].[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6 4.9.6 0 0 0 0) # Request [same major].[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 9.0.0 0 0 0 0) # Request [newer major].0.0
-test_write_basic_config_version_file(4.5.6 9.0.2 0 0 0 0) # Request [newer major].0.[older patch]
-test_write_basic_config_version_file(4.5.6 9.0.6 0 0 0 0) # Request [newer major].0.[same patch]
-test_write_basic_config_version_file(4.5.6 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
-test_write_basic_config_version_file(4.5.6 9.2.0 0 0 0 0) # Request [newer major].[older minor].0
-test_write_basic_config_version_file(4.5.6 9.2.2 0 0 0 0) # Request [newer major].[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6 9.2.6 0 0 0 0) # Request [newer major].[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6 9.2.9 0 0 0 0) # Request [newer major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 9.5.0 0 0 0 0) # Request [newer major].[same minor].0
-test_write_basic_config_version_file(4.5.6 9.5.2 0 0 0 0) # Request [newer major].[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6 9.5.6 0 0 0 0) # Request [newer major].[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6 9.5.9 0 0 0 0) # Request [newer major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
-test_write_basic_config_version_file(4.5.6 9.9.2 0 0 0 0) # Request [newer major].[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6 9.9.6 0 0 0 0) # Request [newer major].[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
-
-test_write_basic_config_version_file(4.5.6 0.0.0.0 1 0 0 0) # Request 0.0.0.0
-test_write_basic_config_version_file(4.5.6 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.0.2.0 1 0 0 0) # Request 0.0.[older patch].0
-test_write_basic_config_version_file(4.5.6 0.0.2.9 1 0 0 0) # Request 0.0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.0.6.0 1 0 0 0) # Request 0.0.[same patch].0
-test_write_basic_config_version_file(4.5.6 0.0.6.9 1 0 0 0) # Request 0.0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
-test_write_basic_config_version_file(4.5.6 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.2.0.0 1 0 0 0) # Request 0.[older minor].0.0
-test_write_basic_config_version_file(4.5.6 0.2.0.9 1 0 0 0) # Request 0.[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.2.2.0 1 0 0 0) # Request 0.[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 0.2.2.9 1 0 0 0) # Request 0.[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.2.6.0 1 0 0 0) # Request 0.[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 0.2.6.9 1 0 0 0) # Request 0.[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.2.9.0 1 0 0 0) # Request 0.[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 0.2.9.9 1 0 0 0) # Request 0.[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.5.0.0 1 0 0 0) # Request 0.[same minor].0.0
-test_write_basic_config_version_file(4.5.6 0.5.0.9 1 0 0 0) # Request 0.[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.5.2.0 1 0 0 0) # Request 0.[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 0.5.2.9 1 0 0 0) # Request 0.[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.5.6.0 1 0 0 0) # Request 0.[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 0.5.6.9 1 0 0 0) # Request 0.[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.5.9.0 1 0 0 0) # Request 0.[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 0.5.9.9 1 0 0 0) # Request 0.[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
-test_write_basic_config_version_file(4.5.6 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.9.2.0 1 0 0 0) # Request 0.[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 0.9.2.9 1 0 0 0) # Request 0.[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.9.6.0 1 0 0 0) # Request 0.[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 0.9.6.9 1 0 0 0) # Request 0.[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
-test_write_basic_config_version_file(4.5.6 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.0.2.0 1 0 0 0) # Request [older major].0.[older patch].0
-test_write_basic_config_version_file(4.5.6 2.0.2.9 1 0 0 0) # Request [older major].0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.0.6.0 1 0 0 0) # Request [older major].0.[same patch].0
-test_write_basic_config_version_file(4.5.6 2.0.6.9 1 0 0 0) # Request [older major].0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
-test_write_basic_config_version_file(4.5.6 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.2.0.0 1 0 0 0) # Request [older major].[older minor].0.0
-test_write_basic_config_version_file(4.5.6 2.2.0.9 1 0 0 0) # Request [older major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.2.2.0 1 0 0 0) # Request [older major].[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 2.2.2.9 1 0 0 0) # Request [older major].[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.2.6.0 1 0 0 0) # Request [older major].[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 2.2.6.9 1 0 0 0) # Request [older major].[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.2.9.0 1 0 0 0) # Request [older major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 2.2.9.9 1 0 0 0) # Request [older major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.5.0.0 1 0 0 0) # Request [older major].[same minor].0.0
-test_write_basic_config_version_file(4.5.6 2.5.0.9 1 0 0 0) # Request [older major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.5.2.0 1 0 0 0) # Request [older major].[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 2.5.2.9 1 0 0 0) # Request [older major].[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.5.6.0 1 0 0 0) # Request [older major].[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 2.5.6.9 1 0 0 0) # Request [older major].[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.5.9.0 1 0 0 0) # Request [older major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 2.5.9.9 1 0 0 0) # Request [older major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
-test_write_basic_config_version_file(4.5.6 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.9.2.0 1 0 0 0) # Request [older major].[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 2.9.2.9 1 0 0 0) # Request [older major].[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.9.6.0 1 0 0 0) # Request [older major].[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 2.9.6.9 1 0 0 0) # Request [older major].[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
-test_write_basic_config_version_file(4.5.6 4.0.0.9 1 1 0 0) # Request [same major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.0.2.0 1 1 0 0) # Request [same major].0.[older patch].0
-test_write_basic_config_version_file(4.5.6 4.0.2.9 1 1 0 0) # Request [same major].0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.0.6.0 1 1 0 0) # Request [same major].0.[same patch].0
-test_write_basic_config_version_file(4.5.6 4.0.6.9 1 1 0 0) # Request [same major].0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.0.9.0 1 1 0 0) # Request [same major].0.[newer patch].0
-test_write_basic_config_version_file(4.5.6 4.0.9.9 1 1 0 0) # Request [same major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.2.0.0 1 1 0 0) # Request [same major].[older minor].0.0
-test_write_basic_config_version_file(4.5.6 4.2.0.9 1 1 0 0) # Request [same major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.2.2.0 1 1 0 0) # Request [same major].[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 4.2.2.9 1 1 0 0) # Request [same major].[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.2.6.0 1 1 0 0) # Request [same major].[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 4.2.6.9 1 1 0 0) # Request [same major].[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.2.9.0 1 1 0 0) # Request [same major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 4.2.9.9 1 1 0 0) # Request [same major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.5.0.0 1 1 1 0) # Request [same major].[same minor].0.0
-test_write_basic_config_version_file(4.5.6 4.5.0.9 1 1 1 0) # Request [same major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.5.2.0 1 1 1 0) # Request [same major].[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 4.5.2.9 1 1 1 0) # Request [same major].[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.5.6.0 1 1 1 1) # Request [same major].[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 4.5.6.9 0 0 0 1) # Request [same major].[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.5.9.0 0 0 0 0) # Request [same major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 4.5.9.9 0 0 0 0) # Request [same major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
-test_write_basic_config_version_file(4.5.6 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.9.2.0 0 0 0 0) # Request [same major].[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 4.9.2.9 0 0 0 0) # Request [same major].[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.9.6.0 0 0 0 0) # Request [same major].[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 4.9.6.9 0 0 0 0) # Request [same major].[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
-test_write_basic_config_version_file(4.5.6 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.0.2.0 0 0 0 0) # Request [newer major].0.[older patch].0
-test_write_basic_config_version_file(4.5.6 9.0.2.9 0 0 0 0) # Request [newer major].0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.0.6.0 0 0 0 0) # Request [newer major].0.[same patch].0
-test_write_basic_config_version_file(4.5.6 9.0.6.9 0 0 0 0) # Request [newer major].0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
-test_write_basic_config_version_file(4.5.6 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.2.0.0 0 0 0 0) # Request [newer major].[older minor].0.0
-test_write_basic_config_version_file(4.5.6 9.2.0.9 0 0 0 0) # Request [newer major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.2.2.0 0 0 0 0) # Request [newer major].[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 9.2.2.9 0 0 0 0) # Request [newer major].[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.2.6.0 0 0 0 0) # Request [newer major].[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 9.2.6.9 0 0 0 0) # Request [newer major].[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.2.9.0 0 0 0 0) # Request [newer major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 9.2.9.9 0 0 0 0) # Request [newer major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.5.0.0 0 0 0 0) # Request [newer major].[same minor].0.0
-test_write_basic_config_version_file(4.5.6 9.5.0.9 0 0 0 0) # Request [newer major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.5.2.0 0 0 0 0) # Request [newer major].[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 9.5.2.9 0 0 0 0) # Request [newer major].[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.5.6.0 0 0 0 0) # Request [newer major].[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 9.5.6.9 0 0 0 0) # Request [newer major].[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.5.9.0 0 0 0 0) # Request [newer major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 9.5.9.9 0 0 0 0) # Request [newer major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
-test_write_basic_config_version_file(4.5.6 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.9.2.0 0 0 0 0) # Request [newer major].[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6 9.9.2.9 0 0 0 0) # Request [newer major].[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.9.6.0 0 0 0 0) # Request [newer major].[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6 9.9.6.9 0 0 0 0) # Request [newer major].[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
-
-
-test_write_basic_config_version_file(4.5.6.7 0 1 0 0 0) # Request 0
-test_write_basic_config_version_file(4.5.6.7 2 1 0 0 0) # Request [older major]
-test_write_basic_config_version_file(4.5.6.7 4 1 1 0 0) # Request [same major]
-test_write_basic_config_version_file(4.5.6.7 9 0 0 0 0) # Request [newer major]
-
-test_write_basic_config_version_file(4.5.6.7 0.0 1 0 0 0) # Request 0.0
-test_write_basic_config_version_file(4.5.6.7 0.2 1 0 0 0) # Request 0.[older minor]
-test_write_basic_config_version_file(4.5.6.7 0.5 1 0 0 0) # Request 0.[same minor]
-test_write_basic_config_version_file(4.5.6.7 0.9 1 0 0 0) # Request 0.[newer minor]
-test_write_basic_config_version_file(4.5.6.7 2.0 1 0 0 0) # Request [older major].0
-test_write_basic_config_version_file(4.5.6.7 2.2 1 0 0 0) # Request [older major].[older minor]
-test_write_basic_config_version_file(4.5.6.7 2.5 1 0 0 0) # Request [older major].[same minor]
-test_write_basic_config_version_file(4.5.6.7 2.9 1 0 0 0) # Request [older major].[newer minor]
-test_write_basic_config_version_file(4.5.6.7 4.0 1 1 0 0) # Request [same major].0
-test_write_basic_config_version_file(4.5.6.7 4.2 1 1 0 0) # Request [same major].[older minor]
-test_write_basic_config_version_file(4.5.6.7 4.5 1 1 1 0) # Request [same major].[same minor]
-test_write_basic_config_version_file(4.5.6.7 4.9 0 0 0 0) # Request [same major].[newer minor]
-test_write_basic_config_version_file(4.5.6.7 9.0 0 0 0 0) # Request [newer major].0
-test_write_basic_config_version_file(4.5.6.7 9.1 0 0 0 0) # Request [newer major].[older minor]
-test_write_basic_config_version_file(4.5.6.7 9.5 0 0 0 0) # Request [newer major].[same minor]
-test_write_basic_config_version_file(4.5.6.7 9.9 0 0 0 0) # Request [newer major].[newer minor]
-
-test_write_basic_config_version_file(4.5.6.7 0.0.0 1 0 0 0) # Request 0.0.0
-test_write_basic_config_version_file(4.5.6.7 0.0.2 1 0 0 0) # Request 0.0.[older patch]
-test_write_basic_config_version_file(4.5.6.7 0.0.6 1 0 0 0) # Request 0.0.[same patch]
-test_write_basic_config_version_file(4.5.6.7 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
-test_write_basic_config_version_file(4.5.6.7 0.2.0 1 0 0 0) # Request 0.[older minor].0
-test_write_basic_config_version_file(4.5.6.7 0.2.2 1 0 0 0) # Request 0.[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 0.2.6 1 0 0 0) # Request 0.[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 0.2.9 1 0 0 0) # Request 0.[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 0.5.0 1 0 0 0) # Request 0.[same minor].0
-test_write_basic_config_version_file(4.5.6.7 0.5.2 1 0 0 0) # Request 0.[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 0.5.6 1 0 0 0) # Request 0.[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 0.5.9 1 0 0 0) # Request 0.[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 0.9.0 1 0 0 0) # Request 0.[newer minor].0
-test_write_basic_config_version_file(4.5.6.7 0.9.2 1 0 0 0) # Request 0.[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 0.9.6 1 0 0 0) # Request 0.[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 2.0.0 1 0 0 0) # Request [older major].0.0
-test_write_basic_config_version_file(4.5.6.7 2.0.2 1 0 0 0) # Request [older major].0.[older patch]
-test_write_basic_config_version_file(4.5.6.7 2.0.6 1 0 0 0) # Request [older major].0.[same patch]
-test_write_basic_config_version_file(4.5.6.7 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
-test_write_basic_config_version_file(4.5.6.7 2.2.0 1 0 0 0) # Request [older major].[older minor].0
-test_write_basic_config_version_file(4.5.6.7 2.2.2 1 0 0 0) # Request [older major].[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 2.2.6 1 0 0 0) # Request [older major].[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 2.2.9 1 0 0 0) # Request [older major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 2.5.0 1 0 0 0) # Request [older major].[same minor].0
-test_write_basic_config_version_file(4.5.6.7 2.5.2 1 0 0 0) # Request [older major].[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 2.5.6 1 0 0 0) # Request [older major].[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 2.5.9 1 0 0 0) # Request [older major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
-test_write_basic_config_version_file(4.5.6.7 2.9.2 1 0 0 0) # Request [older major].[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 2.9.6 1 0 0 0) # Request [older major].[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 4.0.0 1 1 0 0) # Request [same major].0.0
-test_write_basic_config_version_file(4.5.6.7 4.0.2 1 1 0 0) # Request [same major].0.[older patch]
-test_write_basic_config_version_file(4.5.6.7 4.0.6 1 1 0 0) # Request [same major].0.[same patch]
-test_write_basic_config_version_file(4.5.6.7 4.0.9 1 1 0 0) # Request [same major].0.[newer patch]
-test_write_basic_config_version_file(4.5.6.7 4.2.0 1 1 0 0) # Request [same major].[older minor].0
-test_write_basic_config_version_file(4.5.6.7 4.2.2 1 1 0 0) # Request [same major].[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 4.2.6 1 1 0 0) # Request [same major].[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 4.2.9 1 1 0 0) # Request [same major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 4.5.0 1 1 1 0) # Request [same major].[same minor].0
-test_write_basic_config_version_file(4.5.6.7 4.5.2 1 1 1 0) # Request [same major].[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 4.5.6 1 1 1 1) # Request [same major].[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 4.5.9 0 0 0 0) # Request [same major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
-test_write_basic_config_version_file(4.5.6.7 4.9.2 0 0 0 0) # Request [same major].[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 4.9.6 0 0 0 0) # Request [same major].[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 9.0.0 0 0 0 0) # Request [newer major].0.0
-test_write_basic_config_version_file(4.5.6.7 9.0.2 0 0 0 0) # Request [newer major].0.[older patch]
-test_write_basic_config_version_file(4.5.6.7 9.0.6 0 0 0 0) # Request [newer major].0.[same patch]
-test_write_basic_config_version_file(4.5.6.7 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
-test_write_basic_config_version_file(4.5.6.7 9.2.0 0 0 0 0) # Request [newer major].[older minor].0
-test_write_basic_config_version_file(4.5.6.7 9.2.2 0 0 0 0) # Request [newer major].[older minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 9.2.6 0 0 0 0) # Request [newer major].[older minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 9.2.9 0 0 0 0) # Request [newer major].[older minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 9.5.0 0 0 0 0) # Request [newer major].[same minor].0
-test_write_basic_config_version_file(4.5.6.7 9.5.2 0 0 0 0) # Request [newer major].[same minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 9.5.6 0 0 0 0) # Request [newer major].[same minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 9.5.9 0 0 0 0) # Request [newer major].[same minor].[newer patch]
-test_write_basic_config_version_file(4.5.6.7 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
-test_write_basic_config_version_file(4.5.6.7 9.9.2 0 0 0 0) # Request [newer major].[newer minor].[older patch]
-test_write_basic_config_version_file(4.5.6.7 9.9.6 0 0 0 0) # Request [newer major].[newer minor].[same patch]
-test_write_basic_config_version_file(4.5.6.7 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
-
-test_write_basic_config_version_file(4.5.6.7 0.0.0.0 1 0 0 0) # Request 0.0.0.0
-test_write_basic_config_version_file(4.5.6.7 0.0.0.2 1 0 0 0) # Request 0.0.0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.0.7 1 0 0 0) # Request 0.0.0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.2.0 1 0 0 0) # Request 0.0.[older patch].0
-test_write_basic_config_version_file(4.5.6.7 0.0.2.2 1 0 0 0) # Request 0.0.[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.2.7 1 0 0 0) # Request 0.0.[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.2.9 1 0 0 0) # Request 0.0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.6.0 1 0 0 0) # Request 0.0.[same patch].0
-test_write_basic_config_version_file(4.5.6.7 0.0.6.2 1 0 0 0) # Request 0.0.[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.6.7 1 0 0 0) # Request 0.0.[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.6.9 1 0 0 0) # Request 0.0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 0.0.9.2 1 0 0 0) # Request 0.0.[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.9.7 1 0 0 0) # Request 0.0.[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.0.0 1 0 0 0) # Request 0.[older minor].0.0
-test_write_basic_config_version_file(4.5.6.7 0.2.0.2 1 0 0 0) # Request 0.[older minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.0.7 1 0 0 0) # Request 0.[older minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.0.9 1 0 0 0) # Request 0.[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.2.0 1 0 0 0) # Request 0.[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 0.2.2.2 1 0 0 0) # Request 0.[older minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.2.7 1 0 0 0) # Request 0.[older minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.2.9 1 0 0 0) # Request 0.[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.6.0 1 0 0 0) # Request 0.[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 0.2.6.2 1 0 0 0) # Request 0.[older minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.6.7 1 0 0 0) # Request 0.[older minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.6.9 1 0 0 0) # Request 0.[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.9.0 1 0 0 0) # Request 0.[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 0.2.9.2 1 0 0 0) # Request 0.[older minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.9.7 1 0 0 0) # Request 0.[older minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.2.9.9 1 0 0 0) # Request 0.[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.0.0 1 0 0 0) # Request 0.[same minor].0.0
-test_write_basic_config_version_file(4.5.6.7 0.5.0.2 1 0 0 0) # Request 0.[same minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.0.7 1 0 0 0) # Request 0.[same minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.0.9 1 0 0 0) # Request 0.[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.2.0 1 0 0 0) # Request 0.[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 0.5.2.2 1 0 0 0) # Request 0.[same minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.2.7 1 0 0 0) # Request 0.[same minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.2.9 1 0 0 0) # Request 0.[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.6.0 1 0 0 0) # Request 0.[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 0.5.6.2 1 0 0 0) # Request 0.[same minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.6.7 1 0 0 0) # Request 0.[same minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.6.9 1 0 0 0) # Request 0.[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.9.0 1 0 0 0) # Request 0.[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 0.5.9.2 1 0 0 0) # Request 0.[same minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.9.7 1 0 0 0) # Request 0.[same minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.5.9.9 1 0 0 0) # Request 0.[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
-test_write_basic_config_version_file(4.5.6.7 0.9.0.2 1 0 0 0) # Request 0.[newer minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.0.7 1 0 0 0) # Request 0.[newer minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.2.0 1 0 0 0) # Request 0.[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 0.9.2.2 1 0 0 0) # Request 0.[newer minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.2.7 1 0 0 0) # Request 0.[newer minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.2.9 1 0 0 0) # Request 0.[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.6.0 1 0 0 0) # Request 0.[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 0.9.6.2 1 0 0 0) # Request 0.[newer minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.6.7 1 0 0 0) # Request 0.[newer minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.6.9 1 0 0 0) # Request 0.[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 0.9.9.2 1 0 0 0) # Request 0.[newer minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.9.7 1 0 0 0) # Request 0.[newer minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
-test_write_basic_config_version_file(4.5.6.7 2.0.0.2 1 0 0 0) # Request [older major].0.0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.0.7 1 0 0 0) # Request [older major].0.0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.2.0 1 0 0 0) # Request [older major].0.[older patch].0
-test_write_basic_config_version_file(4.5.6.7 2.0.2.2 1 0 0 0) # Request [older major].0.[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.2.7 1 0 0 0) # Request [older major].0.[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.2.9 1 0 0 0) # Request [older major].0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.6.0 1 0 0 0) # Request [older major].0.[same patch].0
-test_write_basic_config_version_file(4.5.6.7 2.0.6.2 1 0 0 0) # Request [older major].0.[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.6.7 1 0 0 0) # Request [older major].0.[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.6.9 1 0 0 0) # Request [older major].0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 2.0.9.2 1 0 0 0) # Request [older major].0.[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.9.7 1 0 0 0) # Request [older major].0.[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.0.0 1 0 0 0) # Request [older major].[older minor].0.0
-test_write_basic_config_version_file(4.5.6.7 2.2.0.2 1 0 0 0) # Request [older major].[older minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.0.7 1 0 0 0) # Request [older major].[older minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.0.9 1 0 0 0) # Request [older major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.2.0 1 0 0 0) # Request [older major].[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 2.2.2.2 1 0 0 0) # Request [older major].[older minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.2.7 1 0 0 0) # Request [older major].[older minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.2.9 1 0 0 0) # Request [older major].[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.6.0 1 0 0 0) # Request [older major].[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 2.2.6.2 1 0 0 0) # Request [older major].[older minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.6.7 1 0 0 0) # Request [older major].[older minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.6.9 1 0 0 0) # Request [older major].[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.9.0 1 0 0 0) # Request [older major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 2.2.9.2 1 0 0 0) # Request [older major].[older minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.9.7 1 0 0 0) # Request [older major].[older minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.2.9.9 1 0 0 0) # Request [older major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.0.0 1 0 0 0) # Request [older major].[same minor].0.0
-test_write_basic_config_version_file(4.5.6.7 2.5.0.2 1 0 0 0) # Request [older major].[same minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.0.7 1 0 0 0) # Request [older major].[same minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.0.9 1 0 0 0) # Request [older major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.2.0 1 0 0 0) # Request [older major].[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 2.5.2.2 1 0 0 0) # Request [older major].[same minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.2.7 1 0 0 0) # Request [older major].[same minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.2.9 1 0 0 0) # Request [older major].[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.6.0 1 0 0 0) # Request [older major].[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 2.5.6.2 1 0 0 0) # Request [older major].[same minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.6.7 1 0 0 0) # Request [older major].[same minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.6.9 1 0 0 0) # Request [older major].[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.9.0 1 0 0 0) # Request [older major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 2.5.9.2 1 0 0 0) # Request [older major].[same minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.9.7 1 0 0 0) # Request [older major].[same minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.5.9.9 1 0 0 0) # Request [older major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
-test_write_basic_config_version_file(4.5.6.7 2.9.0.2 1 0 0 0) # Request [older major].[newer minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.0.7 1 0 0 0) # Request [older major].[newer minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.2.0 1 0 0 0) # Request [older major].[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 2.9.2.2 1 0 0 0) # Request [older major].[newer minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.2.7 1 0 0 0) # Request [older major].[newer minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.2.9 1 0 0 0) # Request [older major].[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.6.0 1 0 0 0) # Request [older major].[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 2.9.6.2 1 0 0 0) # Request [older major].[newer minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.6.7 1 0 0 0) # Request [older major].[newer minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.6.9 1 0 0 0) # Request [older major].[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 2.9.9.2 1 0 0 0) # Request [older major].[newer minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.9.7 1 0 0 0) # Request [older major].[newer minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
-test_write_basic_config_version_file(4.5.6.7 4.0.0.2 1 1 0 0) # Request [same major].0.0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.0.7 1 1 0 0) # Request [same major].0.0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.0.9 1 1 0 0) # Request [same major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.2.0 1 1 0 0) # Request [same major].0.[older patch].0
-test_write_basic_config_version_file(4.5.6.7 4.0.2.2 1 1 0 0) # Request [same major].0.[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.2.7 1 1 0 0) # Request [same major].0.[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.2.9 1 1 0 0) # Request [same major].0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.6.0 1 1 0 0) # Request [same major].0.[same patch].0
-test_write_basic_config_version_file(4.5.6.7 4.0.6.2 1 1 0 0) # Request [same major].0.[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.6.7 1 1 0 0) # Request [same major].0.[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.6.9 1 1 0 0) # Request [same major].0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.9.0 1 1 0 0) # Request [same major].0.[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 4.0.9.2 1 1 0 0) # Request [same major].0.[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.9.7 1 1 0 0) # Request [same major].0.[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.0.9.9 1 1 0 0) # Request [same major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.0.0 1 1 0 0) # Request [same major].[older minor].0.0
-test_write_basic_config_version_file(4.5.6.7 4.2.0.2 1 1 0 0) # Request [same major].[older minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.0.7 1 1 0 0) # Request [same major].[older minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.0.9 1 1 0 0) # Request [same major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.2.0 1 1 0 0) # Request [same major].[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 4.2.2.2 1 1 0 0) # Request [same major].[older minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.2.7 1 1 0 0) # Request [same major].[older minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.2.9 1 1 0 0) # Request [same major].[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.6.0 1 1 0 0) # Request [same major].[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 4.2.6.2 1 1 0 0) # Request [same major].[older minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.6.7 1 1 0 0) # Request [same major].[older minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.6.9 1 1 0 0) # Request [same major].[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.9.0 1 1 0 0) # Request [same major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 4.2.9.2 1 1 0 0) # Request [same major].[older minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.9.7 1 1 0 0) # Request [same major].[older minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.2.9.9 1 1 0 0) # Request [same major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.0.0 1 1 1 0) # Request [same major].[same minor].0.0
-test_write_basic_config_version_file(4.5.6.7 4.5.0.2 1 1 1 0) # Request [same major].[same minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.0.7 1 1 1 0) # Request [same major].[same minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.0.9 1 1 1 0) # Request [same major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.2.0 1 1 1 0) # Request [same major].[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 4.5.2.2 1 1 1 0) # Request [same major].[same minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.2.7 1 1 1 0) # Request [same major].[same minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.2.9 1 1 1 0) # Request [same major].[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.6.0 1 1 1 1) # Request [same major].[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 4.5.6.2 1 1 1 1) # Request [same major].[same minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.6.7 1 1 1 1) # Request [same major].[same minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.6.9 0 0 0 1) # Request [same major].[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.9.0 0 0 0 0) # Request [same major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 4.5.9.2 0 0 0 0) # Request [same major].[same minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.9.7 0 0 0 0) # Request [same major].[same minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.5.9.9 0 0 0 0) # Request [same major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
-test_write_basic_config_version_file(4.5.6.7 4.9.0.2 0 0 0 0) # Request [same major].[newer minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.0.7 0 0 0 0) # Request [same major].[newer minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.2.0 0 0 0 0) # Request [same major].[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 4.9.2.2 0 0 0 0) # Request [same major].[newer minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.2.7 0 0 0 0) # Request [same major].[newer minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.2.9 0 0 0 0) # Request [same major].[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.6.0 0 0 0 0) # Request [same major].[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 4.9.6.2 0 0 0 0) # Request [same major].[newer minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.6.7 0 0 0 0) # Request [same major].[newer minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.6.9 0 0 0 0) # Request [same major].[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 4.9.9.2 0 0 0 0) # Request [same major].[newer minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.9.7 0 0 0 0) # Request [same major].[newer minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
-test_write_basic_config_version_file(4.5.6.7 9.0.0.2 0 0 0 0) # Request [newer major].0.0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.0.7 0 0 0 0) # Request [newer major].0.0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.2.0 0 0 0 0) # Request [newer major].0.[older patch].0
-test_write_basic_config_version_file(4.5.6.7 9.0.2.2 0 0 0 0) # Request [newer major].0.[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.2.7 0 0 0 0) # Request [newer major].0.[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.2.9 0 0 0 0) # Request [newer major].0.[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.6.0 0 0 0 0) # Request [newer major].0.[same patch].0
-test_write_basic_config_version_file(4.5.6.7 9.0.6.2 0 0 0 0) # Request [newer major].0.[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.6.7 0 0 0 0) # Request [newer major].0.[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.6.9 0 0 0 0) # Request [newer major].0.[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 9.0.9.2 0 0 0 0) # Request [newer major].0.[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.9.7 0 0 0 0) # Request [newer major].0.[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.0.0 0 0 0 0) # Request [newer major].[older minor].0.0
-test_write_basic_config_version_file(4.5.6.7 9.2.0.2 0 0 0 0) # Request [newer major].[older minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.0.7 0 0 0 0) # Request [newer major].[older minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.0.9 0 0 0 0) # Request [newer major].[older minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.2.0 0 0 0 0) # Request [newer major].[older minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 9.2.2.2 0 0 0 0) # Request [newer major].[older minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.2.7 0 0 0 0) # Request [newer major].[older minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.2.9 0 0 0 0) # Request [newer major].[older minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.6.0 0 0 0 0) # Request [newer major].[older minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 9.2.6.2 0 0 0 0) # Request [newer major].[older minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.6.7 0 0 0 0) # Request [newer major].[older minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.6.9 0 0 0 0) # Request [newer major].[older minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.9.0 0 0 0 0) # Request [newer major].[older minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 9.2.9.2 0 0 0 0) # Request [newer major].[older minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.9.7 0 0 0 0) # Request [newer major].[older minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.2.9.9 0 0 0 0) # Request [newer major].[older minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.0.0 0 0 0 0) # Request [newer major].[same minor].0.0
-test_write_basic_config_version_file(4.5.6.7 9.5.0.2 0 0 0 0) # Request [newer major].[same minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.0.7 0 0 0 0) # Request [newer major].[same minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.0.9 0 0 0 0) # Request [newer major].[same minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.2.0 0 0 0 0) # Request [newer major].[same minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 9.5.2.2 0 0 0 0) # Request [newer major].[same minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.2.7 0 0 0 0) # Request [newer major].[same minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.2.9 0 0 0 0) # Request [newer major].[same minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.6.0 0 0 0 0) # Request [newer major].[same minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 9.5.6.2 0 0 0 0) # Request [newer major].[same minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.6.7 0 0 0 0) # Request [newer major].[same minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.6.9 0 0 0 0) # Request [newer major].[same minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.9.0 0 0 0 0) # Request [newer major].[same minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 9.5.9.2 0 0 0 0) # Request [newer major].[same minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.9.7 0 0 0 0) # Request [newer major].[same minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.5.9.9 0 0 0 0) # Request [newer major].[same minor].[newer patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
-test_write_basic_config_version_file(4.5.6.7 9.9.0.2 0 0 0 0) # Request [newer major].[newer minor].0.[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.0.7 0 0 0 0) # Request [newer major].[newer minor].0.[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.2.0 0 0 0 0) # Request [newer major].[newer minor].[older patch].0
-test_write_basic_config_version_file(4.5.6.7 9.9.2.2 0 0 0 0) # Request [newer major].[newer minor].[older patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.2.7 0 0 0 0) # Request [newer major].[newer minor].[older patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.2.9 0 0 0 0) # Request [newer major].[newer minor].[older patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.6.0 0 0 0 0) # Request [newer major].[newer minor].[same patch].0
-test_write_basic_config_version_file(4.5.6.7 9.9.6.2 0 0 0 0) # Request [newer major].[newer minor].[same patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.6.7 0 0 0 0) # Request [newer major].[newer minor].[same patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.6.9 0 0 0 0) # Request [newer major].[newer minor].[same patch].[newer tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
-test_write_basic_config_version_file(4.5.6.7 9.9.9.2 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[older tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.9.7 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[same tweak]
-test_write_basic_config_version_file(4.5.6.7 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
-
-
############################################################################
##Test FIND_PACKAGE using sorting
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR})
diff --git a/Tests/FindPackageTest/cmake/SetFoundResolvedConfig.cmake b/Tests/FindPackageTest/cmake/SetFoundResolvedConfig.cmake
new file mode 100644
index 000000000..b2cf87ce6
--- /dev/null
+++ b/Tests/FindPackageTest/cmake/SetFoundResolvedConfig.cmake
@@ -0,0 +1 @@
+set(SetFoundResolved_DIR "${CMAKE_CURRENT_LIST_DIR}")
diff --git a/Tests/FindPostgreSQL/CMakeLists.txt b/Tests/FindPostgreSQL/CMakeLists.txt
new file mode 100644
index 000000000..50151eec3
--- /dev/null
+++ b/Tests/FindPostgreSQL/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindPostgreSQL.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPostgreSQL/Test"
+ "${CMake_BINARY_DIR}/Tests/FindPostgreSQL/Test"
+ ${build_generator_args}
+ --build-project TestFindPostgreSQL
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindPostgreSQL/Test/CMakeLists.txt b/Tests/FindPostgreSQL/Test/CMakeLists.txt
new file mode 100644
index 000000000..374e1477b
--- /dev/null
+++ b/Tests/FindPostgreSQL/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.10)
+project(TestFindPostgreSQL C)
+include(CTest)
+
+find_package(PostgreSQL REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_POSTGRESQL_VERSION="${PostgreSQL_VERSION_STRING}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt PostgreSQL::PostgreSQL)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${PostgreSQL_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${PostgreSQL_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c
new file mode 100644
index 000000000..2cfeed0da
--- /dev/null
+++ b/Tests/FindPostgreSQL/Test/main.c
@@ -0,0 +1,15 @@
+#include <libpq-fe.h>
+#include <stdio.h>
+#include <string.h>
+
+int main()
+{
+ int version = PQlibVersion();
+ int major = version / 10000;
+ int minor = version % 10000;
+ char version_string[100];
+ snprintf(version_string, sizeof(version_string), "%d.%d", major, minor);
+ printf("Found PostgreSQL version %s, expected version %s\n", version_string,
+ CMAKE_EXPECTED_POSTGRESQL_VERSION);
+ return strcmp(version_string, CMAKE_EXPECTED_POSTGRESQL_VERSION);
+}
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 639d29c65..38211a4bb 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -1,69 +1,94 @@
-add_test(NAME FindPython.Python2 COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2"
- ${build_generator_args}
- --build-project TestPython2
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
+if(CMake_TEST_FindPython)
+ add_test(NAME FindPython.Python2 COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python2"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python2"
+ ${build_generator_args}
+ --build-project TestPython2
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
-add_test(NAME FindPython.Python2Fail COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Fail"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python2Fail"
- ${build_generator_args}
- --build-project TestPython2Fail
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-set_tests_properties(FindPython.Python2Fail PROPERTIES
- PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: foobar\\)")
+ add_test(NAME FindPython.Python2Fail COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Fail"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python2Fail"
+ ${build_generator_args}
+ --build-project TestPython2Fail
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_tests_properties(FindPython.Python2Fail PROPERTIES
+ PASS_REGULAR_EXPRESSION "Could NOT find Python2 \\(missing: foobar\\)")
-add_test(NAME FindPython.Python3 COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3"
- ${build_generator_args}
- --build-project TestPython3
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
+ add_test(NAME FindPython.Python3 COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python3"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python3"
+ ${build_generator_args}
+ --build-project TestPython3
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
-add_test(NAME FindPython.Python3Fail COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Fail"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python3Fail"
- ${build_generator_args}
- --build-project TestPython3Fail
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-set_tests_properties(FindPython.Python3Fail PROPERTIES
- PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)")
+ add_test(NAME FindPython.Python3Fail COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Fail"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python3Fail"
+ ${build_generator_args}
+ --build-project TestPython3Fail
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_tests_properties(FindPython.Python3Fail PROPERTIES
+ PASS_REGULAR_EXPRESSION "Could NOT find Python3 \\(missing: foobar\\)")
-add_test(NAME FindPython.Python COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
- "${CMake_BINARY_DIR}/Tests/FindPython/Python"
- ${build_generator_args}
- --build-project TestPython
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
+ add_test(NAME FindPython.Python COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python"
+ ${build_generator_args}
+ --build-project TestPython
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+ 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()
-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>
+if(CMake_TEST_FindPython_NumPy)
+ add_test(NAME FindPython.NumPy COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/NumPy"
+ "${CMake_BINARY_DIR}/Tests/FindPython/NumPy"
+ ${build_generator_args}
+ --build-project TestNumPy
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.NumPyOnly COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/NumPyOnly"
+ "${CMake_BINARY_DIR}/Tests/FindPython/NumPyOnly"
+ ${build_generator_args}
+ --build-project TestNumPyOnly
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ endif()
diff --git a/Tests/FindPython/FindPythonScript.cmake b/Tests/FindPython/FindPythonScript.cmake
new file mode 100644
index 000000000..94500920e
--- /dev/null
+++ b/Tests/FindPython/FindPythonScript.cmake
@@ -0,0 +1 @@
+find_package(${PYTHON_PACKAGE_NAME} REQUIRED QUIET)
diff --git a/Tests/FindPython/NumPy/CMakeLists.txt b/Tests/FindPython/NumPy/CMakeLists.txt
new file mode 100644
index 000000000..f55702666
--- /dev/null
+++ b/Tests/FindPython/NumPy/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestNumPy C)
+
+find_package (Python2 REQUIRED COMPONENTS Interpreter Development NumPy)
+find_package (Python3 REQUIRED COMPONENTS Interpreter Development NumPy)
+
+Python2_add_library (arraytest2 MODULE arraytest.c)
+target_compile_definitions (arraytest2 PRIVATE PYTHON2)
+target_link_libraries (arraytest2 PRIVATE Python2::NumPy)
+
+Python3_add_library (arraytest3 MODULE arraytest.c)
+target_compile_definitions (arraytest3 PRIVATE PYTHON3)
+target_link_libraries (arraytest3 PRIVATE Python3::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 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]));")
diff --git a/Tests/FindPython/NumPy/arraytest.c b/Tests/FindPython/NumPy/arraytest.c
new file mode 100644
index 000000000..db259e55a
--- /dev/null
+++ b/Tests/FindPython/NumPy/arraytest.c
@@ -0,0 +1,58 @@
+#include "Python.h"
+
+#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
+#include "numpy/arrayobject.h"
+
+#include <math.h>
+
+static PyObject* vecsq(PyObject* self, PyObject* args);
+
+static PyMethodDef arraytestMethods[] = { { "vecsq", vecsq, METH_VARARGS },
+ { NULL, NULL } };
+
+static PyObject* vecsq(PyObject* self, PyObject* args)
+{
+ PyArrayObject *vecin, *vecout;
+ npy_intp dims[2];
+ double *cin, *cout;
+ int i, j, n, m;
+
+ if (!PyArg_ParseTuple(args, "O!", &PyArray_Type, &vecin))
+ return NULL;
+
+ n = dims[0] = PyArray_NDIM(vecin);
+ vecout = (PyArrayObject*)PyArray_SimpleNew(1, dims, NPY_DOUBLE);
+
+ cin = (double*)PyArray_DATA(vecin);
+ cout = (double*)PyArray_DATA(vecout);
+
+ for (i = 0; i < n; i++) {
+ cout[i] = cin[i] * cin[i];
+ }
+ return PyArray_Return(vecout);
+}
+
+#if defined(PYTHON2)
+PyMODINIT_FUNC init_C_arraytest(void)
+{
+ (void)Py_InitModule("arraytest2", arraytestMethods);
+ import_array();
+}
+#endif
+
+#if defined(PYTHON3)
+static struct PyModuleDef arraytestmodule = {
+ PyModuleDef_HEAD_INIT, "arraytest3", /* name of module */
+ NULL, /* module documentation, may be NULL */
+ -1, /* size of per-interpreter state of the module,
+ or -1 if the module keeps state in global variables. */
+ arraytestMethods
+};
+
+PyMODINIT_FUNC PyInit_C_arraytest(void)
+{
+ PyObject* po = PyModule_Create(&arraytestmodule);
+ import_array();
+ return po;
+}
+#endif
diff --git a/Tests/FindPython/NumPyOnly/CMakeLists.txt b/Tests/FindPython/NumPyOnly/CMakeLists.txt
new file mode 100644
index 000000000..a5db6037c
--- /dev/null
+++ b/Tests/FindPython/NumPyOnly/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestNumPyOnly C)
+
+find_package(Python2 REQUIRED COMPONENTS NumPy)
+find_package(Python3 REQUIRED COMPONENTS NumPy)
+
+Python2_add_library (arraytest2 MODULE ../NumPy/arraytest.c)
+target_compile_definitions (arraytest2 PRIVATE PYTHON2)
+target_link_libraries (arraytest2 PRIVATE Python2::NumPy)
+
+Python3_add_library (arraytest3 MODULE ../NumPy/arraytest.c)
+target_compile_definitions (arraytest3 PRIVATE PYTHON3)
+target_link_libraries (arraytest3 PRIVATE Python3::NumPy)
diff --git a/Tests/FindPython/Python/CMakeLists.txt b/Tests/FindPython/Python/CMakeLists.txt
index bebd23fc8..f7fc24368 100644
--- a/Tests/FindPython/Python/CMakeLists.txt
+++ b/Tests/FindPython/Python/CMakeLists.txt
@@ -9,9 +9,21 @@ if (NOT Python_FOUND)
message (FATAL_ERROR "Fail to found Python 3")
endif()
+if(NOT TARGET Python::Interpreter)
+ message(SEND_ERROR "Python::Interpreter not found")
+endif()
+
+if(NOT TARGET Python::Python)
+ message(SEND_ERROR "Python::Python not found")
+endif()
+
Python_add_library (spam3 MODULE ../spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
add_test (NAME python_spam3
COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>"
"${Python_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")")
+
+add_test(NAME findpython_script
+ COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python
+ -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
diff --git a/Tests/FindPython/Python2/CMakeLists.txt b/Tests/FindPython/Python2/CMakeLists.txt
index 9622b6fa6..a0753f611 100644
--- a/Tests/FindPython/Python2/CMakeLists.txt
+++ b/Tests/FindPython/Python2/CMakeLists.txt
@@ -14,9 +14,21 @@ if (NOT Python2_FOUND)
message (FATAL_ERROR "Fail to found Python 2")
endif()
+if(NOT TARGET Python2::Interpreter)
+ message(SEND_ERROR "Python2::Interpreter not found")
+endif()
+
+if(NOT TARGET Python2::Python)
+ message(SEND_ERROR "Python2::Python not found")
+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:spam2>"
"${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")")
+
+add_test(NAME findpython2_script
+ COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python2
+ -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
diff --git a/Tests/FindPython/Python3/CMakeLists.txt b/Tests/FindPython/Python3/CMakeLists.txt
index cb86eae68..65eea4c27 100644
--- a/Tests/FindPython/Python3/CMakeLists.txt
+++ b/Tests/FindPython/Python3/CMakeLists.txt
@@ -14,9 +14,21 @@ if (NOT Python3_FOUND)
message (FATAL_ERROR "Fail to found Python 3")
endif()
+if(NOT TARGET Python3::Interpreter)
+ message(SEND_ERROR "Python2::Interpreter not found")
+endif()
+
+if(NOT TARGET Python3::Python)
+ message(SEND_ERROR "Python2::Python not found")
+endif()
+
Python3_add_library (spam3 MODULE ../spam.c)
target_compile_definitions (spam3 PRIVATE PYTHON3)
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 findpython3_script
+ COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
+ -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
diff --git a/Tests/FindSQLite3/CMakeLists.txt b/Tests/FindSQLite3/CMakeLists.txt
new file mode 100644
index 000000000..8bf170e35
--- /dev/null
+++ b/Tests/FindSQLite3/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindSQLite3.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindSQLite3/Test"
+ "${CMake_BINARY_DIR}/Tests/FindSQLite3/Test"
+ ${build_generator_args}
+ --build-project TestFindSQLite3
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindSQLite3/Test/CMakeLists.txt b/Tests/FindSQLite3/Test/CMakeLists.txt
new file mode 100644
index 000000000..bcc6ebd20
--- /dev/null
+++ b/Tests/FindSQLite3/Test/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindSQLite3 C)
+include(CTest)
+
+find_package(SQLite3 REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_SQLite3_VERSION="${SQLite3_VERSION}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt SQLite::SQLite3)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${SQLite3_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${SQLite3_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindSQLite3/Test/main.c b/Tests/FindSQLite3/Test/main.c
new file mode 100644
index 000000000..aeb494063
--- /dev/null
+++ b/Tests/FindSQLite3/Test/main.c
@@ -0,0 +1,10 @@
+#include <string.h>
+
+#include <sqlite3.h>
+
+int main()
+{
+ char sqlite3_version[] = SQLITE_VERSION;
+
+ return strcmp(sqlite3_version, CMAKE_EXPECTED_SQLite3_VERSION);
+}
diff --git a/Tests/FindThreads/C-only/CMakeLists.txt b/Tests/FindThreads/C-only/CMakeLists.txt
index ab4ca0ddd..ee2a5f991 100644
--- a/Tests/FindThreads/C-only/CMakeLists.txt
+++ b/Tests/FindThreads/C-only/CMakeLists.txt
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(FindThreads_C-only C)
-set(CMAKE_THREAD_PREFER_PTHREAD On)
find_package(Threads REQUIRED)
if (NOT WIN32)
diff --git a/Tests/FindThreads/CXX-only/CMakeLists.txt b/Tests/FindThreads/CXX-only/CMakeLists.txt
index 999312322..3c6cc1e55 100644
--- a/Tests/FindThreads/CXX-only/CMakeLists.txt
+++ b/Tests/FindThreads/CXX-only/CMakeLists.txt
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(FindThreads_CXX-only CXX)
-set(CMAKE_THREAD_PREFER_PTHREAD On)
find_package(Threads REQUIRED)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c
diff --git a/Tests/FindX11/CMakeLists.txt b/Tests/FindX11/CMakeLists.txt
new file mode 100644
index 000000000..cc931a1b8
--- /dev/null
+++ b/Tests/FindX11/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindX11.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindX11/Test"
+ "${CMake_BINARY_DIR}/Tests/FindX11/Test"
+ ${build_generator_args}
+ --build-project TestFindX11
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt
new file mode 100644
index 000000000..769271f4b
--- /dev/null
+++ b/Tests/FindX11/Test/CMakeLists.txt
@@ -0,0 +1,89 @@
+cmake_minimum_required(VERSION 3.10)
+project(TestFindX11 C)
+include(CTest)
+
+find_package(X11 REQUIRED)
+
+function (test_x11_component have_var component)
+ if (NOT X11_${component}_FOUND)
+ message("Skipping ${component} because it was not found.")
+ return ()
+ endif ()
+
+ add_executable(test_tgt_${component} main.c)
+ target_link_libraries(test_tgt_${component} PRIVATE X11::${component})
+ target_compile_definitions(test_tgt_${component} PRIVATE HAVE_X11_${component})
+ add_test(NAME test_tgt_${component} COMMAND test_tgt_${component})
+
+ # Add to the list of components to test for the parent.
+ set(${have_var}
+ ${${have_var}}
+ HAVE_X11_${component}
+ PARENT_SCOPE)
+endfunction ()
+
+set(x11_components)
+test_x11_component(x11_components ICE)
+test_x11_component(x11_components SM)
+# Not a component; hack it up.
+set(X11_X11_FOUND ${X11_FOUND})
+test_x11_component(x11_components X11)
+test_x11_component(x11_components Xau)
+test_x11_component(x11_components Xcomposite)
+test_x11_component(x11_components Xdamage)
+test_x11_component(x11_components Xdmcp)
+test_x11_component(x11_components Xext)
+test_x11_component(x11_components Xxf86misc)
+test_x11_component(x11_components Xxf86vm)
+test_x11_component(x11_components Xfixes)
+# We ignore the Xft component because the variables do not provide the required
+# dependency information (Freetype and Fontconfig).
+test_x11_component(x11_components_ignore Xft)
+test_x11_component(x11_components Xi)
+test_x11_component(x11_components Xinerama)
+test_x11_component(x11_components Xkb)
+test_x11_component(x11_components xkbfile)
+test_x11_component(x11_components Xmu)
+test_x11_component(x11_components Xpm)
+test_x11_component(x11_components Xtst)
+test_x11_component(x11_components Xrandr)
+test_x11_component(x11_components Xrender)
+test_x11_component(x11_components XRes)
+test_x11_component(x11_components Xss)
+test_x11_component(x11_components Xt)
+test_x11_component(x11_components Xutil)
+test_x11_component(x11_components Xv)
+
+# The variables do not include dependency information. Just test "everything".
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${X11_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${X11_LIBRARIES})
+# Not included in X11_LIBRARIES.
+foreach(lib
+ Xau
+ Xcomposite
+ Xdamage
+ Xdmcp
+ Xxf86misc
+ Xxf86vm
+ Xfixes
+ Xi
+ Xinerama
+ Xkb
+ xkbfile
+ Xmu
+ Xpm
+ Xtst
+ Xrandr
+ Xrender
+ XRes
+ Xss
+ Xt
+ Xv
+ )
+ if (X11_${lib}_FOUND)
+ target_link_libraries(test_var PRIVATE ${X11_${lib}_LIB})
+ endif ()
+endforeach()
+target_compile_definitions(test_var PRIVATE ${x11_components})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c
new file mode 100644
index 000000000..044bfa278
--- /dev/null
+++ b/Tests/FindX11/Test/main.c
@@ -0,0 +1,405 @@
+#ifdef HAVE_X11_ICE
+# include <X11/ICE/ICElib.h>
+
+static Status test_ICE(void)
+{
+ return IceInitThreads();
+}
+#endif
+
+#ifdef HAVE_X11_SM
+# include <X11/SM/SMlib.h>
+# include <stdlib.h>
+
+static void test_SM(void)
+{
+ SmcProtocolVersion(NULL);
+}
+#endif
+
+#ifdef HAVE_X11_X11
+# include <X11/Xlib.h>
+
+static Status test_X11(void)
+{
+ return XInitThreads();
+}
+#endif
+
+#ifdef HAVE_X11_Xau
+# include <X11/Xauth.h>
+
+static char* test_Xau(void)
+{
+ return XauFileName();
+}
+#endif
+
+#ifdef HAVE_X11_Xcomposite
+# include <X11/extensions/Xcomposite.h>
+
+static int test_Xcomposite(void)
+{
+ return XCompositeVersion();
+}
+#endif
+
+#ifdef HAVE_X11_Xdamage
+# include <X11/extensions/Xdamage.h>
+
+static Bool test_Xdamage(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ev_base;
+ int err_base;
+ Bool ret = XDamageQueryExtension(dpy, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xdmcp
+# include <X11/Xdmcp.h>
+
+static int test_Xdmcp(void)
+{
+ BYTE data[1024];
+ XdmcpBuffer buf = { data, sizeof(data), 0, 0 };
+ return XdmcpReadRemaining(&buf);
+}
+#endif
+
+#ifdef HAVE_X11_Xext
+# include <X11/Xlib.h>
+# include <X11/extensions/Xext.h>
+
+static int test_Xext(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ret = XMissingExtension(dpy, "cmake");
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xxf86misc
+# include <X11/Xlib.h>
+# include <X11/extensions/xf86misc.h>
+
+static Bool test_Xxf86misc(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ Bool ret = XF86MiscSetClientVersion(dpy);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xxf86vm
+# include <X11/Xlib.h>
+# include <X11/extensions/xf86vmode.h>
+
+static Bool test_Xxf86vm(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ Bool ret = XF86VidModeSetClientVersion(dpy);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xfixes
+# include <X11/extensions/Xfixes.h>
+
+static Bool test_Xfixes(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ev_base;
+ int err_base;
+ Bool ret = XFixesQueryExtension(dpy, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xft
+# include <X11/Xft/Xft.h>
+
+static FcBool test_Xft(void)
+{
+ return XftInitFtLibrary();
+}
+#endif
+
+#ifdef HAVE_X11_Xi
+# include <X11/extensions/XInput.h>
+
+static XExtensionVersion* test_Xi(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ XExtensionVersion* ret = XGetExtensionVersion(dpy, "cmake");
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xinerama
+# include <X11/extensions/Xinerama.h>
+
+static Bool test_Xinerama(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ev_base;
+ int err_base;
+ Bool ret = XineramaQueryExtension(dpy, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xkb
+# include <X11/XKBlib.h>
+
+static Bool test_Xkb(void)
+{
+ return XkbIgnoreExtension(0);
+}
+#endif
+
+#ifdef HAVE_X11_xkbfile
+# include <stdio.h>
+
+# include <X11/XKBlib.h>
+# include <X11/extensions/XKBfile.h>
+
+# include <stdlib.h>
+
+static void test_xkbfile(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ XkbInitAtoms(dpy);
+ XCloseDisplay(dpy);
+}
+#endif
+
+#ifdef HAVE_X11_Xmu
+# include <X11/Xmu/Xmu.h>
+
+# include <stdlib.h>
+
+static Bool test_Xmu(void)
+{
+ return XmuValidArea(NULL);
+}
+#endif
+
+#ifdef HAVE_X11_Xpm
+# include <X11/xpm.h>
+
+static int test_Xpm(void)
+{
+ return XpmAttributesSize();
+}
+#endif
+
+#ifdef HAVE_X11_Xtst
+# include <X11/extensions/XTest.h>
+
+static Status test_Xtst(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ Status ret = XTestDiscard(dpy);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xrandr
+# include <X11/extensions/Xrandr.h>
+
+static Bool test_Xrandr(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ev_base;
+ int err_base;
+ Bool ret = XRRQueryExtension(dpy, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xrender
+# include <X11/extensions/Xrender.h>
+
+static Bool test_Xrender(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ev_base;
+ int err_base;
+ Bool ret = XRenderQueryExtension(dpy, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_XRes
+# include <X11/Xlib.h>
+# include <X11/extensions/XRes.h>
+
+static Bool test_XRes(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ev_base;
+ int err_base;
+ Bool ret = XResQueryExtension(dpy, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xss
+# include <X11/extensions/scrnsaver.h>
+
+static Bool test_Xss(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ int ev_base;
+ int err_base;
+ Bool ret = XScreenSaverQueryExtension(dpy, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#ifdef HAVE_X11_Xt
+# include <X11/Intrinsic.h>
+
+static void test_Xt(void)
+{
+ return XtToolkitInitialize();
+}
+#endif
+
+#ifdef HAVE_X11_Xutil
+# include <X11/Xutil.h>
+
+static int test_Xutil(void)
+{
+ Region r = XCreateRegion();
+ return XDestroyRegion(r);
+}
+#endif
+
+#ifdef HAVE_X11_Xv
+# include <X11/Xlib.h>
+# include <X11/extensions/Xvlib.h>
+
+static int test_Xv(void)
+{
+ Display* dpy = XOpenDisplay(NULL);
+ unsigned int version;
+ unsigned int revision;
+ unsigned int req_base;
+ unsigned int ev_base;
+ unsigned int err_base;
+ int ret =
+ XvQueryExtension(dpy, &version, &revision, &req_base, &ev_base, &err_base);
+ XCloseDisplay(dpy);
+ return ret;
+}
+#endif
+
+#include <stddef.h>
+
+int main(int argc, char* argv[])
+{
+ (void)argv;
+ void* fptrs[] = {
+#ifdef HAVE_X11_ICE
+ test_ICE,
+#endif
+#ifdef HAVE_X11_SM
+ test_SM,
+#endif
+#ifdef HAVE_X11_X11
+ test_X11,
+#endif
+#ifdef HAVE_X11_Xau
+ test_Xau,
+#endif
+#ifdef HAVE_X11_Xcomposite
+ test_Xcomposite,
+#endif
+#ifdef HAVE_X11_Xdamage
+ test_Xdamage,
+#endif
+#ifdef HAVE_X11_Xdmcp
+ test_Xdmcp,
+#endif
+#ifdef HAVE_X11_Xext
+ test_Xext,
+#endif
+#ifdef HAVE_X11_Xxf86misc
+ test_Xxf86misc,
+#endif
+#ifdef HAVE_X11_Xxf86vm
+ test_Xxf86vm,
+#endif
+#ifdef HAVE_X11_Xfixes
+ test_Xfixes,
+#endif
+#ifdef HAVE_X11_Xft
+ test_Xft,
+#endif
+#ifdef HAVE_X11_Xi
+ test_Xi,
+#endif
+#ifdef HAVE_X11_Xinerama
+ test_Xinerama,
+#endif
+#ifdef HAVE_X11_Xkb
+ test_Xkb,
+#endif
+#ifdef HAVE_X11_xkbfile
+ test_xkbfile,
+#endif
+#ifdef HAVE_X11_Xmu
+ test_Xmu,
+#endif
+#ifdef HAVE_X11_Xpm
+ test_Xpm,
+#endif
+#ifdef HAVE_X11_Xtst
+ test_Xtst,
+#endif
+#ifdef HAVE_X11_Xrandr
+ test_Xrandr,
+#endif
+#ifdef HAVE_X11_Xrender
+ test_Xrender,
+#endif
+#ifdef HAVE_X11_XRes
+ test_XRes,
+#endif
+#ifdef HAVE_X11_Xss
+ test_Xss,
+#endif
+#ifdef HAVE_X11_Xt
+ test_Xt,
+#endif
+#ifdef HAVE_X11_Xutil
+ test_Xutil,
+#endif
+#ifdef HAVE_X11_Xv
+ test_Xv,
+#endif
+ NULL,
+ };
+
+ // The code here is to convince the compiler to keep the static functions but
+ // without calling them. This ends up always being "0" because `argc` is
+ // always 1 in the test harness which always returns the sentinel at the end
+ // of the array. The array logic is there to ensure that the contents of
+ // `fptrs` is not optimized out.
+ return (int)fptrs[(sizeof(fptrs) / sizeof(*fptrs)) - argc];
+}
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 52623d028..7023615f2 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -99,6 +99,11 @@ function(test_fortran_c_interface_module)
target_link_libraries(myc myfort)
set_property(TARGET myc PROPERTY COMPILE_DEFINITIONS ${MYC_DEFS})
+ add_library(myfort_obj OBJECT mysub.f)
+ add_library(myc_use_obj myc.c $<TARGET_OBJECTS:myfort_obj>)
+ add_executable(mainc_use_obj mainc.c)
+ target_link_libraries(mainc_use_obj myc_use_obj)
+
add_library(mycxx mycxx.cxx)
target_link_libraries(mycxx myc)
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index 59e6d592e..45372ddb9 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -12,6 +12,12 @@ add_executable(FortranOnly1 testf.f)
set_property(TARGET FortranOnly1 PROPERTY OUTPUT_NAME FortranOnly)
target_link_libraries(FortranOnly1 FortranOnlylib)
+# Test that Fortran+RC work together.
+# FIXME: Add .rc in more cases.
+if(CMAKE_GENERATOR MATCHES "Visual Studio")
+ set(test_rc testRC.rc)
+endif()
+
# create a custom command that runs FortranOnly1 and puts
# the output into the file testfhello.txt
add_custom_command(OUTPUT ${FortranOnly_BINARY_DIR}/testfhello.txt
@@ -20,7 +26,7 @@ add_custom_command(OUTPUT ${FortranOnly_BINARY_DIR}/testfhello.txt
# create a second executable FortranOnly2 that has
# testfhello.txt has an source file so that it will
# run the above custom command.
-add_executable(FortranOnly2 testfhello.txt testf.f)
+add_executable(FortranOnly2 testfhello.txt testf.f ${test_rc})
target_link_libraries(FortranOnly2 FortranOnlylib)
# create a custom target to check the content of testfhello.txt
# by running the cmake script checktestf2.cmake
@@ -70,8 +76,15 @@ if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL XL)
include(CheckFortranCompilerFlag)
CHECK_Fortran_COMPILER_FLAG(-_this_is_not_a_flag_ Fortran_BOGUS_FLAG)
if (Fortran_BOGUS_FLAG)
- message (SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed")
- endif ()
+ message(SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed")
+ endif()
+
+ unset(Fortran_RUN_FLAG CACHE)
+ include(CheckFortranSourceRuns)
+ check_fortran_source_runs("program a; end program" Fortran_RUN_FLAG SRC_EXT F90)
+ if(NOT Fortran_RUN_FLAG)
+ message(SEND_ERROR "CHECK_Fortran_SOURCE_RUNS() failed")
+ endif()
endif()
# Test generation of preprocessed sources.
diff --git a/Tests/FortranOnly/testRC.rc b/Tests/FortranOnly/testRC.rc
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/FortranOnly/testRC.rc
diff --git a/Tests/GhsMulti/CMakeLists.txt b/Tests/GhsMulti/CMakeLists.txt
deleted file mode 100644
index 6e15ba9a7..000000000
--- a/Tests/GhsMulti/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-cmake_minimum_required(VERSION 3.1)
-project(ReturnNum)
-
-add_subdirectory(ReturnNum)
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
new file mode 100644
index 000000000..4a3f5c238
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt
@@ -0,0 +1,92 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+message("Copy project")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
+ ${CMAKE_CURRENT_BINARY_DIR}/src/CMakeLists.txt COPYONLY)
+
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test.c
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src
+)
+
+message("Building project")
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+try_compile(RESULT
+ ${CMAKE_CURRENT_BINARY_DIR}/build
+ ${CMAKE_CURRENT_BINARY_DIR}/src
+ test
+ CMAKE_FLAGS
+ -DRUN_TEST=${RUN_TEST}
+ -DCMAKE_BUILD_TYPE=${RUN_TEST_BUILD_TYPE}
+ OUTPUT_VARIABLE OUTPUT)
+
+message("Output from build:\n${OUTPUT}")
+if (RUN_TEST STREQUAL "RELEASE_FLAGS")
+ find_file (fileName test_none.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/build
+ ${CMAKE_CURRENT_BINARY_DIR}/build/test_none
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(opt "-unexpected_release_option")
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if ( NOT opt_found EQUAL -1 )
+ message(SEND_ERROR "Release option found: ${opt}")
+ endif()
+else()
+ unset(fileName CACHE)
+ find_file (fileName K1.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/build
+ ${CMAKE_CURRENT_BINARY_DIR}/build/K1
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(opt "-required-debug-option")
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if ( opt_found EQUAL -1 )
+ message(SEND_ERROR "Missing debug option: ${opt}")
+ endif()
+
+ unset(fileName CACHE)
+ find_file (fileName K2.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/build
+ ${CMAKE_CURRENT_BINARY_DIR}/build/K2
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(opt "-required-debug-option")
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if ( opt_found EQUAL -1 )
+ message(SEND_ERROR "Missing debug option: ${opt}")
+ endif()
+
+ unset(fileName CACHE)
+ find_file (fileName K3.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/build
+ ${CMAKE_CURRENT_BINARY_DIR}/build/K3
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(opt "-required-debug-option")
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if ( opt_found EQUAL -1 )
+ message(SEND_ERROR "Missing debug option: ${opt}")
+ endif()
+
+ unset(fileName CACHE)
+ find_file (fileName K4.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/build
+ ${CMAKE_CURRENT_BINARY_DIR}/build/K4
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(opt "-required-debug-option")
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if ( opt_found EQUAL -1 )
+ message(SEND_ERROR "Missing debug option: ${opt}")
+ endif()
+endif()
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
new file mode 100644
index 000000000..fc24d907b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/CMakeLists.txt.in
@@ -0,0 +1,32 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ add_link_options("-non_shared")
+endif()
+
+if(RUN_TEST STREQUAL "RELEASE_FLAGS")
+ #RELEASE flags used when CMAKE_BUILD_TYPE is undefined
+ string(APPEND CMAKE_C_FLAGS_RELEASE " -unexpected_release_option")
+ add_executable(test_none test.c)
+endif()
+
+if(RUN_TEST STREQUAL "KERNEL_FLAGS")
+ #DEBUG flag missing when -kernel is added as a compile option
+ string(APPEND CMAKE_C_FLAGS_DEBUG " -required-debug-option")
+
+ add_executable(K1 test.c)
+
+ add_executable(K2 test.c)
+ target_compile_options(K2 PRIVATE -kernel)
+
+ add_executable(K3 test.c)
+ target_compile_options(K3 PRIVATE -kernel=fast)
+
+ add_executable(K4 test.c)
+ target_link_options(K4 PRIVATE -kernel)
+endif()
diff --git a/Tests/GhsMulti/GhsMultiCompilerOptions/test.c b/Tests/GhsMulti/GhsMultiCompilerOptions/test.c
new file mode 100644
index 000000000..95f2e8ec1
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCompilerOptions/test.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return -1;
+}
diff --git a/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt b/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
new file mode 100644
index 000000000..d6d007d9c
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCopyFile/CMakeLists.txt
@@ -0,0 +1,30 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+try_compile(RESULT
+ ${CMAKE_CURRENT_BINARY_DIR}/build
+ ${CMAKE_CURRENT_SOURCE_DIR}/test.c
+ OUTPUT_VARIABLE OUTPUT
+ COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_library"
+)
+
+message(STATUS "Output from build:\n${OUTPUT}")
+
+if(NOT RESULT)
+ message(SEND_ERROR "try_compile() failed")
+endif()
+
+if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/test_library")
+ if (IS_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_library")
+ message(SEND_ERROR "library is folder !")
+ else()
+ message(STATUS "library seems okay")
+ endif()
+else()
+ message(SEND_ERROR "library is not found !")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiCopyFile/test.c b/Tests/GhsMulti/GhsMultiCopyFile/test.c
new file mode 100644
index 000000000..5c657b561
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiCopyFile/test.c
@@ -0,0 +1,4 @@
+int lib(int x)
+{
+ return -x;
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
index 82a014bb7..a1f152f29 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/CMakeLists.txt
@@ -1,15 +1,17 @@
cmake_minimum_required(VERSION 3.5)
-project(demo C)
+project(test C)
add_library(libdemo
test.c
+ testCase.c
subfolder_test.c
subfolder_test_0.c
"subfolder/test.c"
+ subfolder/testcase.c
)
add_executable(demo main.c)
target_link_libraries(demo libdemo)
-if(GHSMULTI)
- target_compile_options(demo PUBLIC "-non_shared")
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ target_link_options(demo PRIVATE "-non_shared")
endif()
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/main.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/main.c
index d5b791409..d4ef7bb0f 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/main.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/main.c
@@ -2,6 +2,8 @@ int test_a(void);
int test_b(void);
int test_c(void);
int test_d(void);
+int test_e(void);
+int test_f(void);
int main(int argc, char* argv[])
{
@@ -9,5 +11,7 @@ int main(int argc, char* argv[])
test_b();
test_c();
test_d();
+ test_e();
+ test_f();
return 0;
}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
index e1e175921..5d857dde6 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
@@ -1,4 +1,3 @@
-
int test_b()
{
return 2;
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
new file mode 100644
index 000000000..66ee6f380
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
@@ -0,0 +1,4 @@
+int test_f()
+{
+ return 1;
+}
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
index c552e6a13..83589ba19 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
@@ -1,4 +1,3 @@
-
int test_c()
{
return 1;
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
index 170b33d2c..82f9a52b7 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
@@ -1,4 +1,3 @@
-
int test_d()
{
return 1;
diff --git a/Tests/GhsMultiDuplicateSourceFilenames/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
index 5ffcbdf72..feba80efc 100644
--- a/Tests/GhsMultiDuplicateSourceFilenames/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
@@ -1,4 +1,3 @@
-
int test_a()
{
return 1;
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
new file mode 100644
index 000000000..943c19de6
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
@@ -0,0 +1,4 @@
+int test_e()
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
new file mode 100644
index 000000000..0448cf2d6
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiExclude/CMakeLists.txt
@@ -0,0 +1,17 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ add_link_options("-non_shared")
+endif()
+
+add_library(lib1 lib1.c)
+set_target_properties( lib1 PROPERTIES EXCLUDE_FROM_ALL yes )
+
+add_library(lib2 EXCLUDE_FROM_ALL lib1.c)
+
+add_executable(exe1 exe1.c)
diff --git a/Tests/GhsMulti/GhsMultiExclude/exe1.c b/Tests/GhsMulti/GhsMultiExclude/exe1.c
new file mode 100644
index 000000000..8488f4e58
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiExclude/exe1.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/GhsMulti/GhsMultiExclude/lib1.c b/Tests/GhsMulti/GhsMultiExclude/lib1.c
new file mode 100644
index 000000000..b35e9cc5e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiExclude/lib1.c
@@ -0,0 +1,4 @@
+int func(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiExclude/verify.cmake b/Tests/GhsMulti/GhsMultiExclude/verify.cmake
new file mode 100644
index 000000000..0467b5a0d
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiExclude/verify.cmake
@@ -0,0 +1,54 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#test project was generated
+unset(fileName CACHE)
+find_file (fileName lib1.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/lib1
+ )
+
+if (fileName)
+ message("Found target lib1: ${fileName}")
+else()
+ message(SEND_ERROR "Could not find target lib1: ${fileName}")
+endif()
+
+#test project was built
+unset(fileName CACHE)
+find_file (fileName lib1.a
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/lib1
+ )
+
+if (fileName)
+ message(SEND_ERROR "Found target lib1: ${fileName}")
+else()
+ message("Could not find target lib1: ${fileName}")
+endif()
+
+#test project was generated
+unset(fileName CACHE)
+find_file (fileName lib2.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/lib2
+ )
+
+if (fileName)
+ message("Found target lib2 ${fileName}")
+else()
+ message(SEND_ERROR "Could not find target lib2: ${fileName}")
+endif()
+
+#test project was built
+unset(fileName CACHE)
+find_file (fileName lib2.a
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/lib2
+ )
+
+if (fileName)
+ message(SEND_ERROR "Found target lib2: ${fileName}")
+else()
+ message("Could not find target lib2: ${fileName}")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
new file mode 100644
index 000000000..d4cbf0476
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt
@@ -0,0 +1,19 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+add_link_options("-non_shared")
+
+# create virtual AS
+add_executable(vas exe.c)
+target_link_libraries(vas lib)
+add_library(lib func.c)
+
+# create dynamic download INTEGRITY application
+add_executable(dynamic)
+set_target_properties(dynamic PROPERTIES ghs_integrity_app ON)
+target_compile_options(dynamic PRIVATE -dynamic)
+add_dependencies(dynamic vas)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c
new file mode 100644
index 000000000..29ad70a3b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c
@@ -0,0 +1,5 @@
+extern int func(void);
+int main(void)
+{
+ return func();
+}
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c
new file mode 100644
index 000000000..b35e9cc5e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c
@@ -0,0 +1,4 @@
+int func(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt
index 2adbd4e3d..e431217aa 100644
--- a/Tests/GhsMulti/ReturnNum/App/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt
@@ -1,4 +1,4 @@
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Lib)
add_executable(App Main.c)
+target_include_directories(App PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../Lib)
target_link_libraries(App Lib)
target_compile_options(App PUBLIC "-non_shared")
diff --git a/Tests/GhsMulti/ReturnNum/App/Main.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c
index db8d6587d..db8d6587d 100644
--- a/Tests/GhsMulti/ReturnNum/App/Main.c
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c
diff --git a/Tests/GhsMulti/ReturnNum/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt
index 7bcc5f96a..92254e673 100644
--- a/Tests/GhsMulti/ReturnNum/CMakeLists.txt
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt
@@ -1,3 +1,6 @@
+cmake_minimum_required(VERSION 3.1)
+project(test)
+
add_subdirectory(App)
add_subdirectory(Int)
add_subdirectory(Lib)
diff --git a/Tests/GhsMulti/ReturnNum/Int/AppDD.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int
index 9e22b5e25..5035d581a 100644
--- a/Tests/GhsMulti/ReturnNum/Int/AppDD.int
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int
@@ -7,6 +7,6 @@ Kernel
EndKernel
AddressSpace App
- Filename "App/App.as"
+ Filename "App/App"
Language C
EndAddressSpace
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt
new file mode 100644
index 000000000..d173c0151
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt
@@ -0,0 +1 @@
+add_executable(AppDD AppDD.int)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt
new file mode 100644
index 000000000..00e0f59b8
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(Lib HelperFun.c HelperFun.h)
diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c
index 61922bb75..61922bb75 100644
--- a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.c
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c
diff --git a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h
index 00971b04f..00971b04f 100644
--- a/Tests/GhsMulti/ReturnNum/Lib/HelperFun.h
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
new file mode 100644
index 000000000..c5db1551a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt
@@ -0,0 +1,20 @@
+# 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.12 FATAL_ERROR)
+
+add_link_options("-non_shared")
+
+project(test C)
+
+# create virtual AS
+add_executable(vas exe.c)
+target_link_libraries(vas lib)
+add_library(lib func.c)
+
+# create kernel
+add_executable(kernel kernel.c)
+target_link_options(kernel PRIVATE -kernel)
+
+# create monolith INTEGRITY application
+add_executable(monolith test.int)
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c
new file mode 100644
index 000000000..29ad70a3b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c
@@ -0,0 +1,5 @@
+extern int func(void);
+int main(void)
+{
+ return func();
+}
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c
new file mode 100644
index 000000000..c302418f9
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c
@@ -0,0 +1,5 @@
+
+int func(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
new file mode 100644
index 000000000..d1bce33c9
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
@@ -0,0 +1,15 @@
+#include "INTEGRITY.h"
+#include "boottable.h"
+
+void main()
+{
+ Exit(0);
+}
+
+/* This global table will be filled in during the Integrate phase with */
+/* information about the AddressSpaces, Tasks, and Objects that are to be */
+/* created. If you do not plan to use Integrate, you may omit this file from
+ */
+/* the kernel, and the boot table code will then not be included. */
+
+GlobalTable TheGlobalTable = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
new file mode 100644
index 000000000..361793a86
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int
@@ -0,0 +1,8 @@
+Kernel
+ Filename kernel
+EndKernel
+
+AddressSpace App
+ Filename vas
+ Language C
+EndAddressSpace
diff --git a/Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt b/Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt
new file mode 100644
index 000000000..fa0dce027
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiInterface/CMakeLists.txt
@@ -0,0 +1,8 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+add_library(iface INTERFACE)
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
new file mode 100644
index 000000000..da80b510f
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt
@@ -0,0 +1,92 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+message("Copy project")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in
+ ${CMAKE_CURRENT_BINARY_DIR}/link_src/CMakeLists.txt COPYONLY)
+
+file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/exe1.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/exe1.h
+ ${CMAKE_CURRENT_SOURCE_DIR}/func2.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/func3.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/func4.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/func5.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/func6.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/func7.c
+ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/link_src
+)
+
+message("Building project")
+try_compile(RESULT
+ ${CMAKE_CURRENT_BINARY_DIR}/link_build
+ ${CMAKE_CURRENT_BINARY_DIR}/link_src
+ test
+ CMAKE_FLAGS
+ -DRUN_TEST=${RUN_TEST}
+ -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
+ OUTPUT_VARIABLE OUTPUT)
+
+message("Output from build:\n${OUTPUT}")
+if (RUN_TEST STREQUAL "NO_FLAGS")
+ if(NOT RESULT)
+ message(SEND_ERROR "Could not build test project (1)!")
+ endif()
+else()
+ unset(fileName CACHE)
+ find_file(fileName exe1.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/link_build
+ ${CMAKE_CURRENT_BINARY_DIR}/link_build/exe1
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(expected_flags
+ -add-link-options1 -add-link-options2
+ link_directories_used1 link_directories_used2 "c:/absolute"
+ link_libraries_used1 link_libraries_used2
+ -lcsl1 csl2
+ -clinkexe1 -clinkexe2
+ -special-lib2-public-link)
+ foreach(opt IN LISTS expected_flags)
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if ( opt_found EQUAL -1 )
+ message(SEND_ERROR "Could not find: ${opt}")
+ endif()
+ endforeach()
+
+ unset(fileName CACHE)
+ find_file (fileName lib1.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/link_build
+ ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib1
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(expected_flags
+ -clinkexeA1 -clinkexeA2
+ -static-lib-flags1 -static-lib-flags2)
+ foreach(opt IN LISTS expected_flags)
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if (opt_found EQUAL -1)
+ message(SEND_ERROR "Could not find: ${opt}")
+ endif()
+ endforeach()
+
+ unset(fileName CACHE)
+ find_file (fileName lib2.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}/link_build
+ ${CMAKE_CURRENT_BINARY_DIR}/link_build/lib2
+ )
+ message("Parsing project file: ${fileName}")
+ file(STRINGS ${fileName} fileText)
+ set(expected_flags
+ -clinkexeA1 -clinkexeA2)
+ foreach(opt IN LISTS expected_flags)
+ string(FIND "${fileText}" "${opt}" opt_found)
+ if ( opt_found EQUAL -1 )
+ message(SEND_ERROR "Could not find: ${opt}")
+ endif()
+ endforeach()
+endif()
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
new file mode 100644
index 000000000..58c211524
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/CMakeLists.txt.in
@@ -0,0 +1,43 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ add_link_options("-non_shared")
+endif()
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+ add_link_options(-add-link-options1 -add-link-options2)
+ link_directories(link_directories_used1 link_directories_used2 "c:/absolute")
+ link_libraries(link_libraries_used1 link_libraries_used2 )
+ set( CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lcsl1 csl2" )
+ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -clinkexe1 -clinkexe2")
+endif()
+
+add_executable(exe1 exe1.c)
+target_link_libraries(exe1 lib1)
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+ set_property(TARGET exe1 APPEND_STRING PROPERTY LINK_FLAGS "--link-flag-prop1 --link-flag-prop2")
+ set_property(TARGET exe1 APPEND PROPERTY LINK_OPTIONS --link-opt-prop1 --link-opt-prop2)
+endif()
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+ set(CMAKE_STATIC_LINKER_FLAGS ${CMAKE_STATIC_LINKER_FLAGS} "-clinkexeA1 -clinkexeA2")
+endif()
+
+add_library(lib1 STATIC func2.c func3.c func4.c)
+target_link_libraries(lib1 lib2)
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+ set_property(TARGET lib1 APPEND_STRING PROPERTY STATIC_LIBRARY_FLAGS "-static-lib-flags1 -static-lib-flags2")
+endif()
+
+add_library(lib2 STATIC func5.c func6.c func7.c)
+
+if(RUN_TEST STREQUAL "CHECK_FLAGS")
+ target_link_options(lib2 PUBLIC -special-lib2-public-link)
+endif()
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/exe1.c b/Tests/GhsMulti/GhsMultiLinkTest/exe1.c
new file mode 100644
index 000000000..f21c12645
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/exe1.c
@@ -0,0 +1,6 @@
+#include "exe1.h"
+
+int main(void)
+{
+ return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/exe1.h b/Tests/GhsMulti/GhsMultiLinkTest/exe1.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/exe1.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func2.c b/Tests/GhsMulti/GhsMultiLinkTest/func2.c
new file mode 100644
index 000000000..8f66fba25
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func2.c
@@ -0,0 +1,4 @@
+int func2a(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func3.c b/Tests/GhsMulti/GhsMultiLinkTest/func3.c
new file mode 100644
index 000000000..57c7a6ffb
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func3.c
@@ -0,0 +1,4 @@
+int func3a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func4.c b/Tests/GhsMulti/GhsMultiLinkTest/func4.c
new file mode 100644
index 000000000..109fd7b4a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func4.c
@@ -0,0 +1,4 @@
+int func4a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func5.c b/Tests/GhsMulti/GhsMultiLinkTest/func5.c
new file mode 100644
index 000000000..f28a705d4
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func5.c
@@ -0,0 +1,4 @@
+int func5a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func6.c b/Tests/GhsMulti/GhsMultiLinkTest/func6.c
new file mode 100644
index 000000000..bf7740658
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func6.c
@@ -0,0 +1,4 @@
+int func6a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTest/func7.c b/Tests/GhsMulti/GhsMultiLinkTest/func7.c
new file mode 100644
index 000000000..6a4a9a1f0
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTest/func7.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt
new file mode 100644
index 000000000..145dac0eb
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/CMakeLists.txt
@@ -0,0 +1,9 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+add_subdirectory(sub_exe)
+add_subdirectory(sub_lib)
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
new file mode 100644
index 000000000..f49e33d6c
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/CMakeLists.txt
@@ -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.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_executable(exe1 exe1.c)
+target_link_libraries(exe1 lib1)
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ target_link_options(exe1 PRIVATE "-non_shared")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c
new file mode 100644
index 000000000..f21c12645
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.c
@@ -0,0 +1,6 @@
+#include "exe1.h"
+
+int main(void)
+{
+ return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_exe/exe1.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt
new file mode 100644
index 000000000..90397304f
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+add_library(lib1 STATIC func2.c func3.c func4.c)
+target_link_libraries(lib1 lib2)
+
+add_library(lib2 STATIC func5.c func6.c func7.c)
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c
new file mode 100644
index 000000000..8f66fba25
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func2.c
@@ -0,0 +1,4 @@
+int func2a(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c
new file mode 100644
index 000000000..57c7a6ffb
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func3.c
@@ -0,0 +1,4 @@
+int func3a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c
new file mode 100644
index 000000000..109fd7b4a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func4.c
@@ -0,0 +1,4 @@
+int func4a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c
new file mode 100644
index 000000000..f28a705d4
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func5.c
@@ -0,0 +1,4 @@
+int func5a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c
new file mode 100644
index 000000000..bf7740658
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func6.c
@@ -0,0 +1,4 @@
+int func6a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c
new file mode 100644
index 000000000..6a4a9a1f0
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiLinkTestSub/sub_lib/func7.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt b/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
new file mode 100644
index 000000000..9e077a9a4
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/CMakeLists.txt
@@ -0,0 +1,17 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ add_link_options("-non_shared")
+endif()
+
+add_library(lib1 lib1.c)
+add_executable(exe1 exe1.c)
+target_link_libraries(exe1 lib1)
+
+add_subdirectory(sub)
+add_subdirectory(sub2 examples EXCLUDE_FROM_ALL)
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c b/Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c
new file mode 100644
index 000000000..b9cdd61e7
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/exe1.c
@@ -0,0 +1,5 @@
+extern int lib1_func(void);
+int main(void)
+{
+ return lib1_func();
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c b/Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c
new file mode 100644
index 000000000..510094589
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/lib1.c
@@ -0,0 +1,4 @@
+int lib1_func(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt
new file mode 100644
index 000000000..0d83bc310
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/CMakeLists.txt
@@ -0,0 +1,10 @@
+# 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.12 FATAL_ERROR)
+
+project(test2 C)
+
+add_library(lib2 lib2.c)
+add_executable(exe2 exe2.c)
+target_link_libraries(exe2 lib1 lib2)
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c
new file mode 100644
index 000000000..9238cf369
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/exe2.c
@@ -0,0 +1,6 @@
+extern int func(void);
+extern int lib1_func(void);
+int main(void)
+{
+ return func() + lib1_func();
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub/lib2.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/lib2.c
new file mode 100644
index 000000000..b35e9cc5e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub/lib2.c
@@ -0,0 +1,4 @@
+int func(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt
new file mode 100644
index 000000000..e42e7fb2c
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/CMakeLists.txt
@@ -0,0 +1,10 @@
+# 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.12 FATAL_ERROR)
+
+project(test3 C)
+
+add_library(lib3 lib3.c)
+add_executable(exe3 exe3.c)
+target_link_libraries(exe3 lib1 lib3)
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c
new file mode 100644
index 000000000..9238cf369
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/exe3.c
@@ -0,0 +1,6 @@
+extern int func(void);
+extern int lib1_func(void);
+int main(void)
+{
+ return func() + lib1_func();
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c
new file mode 100644
index 000000000..b35e9cc5e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/sub2/lib3.c
@@ -0,0 +1,4 @@
+int func(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
new file mode 100644
index 000000000..3855215af
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiMultipleProjects/verify.cmake
@@ -0,0 +1,58 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#test project was generated
+unset(fileName CACHE)
+find_file(fileName lib3.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/lib3
+ ${CMAKE_CURRENT_BINARY_DIR}/examples
+ )
+
+if (fileName)
+ message("Found target lib3: ${fileName}")
+else()
+ message(SEND_ERROR "Could not find target lib3: ${fileName}")
+endif()
+
+#test project was generated
+unset(fileName CACHE)
+find_file (fileName exe3.gpj
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/exe3
+ ${CMAKE_CURRENT_BINARY_DIR}/examples
+ )
+
+if (fileName)
+ message("Found target exe3: ${fileName}")
+else()
+ message(SEND_ERROR "Could not find target exe3: ${fileName}")
+endif()
+
+#test project was not built
+unset(fileName CACHE)
+find_file (fileName lib3.a
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/lib3
+ ${CMAKE_CURRENT_BINARY_DIR}/examples
+ )
+
+if (fileName)
+ message(SEND_ERROR "Found target lib3: ${fileName}")
+else()
+ message("Could not find target lib3: ${fileName}")
+endif()
+
+unset(fileName CACHE)
+find_file (fileName NAMES exe3.as exe3
+ HINTS
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/exe3
+ ${CMAKE_CURRENT_BINARY_DIR}/examples
+ )
+
+if (fileName)
+ message(SEND_ERROR "Found target exe3: ${fileName}")
+else()
+ message("Could not find target exe3: ${fileName}")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt b/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
new file mode 100644
index 000000000..a025814ed
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/CMakeLists.txt
@@ -0,0 +1,13 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+add_library(obj1 OBJECT testObj.c testObj.h sub/testObj.c testObj2.c)
+
+add_executable(exe1 exe.c $<TARGET_OBJECTS:obj1>)
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ target_link_options(exe1 PRIVATE "-non_shared")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/exe.c b/Tests/GhsMulti/GhsMultiObjectLibrary/exe.c
new file mode 100644
index 000000000..c2c5a1945
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/exe.c
@@ -0,0 +1,8 @@
+extern int funcOBJ(void);
+extern int funcOBJ2(void);
+extern int funcOBJs(void);
+
+int main(void)
+{
+ return funcOBJ() + funcOBJ2() + funcOBJs();
+}
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c b/Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c
new file mode 100644
index 000000000..5228ef264
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/sub/testOBJ.c
@@ -0,0 +1,4 @@
+int funcOBJs(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c
new file mode 100644
index 000000000..ec6f2c331
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.c
@@ -0,0 +1,4 @@
+int funcOBJ(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h
new file mode 100644
index 000000000..9aef4315c
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ.h
@@ -0,0 +1 @@
+extern int funcOBJ(void);
diff --git a/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c
new file mode 100644
index 000000000..b6a9b93f2
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiObjectLibrary/testOBJ2.c
@@ -0,0 +1,4 @@
+int funcOBJ2(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt b/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
new file mode 100644
index 000000000..b177887c9
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiPlatform/CMakeLists.txt
@@ -0,0 +1,34 @@
+# 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.12 FATAL_ERROR)
+
+project(test)
+
+message("PLATFORM_ID = ${PLATFORM_ID}")
+
+message("CMAKE_C_COMPILER = ${CMAKE_C_COMPILER}")
+message("CMAKE_C_COMPILER_ID = ${CMAKE_C_COMPILER_ID}")
+message("CMAKE_C_COMPILER_VERSION = ${CMAKE_C_COMPILER_VERSION}")
+message("CMAKE_C_COMPILER_VERSION_INTERNAL = ${CMAKE_C_COMPILER_VERSION_INTERNAL}")
+message("CMAKE_C_PLATFORM_ID = ${CMAKE_C_PLATFORM_ID}")
+message("CMAKE_C_COMPILER_ARCHITECTURE_ID = ${CMAKE_C_COMPILER_ARCHITECTURE_ID}")
+message("CMAKE_C_COMPILER_ABI = ${CMAKE_C_COMPILER_ABI}")
+message("CMAKE_C_STANDARD_COMPUTED_DEFAULT = ${CMAKE_C_STANDARD_COMPUTED_DEFAULT}")
+
+message("CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
+message("CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
+message("CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}")
+message("CMAKE_CXX_COMPILER_VERSION_INTERNAL = ${CMAKE_CXX_COMPILER_VERSION_INTERNAL}")
+message("CMAKE_CXX_PLATFORM_ID = ${CMAKE_CXX_PLATFORM_ID}")
+message("CMAKE_CXX_COMPILER_ARCHITECTURE_ID = ${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
+message("CMAKE_CXX_COMPILER_ABI = ${CMAKE_CXX_COMPILER_ABI}")
+message("CMAKE_CXX_STANDARD_COMPUTED_DEFAULT = ${CMAKE_CXX_STANDARD_COMPUTED_DEFAULT}")
+
+if(CMAKE_C_COMPILER AND NOT CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ message(FATAL_ERROR "CMAKE_C_COMPILER_ID != GHS")
+endif()
+
+if(CMAKE_CXX_COMPILER AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "GHS")
+ message(FATAL_ERROR "CMAKE_CXX_COMPILER_ID != GHS")
+endif()
diff --git a/Tests/GhsMulti/GhsMultiPlatform/file1.c b/Tests/GhsMulti/GhsMultiPlatform/file1.c
new file mode 100644
index 000000000..4132aa406
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiPlatform/file1.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return -42;
+}
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt b/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
new file mode 100644
index 000000000..f5792b405
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/CMakeLists.txt
@@ -0,0 +1,42 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+set(targets_to_install "")
+
+if(CMAKE_C_COMPILER_ID STREQUAL "GHS")
+ add_link_options("-non_shared")
+endif()
+
+if(RUN_TEST STREQUAL "SINGLE_EXEC")
+ add_executable(exe1 exe.c)
+ set(targets_to_install ${targets_to_install} exe1)
+endif()
+
+if(RUN_TEST STREQUAL "SINGLE_EXEC_RENAMED")
+ set(name new_name)
+ add_executable(exe1 exe.c)
+ set_property(TARGET exe1 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${name}_bin_$<CONFIG>)
+ set_property(TARGET exe1 PROPERTY OUTPUT_NAME ${name}_$<CONFIG>)
+ set_property(TARGET exe1 PROPERTY SUFFIX .bin)
+ set(targets_to_install ${targets_to_install} exe1)
+endif()
+
+if(RUN_TEST STREQUAL "EXEC_AND_LIB")
+ add_library(lib1 lib1.c)
+ set_property(TARGET lib1 PROPERTY ARCHIVE_OUTPUT_DIRECTORY forced-$<CONFIG>)
+ set_property(TARGET lib1 PROPERTY SUFFIX .LL)
+ set_property(TARGET lib1 PROPERTY OUTPUT_NAME lib1_$<CONFIG>)
+
+ add_executable(exe1 exe1.c)
+ target_link_libraries(exe1 lib1)
+ set(targets_to_install ${targets_to_install} exe1 lib1)
+endif()
+
+install(TARGETS ${targets_to_install}
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib/static)
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/exe.c b/Tests/GhsMulti/GhsMultiRenameInstall/exe.c
new file mode 100644
index 000000000..8488f4e58
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/exe.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/exe1.c b/Tests/GhsMulti/GhsMultiRenameInstall/exe1.c
new file mode 100644
index 000000000..29ad70a3b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/exe1.c
@@ -0,0 +1,5 @@
+extern int func(void);
+int main(void)
+{
+ return func();
+}
diff --git a/Tests/GhsMulti/GhsMultiRenameInstall/lib1.c b/Tests/GhsMulti/GhsMultiRenameInstall/lib1.c
new file mode 100644
index 000000000..b35e9cc5e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiRenameInstall/lib1.c
@@ -0,0 +1,4 @@
+int func(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c b/Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c
new file mode 100644
index 000000000..9c9c1d91b
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/Atest3.c
@@ -0,0 +1,4 @@
+int funcA3a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
new file mode 100644
index 000000000..93a1afcb6
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/CMakeLists.txt
@@ -0,0 +1,45 @@
+# 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.12 FATAL_ERROR)
+
+project(test C)
+
+#set(CMAKE_FOLDER ON)
+add_executable(groups
+ test1.c
+ test1.h
+ test2a.c
+ test4.c
+ test5.c
+ test6.c
+ test7.c
+ standard.h
+ testOBJ.c
+ testOBJ.h
+ sub/testOBJ.c
+ sub/testOBJ.h
+ textfile.txt
+ textfile2.txt
+ test3.c
+ Atest3.c
+# object.o
+ resource.pdf
+ cmake.rule
+ s5.h
+ s2.h
+ s4.h
+ standard.h
+ )
+
+if(TEST_PROP)
+ set_target_properties(groups PROPERTIES GHS_NO_SOURCE_GROUP_FILE ON)
+endif()
+if(CMAKE_C_COMPILER_ID MATCHES "GHS")
+ target_link_options(groups PRIVATE "-non_shared")
+endif()
+source_group( gC FILES sub/testOBJ.h testOBJ.c testOBJ.h sub/testOBJ.c )
+source_group( gA FILES test1.c test1.h)
+source_group( gB test[65].c )
+source_group( gC\\gD FILES test7.c )
+source_group( docs FILES textfile.txt )
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule b/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
new file mode 100644
index 000000000..c6cac6926
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/cmake.rule
@@ -0,0 +1 @@
+empty
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/object.o b/Tests/GhsMulti/GhsMultiSrcGroups/object.o
new file mode 100644
index 000000000..c6cac6926
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/object.o
@@ -0,0 +1 @@
+empty
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf b/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/resource.pdf
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/s2.h b/Tests/GhsMulti/GhsMultiSrcGroups/s2.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/s2.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/s4.h b/Tests/GhsMulti/GhsMultiSrcGroups/s4.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/s4.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/s5.h b/Tests/GhsMulti/GhsMultiSrcGroups/s5.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/s5.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/standard.h b/Tests/GhsMulti/GhsMultiSrcGroups/standard.h
new file mode 100644
index 000000000..2773a5511
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/standard.h
@@ -0,0 +1 @@
+#define somthing
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c
new file mode 100644
index 000000000..90ea9b991
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.c
@@ -0,0 +1,6 @@
+#include "testOBJ.h"
+
+int funcOBJsub(void)
+{
+ return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/sub/testOBJ.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test1.c b/Tests/GhsMulti/GhsMultiSrcGroups/test1.c
new file mode 100644
index 000000000..94f818a0e
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test1.c
@@ -0,0 +1,6 @@
+#include "test1.h"
+
+int main(void)
+{
+ return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test1.h b/Tests/GhsMulti/GhsMultiSrcGroups/test1.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test1.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test2a.c b/Tests/GhsMulti/GhsMultiSrcGroups/test2a.c
new file mode 100644
index 000000000..8f66fba25
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test2a.c
@@ -0,0 +1,4 @@
+int func2a(void)
+{
+ return 2;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test3.c b/Tests/GhsMulti/GhsMultiSrcGroups/test3.c
new file mode 100644
index 000000000..57c7a6ffb
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test3.c
@@ -0,0 +1,4 @@
+int func3a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test3.h b/Tests/GhsMulti/GhsMultiSrcGroups/test3.h
new file mode 100644
index 000000000..2773a5511
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test3.h
@@ -0,0 +1 @@
+#define somthing
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test4.c b/Tests/GhsMulti/GhsMultiSrcGroups/test4.c
new file mode 100644
index 000000000..109fd7b4a
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test4.c
@@ -0,0 +1,4 @@
+int func4a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test5.c b/Tests/GhsMulti/GhsMultiSrcGroups/test5.c
new file mode 100644
index 000000000..f28a705d4
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test5.c
@@ -0,0 +1,4 @@
+int func5a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test6.c b/Tests/GhsMulti/GhsMultiSrcGroups/test6.c
new file mode 100644
index 000000000..bf7740658
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test6.c
@@ -0,0 +1,4 @@
+int func6a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/test7.c b/Tests/GhsMulti/GhsMultiSrcGroups/test7.c
new file mode 100644
index 000000000..6a4a9a1f0
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/test7.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c
new file mode 100644
index 000000000..e86e2a451
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.c
@@ -0,0 +1,11 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
+
+int funcOBJ(void)
+{
+ return func2a() + func3a() + func4a() + func5a() + func6a() + func7a();
+}
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h
new file mode 100644
index 000000000..e2b172570
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/testOBJ.h
@@ -0,0 +1,6 @@
+extern int func2a(void);
+extern int func3a(void);
+extern int func4a(void);
+extern int func5a(void);
+extern int func6a(void);
+extern int func7a(void);
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt b/Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt
new file mode 100644
index 000000000..48cdce852
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/textfile.txt
@@ -0,0 +1 @@
+placeholder
diff --git a/Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt b/Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt
new file mode 100644
index 000000000..48cdce852
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiSrcGroups/textfile2.txt
@@ -0,0 +1 @@
+placeholder
diff --git a/Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt b/Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt
new file mode 100644
index 000000000..ed3094b02
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiUnsupportedTargets/CMakeLists.txt
@@ -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.
+
+cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
+
+project(test C)
+
+add_custom_target(testTarget ALL echo this is a test)
+
+add_library(sharedLib SHARED file.c)
+
+add_library(moduleLib MODULE file.c)
diff --git a/Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c b/Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c
new file mode 100644
index 000000000..6a4a9a1f0
--- /dev/null
+++ b/Tests/GhsMulti/GhsMultiUnsupportedTargets/file.c
@@ -0,0 +1,4 @@
+int func7a(void)
+{
+ return 1;
+}
diff --git a/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt
deleted file mode 100644
index 44c5de1c5..000000000
--- a/Tests/GhsMulti/ReturnNum/Int/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_executable(AppDD AppDD.int Default.bsp)
diff --git a/Tests/GhsMulti/ReturnNum/Int/Default.bsp b/Tests/GhsMulti/ReturnNum/Int/Default.bsp
deleted file mode 100644
index 224ec2906..000000000
--- a/Tests/GhsMulti/ReturnNum/Int/Default.bsp
+++ /dev/null
@@ -1,35 +0,0 @@
-# Target description File for the Integrate utility for use with the
-# INTEGRITY real-time operating system by Green Hills Software.
-# Before editing this file, refer to your Integrate documentation.
-# default.bsp is appropriate for INTEGRITY applications which are
-# fully linked with the kernel (for RAM or ROM) or dynamically downloaded.
-#
-# MinimumAddress must match the value of .ramend in the linker directives
-# file used for the KernelSpace program - see default.ld for more info.
-# The MaximumAddress used here allows memory mappings to be specified
-# for up to the 16 MB mark in RAM. Intex will not permit programs
-# that require more memory for its mappings. If the board has less
-# memory, this number can be reduced by the user.
-
-Target
- MinimumAddress .ramend
- MaximumAddress .ramlimit
- Clock StandardTick
- EndClock
- Clock HighResTimer
- EndClock
- IODevice "SerialDev0"
- InitialKernelObjects 200
- DefaultStartIt false
- DefaultMaxPriority 255
- DefaultPriority 127
- DefaultWeight 1
- DefaultMaxWeight 255
- DefaultHeapSize 0x10000
- LastVirtualAddress 0x3fffffff
- PageSize 0x1000
- ArchitectedPageSize 0x1000
- ArchitectedPageSize 0x10000
- ArchitectedPageSize 0x100000
- DefaultMemoryRegionSize 0x20000
-EndTarget
diff --git a/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt b/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt
deleted file mode 100644
index 9c822da56..000000000
--- a/Tests/GhsMulti/ReturnNum/Lib/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_library(Lib HelperFun.c HelperFun.h) \ No newline at end of file
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index 3db210a5d..954c02d51 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -31,6 +31,7 @@ add_library(item_real STATIC item.cpp)
add_library(item_iface INTERFACE IMPORTED)
set_property(TARGET item_iface PROPERTY IMPORTED_LIBNAME item_real)
add_dependencies(item_iface item_real)
+get_property(item_iface_dependencies TARGET item_iface PROPERTY MANUALLY_ADDED_DEPENDENCIES)
link_directories(${CMAKE_CURRENT_BINARY_DIR})
add_executable(InterfaceLibrary definetestexe.cpp)
@@ -46,6 +47,7 @@ target_link_libraries(InterfaceLibrary
add_dependencies(InterfaceLibrary item_fake_tgt)
add_subdirectory(libsdir)
+add_subdirectory(excluded EXCLUDE_FROM_ALL)
add_executable(sharedlibtestexe sharedlibtestexe.cpp)
target_link_libraries(sharedlibtestexe shared_iface imported::iface)
diff --git a/Tests/InterfaceLibrary/excluded/CMakeLists.txt b/Tests/InterfaceLibrary/excluded/CMakeLists.txt
new file mode 100644
index 000000000..69a6807c9
--- /dev/null
+++ b/Tests/InterfaceLibrary/excluded/CMakeLists.txt
@@ -0,0 +1 @@
+add_library(excluded_iface INTERFACE)
diff --git a/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m b/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m
index ee7068240..5567c4eef 100644
--- a/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m
+++ b/Tests/MumpsCoverage/VistA-FOIA/Packages/Uncategorized/ZZCOVTST.m
@@ -12,6 +12,9 @@ EN ; This entry point shouldn't be found without fixing
; This line not executable
D T6^ZZCOVTST
;
+% ; a line to test for a problem where % was dropped
+ N Do,Re,Mi
+ S Do="A#"
T1 ; This line should always be found
N D
S D=2
diff --git a/Tests/MumpsCoverage/ZZCOVTST.cmcov b/Tests/MumpsCoverage/ZZCOVTST.cmcov
index 41c0ff398..515f822cc 100644
--- a/Tests/MumpsCoverage/ZZCOVTST.cmcov
+++ b/Tests/MumpsCoverage/ZZCOVTST.cmcov
@@ -13,33 +13,36 @@ ZZCOVTST,1,1,"ZZCOVTST;OSEHRA/JPS -- Test routine for Coverage Parsing;4/28/2014
,12,1," Q"
,13,0," ; This line not executable"
,14,0," ;"
-,15,0,"T1 ; This line should always be found"
-,16,1," N D"
-,17,1," S D=2"
-,18,1," W !,D,!,""This is the second entry point"",!"
-,19,1," D T2^ZZCOVTST(D)"
-,20,1," Q"
-,21,0," ;"
-,22,0,"T2(EQ) ; This is debatable and only called with ENT^ROU notation"
-,23,1," N D"
-,24,1," S D=3"
-,25,1," W !,D,!,EQ,""This is the third entry point"",!"
-,26,1," D T3^ZZCOVTST"
-,27,1," Q"
-,28,0," ;"
-,29,1,"T3 N D S D=4 W D,!,""Fourth Entry point"",! Q"
-,30,0," ;"
-,31,0,"T4 N D S D=5 W ""Shouldn't be executed"""
-,32,0," W ""Lots to not do"""
-,33,0," Q"
-,34,1,"T5(EQ) ;this entry point is called with a $$ notation"
-,35,1," W ""THIS IS THE $$ NOTATION!"",!"
-,36,1," Q 0"
-,37,0,"T6 ; An entry point to show comments inside of ""DO"" blocks"
-,38,1," D"
-,39,1," . W ""This is executable code"",!"
-,40,0," . ; This is a comment inside the do block, not executable"
-,41,1," . S ZZBLAH=""blah"""
-,42,1," W ""Ending T6"",!"
-,43,0," ;"
-Totals for ZZCOVTST,,25,
+,15,1,"% ; a line to test for a problem where % was dropped"
+,16,1,"N Do,Re,Mi"
+,17,1,"S Do=""A#"""
+,18,0,"T1 ; This line should always be found"
+,19,1," N D"
+,20,1," S D=2"
+,21,1," W !,D,!,""This is the second entry point"",!"
+,22,1," D T2^ZZCOVTST(D)"
+,23,1," Q"
+,24,0," ;"
+,25,0,"T2(EQ) ; This is debatable and only called with ENT^ROU notation"
+,26,1," N D"
+,27,1," S D=3"
+,28,1," W !,D,!,EQ,""This is the third entry point"",!"
+,29,1," D T3^ZZCOVTST"
+,30,1," Q"
+,31,0," ;"
+,32,1,"T3 N D S D=4 W D,!,""Fourth Entry point"",! Q"
+,33,0," ;"
+,34,0,"T4 N D S D=5 W ""Shouldn't be executed"""
+,35,0," W ""Lots to not do"""
+,36,0," Q"
+,37,1,"T5(EQ) ;this entry point is called with a $$ notation"
+,38,1," W ""THIS IS THE $$ NOTATION!"",!"
+,39,1," Q 0"
+,40,0,"T6 ; An entry point to show comments inside of ""DO"" blocks"
+,41,1," D"
+,42,1," . W ""This is executable code"",!"
+,43,0," . ; This is a comment inside the do block, not executable"
+,44,1," . S ZZBLAH=""blah"""
+,45,1," W ""Ending T6"",!"
+,46,0," ;"
+Toals for ZZCOVTST,,28,
diff --git a/Tests/MumpsCoverage/ZZCOVTST.mcov b/Tests/MumpsCoverage/ZZCOVTST.mcov
index b2608d952..e1fa18cad 100644
--- a/Tests/MumpsCoverage/ZZCOVTST.mcov
+++ b/Tests/MumpsCoverage/ZZCOVTST.mcov
@@ -9,6 +9,9 @@ GT.M 15-AUG-2014 10:14:32 ZWR
^ZZCOVERAGE("ZZCOVTST","EN",4)="1:0:0:0:74"
^ZZCOVERAGE("ZZCOVTST","EN",5)="1:0:0:0:66"
^ZZCOVERAGE("ZZCOVTST","EN",6)="1:0:0:0:40"
+^ZZCOVERAGE("ZZCOVTST","%")="2:0:0:0:208"
+^ZZCOVERAGE("ZZCOVTST","%",1)="2:0:0:0:208"
+^ZZCOVERAGE("ZZCOVTST","%",2)="2:0:0:0:208"
^ZZCOVERAGE("ZZCOVTST","T1")="1:0:0:0:208"
^ZZCOVERAGE("ZZCOVTST","T1",1)="1:0:0:0:23"
^ZZCOVERAGE("ZZCOVTST","T1",2)="1:0:0:0:24"
diff --git a/Tests/Qt4Autogen/CMakeLists.txt b/Tests/Qt4Autogen/CMakeLists.txt
index 818e88813..68b885bab 100644
--- a/Tests/Qt4Autogen/CMakeLists.txt
+++ b/Tests/Qt4Autogen/CMakeLists.txt
@@ -6,4 +6,4 @@ include("../QtAutogen/TestMacros.cmake")
ADD_AUTOGEN_TEST(DefinesTest)
# Common tests
-include("../QtAutogen/CommonTests.cmake")
+include("../QtAutogen/Tests.cmake")
diff --git a/Tests/Qt5Autogen/CMakeLists.txt b/Tests/Qt5Autogen/CMakeLists.txt
index 527e5ff8e..49d33cc8e 100644
--- a/Tests/Qt5Autogen/CMakeLists.txt
+++ b/Tests/Qt5Autogen/CMakeLists.txt
@@ -3,4 +3,4 @@ set(QT_TEST_VERSION 5)
include("../QtAutogen/TestMacros.cmake")
# Common tests
-include("../QtAutogen/CommonTests.cmake")
+include("../QtAutogen/Tests.cmake")
diff --git a/Tests/QtAutogen/AutogenCoreTest.cmake b/Tests/QtAutogen/AutogenCoreTest.cmake
new file mode 100644
index 000000000..580385928
--- /dev/null
+++ b/Tests/QtAutogen/AutogenCoreTest.cmake
@@ -0,0 +1,55 @@
+
+# Tell find_package(Qt5) where to find Qt.
+if(QT_QMAKE_EXECUTABLE)
+ get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
+ get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH)
+ list(APPEND CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR})
+endif()
+
+if (QT_TEST_VERSION EQUAL 4)
+
+ find_package(Qt4 REQUIRED QtCore)
+ include(UseQt4)
+
+ set(QT_QTCORE_TARGET Qt4::QtCore)
+
+ # Qt macros
+ macro(qtx_wrap_cpp)
+ qt4_wrap_cpp(${ARGN})
+ endmacro()
+ macro(qtx_generate_moc)
+ qt4_generate_moc(${ARGN})
+ endmacro()
+
+elseif(QT_TEST_VERSION EQUAL 5)
+
+ find_package(Qt5Core REQUIRED)
+
+ set(QT_QTCORE_TARGET Qt5::Core)
+ set(QT_LIBRARIES Qt5::Core)
+
+ # Include directories
+ include_directories(${Qt5Core_INCLUDE_DIRS})
+
+ # Definitions
+ if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
+ add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC})
+ endif()
+
+ # Qt macros
+ macro(qtx_wrap_cpp)
+ qt5_wrap_cpp(${ARGN})
+ endmacro()
+ macro(qtx_generate_moc)
+ qt5_generate_moc(${ARGN})
+ endmacro()
+
+else()
+ message(SEND_ERROR "Invalid Qt version specified: ${QT_TEST_VERSION}")
+endif()
+
+# Get Qt compile features
+get_property(QT_COMPILE_FEATURES
+ TARGET ${QT_QTCORE_TARGET}
+ PROPERTY INTERFACE_COMPILE_FEATURES
+)
diff --git a/Tests/QtAutogen/AutogenTest.cmake b/Tests/QtAutogen/AutogenGuiTest.cmake
index 3969a8931..b76d341a4 100644
--- a/Tests/QtAutogen/AutogenTest.cmake
+++ b/Tests/QtAutogen/AutogenGuiTest.cmake
@@ -7,11 +7,11 @@ if(QT_QMAKE_EXECUTABLE)
endif()
if (QT_TEST_VERSION EQUAL 4)
+
find_package(Qt4 REQUIRED)
include(UseQt4)
set(QT_QTCORE_TARGET Qt4::QtCore)
- set(QT_QTGUI_TARGET Qt4::QtGui)
# Qt macros
macro(qtx_wrap_cpp)
@@ -22,14 +22,16 @@ if (QT_TEST_VERSION EQUAL 4)
endmacro()
elseif(QT_TEST_VERSION EQUAL 5)
+
find_package(Qt5Widgets REQUIRED)
set(QT_QTCORE_TARGET Qt5::Core)
- set(QT_QTGUI_TARGET Qt5::Widgets)
+ set(QT_LIBRARIES Qt5::Widgets)
+ # Include directories
include_directories(${Qt5Widgets_INCLUDE_DIRS})
- set(QT_LIBRARIES Qt5::Widgets)
+ # Definitions
if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC})
endif()
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
new file mode 100644
index 000000000..9e6fe8b34
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
@@ -0,0 +1,71 @@
+cmake_minimum_required(VERSION 3.11)
+project(AutogenOriginDependsOff)
+include("../AutogenCoreTest.cmake")
+
+set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
+set(CBD ${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CSD})
+include_directories(${CBD})
+
+# A GENERATED file ensures there will be an _autogen target in VS
+add_custom_command (
+ OUTPUT "${CBD}/config.hpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CSD}/config.hpp.in" "${CBD}/config.hpp"
+ )
+
+
+# Library "a_mc" provides a header that holds a string with the content of
+# mocs_compilation.cpp from a_qt. It therefore must depend on a_qt_autogen.
+add_custom_target ( a_mc
+ COMMAND ${CMAKE_COMMAND} -E sleep 2
+ COMMAND ${CMAKE_COMMAND}
+ "-DMCF=${CBD}/a_qt_autogen/mocs_compilation.cpp"
+ "-DCF_IN=${CSD}/a_mc.hpp.in"
+ "-DCF_OUT=${CBD}/a_mc.hpp"
+ -P ${CSD}/configure_content.cmake
+ )
+add_dependencies ( a_mc a_qt_autogen )
+
+# Library "a_qt"
+# - depends on a GENERATED file
+# - AUTOMOC enabled
+# - depends on a target (a_mc) that depends on a_qt_qutogen
+add_library ( a_qt a_qt.cpp "${CBD}/config.hpp" )
+add_dependencies ( a_qt a_mc )
+target_link_libraries ( a_qt ${QT_QTCORE_TARGET})
+set_target_properties ( a_qt PROPERTIES AUTOMOC TRUE)
+# Disable AUTOGEN_ORIGIN_DEPENDS to avoid loop dependencies
+set_target_properties ( a_qt PROPERTIES AUTOGEN_ORIGIN_DEPENDS OFF)
+
+
+# Library "b_mc" provides a header that holds a string function that returns
+# the content of mocs_compilation.cpp from b_qt.
+# It therefore must depend on b_qt_autogen.
+add_custom_command (
+ OUTPUT ${CBD}/b_mc.cpp
+ DEPENDS b_qt_autogen
+ COMMAND ${CMAKE_COMMAND} -E sleep 2
+ COMMAND ${CMAKE_COMMAND}
+ "-DMCF=${CBD}/b_qt_autogen/mocs_compilation.cpp"
+ "-DCF_IN=${CSD}/b_mc.cpp.in"
+ "-DCF_OUT=${CBD}/b_mc.cpp"
+ -P ${CSD}/configure_content.cmake
+ )
+add_library ( b_mc ${CSD}/b_mc.hpp ${CBD}/b_mc.cpp )
+
+# Library "b_qt"
+# - depends on a GENERATED file
+# - AUTOMOC enabled
+# - depends on a library (b_mc) that depends on b_qt_qutogen
+add_library ( b_qt b_qt.cpp "${CBD}/config.hpp" )
+target_link_libraries ( b_qt b_mc )
+target_link_libraries ( b_qt ${QT_QTCORE_TARGET})
+set_target_properties ( b_qt PROPERTIES AUTOMOC TRUE)
+# Disable AUTOGEN_ORIGIN_DEPENDS to avoid loop dependencies
+set_target_properties ( b_qt PROPERTIES AUTOGEN_ORIGIN_DEPENDS OFF)
+
+
+# The main target depends on both libraries which depend on the _autogen
+# target of the main target.
+add_executable ( autogenOriginDependsOff main.cpp )
+target_link_libraries ( autogenOriginDependsOff a_qt b_qt )
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_mc.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOff/a_mc.hpp.in
new file mode 100644
index 000000000..fe71f673d
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_mc.hpp.in
@@ -0,0 +1,9 @@
+#ifndef A_MC_HPP
+#define A_MC_HPP
+
+namespace a_mc {
+
+char const* mocs_compilation = "@MOCS_COMPILATION@";
+}
+
+#endif
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp
new file mode 100644
index 000000000..e498969e9
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp
@@ -0,0 +1,28 @@
+
+#include "a_qt.hpp"
+#include <a_mc.hpp>
+
+namespace a_qt {
+
+/// @brief A source local QObject based class
+class Source_QObject : public QObject
+{
+ Q_OBJECT
+public:
+ Source_QObject() {}
+ ~Source_QObject() {}
+
+ std::string str;
+};
+
+std::string mocs_compilation()
+{
+ // Create and destroy QObject based classes
+ Header_QObject header_obj;
+ Source_QObject source_obj;
+
+ return std::string(a_mc::mocs_compilation);
+}
+}
+
+#include "a_qt.moc"
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
new file mode 100644
index 000000000..e2387ee11
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
@@ -0,0 +1,25 @@
+#ifndef A_QT_HPP
+#define A_QT_HPP
+
+#include <QObject>
+#include <config.hpp>
+#include <string>
+
+namespace a_qt {
+
+/// @brief A header local QObject based class
+class Header_QObject : public QObject
+{
+ Q_OBJECT
+public:
+ Header_QObject() {}
+ ~Header_QObject() {}
+
+ std::string str;
+};
+
+/// @brief Function that returns the content of mocs_compilation.cpp
+extern std::string mocs_compilation();
+}
+
+#endif
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.cpp.in b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.cpp.in
new file mode 100644
index 000000000..0f5ec308c
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.cpp.in
@@ -0,0 +1,9 @@
+#include <b_mc.hpp>
+
+namespace b_mc {
+
+char const* mocs_compilation()
+{
+ return "@MOCS_COMPILATION@";
+}
+}
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.hpp
new file mode 100644
index 000000000..043727359
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_mc.hpp
@@ -0,0 +1,9 @@
+#ifndef B_MC_HPP
+#define B_MC_HPP
+
+namespace b_mc {
+
+extern char const* mocs_compilation();
+}
+
+#endif
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp
new file mode 100644
index 000000000..f72f6ca9f
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp
@@ -0,0 +1,28 @@
+
+#include "b_qt.hpp"
+#include <b_mc.hpp>
+
+namespace b_qt {
+
+/// @brief A source local QObject based class
+class Source_QObject : public QObject
+{
+ Q_OBJECT
+public:
+ Source_QObject() {}
+ ~Source_QObject() {}
+
+ std::string str;
+};
+
+std::string mocs_compilation()
+{
+ // Create and destroy QObject based classes
+ Header_QObject header_obj;
+ Source_QObject source_obj;
+
+ return std::string(b_mc::mocs_compilation());
+}
+}
+
+#include "b_qt.moc"
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
new file mode 100644
index 000000000..d7f0311a6
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
@@ -0,0 +1,25 @@
+#ifndef B_QT_HPP
+#define B_QT_HPP
+
+#include <QObject>
+#include <config.hpp>
+#include <string>
+
+namespace b_qt {
+
+/// @brief A header local QObject based class
+class Header_QObject : public QObject
+{
+ Q_OBJECT
+public:
+ Header_QObject() {}
+ ~Header_QObject() {}
+
+ std::string str;
+};
+
+/// @brief Function that returns the content of mocs_compilation.cpp
+extern std::string mocs_compilation();
+}
+
+#endif
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/config.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOff/config.hpp.in
new file mode 100644
index 000000000..e415d0855
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/config.hpp.in
@@ -0,0 +1,8 @@
+#ifndef CONFIG_HPP
+#define CONFIG_HPP
+
+// Application configuration
+
+enum dummy { NO_OP };
+
+#endif
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/configure_content.cmake b/Tests/QtAutogen/AutogenOriginDependsOff/configure_content.cmake
new file mode 100644
index 000000000..0fc6e638d
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/configure_content.cmake
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.10)
+
+# Read mocs_compilation.cpp file into variable
+file(READ "${MCF}" MOCS_COMPILATION)
+string(REPLACE "\\" "\\\\" MOCS_COMPILATION "${MOCS_COMPILATION}" )
+string(REPLACE "\"" "\\\"" MOCS_COMPILATION "${MOCS_COMPILATION}" )
+string(REPLACE "\n" "\"\n\"" MOCS_COMPILATION "${MOCS_COMPILATION}" )
+
+# Configure file
+configure_file ( "${CF_IN}" "${CF_OUT}" @ONLY )
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp
new file mode 100644
index 000000000..a3425f14c
--- /dev/null
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp
@@ -0,0 +1,15 @@
+
+#include <a_qt.hpp>
+#include <b_qt.hpp>
+#include <string>
+
+int main()
+{
+ if (a_qt::mocs_compilation().empty()) {
+ return -1;
+ }
+ if (b_qt::mocs_compilation().empty()) {
+ return -1;
+ }
+ return 0;
+}
diff --git a/Tests/QtAutogen/MocDepends/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt
index 6ea72be61..5aabe0e68 100644
--- a/Tests/QtAutogen/MocDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
-project(MocDepends)
-include("../AutogenTest.cmake")
+project(AutogenOriginDependsOn)
+include("../AutogenCoreTest.cmake")
include_directories(${CMAKE_CURRENT_BINARY_DIR})
set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
@@ -89,51 +89,3 @@ target_link_libraries(SimpleLib ${QT_QTCORE_TARGET})
add_executable(mocDepGenLib testGenLib.cpp)
target_link_libraries(mocDepGenLib SimpleLib ${QT_QTCORE_TARGET})
set_target_properties(mocDepGenLib PROPERTIES AUTOMOC TRUE)
-
-
-# -- Test AUTOGEN_TARGET_DEPENDS with GENERATED file dependency
-#
-# This tests the dependency of the mocDepATDFile_autogen target of
-# mocDepATDTarget to the utility target mocDepATDFileUtil.
-# If mocDepATDFile_autogen gets built *before* or in *parallel* to
-# mocDepATDFileUtil, the build will fail. That's
-# because ATDFile.hpp, which is required by mocDepATDFile_autogen,
-# is only valid after the mocDepATDFileUtil build has been completed.
-#
-# The sleep seconds artificially increase the build time of
-# mocDepATDFileUtil to simulate a slow utility target build that takes
-# longer to run than the build of the mocDepATDFile_autogen target.
-add_custom_command(
- OUTPUT ${CBD}/ATDFile.hpp
- COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDFile.hpp
- COMMAND ${CMAKE_COMMAND} -E sleep 3
- COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDFile.hpp)
-
-add_executable(mocDepATDFile testATDFile.cpp)
-target_link_libraries(mocDepATDFile ${QT_QTCORE_TARGET})
-set_target_properties(mocDepATDFile PROPERTIES AUTOMOC TRUE)
-set_target_properties(mocDepATDFile PROPERTIES AUTOGEN_TARGET_DEPENDS ${CBD}/ATDFile.hpp)
-
-
-# -- Test AUTOGEN_TARGET_DEPENDS with target dependency
-#
-# This tests the dependency of the mocDepATDTarget_autogen target of
-# mocDepATDTarget to the utility target mocDepATDTargetUtil.
-# If mocDepATDTarget_autogen gets built *before* or in *parallel* to
-# mocDepATDTargetUtil, the build will fail. That's
-# because ATDTarget.hpp, which is required by mocDepATDTarget_autogen,
-# is only valid after the mocDepATDTargetUtil build has been completed.
-#
-# The sleep seconds artificially increase the build time of
-# mocDepATDTargetUtil to simulate a slow utility target build that takes
-# longer to run than the build of the mocDepATDTarget_autogen target.
-add_custom_target(mocDepATDTargetUtil
- BYPRODUCTS ${CBD}/ATDTarget.hpp
- COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDTarget.hpp
- COMMAND ${CMAKE_COMMAND} -E sleep 3
- COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDTarget.hpp)
-
-add_executable(mocDepATDTarget testATDTarget.cpp)
-target_link_libraries(mocDepATDTarget ${QT_QTCORE_TARGET})
-set_target_properties(mocDepATDTarget PROPERTIES AUTOMOC TRUE)
-set_target_properties(mocDepATDTarget PROPERTIES AUTOGEN_TARGET_DEPENDS mocDepATDTargetUtil)
diff --git a/Tests/QtAutogen/MocDepends/object_invalid.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/object_invalid.hpp.in
index 854d9a143..854d9a143 100644
--- a/Tests/QtAutogen/MocDepends/object_invalid.hpp.in
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/object_invalid.hpp.in
diff --git a/Tests/QtAutogen/MocDepends/object_valid.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/object_valid.hpp.in
index f364f7c97..f364f7c97 100644
--- a/Tests/QtAutogen/MocDepends/object_valid.hpp.in
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/object_valid.hpp.in
diff --git a/Tests/QtAutogen/MocDepends/simpleLib.cpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.cpp.in
index fa33bd375..fa33bd375 100644
--- a/Tests/QtAutogen/MocDepends/simpleLib.cpp.in
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.cpp.in
diff --git a/Tests/QtAutogen/MocDepends/simpleLib.hpp.in b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.hpp.in
index b65b0cb4a..b65b0cb4a 100644
--- a/Tests/QtAutogen/MocDepends/simpleLib.hpp.in
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/simpleLib.hpp.in
diff --git a/Tests/QtAutogen/MocDepends/testGenFile.cpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenFile.cpp
index 7df6e137c..7df6e137c 100644
--- a/Tests/QtAutogen/MocDepends/testGenFile.cpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenFile.cpp
diff --git a/Tests/QtAutogen/MocDepends/testGenLib.cpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.cpp
index c14e15958..c14e15958 100644
--- a/Tests/QtAutogen/MocDepends/testGenLib.cpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.cpp
diff --git a/Tests/QtAutogen/MocDepends/testGenLib.hpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp
index 408335bd2..408335bd2 100644
--- a/Tests/QtAutogen/MocDepends/testGenLib.hpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp
diff --git a/Tests/QtAutogen/MocDepends/testGenTarget.cpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenTarget.cpp
index 911076efd..911076efd 100644
--- a/Tests/QtAutogen/MocDepends/testGenTarget.cpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenTarget.cpp
diff --git a/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt
new file mode 100644
index 000000000..492b5dbd3
--- /dev/null
+++ b/Tests/QtAutogen/AutogenTargetDepends/CMakeLists.txt
@@ -0,0 +1,54 @@
+cmake_minimum_required(VERSION 3.10)
+project(AutogenTargetDepends)
+include("../AutogenCoreTest.cmake")
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
+set(CBD ${CMAKE_CURRENT_BINARY_DIR})
+
+# -- Test AUTOGEN_TARGET_DEPENDS with GENERATED file dependency
+#
+# This tests the dependency of the mocDepATDFile_autogen target of
+# mocDepATDTarget to the utility target mocDepATDFileUtil.
+# If mocDepATDFile_autogen gets built *before* or in *parallel* to
+# mocDepATDFileUtil, the build will fail. That's
+# because ATDFile.hpp, which is required by mocDepATDFile_autogen,
+# is only valid after the mocDepATDFileUtil build has been completed.
+#
+# The sleep seconds artificially increase the build time of
+# mocDepATDFileUtil to simulate a slow utility target build that takes
+# longer to run than the build of the mocDepATDFile_autogen target.
+add_custom_command(
+ OUTPUT ${CBD}/ATDFile.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDFile.hpp
+ COMMAND ${CMAKE_COMMAND} -E sleep 3
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDFile.hpp)
+
+add_executable(mocDepATDFile testATDFile.cpp)
+target_link_libraries(mocDepATDFile ${QT_QTCORE_TARGET})
+set_target_properties(mocDepATDFile PROPERTIES AUTOMOC TRUE)
+set_target_properties(mocDepATDFile PROPERTIES AUTOGEN_TARGET_DEPENDS ${CBD}/ATDFile.hpp)
+
+
+# -- Test AUTOGEN_TARGET_DEPENDS with target dependency
+#
+# This tests the dependency of the mocDepATDTarget_autogen target of
+# mocDepATDTarget to the utility target mocDepATDTargetUtil.
+# If mocDepATDTarget_autogen gets built *before* or in *parallel* to
+# mocDepATDTargetUtil, the build will fail. That's
+# because ATDTarget.hpp, which is required by mocDepATDTarget_autogen,
+# is only valid after the mocDepATDTargetUtil build has been completed.
+#
+# The sleep seconds artificially increase the build time of
+# mocDepATDTargetUtil to simulate a slow utility target build that takes
+# longer to run than the build of the mocDepATDTarget_autogen target.
+add_custom_target(mocDepATDTargetUtil
+ BYPRODUCTS ${CBD}/ATDTarget.hpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_invalid.hpp.in ${CBD}/ATDTarget.hpp
+ COMMAND ${CMAKE_COMMAND} -E sleep 3
+ COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDTarget.hpp)
+
+add_executable(mocDepATDTarget testATDTarget.cpp)
+target_link_libraries(mocDepATDTarget ${QT_QTCORE_TARGET})
+set_target_properties(mocDepATDTarget PROPERTIES AUTOMOC TRUE)
+set_target_properties(mocDepATDTarget PROPERTIES AUTOGEN_TARGET_DEPENDS mocDepATDTargetUtil)
diff --git a/Tests/QtAutogen/AutogenTargetDepends/object_invalid.hpp.in b/Tests/QtAutogen/AutogenTargetDepends/object_invalid.hpp.in
new file mode 100644
index 000000000..854d9a143
--- /dev/null
+++ b/Tests/QtAutogen/AutogenTargetDepends/object_invalid.hpp.in
@@ -0,0 +1 @@
+#ifndef
diff --git a/Tests/QtAutogen/AutogenTargetDepends/object_valid.hpp.in b/Tests/QtAutogen/AutogenTargetDepends/object_valid.hpp.in
new file mode 100644
index 000000000..f364f7c97
--- /dev/null
+++ b/Tests/QtAutogen/AutogenTargetDepends/object_valid.hpp.in
@@ -0,0 +1,14 @@
+#ifndef OBJECT_HPP
+#define OBJECT_HPP
+
+#include <QObject>
+
+class Object : public QObject
+{
+ Q_OBJECT
+public:
+ Q_SLOT
+ void aSlot(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocDepends/testATDFile.cpp b/Tests/QtAutogen/AutogenTargetDepends/testATDFile.cpp
index 6bddfcd39..6bddfcd39 100644
--- a/Tests/QtAutogen/MocDepends/testATDFile.cpp
+++ b/Tests/QtAutogen/AutogenTargetDepends/testATDFile.cpp
diff --git a/Tests/QtAutogen/MocDepends/testATDTarget.cpp b/Tests/QtAutogen/AutogenTargetDepends/testATDTarget.cpp
index 831fc2691..831fc2691 100644
--- a/Tests/QtAutogen/MocDepends/testATDTarget.cpp
+++ b/Tests/QtAutogen/AutogenTargetDepends/testATDTarget.cpp
diff --git a/Tests/QtAutogen/Complex/CMakeLists.txt b/Tests/QtAutogen/Complex/CMakeLists.txt
index a18cc042f..d9fdf5cf4 100644
--- a/Tests/QtAutogen/Complex/CMakeLists.txt
+++ b/Tests/QtAutogen/Complex/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(Complex)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# -- Test: AUTOMOC AUTORCC AUTOUIC
add_definitions(-DFOO -DSomeDefine="Barx")
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
new file mode 100644
index 000000000..cff7022d2
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
@@ -0,0 +1,123 @@
+cmake_minimum_required(VERSION 3.12)
+project(GlobalAutogenTarget)
+include("../AutogenCoreTest.cmake")
+
+# This tests
+# CMAKE_GLOBAL_AUTOGEN_TARGET,
+# CMAKE_GLOBAL_AUTORCC_TARGET,
+# CMAKE_GLOBAL_AUTOGEN_TARGET_NAME and
+# CMAKE_GLOBAL_AUTORCC_TARGET_NAME
+# for the latter two with different values in different subdirectories.
+
+# Directories
+set(GAT_SDIR "${CMAKE_CURRENT_SOURCE_DIR}/GAT")
+set(GAT_BDIR "${CMAKE_CURRENT_BINARY_DIR}/GAT")
+# Files
+set(MCA "sda/sda_autogen/mocs_compilation.cpp")
+set(MCB "sdb/sdb_autogen/mocs_compilation.cpp")
+set(MCC "sdc/sdc_autogen/mocs_compilation.cpp")
+set(MCG "gat_autogen/mocs_compilation.cpp")
+
+set(DRA "sda/sda_autogen/*qrc_data.cpp")
+set(DRB "sdb/sdb_autogen/*qrc_data.cpp")
+set(DRC "sdc/sdc_autogen/*qrc_data.cpp")
+set(DRG "gat_autogen/*qrc_data.cpp")
+
+# -- Utility macros
+macro(GAT_FIND_FILES VAR NAME)
+ file(GLOB_RECURSE ${VAR} ${GAT_BDIR}/*${NAME})
+endmacro()
+
+macro(GAT_FIND_FILE NAME)
+ GAT_FIND_FILES(LST ${NAME})
+ if(LST)
+ message("Good find ${LST}")
+ else()
+ message(SEND_ERROR "Expected to find ${GAT_BDIR}/${NAME}")
+ endif()
+ unset(LST)
+endmacro()
+
+macro(GAT_FIND_FILE_NOT NAME)
+ GAT_FIND_FILES(LST ${NAME})
+ if(LST)
+ message(SEND_ERROR "Not expected to find ${GAT_BDIR}/${NAME}")
+ else()
+ message("Good not find ${GAT_BDIR}/${NAME}")
+ endif()
+ unset(LST)
+endmacro()
+
+macro(GAT_BUILD_TARGET NAME)
+ message("___ Building GAT ${NAME} target ___")
+ execute_process(
+ COMMAND "${CMAKE_COMMAND}" --build "${GAT_BDIR}" --target ${NAME}
+ WORKING_DIRECTORY "${GAT_BDIR}"
+ RESULT_VARIABLE result)
+ if (result)
+ message(SEND_ERROR "Building of GAT ${NAME} target failed")
+ endif()
+endmacro()
+
+
+# -- Remove and recreate build directory
+file(REMOVE_RECURSE ${GAT_BDIR})
+file(MAKE_DIRECTORY ${GAT_BDIR})
+
+
+# -- Configure project
+message("___ Configuring GAT project ___")
+execute_process(
+ COMMAND "${CMAKE_COMMAND}" "${GAT_SDIR}"
+ "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+ WORKING_DIRECTORY "${GAT_BDIR}"
+ OUTPUT_VARIABLE output
+ RESULT_VARIABLE result)
+if (result)
+ message(SEND_ERROR "Configuring of GAT project failed")
+else()
+ message("Configuring of GAT project succeeded")
+ message("${output}")
+endif()
+
+
+# -- Build autogen subtargets
+GAT_BUILD_TARGET("autogen")
+GAT_FIND_FILE("${MCA}")
+GAT_FIND_FILE_NOT("${MCB}")
+GAT_FIND_FILE_NOT("${MCC}")
+GAT_FIND_FILE("${MCG}")
+
+GAT_BUILD_TARGET("global_autogen_sdb")
+GAT_FIND_FILE("${MCA}")
+GAT_FIND_FILE("${MCB}")
+GAT_FIND_FILE_NOT("${MCC}")
+GAT_FIND_FILE("${MCG}")
+
+GAT_BUILD_TARGET("all_autogen")
+GAT_FIND_FILE("${MCA}")
+GAT_FIND_FILE("${MCB}")
+GAT_FIND_FILE("${MCC}")
+GAT_FIND_FILE("${MCG}")
+
+
+# -- Build autorcc subtargets
+GAT_BUILD_TARGET("autorcc")
+GAT_FIND_FILE("${DRA}")
+GAT_FIND_FILE_NOT("${DRB}")
+GAT_FIND_FILE_NOT("${DRC}")
+GAT_FIND_FILE("${DRG}")
+
+GAT_BUILD_TARGET("global_autorcc_sdb")
+GAT_FIND_FILE("${DRA}")
+GAT_FIND_FILE("${DRB}")
+GAT_FIND_FILE_NOT("${DRC}")
+GAT_FIND_FILE("${DRG}")
+
+GAT_BUILD_TARGET("all_autorcc")
+GAT_FIND_FILE("${DRA}")
+GAT_FIND_FILE("${DRB}")
+GAT_FIND_FILE("${DRC}")
+GAT_FIND_FILE("${DRG}")
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
new file mode 100644
index 000000000..3925197fe
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.12)
+project(GAT)
+include("../../AutogenCoreTest.cmake")
+
+# Include directories
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+# Enable AUTOMOC/UIC/RCC
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+# Disable ORIGN_DEPENDS and enable AUTOGEN global targets
+set(CMAKE_AUTOGEN_ORIGIN_DEPENDS OFF)
+set(CMAKE_GLOBAL_AUTOGEN_TARGET ON)
+set(CMAKE_GLOBAL_AUTORCC_TARGET ON)
+
+add_subdirectory(sda)
+add_subdirectory(sdb)
+add_subdirectory(sdc)
+
+# Add custom target that depends on all autogen/autorcc targets
+add_custom_target(all_autogen DEPENDS autogen global_autogen_sdb global_autogen_sdc)
+add_custom_target(all_autorcc DEPENDS autorcc global_autorcc_sdb global_autorcc_sdc)
+
+# Main target
+add_executable(gat data.qrc item.cpp main.cpp)
+target_link_libraries(gat ${QT_LIBRARIES})
+target_link_libraries(gat sda sdb sdc)
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc b/Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc
new file mode 100644
index 000000000..68d02c9eb
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/data.qrc
@@ -0,0 +1,5 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>item.cpp</file>
+</qresource>
+</RCC>
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.cpp
new file mode 100644
index 000000000..3d1fbe7cf
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.cpp
@@ -0,0 +1,20 @@
+#include "item.hpp"
+// Include ui_view.h in source and header
+#include <ui_view.h>
+
+class MocLocal : public QObject
+{
+ Q_OBJECT;
+
+public:
+ MocLocal() = default;
+ ~MocLocal() = default;
+};
+
+void Item::go()
+{
+ Ui_View ui;
+ MocLocal obj;
+}
+
+#include "item.moc"
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.hpp
new file mode 100644
index 000000000..75e83f483
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/item.hpp
@@ -0,0 +1,15 @@
+#ifndef ITEM_HPP
+#define ITEM_HPP
+
+#include <QObject>
+// Include ui_view.h in source and header
+#include <ui_view.h>
+
+class Item : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go();
+};
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp
new file mode 100644
index 000000000..79c00b407
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/main.cpp
@@ -0,0 +1,15 @@
+#include "item.hpp"
+#include "sda/sda.hpp"
+#include "sdb/sdb.hpp"
+#include "sdc/sdc.hpp"
+
+int main(int argv, char** args)
+{
+ // Object instances
+ Item item;
+ // Library calls
+ sda();
+ sdb();
+ sdc();
+ return 0;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt
new file mode 100644
index 000000000..795e91e97
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(sda ../item.cpp ../data.qrc sda.cpp)
+target_link_libraries(sda ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp
new file mode 100644
index 000000000..ec4dec88a
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.cpp
@@ -0,0 +1,6 @@
+#include <item.hpp>
+
+void sda()
+{
+ Item item;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp
new file mode 100644
index 000000000..89ac744b3
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sda/sda.hpp
@@ -0,0 +1,6 @@
+#ifndef SDA_HPP
+#define SDA_HPP
+
+void sda();
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt
new file mode 100644
index 000000000..5c686fec4
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(CMAKE_GLOBAL_AUTOGEN_TARGET_NAME "global_autogen_sdb")
+set(CMAKE_GLOBAL_AUTORCC_TARGET_NAME "global_autorcc_sdb")
+
+add_library(sdb ../item.cpp ../data.qrc sdb.cpp)
+target_link_libraries(sdb ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp
new file mode 100644
index 000000000..e32c46709
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.cpp
@@ -0,0 +1,6 @@
+#include <item.hpp>
+
+void sdb()
+{
+ Item item;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp
new file mode 100644
index 000000000..a5b0f62f9
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdb/sdb.hpp
@@ -0,0 +1,6 @@
+#ifndef SDB_HPP
+#define SDB_HPP
+
+void sdb();
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt
new file mode 100644
index 000000000..2698bda6b
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(CMAKE_GLOBAL_AUTOGEN_TARGET_NAME "global_autogen_sdc")
+set(CMAKE_GLOBAL_AUTORCC_TARGET_NAME "global_autorcc_sdc")
+
+add_library(sdc ../item.cpp ../data.qrc sdc.cpp)
+target_link_libraries(sdc ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp
new file mode 100644
index 000000000..a97cd4276
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.cpp
@@ -0,0 +1,6 @@
+#include <item.hpp>
+
+void sdc()
+{
+ Item item;
+}
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp
new file mode 100644
index 000000000..7e9217902
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/sdc/sdc.hpp
@@ -0,0 +1,6 @@
+#ifndef SDC_HPP
+#define SDC_HPP
+
+void sdc();
+
+#endif
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/GAT/view.ui b/Tests/QtAutogen/GlobalAutogenTarget/GAT/view.ui
new file mode 100644
index 000000000..2ffe7344c
--- /dev/null
+++ b/Tests/QtAutogen/GlobalAutogenTarget/GAT/view.ui
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>View</class>
+ <widget class="QWidget" name="Base">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTreeView" name="treeView"/>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt b/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt
index a6ac338e3..e1af3d863 100644
--- a/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt
+++ b/Tests/QtAutogen/LowMinimumVersion/CMakeLists.txt
@@ -1,7 +1,7 @@
# Use a low minimum version
cmake_minimum_required(VERSION 3.0)
project(LowMinimumVersion)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
diff --git a/Tests/QtAutogen/MacOsFW/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/CMakeLists.txt
index 26d201926..c08efc47a 100644
--- a/Tests/QtAutogen/MacOsFW/CMakeLists.txt
+++ b/Tests/QtAutogen/MacOsFW/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MacOsFW)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
find_package(Qt5Test REQUIRED)
diff --git a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt
index a79f36eb7..5c58a8278 100644
--- a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt
+++ b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocCMP0071)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
add_subdirectory(OLD)
add_subdirectory(NEW)
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt
index 1ad6238df..8b4da3453 100644
--- a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt
+++ b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocIncludeRelaxed)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test moc include patterns
set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
diff --git a/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt
index 2cf0fedfd..d0aaebf37 100644
--- a/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt
+++ b/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocIncludeStrict)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test moc include patterns
set(CMAKE_AUTOMOC_RELAXED_MODE FALSE)
diff --git a/Tests/QtAutogen/MocMacroName/CMakeLists.txt b/Tests/QtAutogen/MocMacroName/CMakeLists.txt
index f0251a2a0..bf13d187d 100644
--- a/Tests/QtAutogen/MocMacroName/CMakeLists.txt
+++ b/Tests/QtAutogen/MocMacroName/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocMacroName)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test CMAKE_AUTOMOC_MACRO_NAMES and AUTOMOC_MACRO_NAMES
list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS")
diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt
index a37a2ae7c..e109154aa 100644
--- a/Tests/QtAutogen/MocOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocOnly)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
add_executable(mocOnly
main.cpp
@@ -13,3 +13,5 @@ add_executable(mocOnly
)
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
target_link_libraries(mocOnly ${QT_LIBRARIES})
+# Add compile definitions with unusual characters
+target_compile_definitions(mocOnly PUBLIC "TOKEN=\"hello\;\"" )
diff --git a/Tests/QtAutogen/MocOnly/main.cpp b/Tests/QtAutogen/MocOnly/main.cpp
index 1611f9744..b83b8063b 100644
--- a/Tests/QtAutogen/MocOnly/main.cpp
+++ b/Tests/QtAutogen/MocOnly/main.cpp
@@ -2,6 +2,7 @@
#include "IncB.hpp"
#include "StyleA.hpp"
#include "StyleB.hpp"
+#include <iostream>
int main(int argv, char** args)
{
@@ -10,5 +11,8 @@ int main(int argv, char** args)
IncA incA;
IncB incB;
- return 0;
+ // Test the TOKEN definition passed on the command line
+ std::string token(TOKEN);
+ std::cout << "std::string(TOKEN): \"" << token << "\"\n";
+ return (token == "hello;") ? 0 : -1;
}
diff --git a/Tests/QtAutogen/MocOptions/CMakeLists.txt b/Tests/QtAutogen/MocOptions/CMakeLists.txt
index f64b37b46..19ee6587e 100644
--- a/Tests/QtAutogen/MocOptions/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOptions/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocOptions)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test extra options passed to moc via AUTOMOC_MOC_OPTIONS
add_executable(mocOptions Object.cpp main.cpp)
diff --git a/Tests/QtAutogen/MocOsMacros/CMakeLists.txt b/Tests/QtAutogen/MocOsMacros/CMakeLists.txt
index e7b670e65..b0125f6c3 100644
--- a/Tests/QtAutogen/MocOsMacros/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOsMacros/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.11)
project(MocOsMacros)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Tests if moc processes Q_OS_XXX macros
diff --git a/Tests/QtAutogen/MocOsMacros/TestClass.cpp b/Tests/QtAutogen/MocOsMacros/TestClass.cpp
index 340d130b1..13f8fd93a 100644
--- a/Tests/QtAutogen/MocOsMacros/TestClass.cpp
+++ b/Tests/QtAutogen/MocOsMacros/TestClass.cpp
@@ -1,6 +1,11 @@
#include "TestClass.hpp"
#include <iostream>
+void TestClass::open()
+{
+ std::cout << "open\n";
+}
+
// -- Mac
#ifndef Q_OS_MAC
void TestClass::MacNotDef()
diff --git a/Tests/QtAutogen/MocOsMacros/TestClass.hpp b/Tests/QtAutogen/MocOsMacros/TestClass.hpp
index 53000aa79..87fd49478 100644
--- a/Tests/QtAutogen/MocOsMacros/TestClass.hpp
+++ b/Tests/QtAutogen/MocOsMacros/TestClass.hpp
@@ -3,12 +3,17 @@
#include <QObject>
#include <QtGlobal>
+// include qplatformdefs.h for #18669
+#include <qplatformdefs.h>
class TestClass : public QObject
{
Q_OBJECT
public Q_SLOTS:
+ // Method named "open" to test if #18669 is fixed
+ void open();
+
// -- Mac
#ifndef Q_OS_MAC
void MacNotDef();
diff --git a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt
index 8d1fa6a54..454e896e8 100644
--- a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt
+++ b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocSkipSource)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
diff --git a/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt
index 088a24c61..ec204e775 100644
--- a/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt
+++ b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(ObjectLibrary)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
diff --git a/Tests/QtAutogen/Parallel/CMakeLists.txt b/Tests/QtAutogen/Parallel/CMakeLists.txt
index 9c6480407..299bcbfd7 100644
--- a/Tests/QtAutogen/Parallel/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(Parallel)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test different values for AUTOGEN_PARALLEL
include("../Parallel/parallel.cmake")
diff --git a/Tests/QtAutogen/Parallel1/CMakeLists.txt b/Tests/QtAutogen/Parallel1/CMakeLists.txt
index 9c0b4e5f4..5c7d547df 100644
--- a/Tests/QtAutogen/Parallel1/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel1/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(Parallel1)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test different values for AUTOGEN_PARALLEL
include("../Parallel/parallel.cmake")
diff --git a/Tests/QtAutogen/Parallel2/CMakeLists.txt b/Tests/QtAutogen/Parallel2/CMakeLists.txt
index 74c38f1e4..668aea4bd 100644
--- a/Tests/QtAutogen/Parallel2/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel2/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(Parallel2)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test different values for AUTOGEN_PARALLEL
include("../Parallel/parallel.cmake")
diff --git a/Tests/QtAutogen/Parallel3/CMakeLists.txt b/Tests/QtAutogen/Parallel3/CMakeLists.txt
index c7355312d..5c50f5ee5 100644
--- a/Tests/QtAutogen/Parallel3/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel3/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(Parallel3)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test different values for AUTOGEN_PARALLEL
include("../Parallel/parallel.cmake")
diff --git a/Tests/QtAutogen/Parallel4/CMakeLists.txt b/Tests/QtAutogen/Parallel4/CMakeLists.txt
index c012ccdf6..2c40c6a67 100644
--- a/Tests/QtAutogen/Parallel4/CMakeLists.txt
+++ b/Tests/QtAutogen/Parallel4/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(Parallel4)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test different values for AUTOGEN_PARALLEL
include("../Parallel/parallel.cmake")
diff --git a/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt b/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
index 3fd3ebc59..cddece37a 100644
--- a/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
+++ b/Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(ParallelAUTO)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test different values for AUTOGEN_PARALLEL
include("../Parallel/parallel.cmake")
diff --git a/Tests/QtAutogen/RccEmpty/CMakeLists.txt b/Tests/QtAutogen/RccEmpty/CMakeLists.txt
index 3b16edc43..a8e2af1b6 100644
--- a/Tests/QtAutogen/RccEmpty/CMakeLists.txt
+++ b/Tests/QtAutogen/RccEmpty/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RccEmpty)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test AUTORCC on a .qrc file with no resource files
add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc)
diff --git a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
index 7f7432e74..61b9601a2 100644
--- a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
+++ b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RccOffMocLibrary)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Add not_generated_file.qrc to the source list to get the file-level
# dependency, but don't generate a c++ file from it. Disable the AUTORCC
diff --git a/Tests/QtAutogen/RccOnly/CMakeLists.txt b/Tests/QtAutogen/RccOnly/CMakeLists.txt
index a65dee4d8..f3776f575 100644
--- a/Tests/QtAutogen/RccOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/RccOnly/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RccOnly)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test AUTORCC being enabled only
add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc)
diff --git a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt
index f8a8032d6..42232744f 100644
--- a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt
+++ b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RccSkipSource)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target
set(skipRccSources
diff --git a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
index 6fad80c09..f4b726f63 100644
--- a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RerunMocBasic)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Dummy executable to generate a clean target
add_executable(dummy dummy.cpp)
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
index cec60a415..6a9f5507c 100644
--- a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocBasic)
-include("../../AutogenTest.cmake")
+include("../../AutogenCoreTest.cmake")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
diff --git a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
index b5287c198..b83e99419 100644
--- a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RerunMocPlugin)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Tests Q_PLUGIN_METADATA and CMAKE_AUTOMOC_DEPEND_FILTERS
# json file change detection
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt
index ca22aeb21..506828976 100644
--- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(MocPlugin)
-include("../../AutogenTest.cmake")
+include("../../AutogenGuiTest.cmake")
if (QT_TEST_VERSION LESS 5)
message(SEND_ERROR "Qt 5 or higher required.")
diff --git a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
index 4dc24fec0..dcb7a79ce 100644
--- a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.11.2)
project(RerunRccConfigChange)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Tests rcc rebuilding after a configuration change
diff --git a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
index 3cddf5c31..e2dd0ac38 100644
--- a/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccConfigChange/RccConfigChange/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.11.2)
project(RccConfigChange)
-include("../../AutogenTest.cmake")
+include("../../AutogenCoreTest.cmake")
# Enable AUTORCC for all targets
set(CMAKE_AUTORCC ON)
diff --git a/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
index 4268de26e..80c5cf035 100644
--- a/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RerunRccDepends)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Tests rcc rebuilding when a resource file changes
diff --git a/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
index 0507e619e..150f849b3 100644
--- a/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(RccDepends)
-include("../../AutogenTest.cmake")
+include("../../AutogenCoreTest.cmake")
# Enable AUTORCC for all targets
set(CMAKE_AUTORCC ON)
diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt
index 931e40f16..8d4f71f65 100644
--- a/Tests/QtAutogen/SameName/CMakeLists.txt
+++ b/Tests/QtAutogen/SameName/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(SameName)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test AUTOMOC and AUTORCC on source files with the same name
# but in different subdirectories
@@ -17,6 +17,10 @@ add_executable(sameName
ccc/item.cpp
ccc/data.qrc
item.cpp
+ object.h
+ object.h++
+ object.hpp
+ object.hxx
data.qrc
main.cpp
)
diff --git a/Tests/QtAutogen/SameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp
index a4ffcb350..92f15cd5f 100644
--- a/Tests/QtAutogen/SameName/main.cpp
+++ b/Tests/QtAutogen/SameName/main.cpp
@@ -3,14 +3,25 @@
#include "bbb/aaa/item.hpp"
#include "bbb/item.hpp"
#include "ccc/item.hpp"
+#include "item.hpp"
+#include "object.h"
+#include "object.h++"
+#include "object.hpp"
+#include "object.hxx"
int main(int argv, char** args)
{
- // Object instances
+ // Item instances
+ ::Item item;
::aaa::Item aaa_item;
::aaa::bbb::Item aaa_bbb_item;
::bbb::Item bbb_item;
::bbb::aaa::Item bbb_aaa_item;
::ccc::Item ccc_item;
+ // Object instances
+ ::Object_h obj_h;
+ ::Object_hplpl obj_hplpl;
+ ::Object_hpp obj_hpp;
+ ::Object_hxx obj_hxx;
return 0;
}
diff --git a/Tests/QtAutogen/SameName/object.h b/Tests/QtAutogen/SameName/object.h
new file mode 100644
index 000000000..86620941a
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.h
@@ -0,0 +1,13 @@
+#ifndef OBJECT_H
+#define OBJECT_H
+
+#include <QObject>
+
+class Object_h : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/SameName/object.h++ b/Tests/QtAutogen/SameName/object.h++
new file mode 100644
index 000000000..64222b7ec
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.h++
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HPLPL
+#define OBJECT_HPLPL
+
+#include <QObject>
+
+class Object_hplpl : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/SameName/object.hpp b/Tests/QtAutogen/SameName/object.hpp
new file mode 100644
index 000000000..035050ec7
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.hpp
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HPP
+#define OBJECT_HPP
+
+#include <QObject>
+
+class Object_hpp : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/SameName/object.hxx b/Tests/QtAutogen/SameName/object.hxx
new file mode 100644
index 000000000..c3c050f13
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.hxx
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HXX
+#define OBJECT_HXX
+
+#include <QObject>
+
+class Object_hxx : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt
index 0c2f98782..f3536ba2c 100644
--- a/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt
+++ b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(StaticLibraryCycle)
-include("../AutogenTest.cmake")
+include("../AutogenCoreTest.cmake")
# Test AUTOMOC on cyclic static libraries
diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/Tests.cmake
index ef11ddf28..096d5e3bd 100644
--- a/Tests/QtAutogen/CommonTests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -1,50 +1,47 @@
-# Autogen tests common for Qt4 and Qt5
+# Qt4 and Qt5 tests
+ADD_AUTOGEN_TEST(AutogenOriginDependsOff autogenOriginDependsOff)
+ADD_AUTOGEN_TEST(AutogenOriginDependsOn)
+ADD_AUTOGEN_TEST(AutogenTargetDepends)
ADD_AUTOGEN_TEST(Complex QtAutogen)
+ADD_AUTOGEN_TEST(GlobalAutogenTarget)
ADD_AUTOGEN_TEST(LowMinimumVersion lowMinimumVersion)
ADD_AUTOGEN_TEST(MocOnly mocOnly)
ADD_AUTOGEN_TEST(MocOptions mocOptions)
-ADD_AUTOGEN_TEST(UicOnly uicOnly)
-ADD_AUTOGEN_TEST(RccOnly rccOnly)
-ADD_AUTOGEN_TEST(RccEmpty rccEmpty)
-ADD_AUTOGEN_TEST(RccOffMocLibrary)
-if(QT_TEST_ALLOW_QT_MACROS)
- ADD_AUTOGEN_TEST(MocSkipSource)
-endif()
-ADD_AUTOGEN_TEST(UicSkipSource)
-ADD_AUTOGEN_TEST(RccSkipSource)
-if(QT_TEST_VERSION GREATER 4)
- ADD_AUTOGEN_TEST(MocMacroName mocMacroName)
-endif()
-ADD_AUTOGEN_TEST(MocDepends)
-if(QT_TEST_ALLOW_QT_MACROS)
- ADD_AUTOGEN_TEST(MocIncludeStrict mocIncludeStrict)
- ADD_AUTOGEN_TEST(MocIncludeRelaxed mocIncludeRelaxed)
-endif()
-if(QT_TEST_ALLOW_QT_MACROS)
- ADD_AUTOGEN_TEST(MocCMP0071)
-endif()
-# Disabled for issue #18669
-#if(QT_TEST_VERSION GREATER 4)
-# ADD_AUTOGEN_TEST(MocOsMacros)
-#endif()
-ADD_AUTOGEN_TEST(UicInclude uicInclude)
-ADD_AUTOGEN_TEST(UicInterface QtAutoUicInterface)
ADD_AUTOGEN_TEST(ObjectLibrary someProgram)
-if(APPLE AND (QT_TEST_VERSION GREATER 4))
- ADD_AUTOGEN_TEST(MacOsFW)
-endif()
ADD_AUTOGEN_TEST(Parallel parallel)
ADD_AUTOGEN_TEST(Parallel1 parallel1)
ADD_AUTOGEN_TEST(Parallel2 parallel2)
ADD_AUTOGEN_TEST(Parallel3 parallel3)
ADD_AUTOGEN_TEST(Parallel4 parallel4)
ADD_AUTOGEN_TEST(ParallelAUTO parallelAUTO)
+ADD_AUTOGEN_TEST(RccEmpty rccEmpty)
+ADD_AUTOGEN_TEST(RccOffMocLibrary)
+ADD_AUTOGEN_TEST(RccOnly rccOnly)
+ADD_AUTOGEN_TEST(RccSkipSource)
+ADD_AUTOGEN_TEST(RerunMocBasic)
+ADD_AUTOGEN_TEST(RerunRccConfigChange)
+ADD_AUTOGEN_TEST(RerunRccDepends)
ADD_AUTOGEN_TEST(SameName sameName)
ADD_AUTOGEN_TEST(StaticLibraryCycle slc)
-# Rerun tests
-ADD_AUTOGEN_TEST(RerunMocBasic)
+ADD_AUTOGEN_TEST(UicInclude uicInclude)
+ADD_AUTOGEN_TEST(UicInterface QtAutoUicInterface)
+ADD_AUTOGEN_TEST(UicNoGui uicNoGui)
+ADD_AUTOGEN_TEST(UicOnly uicOnly)
+ADD_AUTOGEN_TEST(UicSkipSource)
+
+if(QT_TEST_ALLOW_QT_MACROS)
+ ADD_AUTOGEN_TEST(MocCMP0071)
+ ADD_AUTOGEN_TEST(MocIncludeRelaxed mocIncludeRelaxed)
+ ADD_AUTOGEN_TEST(MocIncludeStrict mocIncludeStrict)
+ ADD_AUTOGEN_TEST(MocSkipSource)
+endif()
+
+# Qt5 only tests
if(QT_TEST_VERSION GREATER 4)
+ ADD_AUTOGEN_TEST(MocMacroName mocMacroName)
+ ADD_AUTOGEN_TEST(MocOsMacros)
ADD_AUTOGEN_TEST(RerunMocPlugin)
+ if(APPLE)
+ ADD_AUTOGEN_TEST(MacOsFW)
+ endif()
endif()
-ADD_AUTOGEN_TEST(RerunRccDepends)
-ADD_AUTOGEN_TEST(RerunRccConfigChange)
diff --git a/Tests/QtAutogen/UicInclude/CMakeLists.txt b/Tests/QtAutogen/UicInclude/CMakeLists.txt
index 56f76fb30..929868b52 100644
--- a/Tests/QtAutogen/UicInclude/CMakeLists.txt
+++ b/Tests/QtAutogen/UicInclude/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(UicInclude)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test uic include patterns
set(CMAKE_AUTOUIC_SEARCH_PATHS "dirA")
diff --git a/Tests/QtAutogen/UicInterface/CMakeLists.txt b/Tests/QtAutogen/UicInterface/CMakeLists.txt
index e0421a23c..e0227645b 100644
--- a/Tests/QtAutogen/UicInterface/CMakeLists.txt
+++ b/Tests/QtAutogen/UicInterface/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(UicInterface)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
set(CMAKE_AUTOMOC ON)
@@ -43,12 +43,12 @@ set(INC_DIR "include" )
endif()
add_library(LibWidget libwidget.cpp)
-target_link_libraries(LibWidget KI18n ${QT_QTGUI_TARGET})
+target_link_libraries(LibWidget KI18n ${QT_LIBRARIES})
set_property(TARGET LibWidget PROPERTY NO_KUIT_SEMANTIC ON)
set_property(TARGET LibWidget PROPERTY TRANSLATION_DOMAIN customdomain)
add_library(MyWidget mywidget.cpp)
-target_link_libraries(MyWidget KI18n ${QT_QTGUI_TARGET})
+target_link_libraries(MyWidget KI18n ${QT_LIBRARIES})
add_executable(QtAutoUicInterface main.cpp)
target_compile_definitions(QtAutoUicInterface
diff --git a/Tests/QtAutogen/UicNoGui/CMakeLists.txt b/Tests/QtAutogen/UicNoGui/CMakeLists.txt
new file mode 100644
index 000000000..076299db1
--- /dev/null
+++ b/Tests/QtAutogen/UicNoGui/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.13)
+project(UicNoGui)
+include("../AutogenCoreTest.cmake")
+
+# This tests creates a target that has AUTOUIC enabled but does not
+# link against QtXWidgets.
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+
+add_subdirectory(MocOnly)
+add_subdirectory(NoQt)
+
+add_executable(uicNoGui main.cpp)
+target_link_libraries(uicNoGui mocOnly noQt)
diff --git a/Tests/QtAutogen/UicNoGui/MocOnly/CMakeLists.txt b/Tests/QtAutogen/UicNoGui/MocOnly/CMakeLists.txt
new file mode 100644
index 000000000..4fcd75fa0
--- /dev/null
+++ b/Tests/QtAutogen/UicNoGui/MocOnly/CMakeLists.txt
@@ -0,0 +1,3 @@
+# Library uses QtCore only (no Widgets)
+add_library(mocOnly main.cpp)
+target_link_libraries(mocOnly ${QT_QTCORE_TARGET})
diff --git a/Tests/QtAutogen/UicNoGui/MocOnly/main.cpp b/Tests/QtAutogen/UicNoGui/MocOnly/main.cpp
new file mode 100644
index 000000000..3091845ef
--- /dev/null
+++ b/Tests/QtAutogen/UicNoGui/MocOnly/main.cpp
@@ -0,0 +1,15 @@
+#include <QObject>
+
+class LocalObject : public QObject
+{
+ Q_OBJECT
+public:
+ LocalObject(){};
+};
+
+void mocOnly()
+{
+ LocalObject obj;
+}
+
+#include "main.moc"
diff --git a/Tests/QtAutogen/UicNoGui/NoQt/CMakeLists.txt b/Tests/QtAutogen/UicNoGui/NoQt/CMakeLists.txt
new file mode 100644
index 000000000..f2bf3eec1
--- /dev/null
+++ b/Tests/QtAutogen/UicNoGui/NoQt/CMakeLists.txt
@@ -0,0 +1,2 @@
+# Library doesn't use or link against Qt at all
+add_library(noQt main.cpp)
diff --git a/Tests/QtAutogen/UicNoGui/NoQt/main.cpp b/Tests/QtAutogen/UicNoGui/NoQt/main.cpp
new file mode 100644
index 000000000..0052cc864
--- /dev/null
+++ b/Tests/QtAutogen/UicNoGui/NoQt/main.cpp
@@ -0,0 +1,4 @@
+
+void noQt()
+{
+}
diff --git a/Tests/QtAutogen/UicNoGui/main.cpp b/Tests/QtAutogen/UicNoGui/main.cpp
new file mode 100644
index 000000000..e90c60aa5
--- /dev/null
+++ b/Tests/QtAutogen/UicNoGui/main.cpp
@@ -0,0 +1,9 @@
+extern void mocOnly();
+extern void noQt();
+
+int main(int argc, char* argv[])
+{
+ mocOnly();
+ noQt();
+ return 0;
+}
diff --git a/Tests/QtAutogen/UicOnly/CMakeLists.txt b/Tests/QtAutogen/UicOnly/CMakeLists.txt
index f927f7297..b16325438 100644
--- a/Tests/QtAutogen/UicOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/UicOnly/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(UicOnly)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test AUTOUIC being enabled only
add_executable(uicOnly main.cpp UicOnly.cpp)
diff --git a/Tests/QtAutogen/UicSkipSource/CMakeLists.txt b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt
index e94864d57..dc3b7d4eb 100644
--- a/Tests/QtAutogen/UicSkipSource/CMakeLists.txt
+++ b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(UicSkipSource)
-include("../AutogenTest.cmake")
+include("../AutogenGuiTest.cmake")
# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target
set(skipUicSources
diff --git a/Tests/RunCMake/Autogen/NoQt-stderr.txt b/Tests/RunCMake/Autogen/NoQt-stderr.txt
index 6b4a933f4..1c6660a5e 100644
--- a/Tests/RunCMake/Autogen/NoQt-stderr.txt
+++ b/Tests/RunCMake/Autogen/NoQt-stderr.txt
@@ -1,8 +1,8 @@
^CMake Warning \(dev\) in CMakeLists.txt:
- AUTOGEN: No valid Qt version found for target main. AUTOMOC, AUTOUIC,
+ AUTOGEN: No valid Qt version found for target main. AUTOMOC, AUTOUIC and
AUTORCC disabled. Consider adding:
- find_package\(Qt5 COMPONENTS Widgets\)
+ find_package\(Qt<QTVERSION> COMPONENTS Widgets\)
to your CMakeLists.txt file.
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt b/Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt
index 6b4a933f4..1c6660a5e 100644
--- a/Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt
+++ b/Tests/RunCMake/Autogen/QtInFunctionNested-stderr.txt
@@ -1,8 +1,8 @@
^CMake Warning \(dev\) in CMakeLists.txt:
- AUTOGEN: No valid Qt version found for target main. AUTOMOC, AUTOUIC,
+ AUTOGEN: No valid Qt version found for target main. AUTOMOC, AUTOUIC and
AUTORCC disabled. Consider adding:
- find_package\(Qt5 COMPONENTS Widgets\)
+ find_package\(Qt<QTVERSION> COMPONENTS Widgets\)
to your CMakeLists.txt file.
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt b/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt
index a1a0e8fe4..c3d541e47 100644
--- a/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt
+++ b/Tests/RunCMake/BundleUtilities/CMP0080-WARN-stderr.txt
@@ -1,4 +1,10 @@
CMake Warning \(dev\) at .*/Modules/BundleUtilities\.cmake:[0-9]+ \(message\):
- Policy CMP0080 is not set: BundleUtilities prefers not to be included at
- configure time\. Run "cmake --help-policy CMP0080" for policy details\. Use
- the cmake_policy command to set the policy and suppress this warning\.
+ Policy CMP0080 is not set: BundleUtilities cannot be included at configure
+ time\. Run "cmake --help-policy CMP0080" for policy details\. Use the
+ cmake_policy command to set the policy and suppress this warning\.
+
+Call Stack \(most recent call first\):
+ .*/Modules/BundleUtilities\.cmake:[0-9]+ \(_warn_cmp0080\)
+ CMP0080-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/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt
index 05b021746..6a1f1bde4 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-NEW-stderr.txt
@@ -4,4 +4,4 @@ CMake Error at CMP0026-CONFIG-LOCATION-NEW.cmake:7 \(get_target_property\):
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
index edeb33728..84dec3212 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
@@ -7,4 +7,4 @@
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\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt
index d44dcb48d..d2209fdc8 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-WARN-stderr.txt
@@ -8,5 +8,5 @@ CMake Warning \(dev\) at CMP0026-CONFIG-LOCATION-WARN.cmake:5 \(get_target_prope
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt
index fec9dfb4d..1490103d5 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-NEW-stderr.txt
@@ -4,4 +4,4 @@ CMake Error at CMP0026-LOCATION-CONFIG-NEW.cmake:7 \(get_target_property\):
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
index 32ff698f1..1fb4ef679 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
@@ -7,4 +7,4 @@
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\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt
index cd6f3d095..8b4faf011 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-WARN-stderr.txt
@@ -8,5 +8,5 @@ CMake Warning \(dev\) at CMP0026-LOCATION-CONFIG-WARN.cmake:5 \(get_target_prope
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt
index fa025129f..8c47c2ab3 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-NEW-stderr.txt
@@ -4,4 +4,4 @@ CMake Error at CMP0026-NEW.cmake:7 \(get_target_property\):
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
index b3f79fc4d..b4282f545 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
@@ -7,4 +7,4 @@
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\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
index d122c4a2e..0d39596b4 100644
--- a/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0026/CMP0026-WARN-stderr.txt
@@ -8,7 +8,7 @@ CMake Warning \(dev\) at CMP0026-WARN.cmake:5 \(get_target_property\):
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
+
CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\):
@@ -21,5 +21,5 @@ CMake Warning \(dev\) at CMP0026-WARN.cmake:8 \(get_target_property\):
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt
index 0996cb6b4..63779219a 100644
--- a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt
+++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS-stderr.txt
@@ -8,5 +8,5 @@ CMake Warning \(dev\) at LOCATION-and-TARGET_OBJECTS.cmake:[0-9]+ \(get_target_p
\$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:[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/CMP0026/ObjlibNotDefined-stderr.txt b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
index 87d198d00..360d98765 100644
--- a/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
+++ b/Tests/RunCMake/CMP0026/ObjlibNotDefined-stderr.txt
@@ -8,5 +8,5 @@ CMake Warning \(dev\) at ObjlibNotDefined.cmake:[0-9]+ \(get_target_property\):
expression \$<TARGET_FILE>, as appropriate.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
index 157a0468a..3525704bb 100644
--- a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
+++ b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
@@ -7,4 +7,4 @@
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\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt
index 697265e91..e1c44e507 100644
--- a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt
+++ b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt
@@ -7,6 +7,6 @@
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:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
Sources: "empty.cpp"$
diff --git a/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt
index ae2e46848..78c6b6d30 100644
--- a/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0051/CMP0051-WARN-stderr.txt
@@ -9,7 +9,7 @@ CMake Warning \(dev\) at CMP0051-WARN.cmake:6 \(get_target_property\):
needs to be adapted to ignore the generator expression using the
string\(GENEX_STRIP\) command.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
Sources: "empty.cpp"
@@ -25,7 +25,7 @@ CMake Warning \(dev\) at CMP0051-WARN.cmake:12 \(get_target_property\):
needs to be adapted to ignore the generator expression using the
string\(GENEX_STRIP\) command.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
Sources: "../empty.cpp"$
diff --git a/Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt b/Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt
new file mode 100644
index 000000000..987a50309
--- /dev/null
+++ b/Tests/RunCMake/CMP0064/CMP0064-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0064-OLD.cmake:1 \(cmake_policy\):
+ The OLD behavior for policy CMP0064 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:3 \(include\)$
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 27413dde1..f2b7ff192 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -42,7 +42,12 @@ function(add_RunCMake_test_group test types)
# much system information so it is easier to set programs and environment
# values here
unset(${test}_${type}_FOUND_PREREQUIREMENTS)
- include("${CMAKE_CURRENT_SOURCE_DIR}/${test}/${type}/Prerequirements.cmake")
+ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${test}/${type}/Prerequirements.cmake")
+ include("${CMAKE_CURRENT_SOURCE_DIR}/${test}/${type}/Prerequirements.cmake")
+ else()
+ string(REGEX MATCH "^[^.]*" main_type "${type}")
+ include("${CMAKE_CURRENT_SOURCE_DIR}/${test}/${main_type}/Prerequirements.cmake")
+ endif()
get_test_prerequirements("${test}_${type}_FOUND_PREREQUIREMENTS"
"${TEST_CONFIG_DIR}/${type}_config.cmake")
@@ -66,6 +71,9 @@ function(add_RunCMake_test_group test types)
endforeach()
endfunction()
+# Some tests use python for extra checks.
+find_package(PythonInterp QUIET)
+
if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1)
set(Swift_ARGS -DXCODE_BELOW_6_1=1)
endif()
@@ -115,7 +123,7 @@ if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
add_RunCMake_test(CMP0065)
endif()
if(CMAKE_GENERATOR MATCHES "Make")
- add_RunCMake_test(Make)
+ add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU})
endif()
if(CMAKE_GENERATOR STREQUAL "Ninja")
set(Ninja_ARGS
@@ -154,6 +162,7 @@ add_RunCMake_test(BuildDepends)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
endif()
+add_RunCMake_test(CMakeRoleGlobalProperty)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(CompilerChange)
endif()
@@ -163,11 +172,12 @@ add_RunCMake_test(DisallowedCommands)
add_RunCMake_test(ExternalData)
add_RunCMake_test(FeatureSummary)
add_RunCMake_test(FPHSA)
+add_RunCMake_test(FileAPI -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(FindBoost)
add_RunCMake_test(FindLua)
add_RunCMake_test(FindOpenGL)
if(CMake_TEST_UseSWIG)
- add_RunCMake_test(UseSWIG)
+ add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython})
endif()
if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom")
add_RunCMake_test(GenerateExportHeader)
@@ -183,6 +193,7 @@ add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
add_RunCMake_test(LinkStatic)
add_RunCMake_test(ObjectLibrary)
+add_RunCMake_test(ParseImplicitIncludeInfo)
if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
add_RunCMake_test(RuntimePath)
endif()
@@ -195,10 +206,12 @@ add_RunCMake_test(find_dependency)
add_RunCMake_test(CompileDefinitions)
add_RunCMake_test(CompileFeatures)
add_RunCMake_test(PolicyScope)
+add_RunCMake_test(WriteBasicConfigVersionFile)
add_RunCMake_test(WriteCompilerDetectionHeader)
add_RunCMake_test(SourceProperties)
if(NOT WIN32)
- add_RunCMake_test(PositionIndependentCode)
+ add_RunCMake_test(PositionIndependentCode -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID})
endif()
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
add_RunCMake_test(VisibilityPreset)
@@ -209,6 +222,7 @@ endif()
add_RunCMake_test(CompatibleInterface)
add_RunCMake_test(Syntax)
add_RunCMake_test(WorkingDirectory)
+add_RunCMake_test(MaxRecursionDepth)
add_RunCMake_test(add_custom_command)
add_RunCMake_test(add_custom_target)
@@ -270,17 +284,18 @@ function(add_RunCMake_test_try_compile)
if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
# Older CMake versions do not know about MSVC language standards.
# Approximate our logic from MSVC-CXX.cmake.
- if ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0.24215.1 AND
+ if ((NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0.24215.1 AND
CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10) OR
- CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.10.25017)
+ NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.10.25017)
set(CMAKE_CXX_STANDARD_DEFAULT 14)
- elseif (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
+ elseif (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
set(CMAKE_CXX_STANDARD_DEFAULT "")
else()
unset(CMAKE_CXX_STANDARD_DEFAULT)
endif()
endif()
foreach(var
+ CMAKE_SYSTEM_NAME
CMAKE_C_COMPILER_ID
CMAKE_C_COMPILER_VERSION
CMAKE_C_STANDARD_DEFAULT
@@ -297,7 +312,8 @@ function(add_RunCMake_test_try_compile)
endfunction()
add_RunCMake_test_try_compile()
-add_RunCMake_test(try_run)
+add_RunCMake_test(try_run -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
add_RunCMake_test(set)
add_RunCMake_test(variable_watch)
add_RunCMake_test(while)
@@ -329,7 +345,7 @@ if (GTK2_FOUND)
endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
- add_RunCMake_test(include_external_msproject)
+ add_RunCMake_test(include_external_msproject -DVS_PLATFORM_NAME=${CMAKE_VS_PLATFORM_NAME})
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio (9|10)" AND NOT CMAKE_VS_DEVENV_COMMAND)
set(NO_USE_FOLDERS 1)
endif()
@@ -338,10 +354,20 @@ endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([^9]|9[0-9])")
add_RunCMake_test(VS10Project)
+ if( vs12 AND wince )
+ add_RunCMake_test( VS10ProjectWinCE "-DRunCMake_GENERATOR_PLATFORM=${wince_sdk}")
+ endif()
endif()
if(XCODE_VERSION)
add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION})
+
+ # This test can take a very long time due to lots of combinations.
+ # Use a long default timeout and provide an option to customize it.
+ if(NOT DEFINED CMake_TEST_XcodeProject_TIMEOUT)
+ set(CMake_TEST_XcodeProject_TIMEOUT 2000)
+ endif()
+ set_property(TEST RunCMake.XcodeProject PROPERTY TIMEOUT ${CMake_TEST_XcodeProject_TIMEOUT})
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
@@ -351,11 +377,16 @@ endif()
add_RunCMake_test(File_Generate)
add_RunCMake_test(ExportWithoutLanguage)
+add_RunCMake_test(target_link_directories)
add_RunCMake_test(target_link_libraries)
add_RunCMake_test(add_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
+add_RunCMake_test(target_compile_definitions)
add_RunCMake_test(target_compile_features)
+add_RunCMake_test(target_compile_options)
+add_RunCMake_test(target_include_directories)
+add_RunCMake_test(target_sources)
add_RunCMake_test(CheckModules)
add_RunCMake_test(CheckIPOSupported)
add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
@@ -373,8 +404,9 @@ add_RunCMake_test(CPackConfig)
add_RunCMake_test(CPackInstallProperties)
add_RunCMake_test(ExternalProject)
add_RunCMake_test(FetchContent)
+set(CTestCommandLine_ARGS -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
if(NOT CMake_TEST_EXTERNAL_CMAKE)
- set(CTestCommandLine_ARGS -DTEST_AFFINITY=$<TARGET_FILE:testAffinity>)
+ list(APPEND CTestCommandLine_ARGS -DTEST_AFFINITY=$<TARGET_FILE:testAffinity>)
endif()
add_executable(print_stdin print_stdin.c)
add_RunCMake_test(CTestCommandLine -DTEST_PRINT_STDIN=$<TARGET_FILE:print_stdin>)
@@ -443,7 +475,53 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
add_RunCMake_test(ctest_labels_for_subprojects)
endif()
-add_RunCMake_test_group(CPack "DEB;RPM;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External")
+set(cpack_tests
+ DEB.CUSTOM_NAMES
+ DEB.DEBUGINFO
+ DEB.DEFAULT_PERMISSIONS
+ DEB.DEPENDENCIES
+ DEB.EMPTY_DIR
+ DEB.VERSION
+ DEB.EXTRA
+ DEB.GENERATE_SHLIBS
+ DEB.GENERATE_SHLIBS_LDCONFIG
+ DEB.LONG_FILENAMES
+ DEB.MINIMAL
+ DEB.PER_COMPONENT_FIELDS
+ DEB.TIMESTAMPS
+ DEB.MD5SUMS
+ DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY
+
+ RPM.CUSTOM_BINARY_SPEC_FILE
+ RPM.CUSTOM_NAMES
+ RPM.DEBUGINFO
+ RPM.DEFAULT_PERMISSIONS
+ RPM.DEPENDENCIES
+ RPM.DIST
+ RPM.EMPTY_DIR
+ RPM.VERSION
+ RPM.INSTALL_SCRIPTS
+ RPM.MAIN_COMPONENT
+ RPM.MINIMAL
+ RPM.PARTIALLY_RELOCATABLE_WARNING
+ RPM.PER_COMPONENT_FIELDS
+ RPM.SINGLE_DEBUGINFO
+ RPM.EXTRA_SLASH_IN_PATH
+ RPM.SOURCE_PACKAGE
+ RPM.SUGGESTS
+ RPM.SYMLINKS
+ RPM.USER_FILELIST
+
+ 7Z
+ TBZ2
+ TGZ
+ TXZ
+ TZ
+ ZIP
+ STGZ
+ External
+ )
+add_RunCMake_test_group(CPack "${cpack_tests}")
# add a test to make sure symbols are exported from a shared library
# for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used
add_RunCMake_test(AutoExportDll)
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/BuildAndTest/CMakeLists.txt b/Tests/RunCMake/CMakeRoleGlobalProperty/BuildAndTest/CMakeLists.txt
new file mode 100644
index 000000000..332b0230d
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/BuildAndTest/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.12)
+project(CMakeRoleGlobalPropertyBuildAndTest NONE)
+include(CTest)
+
+get_property(role GLOBAL PROPERTY CMAKE_ROLE)
+if(NOT role STREQUAL "PROJECT")
+ message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"PROJECT\"")
+endif()
+
+add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt b/Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt
new file mode 100644
index 000000000..44025d3bd
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt.in b/Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt.in
new file mode 100644
index 000000000..bb8f9c140
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/CMakeLists.txt.in
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.12)
+project(CMakeRoleGlobalProperty@CASE_NAME@ NONE)
+include(CTest)
+add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/FindDummyPackage.cmake b/Tests/RunCMake/CMakeRoleGlobalProperty/FindDummyPackage.cmake
new file mode 100644
index 000000000..8299042f3
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/FindDummyPackage.cmake
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.12)
+
+get_property(role GLOBAL PROPERTY CMAKE_ROLE)
+if(NOT role STREQUAL "FIND_PACKAGE")
+ message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"FIND_PACKAGE\"")
+endif()
+
+set(DummyPackage_FOUND 1)
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/Project.cmake b/Tests/RunCMake/CMakeRoleGlobalProperty/Project.cmake
new file mode 100644
index 000000000..22cad2bba
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/Project.cmake
@@ -0,0 +1,10 @@
+get_property(role GLOBAL PROPERTY CMAKE_ROLE)
+
+file(WRITE "${CMAKE_BINARY_DIR}/test.cmake" "# a")
+include("${CMAKE_BINARY_DIR}/test.cmake")
+
+if(NOT role STREQUAL "PROJECT")
+ message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"PROJECT\"")
+endif()
+
+add_subdirectory(sub)
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/RunCMakeTest.cmake b/Tests/RunCMake/CMakeRoleGlobalProperty/RunCMakeTest.cmake
new file mode 100644
index 000000000..7b29c28b8
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+include(RunCTest)
+
+run_cmake(Project)
+file(WRITE "${RunCMake_BINARY_DIR}/Project-build/test.cmake" "# b")
+run_cmake_command(ProjectBuild "${CMAKE_COMMAND}" --build "${RunCMake_BINARY_DIR}/Project-build")
+
+run_cmake_command(Script "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/Script.cmake")
+run_cmake_command(FindPackage "${CMAKE_COMMAND}" --find-package -DNAME=DummyPackage -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}")
+run_ctest(CTest)
+run_cmake_command(BuildAndTest "${CMAKE_CTEST_COMMAND}"
+ --build-and-test
+ "${RunCMake_SOURCE_DIR}/BuildAndTest"
+ "${RunCMake_BINARY_DIR}/BuildAndTest-build"
+ --build-project CMakeRoleGlobalPropertyBuildAndTest
+ --build-generator "${RunCMake_GENERATOR}"
+ )
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/Script.cmake b/Tests/RunCMake/CMakeRoleGlobalProperty/Script.cmake
new file mode 100644
index 000000000..371edbc5c
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/Script.cmake
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.12)
+
+get_property(role GLOBAL PROPERTY CMAKE_ROLE)
+if(NOT role STREQUAL "SCRIPT")
+ message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"SCRIPT\"")
+endif()
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/sub/CMakeLists.txt b/Tests/RunCMake/CMakeRoleGlobalProperty/sub/CMakeLists.txt
new file mode 100644
index 000000000..8ecf671e5
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/sub/CMakeLists.txt
@@ -0,0 +1,4 @@
+get_property(role GLOBAL PROPERTY CMAKE_ROLE)
+if(NOT role STREQUAL "PROJECT")
+ message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"PROJECT\"")
+endif()
diff --git a/Tests/RunCMake/CMakeRoleGlobalProperty/test.cmake.in b/Tests/RunCMake/CMakeRoleGlobalProperty/test.cmake.in
new file mode 100644
index 000000000..4e2c0859e
--- /dev/null
+++ b/Tests/RunCMake/CMakeRoleGlobalProperty/test.cmake.in
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.12)
+set(CTEST_RUN_CURRENT_SCRIPT 0)
+
+get_property(role GLOBAL PROPERTY CMAKE_ROLE)
+if(NOT role STREQUAL "CTEST")
+ message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"CTEST\"")
+endif()
diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
index d00ef3b9d..f65cb9df8 100644
--- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake
+++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
@@ -2,6 +2,7 @@ cmake_policy(SET CMP0057 NEW)
function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACKAGING_TYPE package_target)
if(TEST_TYPE IN_LIST types)
+ string(REGEX MATCH "^[^.]*" GENERATOR_TYPE "${TEST_TYPE}")
set(RunCMake_TEST_NO_CLEAN TRUE)
if(package_target)
set(full_test_name_ "${TEST_NAME}-package-target")
@@ -21,8 +22,8 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
- if(EXISTS "${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-Prerequirements.cmake")
- include("${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-Prerequirements.cmake")
+ if(EXISTS "${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake")
+ include("${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake")
set(FOUND_PREREQUIREMENTS false)
get_test_prerequirements("FOUND_PREREQUIREMENTS" "${config_file}")
@@ -35,7 +36,7 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
endif()
# execute cmake
- set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${TEST_TYPE}"
+ set(RunCMake_TEST_OPTIONS "-DGENERATOR_TYPE=${GENERATOR_TYPE}"
"-DRunCMake_TEST_FILE_PREFIX=${TEST_NAME}"
"-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}"
"-DPACKAGING_TYPE=${PACKAGING_TYPE}")
@@ -64,9 +65,9 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
endif()
if(source)
- set(pack_params_ -G ${TEST_TYPE} --config ./CPackSourceConfig.cmake)
+ set(pack_params_ -G ${GENERATOR_TYPE} --config ./CPackSourceConfig.cmake)
FILE(APPEND ${RunCMake_TEST_BINARY_DIR}/CPackSourceConfig.cmake
- "\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_} -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME} -DGENERATOR_TYPE:STRING=${TEST_TYPE}\")")
+ "\nset(CPACK_RPM_SOURCE_PKG_BUILD_PARAMS \"-DRunCMake_TEST:STRING=${full_test_name_} -DRunCMake_TEST_FILE_PREFIX:STRING=${TEST_NAME} -DGENERATOR_TYPE:STRING=${GENERATOR_TYPE}\")")
else()
unset(pack_params_)
endif()
@@ -91,18 +92,18 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
)
foreach(o out err)
- if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
- set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
- elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-std${o}.txt)
- set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${PACKAGING_TYPE}-std${o}.txt")
- elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
- set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
- elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt)
- set(RunCMake-std${o}-file "tests/${TEST_NAME}/${TEST_TYPE}-std${o}.txt")
+ if(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
+ set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
+ elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-std${o}.txt)
+ set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-${PACKAGING_TYPE}-std${o}.txt")
+ elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt)
+ set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-${SUBTEST_SUFFIX}-std${o}.txt")
+ elseif(EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-std${o}.txt)
+ set(RunCMake-std${o}-file "tests/${TEST_NAME}/${GENERATOR_TYPE}-std${o}.txt")
elseif(SUBTEST_SUFFIX AND EXISTS ${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${SUBTEST_SUFFIX}-std${o}.txt)
set(RunCMake-std${o}-file "tests/${TEST_NAME}/${SUBTEST_SUFFIX}-std${o}.txt")
- elseif(EXISTS ${RunCMake_SOURCE_DIR}/${TEST_TYPE}/default_expected_std${o}.txt)
- set(RunCMake-std${o}-file "${TEST_TYPE}/default_expected_std${o}.txt")
+ elseif(EXISTS ${RunCMake_SOURCE_DIR}/${GENERATOR_TYPE}/default_expected_std${o}.txt)
+ set(RunCMake-std${o}-file "${GENERATOR_TYPE}/default_expected_std${o}.txt")
else()
unset(RunCMake-std${o}-file)
endif()
@@ -110,12 +111,12 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
# verify result
run_cmake_command(
- ${TEST_TYPE}/${full_test_name_}
+ ${GENERATOR_TYPE}/${full_test_name_}
"${CMAKE_COMMAND}"
-DRunCMake_TEST=${full_test_name_}
-DRunCMake_TEST_FILE_PREFIX=${TEST_NAME}
-DRunCMake_SUBTEST_SUFFIX=${SUBTEST_SUFFIX}
- -DGENERATOR_TYPE=${TEST_TYPE}
+ -DGENERATOR_TYPE=${GENERATOR_TYPE}
-DPACKAGING_TYPE=${PACKAGING_TYPE}
"-Dsrc_dir=${RunCMake_SOURCE_DIR}"
"-Dbin_dir=${RunCMake_TEST_BINARY_DIR}"
diff --git a/Tests/RunCMake/CPack/RPM/default_expected_stderr.txt b/Tests/RunCMake/CPack/RPM/default_expected_stderr.txt
index f02f9d696..6c87ca0c0 100644
--- a/Tests/RunCMake/CPack/RPM/default_expected_stderr.txt
+++ b/Tests/RunCMake/CPack/RPM/default_expected_stderr.txt
@@ -1 +1 @@
-^(CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM/CPack/[^-]*(-package-target)?-build((-[^-]*-subtest/)|/)_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec(\n|$))*$
+^(CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.[^/]*/CPack/[^-]*(-package-target)?-build((-[^-]*-subtest/)|/)_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec(\n|$))*$
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 33ddb722c..37df57cd0 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -4,35 +4,35 @@ include(RunCMake)
include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake")
# run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES"
-run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM" false "MONOLITHIC;COMPONENT")
-run_cpack_test(CUSTOM_NAMES "RPM;DEB;TGZ" true "COMPONENT")
-run_cpack_test(DEBUGINFO "RPM;DEB" true "COMPONENT")
-run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM;DEB" false "MONOLITHIC;COMPONENT")
-run_cpack_test(DEPENDENCIES "RPM;DEB" true "COMPONENT")
-run_cpack_test(DIST "RPM" false "MONOLITHIC")
-run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true "MONOLITHIC;COMPONENT")
-run_cpack_test(VERSION "RPM;DEB" false "MONOLITHIC;COMPONENT")
-run_cpack_test(EXTRA "DEB" false "COMPONENT")
-run_cpack_test_subtests(GENERATE_SHLIBS "soversion_not_zero;soversion_zero" "DEB" true "COMPONENT")
-run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB" true "COMPONENT")
-run_cpack_test(INSTALL_SCRIPTS "RPM" false "COMPONENT")
-run_cpack_test(LONG_FILENAMES "DEB" false "MONOLITHIC")
-run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM" false "COMPONENT")
-run_cpack_test(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
-run_cpack_test_package_target(MINIMAL "RPM;DEB;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
+run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM.CUSTOM_BINARY_SPEC_FILE" false "MONOLITHIC;COMPONENT")
+run_cpack_test(CUSTOM_NAMES "RPM.CUSTOM_NAMES;DEB.CUSTOM_NAMES;TGZ" true "COMPONENT")
+run_cpack_test(DEBUGINFO "RPM.DEBUGINFO;DEB.DEBUGINFO" true "COMPONENT")
+run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM.DEFAULT_PERMISSIONS;DEB.DEFAULT_PERMISSIONS" false "MONOLITHIC;COMPONENT")
+run_cpack_test(DEPENDENCIES "RPM.DEPENDENCIES;DEB.DEPENDENCIES" true "COMPONENT")
+run_cpack_test(DIST "RPM.DIST" false "MONOLITHIC")
+run_cpack_test(EMPTY_DIR "RPM.EMPTY_DIR;DEB.EMPTY_DIR;TGZ" true "MONOLITHIC;COMPONENT")
+run_cpack_test(VERSION "RPM.VERSION;DEB.VERSION" false "MONOLITHIC;COMPONENT")
+run_cpack_test(EXTRA "DEB.EXTRA" false "COMPONENT")
+run_cpack_test_subtests(GENERATE_SHLIBS "soversion_not_zero;soversion_zero" "DEB.GENERATE_SHLIBS" true "COMPONENT")
+run_cpack_test(GENERATE_SHLIBS_LDCONFIG "DEB.GENERATE_SHLIBS_LDCONFIG" true "COMPONENT")
+run_cpack_test(INSTALL_SCRIPTS "RPM.INSTALL_SCRIPTS" false "COMPONENT")
+run_cpack_test(LONG_FILENAMES "DEB.LONG_FILENAMES" false "MONOLITHIC")
+run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM.MAIN_COMPONENT" false "COMPONENT")
+run_cpack_test(MINIMAL "RPM.MINIMAL;DEB.MINIMAL;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
+run_cpack_test_package_target(MINIMAL "RPM.MINIMAL;DEB.MINIMAL;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
run_cpack_test_subtests(PACKAGE_CHECKSUM "invalid;MD5;SHA1;SHA224;SHA256;SHA384;SHA512" "TGZ" false "MONOLITHIC")
-run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM" false "COMPONENT")
-run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false "COMPONENT")
-run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM" true "CUSTOM")
-run_cpack_test(EXTRA_SLASH_IN_PATH "RPM" true "COMPONENT")
-run_cpack_source_test(SOURCE_PACKAGE "RPM")
-run_cpack_test(SUGGESTS "RPM" false "MONOLITHIC")
-run_cpack_test(SYMLINKS "RPM;TGZ" false "MONOLITHIC;COMPONENT")
+run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM.PARTIALLY_RELOCATABLE_WARNING" false "COMPONENT")
+run_cpack_test(PER_COMPONENT_FIELDS "RPM.PER_COMPONENT_FIELDS;DEB.PER_COMPONENT_FIELDS" false "COMPONENT")
+run_cpack_test_subtests(SINGLE_DEBUGINFO "no_main_component;one_component;one_component_main;no_debuginfo;one_component_no_debuginfo;no_components;valid" "RPM.SINGLE_DEBUGINFO" true "CUSTOM")
+run_cpack_test(EXTRA_SLASH_IN_PATH "RPM.EXTRA_SLASH_IN_PATH" true "COMPONENT")
+run_cpack_source_test(SOURCE_PACKAGE "RPM.SOURCE_PACKAGE")
+run_cpack_test(SUGGESTS "RPM.SUGGESTS" false "MONOLITHIC")
+run_cpack_test(SYMLINKS "RPM.SYMLINKS;TGZ" false "MONOLITHIC;COMPONENT")
set(ENVIRONMENT "SOURCE_DATE_EPOCH=123456789")
-run_cpack_test(TIMESTAMPS "DEB;TGZ" false "COMPONENT")
+run_cpack_test(TIMESTAMPS "DEB.TIMESTAMPS;TGZ" false "COMPONENT")
unset(ENVIRONMENT)
-run_cpack_test(USER_FILELIST "RPM" false "MONOLITHIC")
-run_cpack_test(MD5SUMS "DEB" false "MONOLITHIC;COMPONENT")
+run_cpack_test(USER_FILELIST "RPM.USER_FILELIST" false "MONOLITHIC")
+run_cpack_test(MD5SUMS "DEB.MD5SUMS" false "MONOLITHIC;COMPONENT")
run_cpack_test(CPACK_INSTALL_SCRIPT "ZIP" false "MONOLITHIC")
-run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB" false "MONOLITHIC;COMPONENT")
+run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY" false "MONOLITHIC;COMPONENT")
run_cpack_test_subtests(EXTERNAL "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "External" false "MONOLITHIC;COMPONENT")
diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_BINARY_SPEC_FILE/RPM-COMPONENT-stderr.txt b/Tests/RunCMake/CPack/tests/CUSTOM_BINARY_SPEC_FILE/RPM-COMPONENT-stderr.txt
index e6d86d0de..b0502628e 100644
--- a/Tests/RunCMake/CPack/tests/CUSTOM_BINARY_SPEC_FILE/RPM-COMPONENT-stderr.txt
+++ b/Tests/RunCMake/CPack/tests/CUSTOM_BINARY_SPEC_FILE/RPM-COMPONENT-stderr.txt
@@ -1,2 +1,2 @@
^CPackRPM: Will use USER specified spec file: (/[^/]*)*/CUSTOM_BINARY_SPEC_FILE/custom\.spec\.in
-CPackRPM: Will use GENERATED spec file:.*/Tests/RunCMake/RPM/CPack/CUSTOM_BINARY_SPEC_FILE-build/_CPack_Packages/.*/RPM/SPECS/custom_binary_spec_file-test2\.spec$
+CPackRPM: Will use GENERATED spec file:.*/Tests/RunCMake/RPM\.CUSTOM_BINARY_SPEC_FILE/CPack/CUSTOM_BINARY_SPEC_FILE-build/_CPack_Packages/.*/RPM/SPECS/custom_binary_spec_file-test2\.spec$
diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake
index 2d7f993c3..6f7c4c224 100644
--- a/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake
+++ b/Tests/RunCMake/CPack/tests/EXTERNAL/create_package.cmake
@@ -1,5 +1,10 @@
message("This script could run an external packaging tool")
+get_property(role GLOBAL PROPERTY CMAKE_ROLE)
+if(NOT role STREQUAL "CPACK")
+ message(SEND_ERROR "CMAKE_ROLE property is \"${role}\", should be \"CPACK\"")
+endif()
+
function(expect_variable VAR)
if(NOT ${VAR})
message(FATAL_ERROR "${VAR} is unexpectedly not set")
diff --git a/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt b/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt
index feb296cae..53d71d91f 100644
--- a/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt
+++ b/Tests/RunCMake/CPack/tests/SUGGESTS/RPM-stderr.txt
@@ -1 +1 @@
-^(.*CPackRPM:Warning: SUGGESTS not supported in provided rpmbuild.*)?CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$
+^(.*CPackRPM:Warning: SUGGESTS not supported in provided rpmbuild.*)?CPackRPM: Will use GENERATED spec file: (/[^/]*)*/Tests/RunCMake/RPM\.SUGGESTS/CPack/[^-]*-build/_CPack_Packages/.*/RPM/SPECS/[^\.]*\.spec$
diff --git a/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt b/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt
index fe4e455ee..a553bde5b 100644
--- a/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt
+++ b/Tests/RunCMake/CPackCommandLine/NotAGenerator-stderr.txt
@@ -1 +1 @@
-^CPack Error: Cannot initialize CPack generator: NotAGenerator
+^CPack Error: Could not create CPack generator: NotAGenerator
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 750ae5026..d524f4184 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -173,3 +173,38 @@ function(run_TestStdin)
run_cmake_command(TestStdin ${CMAKE_CTEST_COMMAND} -V)
endfunction()
run_TestStdin()
+
+function(show_only_json_check_python v)
+ if(RunCMake_TEST_FAILED OR NOT PYTHON_EXECUTABLE)
+ return()
+ endif()
+ set(json_file "${RunCMake_TEST_BINARY_DIR}/ctest.json")
+ file(WRITE "${json_file}" "${actual_stdout}")
+ set(actual_stdout "" PARENT_SCOPE)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/show-only_json-v${v}_check.py" "${json_file}"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE output
+ ERROR_VARIABLE output
+ )
+ if(NOT result EQUAL 0)
+ string(REPLACE "\n" "\n " output " ${output}")
+ set(RunCMake_TEST_FAILED "Unexpected output:\n${output}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(run_ShowOnly)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ShowOnly)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+ add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
+ set_tests_properties(ShowOnly PROPERTIES WILL_FAIL true _BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\")
+ add_test(ShowOnlyNotAvailable NOT_AVAILABLE)
+")
+ run_cmake_command(show-only_human ${CMAKE_CTEST_COMMAND} --show-only=human)
+ run_cmake_command(show-only_bad ${CMAKE_CTEST_COMMAND} --show-only=bad)
+ run_cmake_command(show-only_json-v1 ${CMAKE_CTEST_COMMAND} --show-only=json-v1)
+endfunction()
+run_ShowOnly()
diff --git a/Tests/RunCMake/list/FILTER-NotList-result.txt b/Tests/RunCMake/CTestCommandLine/show-only_bad-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/list/FILTER-NotList-result.txt
+++ b/Tests/RunCMake/CTestCommandLine/show-only_bad-result.txt
diff --git a/Tests/RunCMake/CTestCommandLine/show-only_bad-stderr.txt b/Tests/RunCMake/CTestCommandLine/show-only_bad-stderr.txt
new file mode 100644
index 000000000..cc55ab390
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/show-only_bad-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--show-only=' given unknown value 'bad'$
diff --git a/Tests/RunCMake/CTestCommandLine/show-only_human-stdout.txt b/Tests/RunCMake/CTestCommandLine/show-only_human-stdout.txt
new file mode 100644
index 000000000..13321496c
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/show-only_human-stdout.txt
@@ -0,0 +1 @@
+Test #1: ShowOnly
diff --git a/Tests/RunCMake/CTestCommandLine/show-only_json-v1-check.cmake b/Tests/RunCMake/CTestCommandLine/show-only_json-v1-check.cmake
new file mode 100644
index 000000000..f9234f8d9
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/show-only_json-v1-check.cmake
@@ -0,0 +1 @@
+show_only_json_check_python(1)
diff --git a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
new file mode 100644
index 000000000..4dff90cd0
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
@@ -0,0 +1,106 @@
+from show_only_json_check import *
+
+def check_kind(k):
+ assert is_string(k)
+ assert k == "ctestInfo"
+
+def check_version(v):
+ assert is_dict(v)
+ assert sorted(v.keys()) == ["major", "minor"]
+ assert is_int(v["major"])
+ assert is_int(v["minor"])
+ assert v["major"] == 1
+ assert v["minor"] == 0
+
+def check_backtracegraph(b):
+ assert is_dict(b)
+ assert sorted(b.keys()) == ["commands", "files", "nodes"]
+ check_backtracegraph_commands(b["commands"])
+ check_backtracegraph_files(b["files"])
+ check_backtracegraph_nodes(b["nodes"])
+
+def check_backtracegraph_commands(c):
+ assert is_list(c)
+ assert len(c) == 1
+ assert is_string(c[0])
+ assert c[0] == "add_test"
+
+def check_backtracegraph_files(f):
+ assert is_list(f)
+ assert len(f) == 2
+ assert is_string(f[0])
+ assert is_string(f[1])
+ assert f[0] == "file1"
+ assert f[1] == "file0"
+
+def check_backtracegraph_nodes(n):
+ assert is_list(n)
+ assert len(n) == 2
+ node = n[0]
+ assert is_dict(node)
+ assert sorted(node.keys()) == ["file"]
+ assert is_int(node["file"])
+ assert node["file"] == 1
+ node = n[1]
+ assert is_dict(node)
+ assert sorted(node.keys()) == ["command", "file", "line", "parent"]
+ assert is_int(node["command"])
+ assert is_int(node["file"])
+ assert is_int(node["line"])
+ assert is_int(node["parent"])
+ assert node["command"] == 0
+ assert node["file"] == 0
+ assert node["line"] == 1
+ assert node["parent"] == 0
+
+def check_command(c):
+ assert is_list(c)
+ assert len(c) == 3
+ assert is_string(c[0])
+ check_re(c[0], "/cmake(\.exe)?$")
+ assert is_string(c[1])
+ assert c[1] == "-E"
+ assert is_string(c[2])
+ assert c[2] == "echo"
+
+def check_willfail_property(p):
+ assert is_dict(p)
+ assert sorted(p.keys()) == ["name", "value"]
+ assert is_string(p["name"])
+ assert is_bool(p["value"])
+ assert p["name"] == "WILL_FAIL"
+ assert p["value"] == True
+
+def check_workingdir_property(p):
+ assert is_dict(p)
+ assert sorted(p.keys()) == ["name", "value"]
+ assert is_string(p["name"])
+ assert is_string(p["value"])
+ assert p["name"] == "WORKING_DIRECTORY"
+ assert p["value"].endswith("Tests/RunCMake/CTestCommandLine/ShowOnly")
+
+def check_properties(p):
+ assert is_list(p)
+ assert len(p) == 2
+ check_willfail_property(p[0])
+ check_workingdir_property(p[1])
+
+def check_tests(t):
+ assert is_list(t)
+ assert len(t) == 1
+ test = t[0]
+ assert is_dict(test)
+ assert sorted(test.keys()) == ["backtrace", "command", "name", "properties"]
+ assert is_int(test["backtrace"])
+ assert test["backtrace"] == 1
+ check_command(test["command"])
+ assert is_string(test["name"])
+ assert test["name"] == "ShowOnly"
+ check_properties(test["properties"])
+
+assert is_dict(ctest_json)
+assert sorted(ctest_json.keys()) == ["backtraceGraph", "kind", "tests", "version"]
+check_backtracegraph(ctest_json["backtraceGraph"])
+check_kind(ctest_json["kind"])
+check_version(ctest_json["version"])
+check_tests(ctest_json["tests"])
diff --git a/Tests/RunCMake/CTestCommandLine/show_only_json_check.py b/Tests/RunCMake/CTestCommandLine/show_only_json_check.py
new file mode 100644
index 000000000..493c9e579
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/show_only_json_check.py
@@ -0,0 +1,24 @@
+import sys
+import json
+import re
+
+def is_bool(x):
+ return isinstance(x, bool)
+
+def is_dict(x):
+ return isinstance(x, dict)
+
+def is_list(x):
+ return isinstance(x, list)
+
+def is_int(x):
+ return isinstance(x, int) or isinstance(x, long)
+
+def is_string(x):
+ return isinstance(x, str) or isinstance(x, unicode)
+
+def check_re(x, regex):
+ assert re.search(regex, x)
+
+with open(sys.argv[1]) as f:
+ ctest_json = json.load(f)
diff --git a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
new file mode 100644
index 000000000..2fadf7c1c
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
Binary files differ
diff --git a/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in b/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in
deleted file mode 100644
index 58b11afaf..000000000
--- a/Tests/RunCMake/CTestTimeoutAfterMatch/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "TimeoutAfterMatch@CASE_NAME@")
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-result.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-result.txt
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt
new file mode 100644
index 000000000..e73d76020
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt
@@ -0,0 +1,3 @@
+^'--parallel' invalid number '12ab' given\.
++
+Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-good-number-trailing-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-good-number-stderr.txt
index 3c2c808e9..3c2c808e9 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-good-number-trailing-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-good-number-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-number-trailing-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-good-number-trailing--target-stderr.txt
index 3c2c808e9..3c2c808e9 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-number-trailing-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-good-number-trailing--target-stderr.txt
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/list/REMOVE_ITEM-NotList-result.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-result.txt
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt
new file mode 100644
index 000000000..c81008786
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt
@@ -0,0 +1,3 @@
+^'-j' invalid number '12ab' given\.
++
+Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-good-number-trailing-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-good-number-stderr.txt
index 3c2c808e9..3c2c808e9 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-good-number-trailing-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-good-number-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-number-trailing-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-good-number-trailing--target-stderr.txt
index 3c2c808e9..3c2c808e9 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-number-trailing-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-good-number-trailing--target-stderr.txt
diff --git a/Tests/RunCMake/list/REVERSE-NotList-result.txt b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/list/REVERSE-NotList-result.txt
+++ b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt
new file mode 100644
index 000000000..4729ccb8f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-different-eol-stderr.txt
@@ -0,0 +1 @@
+^Files ".*/compare_files/lf" to ".*/compare_files/crlf" are different.$
diff --git a/Tests/RunCMake/list/SORT-NotList-result.txt b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/list/SORT-NotList-result.txt
+++ b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt
new file mode 100644
index 000000000..8a9ca81f8
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_compare_files-ignore-eol-nonexistent-stderr.txt
@@ -0,0 +1 @@
+^Files "nonexistent_a" to "nonexistent_b" are different.$
diff --git a/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-result.txt b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-stderr.txt b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-stderr.txt
new file mode 100644
index 000000000..470d8115d
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_touch-nonexistent-dir-stderr.txt
@@ -0,0 +1 @@
+^cmake -E touch: failed to update ".+/touch-nonexistent-dir/foo"\.$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 3e56c2554..23fb9ef46 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -18,11 +18,17 @@ run_cmake_command(Uno-src ${CMAKE_COMMAND} -B DummyBuildDir -UVAR)
run_cmake_command(E-no-arg ${CMAKE_COMMAND} -E)
run_cmake_command(E_capabilities ${CMAKE_COMMAND} -E capabilities)
run_cmake_command(E_capabilities-arg ${CMAKE_COMMAND} -E capabilities --extra-arg)
+run_cmake_command(E_compare_files-different-eol ${CMAKE_COMMAND} -E compare_files ${RunCMake_SOURCE_DIR}/compare_files/lf ${RunCMake_SOURCE_DIR}/compare_files/crlf)
+run_cmake_command(E_compare_files-ignore-eol-same ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/lf ${RunCMake_SOURCE_DIR}/compare_files/crlf)
+run_cmake_command(E_compare_files-ignore-eol-empty ${CMAKE_COMMAND} -E compare_files --ignore-eol ${RunCMake_SOURCE_DIR}/compare_files/empty1 ${RunCMake_SOURCE_DIR}/compare_files/empty2)
+run_cmake_command(E_compare_files-ignore-eol-nonexistent ${CMAKE_COMMAND} -E compare_files --ignore-eol nonexistent_a nonexistent_b)
run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename)
run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg)
run_cmake_command(E_server-pipe ${CMAKE_COMMAND} -E server --pipe=)
+
run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate)
+run_cmake_command(E_touch-nonexistent-dir ${CMAKE_COMMAND} -E touch "${RunCMake_BINARY_DIR}/touch-nonexistent-dir/foo")
run_cmake_command(E_time ${CMAKE_COMMAND} -E time ${CMAKE_COMMAND} -E echo "hello world")
run_cmake_command(E_time-no-arg ${CMAKE_COMMAND} -E time)
@@ -113,6 +119,19 @@ function(run_BuildDir)
${CMAKE_COMMAND} --build BuildDir-build --parallel 2)
run_cmake_command(BuildDir--build--parallel-good-number-trailing--target ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build --parallel 2 --target CustomTarget)
+ run_cmake_command(BuildDir--build-jobs-no-space-bad-number ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build -j12ab)
+ run_cmake_command(BuildDir--build-jobs-no-space-good-number ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build -j2)
+ run_cmake_command(BuildDir--build-jobs-no-space-good-number-trailing--target ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build -j2 --target CustomTarget)
+ run_cmake_command(BuildDir--build--parallel-no-space-bad-number ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build --parallel12ab)
+ run_cmake_command(BuildDir--build--parallel-no-space-good-number ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build --parallel2)
+ run_cmake_command(BuildDir--build--parallel-no-space-good-number-trailing--target ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build --parallel2 --target CustomTarget)
+
# No default jobs for Xcode and FreeBSD build command
if(NOT RunCMake_GENERATOR MATCHES "Xcode" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
run_cmake_command(BuildDir--build-jobs-no-number ${CMAKE_COMMAND} -E chdir ..
@@ -359,6 +378,10 @@ set(RunCMake_TEST_OPTIONS --trace-expand --warn-uninitialized)
run_cmake(trace-expand-warn-uninitialized)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS -Wno-deprecated --warn-uninitialized)
+run_cmake(warn-uninitialized)
+unset(RunCMake_TEST_OPTIONS)
+
set(RunCMake_TEST_OPTIONS --trace-source=trace-only-this-file.cmake)
run_cmake(trace-source)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt b/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
index e9be1dcb3..30385f88e 100644
--- a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt
@@ -1,4 +1,4 @@
^CMake Deprecation Warning at Wdeprecated.cmake:1 \(message\):
Some deprecated warning
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CommandLine/Wdev-stderr.txt b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
index 88cfb3a30..172fb8155 100644
--- a/Tests/RunCMake/CommandLine/Wdev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wdev-stderr.txt
@@ -1,11 +1,11 @@
^CMake Warning \(dev\) at Wdev.cmake:1 \(message\):
Some author warning
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning \(dev\) at Wdev.cmake:6 \(include\):
include\(\) given empty file name \(ignored\).
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt b/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
index 6acdc7362..d681836b2 100644
--- a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt
@@ -1,4 +1,4 @@
^CMake Deprecation Error at Werror_deprecated.cmake:1 \(message\):
Some deprecated warning
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt b/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt
index 590ec96d3..35890fc99 100644
--- a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt
@@ -1,11 +1,11 @@
^CMake Error \(dev\) at Werror_dev.cmake:4 \(include\):
include\(\) given empty file name \(ignored\).
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This error is for project developers. Use -Wno-error=dev to suppress it.
CMake Error \(dev\) at Werror_dev.cmake:7 \(message\):
Some author warning
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This error is for project developers. Use -Wno-error=dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt b/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt
index 0ed169861..45897062d 100644
--- a/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wno-error_deprecated-stderr.txt
@@ -1,4 +1,4 @@
^CMake Deprecation Warning at Wno-error_deprecated.cmake:2 \(message\):
Some deprecated warning
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt b/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt
index dd22d5568..ee28d7f02 100644
--- a/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Wno-error_dev-stderr.txt
@@ -1,11 +1,11 @@
^CMake Warning \(dev\) at Wno-error_dev.cmake:2 \(message\):
Some author warning
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning \(dev\) at Wno-error_dev.cmake:6 \(include\):
include\(\) given empty file name \(ignored\).
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/compare_files/crlf b/Tests/RunCMake/CommandLine/compare_files/crlf
new file mode 100644
index 000000000..495181cc2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/crlf
@@ -0,0 +1 @@
+line1
diff --git a/Tests/RunCMake/CommandLine/compare_files/empty1 b/Tests/RunCMake/CommandLine/compare_files/empty1
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/empty1
diff --git a/Tests/RunCMake/CommandLine/compare_files/empty2 b/Tests/RunCMake/CommandLine/compare_files/empty2
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/empty2
diff --git a/Tests/RunCMake/CommandLine/compare_files/lf b/Tests/RunCMake/CommandLine/compare_files/lf
new file mode 100644
index 000000000..a29bdeb43
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/compare_files/lf
@@ -0,0 +1 @@
+line1
diff --git a/Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt b/Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt
new file mode 100644
index 000000000..41ba09898
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/warn-uninitialized-stderr.txt
@@ -0,0 +1,53 @@
+^CMake Warning \(dev\) at warn-uninitialized.cmake:3 \(set\):
+ uninitialized variable 'OLD_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:4 \(set\):
+ uninitialized variable 'OLD_WARN_FROM_NORMAL_CMAKE_FILE_IN_ATS'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:5 \(string\):
+ uninitialized variable 'OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:7 \(configure_file\):
+ uninitialized variable 'OLD_WARN_FROM_CONFIGURE_FILE_INSIDE_AT'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:8 \(string\):
+ uninitialized variable 'OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_AT'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:13 \(set\):
+ uninitialized variable 'NEW_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:14 \(string\):
+ uninitialized variable 'NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:16 \(configure_file\):
+ uninitialized variable 'NEW_WARN_FROM_CONFIGURE_FILE_INSIDE_AT'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at warn-uninitialized.cmake:17 \(string\):
+ uninitialized variable 'NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_AT'
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/CommandLine/warn-uninitialized.cmake b/Tests/RunCMake/CommandLine/warn-uninitialized.cmake
new file mode 100644
index 000000000..ff65c1631
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/warn-uninitialized.cmake
@@ -0,0 +1,18 @@
+cmake_policy(PUSH)
+cmake_policy(SET CMP0053 OLD)
+set(FOO "${OLD_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}")
+set(FOO "@OLD_WARN_FROM_NORMAL_CMAKE_FILE_IN_ATS@")
+string(CONFIGURE "\${OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT1)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file1.in "\@OLD_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@")
+configure_file(${CMAKE_CURRENT_BINARY_DIR}/file1.in file1.out)
+string(CONFIGURE "\@OLD_WARN_FROM_STRING_CONFIGURE_INSIDE_AT\@" OUT2)
+cmake_policy(POP)
+
+cmake_policy(PUSH)
+cmake_policy(SET CMP0053 NEW)
+set(FOO "${NEW_WARN_FROM_NORMAL_CMAKE_FILE_INSIDE_BRACES}")
+string(CONFIGURE "\${NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_BRACES}" OUT3)
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file2.in "\@NEW_WARN_FROM_CONFIGURE_FILE_INSIDE_AT\@")
+configure_file(${CMAKE_CURRENT_BINARY_DIR}/file2.in file2.out)
+string(CONFIGURE "@NEW_WARN_FROM_STRING_CONFIGURE_INSIDE_AT@" OUT4)
+cmake_policy(POP)
diff --git a/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt b/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt
index 573541ac9..d197c913c 100644
--- a/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt
+++ b/Tests/RunCMake/Cppcheck/C-bad-Build-result.txt
@@ -1 +1 @@
-0
+[^0]
diff --git a/Tests/RunCMake/Cppcheck/C-error-Build-result.txt b/Tests/RunCMake/Cppcheck/C-error-Build-result.txt
new file mode 100644
index 000000000..d197c913c
--- /dev/null
+++ b/Tests/RunCMake/Cppcheck/C-error-Build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt b/Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt
new file mode 100644
index 000000000..4a24c0ccd
--- /dev/null
+++ b/Tests/RunCMake/Cppcheck/C-error-Build-stdout.txt
@@ -0,0 +1 @@
+.*Error: cppcheck reported failure.*error.*warning.*style.*performance.*information.*
diff --git a/Tests/RunCMake/Cppcheck/C-error.cmake b/Tests/RunCMake/Cppcheck/C-error.cmake
new file mode 100644
index 000000000..2254d7511
--- /dev/null
+++ b/Tests/RunCMake/Cppcheck/C-error.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_C_CPPCHECK "${PSEUDO_CPPCHECK}" -error)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake b/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake
index 5fd4ead13..e395f3696 100644
--- a/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Cppcheck/RunCMakeTest.cmake
@@ -15,6 +15,7 @@ endfunction()
run_cppcheck(C)
run_cppcheck(CXX)
+run_cppcheck(C-error)
run_cppcheck(C-bad)
if(NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
diff --git a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake
index 1aeb510f0..2fdefc4ce 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/CrosscompilingEmulatorProperty.cmake
@@ -26,3 +26,9 @@ get_property(emulator TARGET target_without_emulator
if(NOT "${emulator}" STREQUAL "")
message(SEND_ERROR "Default CROSSCOMPILING_EMULATOR property not set to null")
endif()
+
+add_executable(target_with_empty_emulator simple_src_exiterror.cxx)
+set_property(TARGET target_with_empty_emulator PROPERTY CROSSCOMPILING_EMULATOR "")
+
+enable_testing()
+add_test(NAME test_target_with_empty_emulator COMMAND target_with_empty_emulator)
diff --git a/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt b/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt
index c3708a9c8..5388c46de 100644
--- a/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadAlgoMap1-stderr.txt
@@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
The transform name must be a valid C identifier.
Call Stack \(most recent call first\):
- BadAlgoMap1.cmake:[0-9]+ \(ExternalData_Add_Target\)
- CMakeLists.txt:3 \(include\)
+ BadAlgoMap1\.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt b/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt
index 1f10644dc..a48e41455 100644
--- a/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadAlgoMap2-stderr.txt
@@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
The transform name must be a valid C identifier.
Call Stack \(most recent call first\):
- BadAlgoMap2.cmake:[0-9]+ \(ExternalData_Add_Target\)
- CMakeLists.txt:3 \(include\)
+ BadAlgoMap2\.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt b/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt
index f68f0be6b..1f9f6b51b 100644
--- a/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadHashAlgo1-stderr.txt
@@ -4,5 +4,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
BAD
Call Stack \(most recent call first\):
.*
- BadHashAlgo1.cmake:3 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ BadHashAlgo1\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadOption1-stderr.txt b/Tests/RunCMake/ExternalData/BadOption1-stderr.txt
index b63d098c0..fece87703 100644
--- a/Tests/RunCMake/ExternalData/BadOption1-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadOption1-stderr.txt
@@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Call Stack \(most recent call first\):
.*
- BadOption1.cmake:2 \(ExternalData_Add_Test\)
- CMakeLists.txt:3 \(include\)
+ BadOption1\.cmake:[0-9]+ \(ExternalData_Add_Test\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadOption2-stderr.txt b/Tests/RunCMake/ExternalData/BadOption2-stderr.txt
index d114c8aa9..865552aca 100644
--- a/Tests/RunCMake/ExternalData/BadOption2-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadOption2-stderr.txt
@@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Call Stack \(most recent call first\):
.*
- BadOption2.cmake:2 \(ExternalData_Add_Test\)
- CMakeLists.txt:3 \(include\)
+ BadOption2\.cmake:[0-9]+ \(ExternalData_Add_Test\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt b/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt
index aedc33015..9d04693ca 100644
--- a/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadRecurse1-stderr.txt
@@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Recurse option "RECURSE:" allowed only with directories.
Call Stack \(most recent call first\):
.*
- BadRecurse1.cmake:2 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ BadRecurse1\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt b/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt
index 3f809ca69..135b42477 100644
--- a/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadRecurse2-stderr.txt
@@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Recurse option "RECURSE:" allowed only with directories.
Call Stack \(most recent call first\):
.*
- BadRecurse2.cmake:2 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ BadRecurse2\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt b/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt
index 37740e0f7..df9bb0e17 100644
--- a/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadRecurse3-stderr.txt
@@ -5,5 +5,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Call Stack \(most recent call first\):
.*
- BadRecurse3.cmake:2 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ BadRecurse3\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt b/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt
index 3099be579..5b3495985 100644
--- a/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadSeries1-stderr.txt
@@ -15,5 +15,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Call Stack \(most recent call first\):
.*
- BadSeries1.cmake:3 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ BadSeries1\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt b/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt
index 3a02c25e9..82b2311d2 100644
--- a/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadSeries2-stderr.txt
@@ -12,5 +12,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
\(x\)\(y\)\$
Call Stack \(most recent call first\):
.*
- BadSeries2.cmake:3 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ BadSeries2\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt b/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt
index 594cb6f6a..13e75c5c5 100644
--- a/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt
+++ b/Tests/RunCMake/ExternalData/BadSeries3-stderr.txt
@@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Series option ":" not allowed with associated files.
Call Stack \(most recent call first\):
.*
- BadSeries3.cmake:2 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ BadSeries3\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/Directory1-stderr.txt b/Tests/RunCMake/ExternalData/Directory1-stderr.txt
index 2bc3c601d..833683285 100644
--- a/Tests/RunCMake/ExternalData/Directory1-stderr.txt
+++ b/Tests/RunCMake/ExternalData/Directory1-stderr.txt
@@ -10,5 +10,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
that is directory instead of a file!
Call Stack \(most recent call first\):
.*
- Directory1.cmake:3 \(ExternalData_Add_Test\)
- CMakeLists.txt:3 \(include\)
+ Directory1\.cmake:[0-9]+ \(ExternalData_Add_Test\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/Directory2-stderr.txt b/Tests/RunCMake/ExternalData/Directory2-stderr.txt
index 92c9a2ff5..ad6d814ec 100644
--- a/Tests/RunCMake/ExternalData/Directory2-stderr.txt
+++ b/Tests/RunCMake/ExternalData/Directory2-stderr.txt
@@ -6,5 +6,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
must list associated files.
Call Stack \(most recent call first\):
.*
- Directory2.cmake:3 \(ExternalData_Add_Test\)
- CMakeLists.txt:3 \(include\)
+ Directory2\.cmake:[0-9]+ \(ExternalData_Add_Test\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/Directory3-stderr.txt b/Tests/RunCMake/ExternalData/Directory3-stderr.txt
index ceed2a04d..5538c38a8 100644
--- a/Tests/RunCMake/ExternalData/Directory3-stderr.txt
+++ b/Tests/RunCMake/ExternalData/Directory3-stderr.txt
@@ -10,6 +10,6 @@ CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
that does not exist as a file \(with or without an extension\)!
Call Stack \(most recent call first\):
.*
- Directory3.cmake:3 \(ExternalData_Add_Test\)
- CMakeLists.txt:3 \(include\)
+ Directory3\.cmake:[0-9]+ \(ExternalData_Add_Test\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ExternalData/Directory4-stderr.txt b/Tests/RunCMake/ExternalData/Directory4-stderr.txt
index dcb8522f8..ef8847685 100644
--- a/Tests/RunCMake/ExternalData/Directory4-stderr.txt
+++ b/Tests/RunCMake/ExternalData/Directory4-stderr.txt
@@ -2,5 +2,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Series option ":" not allowed with directories.
Call Stack \(most recent call first\):
.*
- Directory4.cmake:3 \(ExternalData_Add_Test\)
- CMakeLists.txt:3 \(include\)
+ Directory4\.cmake:[0-9]+ \(ExternalData_Add_Test\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/Directory5-stderr.txt b/Tests/RunCMake/ExternalData/Directory5-stderr.txt
index 8e54aecd2..3fcde414d 100644
--- a/Tests/RunCMake/ExternalData/Directory5-stderr.txt
+++ b/Tests/RunCMake/ExternalData/Directory5-stderr.txt
@@ -10,5 +10,5 @@ CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
that does not exist as a directory!
Call Stack \(most recent call first\):
.*
- Directory5.cmake:3 \(ExternalData_Add_Test\)
- CMakeLists.txt:3 \(include\)
+ Directory5\.cmake:[0-9]+ \(ExternalData_Add_Test\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/MissingData-stderr.txt b/Tests/RunCMake/ExternalData/MissingData-stderr.txt
index 39ed2f15f..b10997681 100644
--- a/Tests/RunCMake/ExternalData/MissingData-stderr.txt
+++ b/Tests/RunCMake/ExternalData/MissingData-stderr.txt
@@ -10,6 +10,6 @@ CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
that does not exist as a file \(with or without an extension\)!
Call Stack \(most recent call first\):
.*
- MissingData.cmake:4 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ MissingData\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt
index 315af5e49..426d86ccd 100644
--- a/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt
+++ b/Tests/RunCMake/ExternalData/MissingDataWithAssociated-stderr.txt
@@ -10,6 +10,6 @@ CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
that does not exist as a file \(with or without an extension\)!
Call Stack \(most recent call first\):
.*
- MissingDataWithAssociated.cmake:4 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ MissingDataWithAssociated\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt b/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt
index 496ad8ae4..33cef07b4 100644
--- a/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt
+++ b/Tests/RunCMake/ExternalData/NoLinkInSource-stderr.txt
@@ -2,5 +2,5 @@ CMake Warning at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
ExternalData_LINK_CONTENT cannot be used in-source
Call Stack \(most recent call first\):
.*
- NoLinkInSource.cmake:8 \(ExternalData_Expand_Arguments\)
- CMakeLists.txt:3 \(include\)
+ NoLinkInSource\.cmake:[0-9]+ \(ExternalData_Expand_Arguments\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt
index ccbaf5af3..45dfb94cb 100644
--- a/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt
+++ b/Tests/RunCMake/ExternalData/NoURLTemplates-stderr.txt
@@ -1,5 +1,5 @@
CMake Error at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!
Call Stack \(most recent call first\):
- NoURLTemplates.cmake:2 \(ExternalData_Add_Target\)
- CMakeLists.txt:3 \(include\)
+ NoURLTemplates\.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt
new file mode 100644
index 000000000..c20fd86c7
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-result.txt
@@ -0,0 +1 @@
+^[^0]
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt
new file mode 100644
index 000000000..87e5384fa
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure-build-stdout.txt
@@ -0,0 +1,8 @@
+( )?-- stdout output is:
+( )?This is some dummy output with some long lines to ensure formatting is preserved
+( )? Including lines with leading spaces
+( )?
+( )?And also blank lines[
+ ]+
+( )?-- stderr output is:
+( )?cmake -E env: no command given
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake
new file mode 100644
index 000000000..863bbef9b
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailure.cmake
@@ -0,0 +1,20 @@
+include(ExternalProject)
+
+set(dummyOutput [[
+This is some dummy output with some long lines to ensure formatting is preserved
+ Including lines with leading spaces
+
+And also blank lines
+]])
+
+ExternalProject_Add(FailsWithOutput
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput}
+ COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail
+ TEST_COMMAND ""
+ INSTALL_COMMAND ""
+ LOG_BUILD YES
+ LOG_OUTPUT_ON_FAILURE YES
+ USES_TERMINAL_BUILD YES
+)
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt
new file mode 100644
index 000000000..c20fd86c7
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-result.txt
@@ -0,0 +1 @@
+^[^0]
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt
new file mode 100644
index 000000000..11c73176e
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged-build-stdout.txt
@@ -0,0 +1,7 @@
+( )?-- Log output is:
+( )?This is some dummy output with some long lines to ensure formatting is preserved
+( )? Including lines with leading spaces
+( )?
+( )?And also blank lines[
+ ]+
+( )?cmake -E env: no command given
diff --git a/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake
new file mode 100644
index 000000000..116448b8f
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/LogOutputOnFailureMerged.cmake
@@ -0,0 +1,21 @@
+include(ExternalProject)
+
+set(dummyOutput [[
+This is some dummy output with some long lines to ensure formatting is preserved
+ Including lines with leading spaces
+
+And also blank lines
+]])
+
+ExternalProject_Add(FailsWithOutput
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ${CMAKE_COMMAND} -E echo ${dummyOutput}
+ COMMAND ${CMAKE_COMMAND} -E env # missing command, forces fail
+ TEST_COMMAND ""
+ INSTALL_COMMAND ""
+ LOG_BUILD YES
+ LOG_OUTPUT_ON_FAILURE YES
+ LOG_MERGED_STDOUTERR YES
+ USES_TERMINAL_BUILD YES
+)
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
index bf11381a8..caaf0d2fd 100644
--- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -29,6 +29,13 @@ endfunction()
__ep_test_with_build(MultiCommand)
+# Output is not predictable enough to be able to verify it reliably
+# when using the various different Visual Studio generators
+if(NOT RunCMake_GENERATOR MATCHES "Visual Studio")
+ __ep_test_with_build(LogOutputOnFailure)
+ __ep_test_with_build(LogOutputOnFailureMerged)
+endif()
+
# We can't test the substitution when using the old MSYS due to
# make/sh mangling the paths (substitution is performed correctly,
# but the mangling means we can't reliably test the output).
diff --git a/Tests/RunCMake/FetchContent/CMakeLists.txt b/Tests/RunCMake/FetchContent/CMakeLists.txt
index d3137f614..3cc2e4364 100644
--- a/Tests/RunCMake/FetchContent/CMakeLists.txt
+++ b/Tests/RunCMake/FetchContent/CMakeLists.txt
@@ -1,3 +1,7 @@
cmake_minimum_required(VERSION 3.9)
project(${RunCMake_TEST} NONE)
+
+# Tests assume no previous downloads in the output directory
+file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/_deps)
+
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt b/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt
new file mode 100644
index 000000000..6e6c73062
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt
@@ -0,0 +1,2 @@
+Confirmation project has been added
+.*Confirmation script has been called
diff --git a/Tests/RunCMake/FetchContent/MakeAvailable.cmake b/Tests/RunCMake/FetchContent/MakeAvailable.cmake
new file mode 100644
index 000000000..a93f1f70d
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailable.cmake
@@ -0,0 +1,20 @@
+include(FetchContent)
+
+FetchContent_Declare(
+ WithProject
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithProject
+)
+FetchContent_Declare(
+ WithoutProject
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithoutProject
+)
+
+# Order is important and will be verified by test output
+FetchContent_MakeAvailable(WithProject WithoutProject)
+
+get_property(addedWith GLOBAL PROPERTY FetchWithProject SET)
+if(NOT addedWith)
+ message(SEND_ERROR "Subdir with CMakeLists.txt not added")
+endif()
+
+include(${withoutproject_SOURCE_DIR}/confirmMessage.cmake)
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt b/Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt
new file mode 100644
index 000000000..8d3b7c04f
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableTwice-stdout.txt
@@ -0,0 +1,4 @@
+-- Before first[
+ ]+-- Confirmation project has been added[
+ ]+-- Between both[
+ ]+-- After last
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake b/Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake
new file mode 100644
index 000000000..a9af02091
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableTwice.cmake
@@ -0,0 +1,12 @@
+include(FetchContent)
+
+FetchContent_Declare(
+ WithProject
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithProject
+)
+
+message(STATUS "Before first")
+FetchContent_MakeAvailable(WithProject)
+message(STATUS "Between both")
+FetchContent_MakeAvailable(WithProject)
+message(STATUS "After last")
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt
new file mode 100644
index 000000000..9715b7889
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared-stderr.txt
@@ -0,0 +1 @@
+No content details recorded for NoDetails
diff --git a/Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake
new file mode 100644
index 000000000..bd57cbe1a
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/MakeAvailableUndeclared.cmake
@@ -0,0 +1,3 @@
+include(FetchContent)
+
+FetchContent_MakeAvailable(NoDetails)
diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
index 621fb8bd5..e28ae96dd 100644
--- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
@@ -10,6 +10,10 @@ run_cmake(SameGenerator)
run_cmake(VarDefinitions)
run_cmake(GetProperties)
run_cmake(DirOverrides)
+run_cmake(UsesTerminalOverride)
+run_cmake(MakeAvailable)
+run_cmake(MakeAvailableTwice)
+run_cmake(MakeAvailableUndeclared)
# We need to pass through CMAKE_GENERATOR and CMAKE_MAKE_PROGRAM
# to ensure the test can run on machines where the build tool
diff --git a/Tests/RunCMake/FetchContent/UsesTerminalOverride-stdout.txt b/Tests/RunCMake/FetchContent/UsesTerminalOverride-stdout.txt
new file mode 100644
index 000000000..3718d6459
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/UsesTerminalOverride-stdout.txt
@@ -0,0 +1,2 @@
+Logged from t1 download step
++.*Logged from t2 download step
diff --git a/Tests/RunCMake/FetchContent/UsesTerminalOverride.cmake b/Tests/RunCMake/FetchContent/UsesTerminalOverride.cmake
new file mode 100644
index 000000000..99d9719e4
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/UsesTerminalOverride.cmake
@@ -0,0 +1,17 @@
+include(FetchContent)
+
+set(FETCHCONTENT_QUIET NO)
+
+FetchContent_Declare(
+ t1
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Logged from t1 download step"
+ USES_TERMINAL_DOWNLOAD NO
+
+)
+FetchContent_Populate(t1)
+
+FetchContent_Populate(
+ t2
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Logged from t2 download step"
+ USES_TERMINAL_DOWNLOAD NO
+)
diff --git a/Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt b/Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt
new file mode 100644
index 000000000..b6a37508e
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/WithProject/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.13)
+project(WithProject LANGUAGES NONE)
+
+set_property(GLOBAL PROPERTY FetchWithProject YES)
+message(STATUS "Confirmation project has been added")
diff --git a/Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake b/Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake
new file mode 100644
index 000000000..a2f5c61d0
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/WithoutProject/confirmMessage.cmake
@@ -0,0 +1 @@
+message(STATUS "Confirmation script has been called")
diff --git a/Tests/RunCMake/FileAPI/CMakeLists.txt b/Tests/RunCMake/FileAPI/CMakeLists.txt
new file mode 100644
index 000000000..44025d3bd
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FileAPI/ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/ClientStateful-check.cmake
new file mode 100644
index 000000000..1e9aab6d1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateful-check.cmake
@@ -0,0 +1,68 @@
+set(expect
+ query
+ query/client-client-member
+ query/client-client-member/query.json
+ query/client-empty-array
+ query/client-empty-array/query.json
+ query/client-empty-object
+ query/client-empty-object/query.json
+ query/client-json-bad-root
+ query/client-json-bad-root/query.json
+ query/client-json-empty
+ query/client-json-empty/query.json
+ query/client-json-extra
+ query/client-json-extra/query.json
+ query/client-not-file
+ query/client-not-file/query.json
+ query/client-request-array-negative-major-version
+ query/client-request-array-negative-major-version/query.json
+ query/client-request-array-negative-minor-version
+ query/client-request-array-negative-minor-version/query.json
+ query/client-request-array-negative-version
+ query/client-request-array-negative-version/query.json
+ query/client-request-array-no-major-version
+ query/client-request-array-no-major-version/query.json
+ query/client-request-array-no-supported-version
+ query/client-request-array-no-supported-version-among
+ query/client-request-array-no-supported-version-among/query.json
+ query/client-request-array-no-supported-version/query.json
+ query/client-request-array-version-1
+ query/client-request-array-version-1-1
+ query/client-request-array-version-1-1/query.json
+ query/client-request-array-version-1/query.json
+ query/client-request-array-version-2
+ query/client-request-array-version-2/query.json
+ query/client-request-negative-major-version
+ query/client-request-negative-major-version/query.json
+ query/client-request-negative-minor-version
+ query/client-request-negative-minor-version/query.json
+ query/client-request-negative-version
+ query/client-request-negative-version/query.json
+ query/client-request-no-major-version
+ query/client-request-no-major-version/query.json
+ query/client-request-no-version
+ query/client-request-no-version/query.json
+ query/client-request-version-1
+ query/client-request-version-1-1
+ query/client-request-version-1-1/query.json
+ query/client-request-version-1/query.json
+ query/client-request-version-2
+ query/client-request-version-2/query.json
+ query/client-requests-bad
+ query/client-requests-bad/query.json
+ query/client-requests-empty
+ query/client-requests-empty/query.json
+ query/client-requests-not-kinded
+ query/client-requests-not-kinded/query.json
+ query/client-requests-not-objects
+ query/client-requests-not-objects/query.json
+ query/client-requests-unknown
+ query/client-requests-unknown/query.json
+ reply
+ reply/__test-v1-[0-9a-f]+.json
+ reply/__test-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(ClientStateful)
diff --git a/Tests/RunCMake/FileAPI/ClientStateful-check.py b/Tests/RunCMake/FileAPI/ClientStateful-check.py
new file mode 100644
index 000000000..f3d20d13e
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateful-check.py
@@ -0,0 +1,258 @@
+from check_index import *
+
+def check_reply(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == [
+ "client-client-member",
+ "client-empty-array",
+ "client-empty-object",
+ "client-json-bad-root",
+ "client-json-empty",
+ "client-json-extra",
+ "client-not-file",
+ "client-request-array-negative-major-version",
+ "client-request-array-negative-minor-version",
+ "client-request-array-negative-version",
+ "client-request-array-no-major-version",
+ "client-request-array-no-supported-version",
+ "client-request-array-no-supported-version-among",
+ "client-request-array-version-1",
+ "client-request-array-version-1-1",
+ "client-request-array-version-2",
+ "client-request-negative-major-version",
+ "client-request-negative-minor-version",
+ "client-request-negative-version",
+ "client-request-no-major-version",
+ "client-request-no-version",
+ "client-request-version-1",
+ "client-request-version-1-1",
+ "client-request-version-2",
+ "client-requests-bad",
+ "client-requests-empty",
+ "client-requests-not-kinded",
+ "client-requests-not-objects",
+ "client-requests-unknown",
+ ]
+ expected = [
+ (check_query_client_member, "client-client-member"),
+ (check_query_empty_array, "client-empty-array"),
+ (check_query_empty_object, "client-empty-object"),
+ (check_query_json_bad_root, "client-json-bad-root"),
+ (check_query_json_empty, "client-json-empty"),
+ (check_query_json_extra, "client-json-extra"),
+ (check_query_not_file, "client-not-file"),
+ (check_query_requests_bad, "client-requests-bad"),
+ (check_query_requests_empty, "client-requests-empty"),
+ (check_query_requests_not_kinded, "client-requests-not-kinded"),
+ (check_query_requests_not_objects, "client-requests-not-objects"),
+ (check_query_requests_unknown, "client-requests-unknown"),
+ ]
+ for (f, k) in expected:
+ assert is_dict(q[k])
+ assert sorted(q[k].keys()) == ["query.json"]
+ f(q[k]["query.json"])
+ expected = [
+ (check_query_response_array_negative_major_version, "client-request-array-negative-major-version"),
+ (check_query_response_array_negative_minor_version, "client-request-array-negative-minor-version"),
+ (check_query_response_array_negative_version, "client-request-array-negative-version"),
+ (check_query_response_array_no_major_version, "client-request-array-no-major-version"),
+ (check_query_response_array_no_supported_version, "client-request-array-no-supported-version"),
+ (check_query_response_array_no_supported_version_among, "client-request-array-no-supported-version-among"),
+ (check_query_response_array_version_1, "client-request-array-version-1"),
+ (check_query_response_array_version_1_1, "client-request-array-version-1-1"),
+ (check_query_response_array_version_2, "client-request-array-version-2"),
+ (check_query_response_negative_major_version, "client-request-negative-major-version"),
+ (check_query_response_negative_minor_version, "client-request-negative-minor-version"),
+ (check_query_response_negative_version, "client-request-negative-version"),
+ (check_query_response_no_major_version, "client-request-no-major-version"),
+ (check_query_response_no_version, "client-request-no-version"),
+ (check_query_response_version_1, "client-request-version-1"),
+ (check_query_response_version_1_1, "client-request-version-1-1"),
+ (check_query_response_version_2, "client-request-version-2"),
+ ]
+ for (f, k) in expected:
+ assert is_dict(q[k])
+ assert sorted(q[k].keys()) == ["query.json"]
+ assert is_dict(q[k]["query.json"])
+ assert sorted(q[k]["query.json"].keys()) == ["requests", "responses"]
+ r = q[k]["query.json"]["requests"]
+ assert is_list(r)
+ assert len(r) == 1
+ assert is_dict(r[0])
+ assert r[0]["kind"] == "__test"
+ r = q[k]["query.json"]["responses"]
+ assert is_list(r)
+ assert len(r) == 1
+ assert is_dict(r[0])
+ f(r[0])
+
+def check_query_client_member(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == ["client", "responses"]
+ assert is_dict(q["client"])
+ assert sorted(q["client"].keys()) == []
+ check_error(q["responses"], "'requests' member missing")
+
+def check_query_empty_array(q):
+ check_error(q, "query root is not an object")
+
+def check_query_empty_object(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == ["responses"]
+ check_error(q["responses"], "'requests' member missing")
+
+def check_query_json_bad_root(q):
+ check_error_re(q, "A valid JSON document must be either an array or an object value")
+
+def check_query_json_empty(q):
+ check_error_re(q, "value, object or array expected")
+
+def check_query_json_extra(q):
+ check_error_re(q, "Extra non-whitespace after JSON value")
+
+def check_query_not_file(q):
+ check_error_re(q, "failed to read from file")
+
+def check_query_requests_bad(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == ["requests", "responses"]
+ r = q["requests"]
+ assert is_dict(r)
+ assert sorted(r.keys()) == []
+ check_error(q["responses"], "'requests' member is not an array")
+
+def check_query_requests_empty(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == ["requests", "responses"]
+ r = q["requests"]
+ assert is_list(r)
+ assert len(r) == 0
+ r = q["responses"]
+ assert is_list(r)
+ assert len(r) == 0
+
+def check_query_requests_not_kinded(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == ["requests", "responses"]
+ r = q["requests"]
+ assert is_list(r)
+ assert len(r) == 4
+ assert is_dict(r[0])
+ assert sorted(r[0].keys()) == []
+ assert is_dict(r[1])
+ assert sorted(r[1].keys()) == ["kind"]
+ assert is_dict(r[1]["kind"])
+ assert is_dict(r[2])
+ assert sorted(r[2].keys()) == ["kind"]
+ assert is_list(r[2]["kind"])
+ assert is_dict(r[3])
+ assert sorted(r[3].keys()) == ["kind"]
+ assert is_int(r[3]["kind"])
+ r = q["responses"]
+ assert is_list(r)
+ assert len(r) == 4
+ check_error(r[0], "'kind' member missing")
+ check_error(r[1], "'kind' member is not a string")
+ check_error(r[2], "'kind' member is not a string")
+ check_error(r[3], "'kind' member is not a string")
+
+def check_query_requests_not_objects(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == ["requests", "responses"]
+ r = q["requests"]
+ assert is_list(r)
+ assert len(r) == 3
+ assert is_int(r[0])
+ assert is_string(r[1])
+ assert is_list(r[2])
+ r = q["responses"]
+ assert is_list(r)
+ assert len(r) == 3
+ check_error(r[0], "request is not an object")
+ check_error(r[1], "request is not an object")
+ check_error(r[2], "request is not an object")
+
+def check_query_requests_unknown(q):
+ assert is_dict(q)
+ assert sorted(q.keys()) == ["requests", "responses"]
+ r = q["requests"]
+ assert is_list(r)
+ assert len(r) == 3
+ assert is_dict(r[0])
+ assert sorted(r[0].keys()) == ["kind"]
+ assert r[0]["kind"] == "unknownC"
+ assert is_dict(r[1])
+ assert sorted(r[1].keys()) == ["kind"]
+ assert r[1]["kind"] == "unknownB"
+ assert is_dict(r[2])
+ assert sorted(r[2].keys()) == ["kind"]
+ assert r[2]["kind"] == "unknownA"
+ r = q["responses"]
+ assert is_list(r)
+ assert len(r) == 3
+ check_error(r[0], "unknown request kind 'unknownC'")
+ check_error(r[1], "unknown request kind 'unknownB'")
+ check_error(r[2], "unknown request kind 'unknownA'")
+
+def check_query_response_array_negative_major_version(r):
+ check_error(r, "'version' object 'major' member is not a non-negative integer")
+
+def check_query_response_array_negative_minor_version(r):
+ check_error(r, "'version' object 'minor' member is not a non-negative integer")
+
+def check_query_response_array_negative_version(r):
+ check_error(r, "'version' array entry is not a non-negative integer or object")
+
+def check_query_response_array_no_major_version(r):
+ check_error(r, "'version' object 'major' member missing")
+
+def check_query_response_array_no_supported_version(r):
+ check_error(r, "no supported version specified")
+
+def check_query_response_array_no_supported_version_among(r):
+ check_error(r, "no supported version specified among: 4.0 3.0")
+
+def check_query_response_array_version_1(r):
+ check_index__test(r, 1, 3)
+
+def check_query_response_array_version_1_1(r):
+ check_index__test(r, 1, 3) # always uses latest minor version
+
+def check_query_response_array_version_2(r):
+ check_index__test(r, 2, 0)
+
+def check_query_response_negative_major_version(r):
+ check_error(r, "'version' object 'major' member is not a non-negative integer")
+
+def check_query_response_negative_minor_version(r):
+ check_error(r, "'version' object 'minor' member is not a non-negative integer")
+
+def check_query_response_negative_version(r):
+ check_error(r, "'version' member is not a non-negative integer, object, or array")
+
+def check_query_response_no_major_version(r):
+ check_error(r, "'version' object 'major' member missing")
+
+def check_query_response_no_version(r):
+ check_error(r, "'version' member missing")
+
+def check_query_response_version_1(r):
+ check_index__test(r, 1, 3)
+
+def check_query_response_version_1_1(r):
+ check_index__test(r, 1, 3) # always uses latest minor version
+
+def check_query_response_version_2(r):
+ check_index__test(r, 2, 0)
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 2
+ check_index__test(o[0], 1, 3)
+ check_index__test(o[1], 2, 0)
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_cmake(index["cmake"])
+check_reply(index["reply"])
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake
new file mode 100644
index 000000000..5b41d7afb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateful-prep.cmake
@@ -0,0 +1,73 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-client-member/query.json" [[{ "client": {} }]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-array/query.json" "[]")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-empty-object/query.json" "{}")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-bad-root/query.json" [["invalid root"]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-empty/query.json" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-json-extra/query.json" "{}x")
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-not-file/query.json")
+
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-bad/query.json" [[{ "requests": {} }]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-empty/query.json" [[{ "requests": [] }]])
+
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-not-objects/query.json" [[
+{ "requests": [ 0, "", [] ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-not-kinded/query.json" [[
+{ "requests": [ {}, { "kind": {} }, { "kind": [] }, { "kind": 0 } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-requests-unknown/query.json" [[
+{ "requests": [ { "kind": "unknownC" }, { "kind": "unknownB" }, { "kind": "unknownA" } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-no-version/query.json" [[
+{ "requests": [ { "kind": "__test" } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : -1 } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-no-major-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : {} } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-major-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : { "major": -1 } } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-negative-minor-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : { "major": 0, "minor": -1 } } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [ 1, -1 ] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-major-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [ 1, {} ] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-major-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [ 1, { "major": -1 } ] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-negative-minor-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [ 1, { "major": 0, "minor": -1 } ] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-supported-version/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-no-supported-version-among/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [4, 3] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-1/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : 1 } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-1-1/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : { "major": 1, "minor": 1 } } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-version-2/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : { "major": 2 } } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-1/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [3, 1] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-1-1/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [3, { "major": 1, "minor": 1 }, 2 ] } ] }
+]])
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-request-array-version-2/query.json" [[
+{ "requests": [ { "kind": "__test", "version" : [3, { "major": 2 } ] } ] }
+]])
+
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "")
diff --git a/Tests/RunCMake/FileAPI/ClientStateful.cmake b/Tests/RunCMake/FileAPI/ClientStateful.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateful.cmake
diff --git a/Tests/RunCMake/FileAPI/ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/ClientStateless-check.cmake
new file mode 100644
index 000000000..955d9bea4
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateless-check.cmake
@@ -0,0 +1,15 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/__test-v1
+ query/client-foo/__test-v2
+ query/client-foo/__test-v3
+ query/client-foo/unknown
+ reply
+ reply/__test-v1-[0-9a-f]+.json
+ reply/__test-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(ClientStateless)
diff --git a/Tests/RunCMake/FileAPI/ClientStateless-check.py b/Tests/RunCMake/FileAPI/ClientStateless-check.py
new file mode 100644
index 000000000..b7da314ce
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateless-check.py
@@ -0,0 +1,26 @@
+from check_index import *
+
+def check_reply(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["client-foo"]
+ check_reply_client_foo(r["client-foo"])
+
+def check_reply_client_foo(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "unknown"]
+ check_index__test(r["__test-v1"], 1, 3)
+ check_index__test(r["__test-v2"], 2, 0)
+ check_error(r["__test-v3"], "unknown query file")
+ check_error(r["unknown"], "unknown query file")
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 2
+ check_index__test(o[0], 1, 3)
+ check_index__test(o[1], 2, 0)
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_cmake(index["cmake"])
+check_reply(index["reply"])
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake
new file mode 100644
index 000000000..1b8d772fa
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateless-prep.cmake
@@ -0,0 +1,5 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v1" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v3" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "")
diff --git a/Tests/RunCMake/FileAPI/ClientStateless.cmake b/Tests/RunCMake/FileAPI/ClientStateless.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/ClientStateless.cmake
diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake
new file mode 100644
index 000000000..4959c1eaa
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/DuplicateStateless-check.cmake
@@ -0,0 +1,20 @@
+set(expect
+ query
+ query/__test-v1
+ query/__test-v2
+ query/__test-v3
+ query/client-foo
+ query/client-foo/__test-v1
+ query/client-foo/__test-v2
+ query/client-foo/__test-v3
+ query/client-foo/unknown
+ query/query.json
+ query/unknown
+ reply
+ reply/__test-v1-[0-9a-f]+.json
+ reply/__test-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(DuplicateStateless)
diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-check.py b/Tests/RunCMake/FileAPI/DuplicateStateless-check.py
new file mode 100644
index 000000000..33354794c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/DuplicateStateless-check.py
@@ -0,0 +1,31 @@
+from check_index import *
+
+def check_reply(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "client-foo", "query.json", "unknown"]
+ check_index__test(r["__test-v1"], 1, 3)
+ check_index__test(r["__test-v2"], 2, 0)
+ check_error(r["__test-v3"], "unknown query file")
+ check_reply_client_foo(r["client-foo"])
+ check_error(r["query.json"], "unknown query file")
+ check_error(r["unknown"], "unknown query file")
+
+def check_reply_client_foo(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "unknown"]
+ check_index__test(r["__test-v1"], 1, 3)
+ check_index__test(r["__test-v2"], 2, 0)
+ check_error(r["__test-v3"], "unknown query file")
+ check_error(r["unknown"], "unknown query file")
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 2
+ check_index__test(o[0], 1, 3)
+ check_index__test(o[1], 2, 0)
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_cmake(index["cmake"])
+check_reply(index["reply"])
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake
new file mode 100644
index 000000000..51b985281
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/DuplicateStateless-prep.cmake
@@ -0,0 +1,10 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v2" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/unknown" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v1" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v3" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "")
diff --git a/Tests/RunCMake/FileAPI/DuplicateStateless.cmake b/Tests/RunCMake/FileAPI/DuplicateStateless.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/DuplicateStateless.cmake
diff --git a/Tests/RunCMake/FileAPI/Empty-check.cmake b/Tests/RunCMake/FileAPI/Empty-check.cmake
new file mode 100644
index 000000000..2764b4297
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Empty-check.cmake
@@ -0,0 +1,8 @@
+set(expect
+ query
+ reply
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(Empty)
diff --git a/Tests/RunCMake/FileAPI/Empty-check.py b/Tests/RunCMake/FileAPI/Empty-check.py
new file mode 100644
index 000000000..75bf096d0
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Empty-check.py
@@ -0,0 +1,15 @@
+from check_index import *
+
+def check_reply(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == []
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 0
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_cmake(index["cmake"])
+check_reply(index["reply"])
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/Empty-prep.cmake b/Tests/RunCMake/FileAPI/Empty-prep.cmake
new file mode 100644
index 000000000..1d1f69e23
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Empty-prep.cmake
@@ -0,0 +1 @@
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query")
diff --git a/Tests/RunCMake/FileAPI/Empty.cmake b/Tests/RunCMake/FileAPI/Empty.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Empty.cmake
diff --git a/Tests/RunCMake/FileAPI/EmptyClient-check.cmake b/Tests/RunCMake/FileAPI/EmptyClient-check.cmake
new file mode 100644
index 000000000..4e5745cdb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/EmptyClient-check.cmake
@@ -0,0 +1,9 @@
+set(expect
+ query
+ query/client-foo
+ reply
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(EmptyClient)
diff --git a/Tests/RunCMake/FileAPI/EmptyClient-check.py b/Tests/RunCMake/FileAPI/EmptyClient-check.py
new file mode 100644
index 000000000..f88790818
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/EmptyClient-check.py
@@ -0,0 +1,20 @@
+from check_index import *
+
+def check_reply(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["client-foo"]
+ check_reply_client_foo(r["client-foo"])
+
+def check_reply_client_foo(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == []
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 0
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_cmake(index["cmake"])
+check_reply(index["reply"])
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake b/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake
new file mode 100644
index 000000000..31512fd0c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/EmptyClient-prep.cmake
@@ -0,0 +1,2 @@
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "")
diff --git a/Tests/RunCMake/FileAPI/EmptyClient.cmake b/Tests/RunCMake/FileAPI/EmptyClient.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/EmptyClient.cmake
diff --git a/Tests/RunCMake/FileAPI/MixedStateless-check.cmake b/Tests/RunCMake/FileAPI/MixedStateless-check.cmake
new file mode 100644
index 000000000..57956143e
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/MixedStateless-check.cmake
@@ -0,0 +1,16 @@
+set(expect
+ query
+ query/__test-v1
+ query/__test-v3
+ query/client-foo
+ query/client-foo/__test-v2
+ query/client-foo/unknown
+ query/query.json
+ reply
+ reply/__test-v1-[0-9a-f]+.json
+ reply/__test-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(MixedStateless)
diff --git a/Tests/RunCMake/FileAPI/MixedStateless-check.py b/Tests/RunCMake/FileAPI/MixedStateless-check.py
new file mode 100644
index 000000000..be019ab72
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/MixedStateless-check.py
@@ -0,0 +1,27 @@
+from check_index import *
+
+def check_reply(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["__test-v1", "__test-v3", "client-foo", "query.json"]
+ check_index__test(r["__test-v1"], 1, 3)
+ check_error(r["__test-v3"], "unknown query file")
+ check_reply_client_foo(r["client-foo"])
+ check_error(r["query.json"], "unknown query file")
+
+def check_reply_client_foo(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["__test-v2", "unknown"]
+ check_index__test(r["__test-v2"], 2, 0)
+ check_error(r["unknown"], "unknown query file")
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 2
+ check_index__test(o[0], 1, 3)
+ check_index__test(o[1], 2, 0)
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_cmake(index["cmake"])
+check_reply(index["reply"])
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake b/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake
new file mode 100644
index 000000000..030baac5b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/MixedStateless-prep.cmake
@@ -0,0 +1,6 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/__test-v2" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/unknown" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "")
diff --git a/Tests/RunCMake/FileAPI/MixedStateless.cmake b/Tests/RunCMake/FileAPI/MixedStateless.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/MixedStateless.cmake
diff --git a/Tests/RunCMake/FileAPI/Nothing-check.cmake b/Tests/RunCMake/FileAPI/Nothing-check.cmake
new file mode 100644
index 000000000..cd4f42efc
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Nothing-check.cmake
@@ -0,0 +1 @@
+check_api("^$")
diff --git a/Tests/RunCMake/FileAPI/Nothing-prep.cmake b/Tests/RunCMake/FileAPI/Nothing-prep.cmake
new file mode 100644
index 000000000..b850d47a8
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Nothing-prep.cmake
@@ -0,0 +1 @@
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1")
diff --git a/Tests/RunCMake/FileAPI/Nothing.cmake b/Tests/RunCMake/FileAPI/Nothing.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Nothing.cmake
diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
new file mode 100644
index 000000000..f8adb644a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
@@ -0,0 +1,58 @@
+include(RunCMake)
+
+# Function called in *-check.cmake scripts to check api files.
+function(check_api expect)
+ file(GLOB_RECURSE actual
+ LIST_DIRECTORIES TRUE
+ RELATIVE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1
+ ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/*
+ )
+ if(NOT "${actual}" MATCHES "${expect}")
+ set(RunCMake_TEST_FAILED "API files:
+ ${actual}
+do not match what we expected:
+ ${expect}
+in directory:
+ ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(check_python case)
+ if(RunCMake_TEST_FAILED OR NOT PYTHON_EXECUTABLE)
+ return()
+ endif()
+ file(GLOB index ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/index-*.json)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE output
+ ERROR_VARIABLE output
+ )
+ if(NOT result EQUAL 0)
+ string(REPLACE "\n" "\n " output " ${output}")
+ set(RunCMake_TEST_FAILED "Unexpected index:\n${output}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+run_cmake(Nothing)
+run_cmake(Empty)
+run_cmake(EmptyClient)
+run_cmake(Stale)
+run_cmake(SharedStateless)
+run_cmake(ClientStateless)
+run_cmake(MixedStateless)
+run_cmake(DuplicateStateless)
+run_cmake(ClientStateful)
+
+function(run_object object)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${object}-build)
+ run_cmake(${object})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${object}-SharedStateless ${CMAKE_COMMAND} .)
+ run_cmake_command(${object}-ClientStateless ${CMAKE_COMMAND} .)
+ run_cmake_command(${object}-ClientStateful ${CMAKE_COMMAND} .)
+endfunction()
+
+run_object(codemodel-v2)
+run_object(cache-v2)
+run_object(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/SharedStateless-check.cmake
new file mode 100644
index 000000000..7f3bb23dc
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/SharedStateless-check.cmake
@@ -0,0 +1,15 @@
+set(expect
+ query
+ query/__test-v1
+ query/__test-v2
+ query/__test-v3
+ query/query.json
+ query/unknown
+ reply
+ reply/__test-v1-[0-9a-f]+.json
+ reply/__test-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(SharedStateless)
diff --git a/Tests/RunCMake/FileAPI/SharedStateless-check.py b/Tests/RunCMake/FileAPI/SharedStateless-check.py
new file mode 100644
index 000000000..79f52d712
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/SharedStateless-check.py
@@ -0,0 +1,22 @@
+from check_index import *
+
+def check_reply(r):
+ assert is_dict(r)
+ assert sorted(r.keys()) == ["__test-v1", "__test-v2", "__test-v3", "query.json", "unknown"]
+ check_index__test(r["__test-v1"], 1, 3)
+ check_index__test(r["__test-v2"], 2, 0)
+ check_error(r["__test-v3"], "unknown query file")
+ check_error(r["query.json"], "unknown query file")
+ check_error(r["unknown"], "unknown query file")
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 2
+ check_index__test(o[0], 1, 3)
+ check_index__test(o[1], 2, 0)
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_cmake(index["cmake"])
+check_reply(index["reply"])
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake
new file mode 100644
index 000000000..b2804140e
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/SharedStateless-prep.cmake
@@ -0,0 +1,6 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v1" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v2" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/__test-v3" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/query.json" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/unknown" "")
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "")
diff --git a/Tests/RunCMake/FileAPI/SharedStateless.cmake b/Tests/RunCMake/FileAPI/SharedStateless.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/SharedStateless.cmake
diff --git a/Tests/RunCMake/FileAPI/Stale-check.cmake b/Tests/RunCMake/FileAPI/Stale-check.cmake
new file mode 100644
index 000000000..7ee2c9e7f
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Stale-check.cmake
@@ -0,0 +1,4 @@
+set(expect
+ reply
+ )
+check_api("^${expect}$")
diff --git a/Tests/RunCMake/FileAPI/Stale-prep.cmake b/Tests/RunCMake/FileAPI/Stale-prep.cmake
new file mode 100644
index 000000000..e920925f0
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Stale-prep.cmake
@@ -0,0 +1 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/object-to-be-deleted.json" "")
diff --git a/Tests/RunCMake/FileAPI/Stale.cmake b/Tests/RunCMake/FileAPI/Stale.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/Stale.cmake
diff --git a/Tests/RunCMake/FileAPI/alias/CMakeLists.txt b/Tests/RunCMake/FileAPI/alias/CMakeLists.txt
new file mode 100644
index 000000000..549307dfb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/alias/CMakeLists.txt
@@ -0,0 +1,10 @@
+project(Alias)
+enable_language(CXX)
+
+add_library(c_alias_lib ALIAS c_lib)
+add_executable(c_alias_exe ../empty.c)
+target_link_libraries(c_alias_exe PRIVATE c_alias_lib)
+
+add_library(cxx_alias_lib ALIAS cxx_lib)
+add_executable(cxx_alias_exe ../empty.cxx)
+target_link_libraries(cxx_alias_exe PRIVATE cxx_alias_lib)
diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake
new file mode 100644
index 000000000..0f5ef28a6
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/query.json
+ reply
+ reply/cache-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cache-v2)
diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake
new file mode 100644
index 000000000..9329280b1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateful-prep.cmake
@@ -0,0 +1,4 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[
+{ "requests": [ { "kind": "cache", "version" : 2 } ] }
+]])
diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake
new file mode 100644
index 000000000..c406ec81b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/cache-v2
+ reply
+ reply/cache-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cache-v2)
diff --git a/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake
new file mode 100644
index 000000000..dccafa545
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2-ClientStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/cache-v2" "")
diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake
new file mode 100644
index 000000000..f8337ebf5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-check.cmake
@@ -0,0 +1,10 @@
+set(expect
+ query
+ query/cache-v2
+ reply
+ reply/cache-v2-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cache-v2)
diff --git a/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake
new file mode 100644
index 000000000..ee5ac5762
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2-SharedStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/cache-v2" "")
diff --git a/Tests/RunCMake/FileAPI/cache-v2-check.py b/Tests/RunCMake/FileAPI/cache-v2-check.py
new file mode 100644
index 000000000..756ef8080
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2-check.py
@@ -0,0 +1,134 @@
+from check_index import *
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 1
+ check_index_object(o[0], "cache", 2, 0, check_object_cache)
+
+def check_cache_entry(actual, expected):
+ assert is_dict(actual)
+ assert sorted(actual.keys()) == ["name", "properties", "type", "value"]
+
+ assert is_string(actual["type"], expected["type"])
+ assert is_string(actual["value"], expected["value"])
+
+ def check_property(actual, expected):
+ assert is_dict(actual)
+ assert sorted(actual.keys()) == ["name", "value"]
+ assert is_string(actual["value"], expected["value"])
+
+ check_list_match(lambda a, e: is_string(a["name"], e["name"]), actual["properties"], expected["properties"], check=check_property)
+
+def check_object_cache(o):
+ assert sorted(o.keys()) == ["entries", "kind", "version"]
+ # The "kind" and "version" members are handled by check_index_object.
+ check_list_match(lambda a, e: is_string(a["name"], e["name"]), o["entries"], [
+ {
+ "name": "CM_OPTION_BOOL",
+ "type": "BOOL",
+ "value": "OFF",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing option()",
+ },
+ ],
+ },
+ {
+ "name": "CM_SET_BOOL",
+ "type": "BOOL",
+ "value": "ON",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing set(CACHE BOOL)",
+ },
+ {
+ "name": "ADVANCED",
+ "value": "1",
+ },
+ ],
+ },
+ {
+ "name": "CM_SET_FILEPATH",
+ "type": "FILEPATH",
+ "value": "dir1/dir2/empty.txt",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing set(CACHE FILEPATH)",
+ },
+ ],
+ },
+ {
+ "name": "CM_SET_PATH",
+ "type": "PATH",
+ "value": "dir1/dir2",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing set(CACHE PATH)",
+ },
+ {
+ "name": "ADVANCED",
+ "value": "ON",
+ },
+ ],
+ },
+ {
+ "name": "CM_SET_STRING",
+ "type": "STRING",
+ "value": "test",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing set(CACHE STRING)",
+ },
+ ],
+ },
+ {
+ "name": "CM_SET_STRINGS",
+ "type": "STRING",
+ "value": "1",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing set(CACHE STRING) with STRINGS",
+ },
+ {
+ "name": "STRINGS",
+ "value": "1;2;3;4",
+ },
+ ],
+ },
+ {
+ "name": "CM_SET_INTERNAL",
+ "type": "INTERNAL",
+ "value": "int2",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing set(CACHE INTERNAL)",
+ },
+ ],
+ },
+ {
+ "name": "CM_SET_TYPE",
+ "type": "STRING",
+ "value": "1",
+ "properties": [
+ {
+ "name": "HELPSTRING",
+ "value": "Testing set(CACHE INTERNAL) with set_property(TYPE)",
+ },
+ {
+ "name": "ADVANCED",
+ "value": "0",
+ },
+ ],
+ },
+ ], check=check_cache_entry, allow_extra=True)
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/cache-v2.cmake b/Tests/RunCMake/FileAPI/cache-v2.cmake
new file mode 100644
index 000000000..45b402de6
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cache-v2.cmake
@@ -0,0 +1,14 @@
+option(CM_OPTION_BOOL "Testing option()" "OFF")
+set(CM_SET_BOOL "ON" CACHE BOOL "Testing set(CACHE BOOL)")
+mark_as_advanced(CM_SET_BOOL)
+set(CM_SET_FILEPATH "dir1/dir2/empty.txt" CACHE FILEPATH "Testing set(CACHE FILEPATH)")
+set(CM_SET_PATH "dir1/dir2" CACHE PATH "Testing set(CACHE PATH)")
+set_property(CACHE CM_SET_PATH PROPERTY ADVANCED ON)
+set(CM_SET_STRING "test" CACHE STRING "Testing set(CACHE STRING)")
+set(CM_SET_STRINGS "1" CACHE STRING "Testing set(CACHE STRING) with STRINGS")
+set_property(CACHE CM_SET_STRINGS PROPERTY STRINGS "1;2;3;4")
+set(CM_SET_INTERNAL "int" CACHE INTERNAL "Testing set(CACHE INTERNAL)")
+set_property(CACHE CM_SET_INTERNAL PROPERTY VALUE "int2")
+set(CM_SET_TYPE "1" CACHE INTERNAL "Testing set(CACHE INTERNAL) with set_property(TYPE)")
+set_property(CACHE CM_SET_TYPE PROPERTY TYPE "STRING")
+set_property(CACHE CM_SET_TYPE PROPERTY ADVANCED "0")
diff --git a/Tests/RunCMake/FileAPI/check_index.py b/Tests/RunCMake/FileAPI/check_index.py
new file mode 100644
index 000000000..cda72341c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/check_index.py
@@ -0,0 +1,163 @@
+import sys
+import os
+import json
+import re
+
+if sys.version_info[0] >= 3:
+ unicode = str
+
+def is_bool(x, val=None):
+ return isinstance(x, bool) and (val is None or x == val)
+
+def is_dict(x):
+ return isinstance(x, dict)
+
+def is_list(x):
+ return isinstance(x, list)
+
+def is_int(x, val=None):
+ return (isinstance(x, int) or isinstance(x, long)) and (val is None or x == val)
+
+def is_string(x, val=None):
+ return (isinstance(x, str) or isinstance(x, unicode)) and (val is None or x == val)
+
+def matches(s, pattern):
+ return is_string(s) and bool(re.search(pattern, s))
+
+def check_list_match(match, actual, expected, check=None, check_exception=None, missing_exception=None, extra_exception=None, allow_extra=False):
+ """
+ Handle the common pattern of making sure every actual item "matches" some
+ item in the expected list, and that neither list has extra items after
+ matching is completed.
+
+ @param match: Callback to check if an actual item matches an expected
+ item. Return True if the item matches, return False if the item doesn't
+ match.
+ @param actual: List of actual items to search.
+ @param expected: List of expected items to match.
+ @param check: Optional function to check that the actual item is valid by
+ comparing it to the expected item.
+ @param check_exception: Optional function that returns an argument to
+ append to any exception thrown by the check function.
+ @param missing_exception: Optional function that returns an argument to
+ append to the exception thrown when an item is not found.
+ @param extra_exception: Optional function that returns an argument to
+ append to the exception thrown when an extra item is found.
+ @param allow_extra: Optional parameter allowing there to be extra actual
+ items after all the expected items have been found.
+ """
+ assert is_list(actual)
+ _actual = actual[:]
+ for expected_item in expected:
+ found = False
+ for i, actual_item in enumerate(_actual):
+ if match(actual_item, expected_item):
+ if check:
+ try:
+ check(actual_item, expected_item)
+ except BaseException as e:
+ if check_exception:
+ e.args += (check_exception(actual_item, expected_item),)
+ raise
+ found = True
+ del _actual[i]
+ break
+ if missing_exception:
+ assert found, missing_exception(expected_item)
+ else:
+ assert found
+ if not allow_extra:
+ if extra_exception:
+ assert len(_actual) == 0, [extra_exception(a) for a in _actual]
+ else:
+ assert len(_actual) == 0
+
+def filter_list(f, l):
+ if l is not None:
+ l = list(filter(f, l))
+ if l == []:
+ l = None
+ return l
+
+def check_cmake(cmake):
+ assert is_dict(cmake)
+ assert sorted(cmake.keys()) == ["generator", "paths", "version"]
+ check_cmake_version(cmake["version"])
+ check_cmake_paths(cmake["paths"])
+ check_cmake_generator(cmake["generator"])
+
+def check_cmake_version(v):
+ assert is_dict(v)
+ assert sorted(v.keys()) == ["isDirty", "major", "minor", "patch", "string", "suffix"]
+ assert is_string(v["string"])
+ assert is_int(v["major"])
+ assert is_int(v["minor"])
+ assert is_int(v["patch"])
+ assert is_string(v["suffix"])
+ assert is_bool(v["isDirty"])
+
+def check_cmake_paths(v):
+ assert is_dict(v)
+ assert sorted(v.keys()) == ["cmake", "cpack", "ctest", "root"]
+ assert is_string(v["cmake"])
+ assert is_string(v["cpack"])
+ assert is_string(v["ctest"])
+ assert is_string(v["root"])
+
+def check_cmake_generator(g):
+ assert is_dict(g)
+ name = g.get("name", None)
+ assert is_string(name)
+ if name.startswith("Visual Studio"):
+ assert sorted(g.keys()) == ["name", "platform"]
+ assert is_string(g["platform"])
+ else:
+ assert sorted(g.keys()) == ["name"]
+
+def check_index_object(indexEntry, kind, major, minor, check):
+ assert is_dict(indexEntry)
+ assert sorted(indexEntry.keys()) == ["jsonFile", "kind", "version"]
+ assert is_string(indexEntry["kind"])
+ assert indexEntry["kind"] == kind
+ assert is_dict(indexEntry["version"])
+ assert sorted(indexEntry["version"].keys()) == ["major", "minor"]
+ assert indexEntry["version"]["major"] == major
+ assert indexEntry["version"]["minor"] == minor
+ assert is_string(indexEntry["jsonFile"])
+ filepath = os.path.join(reply_dir, indexEntry["jsonFile"])
+ with open(filepath) as f:
+ object = json.load(f)
+ assert is_dict(object)
+ assert "kind" in object
+ assert is_string(object["kind"])
+ assert object["kind"] == kind
+ assert "version" in object
+ assert is_dict(object["version"])
+ assert sorted(object["version"].keys()) == ["major", "minor"]
+ assert object["version"]["major"] == major
+ assert object["version"]["minor"] == minor
+ if check:
+ check(object)
+
+def check_index__test(indexEntry, major, minor):
+ def check(object):
+ assert sorted(object.keys()) == ["kind", "version"]
+ check_index_object(indexEntry, "__test", major, minor, check)
+
+def check_error(value, error):
+ assert is_dict(value)
+ assert sorted(value.keys()) == ["error"]
+ assert is_string(value["error"])
+ assert value["error"] == error
+
+def check_error_re(value, error):
+ assert is_dict(value)
+ assert sorted(value.keys()) == ["error"]
+ assert is_string(value["error"])
+ assert re.search(error, value["error"])
+
+reply_index = sys.argv[1]
+reply_dir = os.path.dirname(reply_index)
+
+with open(reply_index) as f:
+ index = json.load(f)
diff --git a/Tests/RunCMake/FileAPI/check_index.pyc b/Tests/RunCMake/FileAPI/check_index.pyc
new file mode 100644
index 000000000..15193e2ef
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/check_index.pyc
Binary files differ
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake
new file mode 100644
index 000000000..21e931e7b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/query.json
+ reply
+ reply/cmakeFiles-v1-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake
new file mode 100644
index 000000000..7a726963e
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateful-prep.cmake
@@ -0,0 +1,4 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[
+{ "requests": [ { "kind": "cmakeFiles", "version" : 1 } ] }
+]])
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake
new file mode 100644
index 000000000..2ce2e79e4
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/cmakeFiles-v1
+ reply
+ reply/cmakeFiles-v1-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake
new file mode 100644
index 000000000..eb9649175
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-ClientStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/cmakeFiles-v1" "")
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake
new file mode 100644
index 000000000..6e3b49a5c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-check.cmake
@@ -0,0 +1,10 @@
+set(expect
+ query
+ query/cmakeFiles-v1
+ reply
+ reply/cmakeFiles-v1-[0-9a-f]+.json
+ reply/index-[0-9.T-]+.json
+ )
+check_api("^${expect}$")
+
+check_python(cmakeFiles-v1)
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake
new file mode 100644
index 000000000..8c8bdef1c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-SharedStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/cmakeFiles-v1" "")
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py b/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py
new file mode 100644
index 000000000..49dfe87ab
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1-check.py
@@ -0,0 +1,94 @@
+from check_index import *
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 1
+ check_index_object(o[0], "cmakeFiles", 1, 0, check_object_cmakeFiles)
+
+def check_input(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["path"]
+
+ if expected["isGenerated"] is not None:
+ expected_keys.append("isGenerated")
+ assert is_bool(actual["isGenerated"], expected["isGenerated"])
+
+ if expected["isExternal"] is not None:
+ expected_keys.append("isExternal")
+ assert is_bool(actual["isExternal"], expected["isExternal"])
+
+ if expected["isCMake"] is not None:
+ expected_keys.append("isCMake")
+ assert is_bool(actual["isCMake"], expected["isCMake"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+def check_object_cmakeFiles(o):
+ assert sorted(o.keys()) == ["inputs", "kind", "paths", "version"]
+ # The "kind" and "version" members are handled by check_index_object.
+ assert is_dict(o["paths"])
+ assert sorted(o["paths"].keys()) == ["build", "source"]
+ assert matches(o["paths"]["build"], "^.*/Tests/RunCMake/FileAPI/cmakeFiles-v1-build$")
+ assert matches(o["paths"]["source"], "^.*/Tests/RunCMake/FileAPI$")
+
+ expected = [
+ {
+ "path": "^CMakeLists\\.txt$",
+ "isGenerated": None,
+ "isExternal": None,
+ "isCMake": None,
+ },
+ {
+ "path": "^cmakeFiles-v1\\.cmake$",
+ "isGenerated": None,
+ "isExternal": None,
+ "isCMake": None,
+ },
+ {
+ "path": "^dir/CMakeLists\\.txt$",
+ "isGenerated": None,
+ "isExternal": None,
+ "isCMake": None,
+ },
+ {
+ "path": "^dir/dir/CMakeLists\\.txt$",
+ "isGenerated": None,
+ "isExternal": None,
+ "isCMake": None,
+ },
+ {
+ "path": "^dir/dirtest\\.cmake$",
+ "isGenerated": None,
+ "isExternal": None,
+ "isCMake": None,
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPIDummyFile\\.cmake$",
+ "isGenerated": None,
+ "isExternal": True,
+ "isCMake": None,
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/cmakeFiles-v1-build/generated\\.cmake",
+ "isGenerated": True,
+ "isExternal": None,
+ "isCMake": None,
+ },
+ {
+ "path": "^.*/Modules/CMakeParseArguments\\.cmake$",
+ "isGenerated": None,
+ "isExternal": True,
+ "isCMake": True,
+ },
+ ]
+
+ inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"]
+ if inSource:
+ for e in expected:
+ e["path"] = e["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1)
+
+ check_list_match(lambda a, e: matches(a["path"], e["path"]), o["inputs"], expected, check=check_input, allow_extra=True)
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake
new file mode 100644
index 000000000..4d4d757c7
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cmakeFiles-v1.cmake
@@ -0,0 +1,8 @@
+include("${CMAKE_CURRENT_LIST_DIR}/dir/dirtest.cmake")
+include(CMakeParseArguments)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cmake" "")
+include("${CMAKE_CURRENT_BINARY_DIR}/generated.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/../FileAPIDummyFile.cmake")
+
+add_subdirectory(dir)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake
new file mode 100644
index 000000000..fb78e8789
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-check.cmake
@@ -0,0 +1,12 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/query.json
+ reply
+ reply/codemodel-v2-[0-9a-f]+\\.json
+ reply/index-[0-9.T-]+\\.json
+ .*
+ )
+check_api("^${expect}$")
+
+check_python(codemodel-v2)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake
new file mode 100644
index 000000000..e2b38ff57
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateful-prep.cmake
@@ -0,0 +1,4 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[
+{ "requests": [ { "kind": "codemodel", "version" : 2 } ] }
+]])
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake
new file mode 100644
index 000000000..7c6a35ab5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-check.cmake
@@ -0,0 +1,12 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/codemodel-v2
+ reply
+ reply/codemodel-v2-[0-9a-f]+\\.json
+ reply/index-[0-9.T-]+\\.json
+ .*
+ )
+check_api("^${expect}$")
+
+check_python(codemodel-v2)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake
new file mode 100644
index 000000000..d1ce2929e
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-ClientStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/codemodel-v2" "")
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake
new file mode 100644
index 000000000..cc2f31b94
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/codemodel-v2
+ reply
+ reply/codemodel-v2-[0-9a-f]+\\.json
+ reply/index-[0-9.T-]+\\.json
+ .*
+ )
+check_api("^${expect}$")
+
+check_python(codemodel-v2)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake
new file mode 100644
index 000000000..8a519d5cb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-SharedStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/codemodel-v2" "")
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
new file mode 100644
index 000000000..18b934755
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -0,0 +1,5085 @@
+from check_index import *
+
+import sys
+import os
+
+def check_objects(o, g):
+ assert is_list(o)
+ assert len(o) == 1
+ check_index_object(o[0], "codemodel", 2, 0, check_object_codemodel(g))
+
+def check_backtrace(t, b, backtrace):
+ btg = t["backtraceGraph"]
+ for expected in backtrace:
+ assert is_int(b)
+ node = btg["nodes"][b]
+ expected_keys = ["file"]
+ assert matches(btg["files"][node["file"]], expected["file"])
+
+ if expected["line"] is not None:
+ expected_keys.append("line")
+ assert is_int(node["line"], expected["line"])
+
+ if expected["command"] is not None:
+ expected_keys.append("command")
+ assert is_int(node["command"])
+ assert is_string(btg["commands"][node["command"]], expected["command"])
+
+ if expected["hasParent"]:
+ expected_keys.append("parent")
+ assert is_int(node["parent"])
+ b = node["parent"]
+ else:
+ b = None
+
+ assert sorted(node.keys()) == sorted(expected_keys)
+
+ assert b is None
+
+def check_directory(c):
+ def _check(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["build", "source", "projectIndex"]
+ assert matches(actual["build"], expected["build"])
+
+ assert is_int(actual["projectIndex"])
+ assert is_string(c["projects"][actual["projectIndex"]]["name"], expected["projectName"])
+
+ if expected["parentSource"] is not None:
+ expected_keys.append("parentIndex")
+ assert is_int(actual["parentIndex"])
+ assert matches(c["directories"][actual["parentIndex"]]["source"], expected["parentSource"])
+
+ if expected["childSources"] is not None:
+ expected_keys.append("childIndexes")
+ check_list_match(lambda a, e: matches(c["directories"][a]["source"], e),
+ actual["childIndexes"], expected["childSources"],
+ missing_exception=lambda e: "Child source: %s" % e,
+ extra_exception=lambda a: "Child source: %s" % a["source"])
+
+ if expected["targetIds"] is not None:
+ expected_keys.append("targetIndexes")
+ check_list_match(lambda a, e: matches(c["targets"][a]["id"], e),
+ actual["targetIndexes"], expected["targetIds"],
+ missing_exception=lambda e: "Target ID: %s" % e,
+ extra_exception=lambda a: "Target ID: %s" % c["targets"][a]["id"])
+
+ if expected["minimumCMakeVersion"] is not None:
+ expected_keys.append("minimumCMakeVersion")
+ assert is_dict(actual["minimumCMakeVersion"])
+ assert sorted(actual["minimumCMakeVersion"].keys()) == ["string"]
+ assert is_string(actual["minimumCMakeVersion"]["string"], expected["minimumCMakeVersion"])
+
+ if expected["hasInstallRule"] is not None:
+ expected_keys.append("hasInstallRule")
+ assert is_bool(actual["hasInstallRule"], expected["hasInstallRule"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ return _check
+
+def check_target_backtrace_graph(t):
+ btg = t["backtraceGraph"]
+ assert is_dict(btg)
+ assert sorted(btg.keys()) == ["commands", "files", "nodes"]
+ assert is_list(btg["commands"])
+
+ for c in btg["commands"]:
+ assert is_string(c)
+
+ for f in btg["files"]:
+ assert is_string(f)
+
+ for n in btg["nodes"]:
+ expected_keys = ["file"]
+ assert is_dict(n)
+ assert is_int(n["file"])
+ assert 0 <= n["file"] < len(btg["files"])
+
+ if "line" in n:
+ expected_keys.append("line")
+ assert is_int(n["line"])
+
+ if "command" in n:
+ expected_keys.append("command")
+ assert is_int(n["command"])
+ assert 0 <= n["command"] < len(btg["commands"])
+
+ if "parent" in n:
+ expected_keys.append("parent")
+ assert is_int(n["parent"])
+ assert 0 <= n["parent"] < len(btg["nodes"])
+
+ assert sorted(n.keys()) == sorted(expected_keys)
+
+def check_target(c):
+ def _check(actual, expected):
+ assert is_dict(actual)
+ assert sorted(actual.keys()) == ["directoryIndex", "id", "jsonFile", "name", "projectIndex"]
+ assert is_int(actual["directoryIndex"])
+ assert matches(c["directories"][actual["directoryIndex"]]["source"], expected["directorySource"])
+ assert is_string(actual["name"], expected["name"])
+ assert is_string(actual["jsonFile"])
+ assert is_int(actual["projectIndex"])
+ assert is_string(c["projects"][actual["projectIndex"]]["name"], expected["projectName"])
+
+ filepath = os.path.join(reply_dir, actual["jsonFile"])
+ with open(filepath) as f:
+ obj = json.load(f)
+
+ expected_keys = ["name", "id", "type", "backtraceGraph", "paths", "sources"]
+ assert is_dict(obj)
+ assert is_string(obj["name"], expected["name"])
+ assert matches(obj["id"], expected["id"])
+ assert is_string(obj["type"], expected["type"])
+ check_target_backtrace_graph(obj)
+
+ assert is_dict(obj["paths"])
+ assert sorted(obj["paths"].keys()) == ["build", "source"]
+ assert matches(obj["paths"]["build"], expected["build"])
+ assert matches(obj["paths"]["source"], expected["source"])
+
+ def check_source(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["path"]
+
+ if expected["compileGroupLanguage"] is not None:
+ expected_keys.append("compileGroupIndex")
+ assert is_string(obj["compileGroups"][actual["compileGroupIndex"]]["language"], expected["compileGroupLanguage"])
+
+ if expected["sourceGroupName"] is not None:
+ expected_keys.append("sourceGroupIndex")
+ assert is_string(obj["sourceGroups"][actual["sourceGroupIndex"]]["name"], expected["sourceGroupName"])
+
+ if expected["isGenerated"] is not None:
+ expected_keys.append("isGenerated")
+ assert is_bool(actual["isGenerated"], expected["isGenerated"])
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: matches(a["path"], e["path"]), obj["sources"],
+ expected["sources"], check=check_source,
+ check_exception=lambda a, e: "Source file: %s" % a["path"],
+ missing_exception=lambda e: "Source file: %s" % e["path"],
+ extra_exception=lambda a: "Source file: %s" % a["path"])
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ check_backtrace(obj, obj["backtrace"], expected["backtrace"])
+
+ if expected["folder"] is not None:
+ expected_keys.append("folder")
+ assert is_dict(obj["folder"])
+ assert sorted(obj["folder"].keys()) == ["name"]
+ assert is_string(obj["folder"]["name"], expected["folder"])
+
+ if expected["nameOnDisk"] is not None:
+ expected_keys.append("nameOnDisk")
+ assert matches(obj["nameOnDisk"], expected["nameOnDisk"])
+
+ if expected["artifacts"] is not None:
+ expected_keys.append("artifacts")
+
+ def check_artifact(actual, expected):
+ assert is_dict(actual)
+ assert sorted(actual.keys()) == ["path"]
+
+ check_list_match(lambda a, e: matches(a["path"], e["path"]),
+ obj["artifacts"], expected["artifacts"],
+ check=check_artifact,
+ check_exception=lambda a, e: "Artifact: %s" % a["path"],
+ missing_exception=lambda e: "Artifact: %s" % e["path"],
+ extra_exception=lambda a: "Artifact: %s" % a["path"])
+
+ if expected["isGeneratorProvided"] is not None:
+ expected_keys.append("isGeneratorProvided")
+ assert is_bool(obj["isGeneratorProvided"], expected["isGeneratorProvided"])
+
+ if expected["install"] is not None:
+ expected_keys.append("install")
+ assert is_dict(obj["install"])
+ assert sorted(obj["install"].keys()) == ["destinations", "prefix"]
+
+ assert is_dict(obj["install"]["prefix"])
+ assert sorted(obj["install"]["prefix"].keys()) == ["path"]
+ assert matches(obj["install"]["prefix"]["path"], expected["install"]["prefix"])
+
+ def check_install_destination(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["path"]
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: matches(a["path"], e["path"]),
+ obj["install"]["destinations"], expected["install"]["destinations"],
+ check=check_install_destination,
+ check_exception=lambda a, e: "Install path: %s" % a["path"],
+ missing_exception=lambda e: "Install path: %s" % e["path"],
+ extra_exception=lambda a: "Install path: %s" % a["path"])
+
+ if expected["link"] is not None:
+ expected_keys.append("link")
+ assert is_dict(obj["link"])
+ link_keys = ["language"]
+
+ assert is_string(obj["link"]["language"], expected["link"]["language"])
+
+ # FIXME: Properly test commandFragments
+ if "commandFragments" in obj["link"]:
+ link_keys.append("commandFragments")
+ assert is_list(obj["link"]["commandFragments"])
+ for f in obj["link"]["commandFragments"]:
+ assert is_dict(f)
+ assert sorted(f.keys()) == ["fragment", "role"]
+ assert is_string(f["fragment"])
+ assert is_string(f["role"])
+ assert f["role"] in ("flags", "libraries", "libraryPath", "frameworkPath")
+
+ if expected["link"]["lto"] is not None:
+ link_keys.append("lto")
+ assert is_bool(obj["link"]["lto"], expected["link"]["lto"])
+
+ # FIXME: Properly test sysroot
+ if "sysroot" in obj["link"]:
+ link_keys.append("sysroot")
+ assert is_string(obj["link"]["sysroot"])
+
+ assert sorted(obj["link"].keys()) == sorted(link_keys)
+
+ if expected["archive"] is not None:
+ expected_keys.append("archive")
+ assert is_dict(obj["archive"])
+ archive_keys = []
+
+ # FIXME: Properly test commandFragments
+ if "commandFragments" in obj["archive"]:
+ archive_keys.append("commandFragments")
+ assert is_list(obj["archive"]["commandFragments"])
+ for f in obj["archive"]["commandFragments"]:
+ assert is_dict(f)
+ assert sorted(f.keys()) == ["fragment", "role"]
+ assert is_string(f["fragment"])
+ assert is_string(f["role"])
+ assert f["role"] in ("flags")
+
+ if expected["archive"]["lto"] is not None:
+ archive_keys.append("lto")
+ assert is_bool(obj["archive"]["lto"], expected["archive"]["lto"])
+
+ assert sorted(obj["archive"].keys()) == sorted(archive_keys)
+
+ if expected["dependencies"] is not None:
+ expected_keys.append("dependencies")
+
+ def check_dependency(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["id"]
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: matches(a["id"], e["id"]),
+ obj["dependencies"], expected["dependencies"],
+ check=check_dependency,
+ check_exception=lambda a, e: "Dependency ID: %s" % a["id"],
+ missing_exception=lambda e: "Dependency ID: %s" % e["id"],
+ extra_exception=lambda a: "Dependency ID: %s" % a["id"])
+
+ if expected["sourceGroups"] is not None:
+ expected_keys.append("sourceGroups")
+
+ def check_source_group(actual, expected):
+ assert is_dict(actual)
+ assert sorted(actual.keys()) == ["name", "sourceIndexes"]
+
+ check_list_match(lambda a, e: matches(obj["sources"][a]["path"], e),
+ actual["sourceIndexes"], expected["sourcePaths"],
+ missing_exception=lambda e: "Source path: %s" % e,
+ extra_exception=lambda a: "Source path: %s" % obj["sources"][a]["path"])
+
+ check_list_match(lambda a, e: is_string(a["name"], e["name"]),
+ obj["sourceGroups"], expected["sourceGroups"],
+ check=check_source_group,
+ check_exception=lambda a, e: "Source group: %s" % a["name"],
+ missing_exception=lambda e: "Source group: %s" % e["name"],
+ extra_exception=lambda a: "Source group: %s" % a["name"])
+
+ if expected["compileGroups"] is not None:
+ expected_keys.append("compileGroups")
+
+ def check_compile_group(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["sourceIndexes", "language"]
+
+ check_list_match(lambda a, e: matches(obj["sources"][a]["path"], e),
+ actual["sourceIndexes"], expected["sourcePaths"],
+ missing_exception=lambda e: "Source path: %s" % e,
+ extra_exception=lambda a: "Source path: %s" % obj["sources"][a]["path"])
+
+ # FIXME: Properly test compileCommandFragments
+ if "compileCommandFragments" in actual:
+ expected_keys.append("compileCommandFragments")
+ assert is_list(actual["compileCommandFragments"])
+ for f in actual["compileCommandFragments"]:
+ assert is_dict(f)
+ assert sorted(f.keys()) == ["fragment"]
+ assert is_string(f["fragment"])
+
+ if expected["includes"] is not None:
+ expected_keys.append("includes")
+
+ def check_include(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["path"]
+
+ if expected["isSystem"] is not None:
+ expected_keys.append("isSystem")
+ assert is_bool(actual["isSystem"], expected["isSystem"])
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: matches(a["path"], e["path"]),
+ actual["includes"], expected["includes"],
+ check=check_include,
+ check_exception=lambda a, e: "Include path: %s" % a["path"],
+ missing_exception=lambda e: "Include path: %s" % e["path"],
+ extra_exception=lambda a: "Include path: %s" % a["path"])
+
+ if expected["defines"] is not None:
+ expected_keys.append("defines")
+
+ def check_define(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["define"]
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: is_string(a["define"], e["define"]),
+ actual["defines"], expected["defines"],
+ check=check_define,
+ check_exception=lambda a, e: "Define: %s" % a["define"],
+ missing_exception=lambda e: "Define: %s" % e["define"],
+ extra_exception=lambda a: "Define: %s" % a["define"])
+
+ # FIXME: Properly test sysroot
+ if "sysroot" in actual:
+ expected_keys.append("sysroot")
+ assert is_string(actual["sysroot"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: is_string(a["language"], e["language"]),
+ obj["compileGroups"], expected["compileGroups"],
+ check=check_compile_group,
+ check_exception=lambda a, e: "Compile group: %s" % a["language"],
+ missing_exception=lambda e: "Compile group: %s" % e["language"],
+ extra_exception=lambda a: "Compile group: %s" % a["language"])
+
+ assert sorted(obj.keys()) == sorted(expected_keys)
+
+ return _check
+
+def check_project(c):
+ def _check(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["name", "directoryIndexes"]
+
+ check_list_match(lambda a, e: matches(c["directories"][a]["source"], e),
+ actual["directoryIndexes"], expected["directorySources"],
+ missing_exception=lambda e: "Directory source: %s" % e,
+ extra_exception=lambda a: "Directory source: %s" % c["directories"][a]["source"])
+
+ if expected["parentName"] is not None:
+ expected_keys.append("parentIndex")
+ assert is_int(actual["parentIndex"])
+ assert is_string(c["projects"][actual["parentIndex"]]["name"], expected["parentName"])
+
+ if expected["childNames"] is not None:
+ expected_keys.append("childIndexes")
+ check_list_match(lambda a, e: is_string(c["projects"][a]["name"], e),
+ actual["childIndexes"], expected["childNames"],
+ missing_exception=lambda e: "Child name: %s" % e,
+ extra_exception=lambda a: "Child name: %s" % c["projects"][a]["name"])
+
+ if expected["targetIds"] is not None:
+ expected_keys.append("targetIndexes")
+ check_list_match(lambda a, e: matches(c["targets"][a]["id"], e),
+ actual["targetIndexes"], expected["targetIds"],
+ missing_exception=lambda e: "Target ID: %s" % e,
+ extra_exception=lambda a: "Target ID: %s" % c["targets"][a]["id"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ return _check
+
+def gen_check_directories(c, g):
+ expected = [
+ {
+ "source": "^\\.$",
+ "build": "^\\.$",
+ "parentSource": None,
+ "childSources": [
+ "^alias$",
+ "^custom$",
+ "^cxx$",
+ "^imported$",
+ "^object$",
+ "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "^dir$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@6890427a1f51a3e7e1df$",
+ "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "^c_exe::@6890427a1f51a3e7e1df$",
+ "^c_lib::@6890427a1f51a3e7e1df$",
+ "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "^interface_exe::@6890427a1f51a3e7e1df$",
+ ],
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": True,
+ },
+ {
+ "source": "^alias$",
+ "build": "^alias$",
+ "parentSource": "^\\.$",
+ "childSources": None,
+ "targetIds": [
+ "^ALL_BUILD::@53632cba2752272bb008$",
+ "^ZERO_CHECK::@53632cba2752272bb008$",
+ "^c_alias_exe::@53632cba2752272bb008$",
+ "^cxx_alias_exe::@53632cba2752272bb008$",
+ ],
+ "projectName": "Alias",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": None,
+ },
+ {
+ "source": "^custom$",
+ "build": "^custom$",
+ "parentSource": "^\\.$",
+ "childSources": None,
+ "targetIds": [
+ "^ALL_BUILD::@c11385ffed57b860da63$",
+ "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "^custom_exe::@c11385ffed57b860da63$",
+ "^custom_tgt::@c11385ffed57b860da63$",
+ ],
+ "projectName": "Custom",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": None,
+ },
+ {
+ "source": "^cxx$",
+ "build": "^cxx$",
+ "parentSource": "^\\.$",
+ "childSources": None,
+ "targetIds": [
+ "^ALL_BUILD::@a56b12a3f5c0529fb296$",
+ "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ ],
+ "projectName": "Cxx",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": None,
+ },
+ {
+ "source": "^imported$",
+ "build": "^imported$",
+ "parentSource": "^\\.$",
+ "childSources": None,
+ "targetIds": [
+ "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
+ "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ ],
+ "projectName": "Imported",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": None,
+ },
+ {
+ "source": "^object$",
+ "build": "^object$",
+ "parentSource": "^\\.$",
+ "childSources": None,
+ "targetIds": [
+ "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
+ "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ ],
+ "projectName": "Object",
+ "minimumCMakeVersion": "3.13",
+ "hasInstallRule": True,
+ },
+ {
+ "source": "^dir$",
+ "build": "^dir$",
+ "parentSource": "^\\.$",
+ "childSources": [
+ "^dir/dir$",
+ ],
+ "targetIds": None,
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": None,
+ },
+ {
+ "source": "^dir/dir$",
+ "build": "^dir/dir$",
+ "parentSource": "^dir$",
+ "childSources": None,
+ "targetIds": None,
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": None,
+ },
+ {
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "parentSource": "^\\.$",
+ "childSources": None,
+ "targetIds": [
+ "^ALL_BUILD::@[0-9a-f]+$",
+ "^ZERO_CHECK::@[0-9a-f]+$",
+ "^generated_exe::@[0-9a-f]+$",
+ ],
+ "projectName": "External",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": None,
+ },
+ ]
+
+ if matches(g, "^Visual Studio "):
+ for e in expected:
+ if e["parentSource"] is not None:
+ e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"])
+
+ elif g == "Xcode":
+ if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
+ for e in expected:
+ e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"])
+
+ else:
+ for e in expected:
+ e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(ALL_BUILD|ZERO_CHECK)"), e["targetIds"])
+
+ return expected
+
+def check_directories(c, g):
+ check_list_match(lambda a, e: matches(a["source"], e["source"]), c["directories"], gen_check_directories(c, g),
+ check=check_directory(c),
+ check_exception=lambda a, e: "Directory source: %s" % a["source"],
+ missing_exception=lambda e: "Directory source: %s" % e["source"],
+ extra_exception=lambda a: "Directory source: %s" % a["source"])
+
+def gen_check_targets(c, g, inSource):
+ expected = [
+ {
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^interface_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_alias_exe::@53632cba2752272bb008$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^custom_exe::@c11385ffed57b860da63$",
+ "backtrace": None,
+ },
+ {
+ "id": "^generated_exe::@[0-9a-f]+$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": None,
+ },
+ {
+ "name": "interface_exe",
+ "id": "^interface_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^include_test\\.cmake$",
+ "line": 3,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^include_test\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": [
+ {
+ "define": "interface_exe_EXPORTS",
+ "backtrace": None,
+ },
+ ],
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^include_test\\.cmake$",
+ "line": 3,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^include_test\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^my_interface_exe\\.myexe$",
+ "artifacts": [
+ {
+ "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.myexe$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$",
+ "_dllExtra": True,
+ },
+ {
+ "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "c_lib",
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^(lib)?c_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$",
+ "_dllExtra": False,
+ },
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": None,
+ "archive": {
+ "lto": None,
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "c_exe",
+ "id": "^c_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^c_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 7,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "c_shared_lib",
+ "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "SHARED_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": [
+ {
+ "define": "c_shared_lib_EXPORTS",
+ "backtrace": None,
+ },
+ ],
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$",
+ "artifacts": [
+ {
+ "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$",
+ "_dllExtra": True,
+ },
+ {
+ "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": True,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "c_shared_exe",
+ "id": "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^c_shared_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": True,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 11,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "c_static_lib",
+ "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$",
+ "_dllExtra": False,
+ },
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": None,
+ "archive": {
+ "lto": True,
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "c_static_exe",
+ "id": "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^c_static_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 15,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": None,
+ "command": None,
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": True,
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": None,
+ },
+ {
+ "name": "cxx_lib",
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$",
+ "_dllExtra": False,
+ },
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": None,
+ "archive": {
+ "lto": None,
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_exe",
+ "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": "bin",
+ "nameOnDisk": "^cxx_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": {
+ "language": "CXX",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_shared_lib",
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "SHARED_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": [
+ {
+ "define": "cxx_shared_lib_EXPORTS",
+ "backtrace": None,
+ },
+ ],
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$",
+ "_dllExtra": True,
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": {
+ "language": "CXX",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_shared_exe",
+ "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^cxx_shared_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": {
+ "language": "CXX",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_static_lib",
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$",
+ "_dllExtra": False,
+ },
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": None,
+ "archive": {
+ "lto": None,
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_static_exe",
+ "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^cxx_static_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": None,
+ "link": {
+ "language": "CXX",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 15,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_alias_exe::@53632cba2752272bb008$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": None,
+ },
+ {
+ "name": "c_alias_exe",
+ "id": "^c_alias_exe::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^c_alias_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_alias_exe",
+ "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^cxx_alias_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": None,
+ "link": {
+ "language": "CXX",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^object$",
+ "source": "^object$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ {
+ "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^object$",
+ "source": "^object$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": None,
+ },
+ {
+ "name": "c_object_lib",
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "OBJECT_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": [
+ {
+ "path": "^object/.*/empty(\\.c)?\\.o(bj)?$",
+ "_dllExtra": False,
+ },
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "c_object_exe",
+ "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$",
+ "isGenerated": True,
+ "sourceGroupName": "Object Libraries",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 7,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ {
+ "name": "Object Libraries",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^c_object_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "bin",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "install",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ },
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ # FIXME: Add a backtrace here when it becomes available.
+ # You'll know when it's available, because this test will
+ # fail.
+ "backtrace": None,
+ },
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_object_lib",
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "OBJECT_LIBRARY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": [
+ {
+ "path": "^object/.*/empty(\\.cxx)?\\.o(bj)?$",
+ "_dllExtra": False,
+ },
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "cxx_object_exe",
+ "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$",
+ "isGenerated": True,
+ "sourceGroupName": "Object Libraries",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ },
+ {
+ "name": "Object Libraries",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^cxx_object_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "bin",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "install",
+ "hasParent": True,
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ },
+ "link": {
+ "language": "CXX",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ # FIXME: Add a backtrace here when it becomes available.
+ # You'll know when it's available, because this test will
+ # fail.
+ "backtrace": None,
+ },
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ {
+ "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": None,
+ },
+ {
+ "name": "link_imported_exe",
+ "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^link_imported_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "link_imported_shared_exe",
+ "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^link_imported_shared_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "link_imported_static_exe",
+ "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^link_imported_static_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "link_imported_object_exe",
+ "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 18,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 18,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^link_imported_object_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "link_imported_interface_exe",
+ "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 23,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 23,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^link_imported_interface_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "backtrace": None,
+ },
+ {
+ "id": "^custom_exe::@c11385ffed57b860da63$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": None,
+ },
+ {
+ "name": "custom_tgt",
+ "id": "^custom_tgt::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "UTILITY",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_custom_target",
+ "hasParent": True,
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_custom_target",
+ "hasParent": True,
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "custom_exe",
+ "id": "^custom_exe::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$",
+ ],
+ "includes": None,
+ "defines": None,
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^custom_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": None,
+ "link": {
+ "language": "C",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^custom_tgt::@c11385ffed57b860da63$",
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_dependencies",
+ "hasParent": True,
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@[0-9a-f]+$",
+ "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "projectName": "External",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@[0-9a-f]+$",
+ "backtrace": None,
+ },
+ {
+ "id": "^generated_exe::@[0-9a-f]+$",
+ "backtrace": None,
+ },
+ ],
+ },
+ {
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@[0-9a-f]+$",
+ "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "projectName": "External",
+ "type": "UTILITY",
+ "isGeneratorProvided": True,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": True,
+ "sourceGroupName": "",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$",
+ ],
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$",
+ ],
+ },
+ ],
+ "compileGroups": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": None,
+ "artifacts": None,
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "install": None,
+ "link": None,
+ "archive": None,
+ "dependencies": None,
+ },
+ {
+ "name": "generated_exe",
+ "id": "^generated_exe::@[0-9a-f]+$",
+ "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "projectName": "External",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": None,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
+ "isGenerated": None,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
+ "isGenerated": True,
+ "sourceGroupName": "Generated Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_sources",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
+ ],
+ },
+ {
+ "name": "Generated Source Files",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
+ ],
+ },
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
+ ],
+ "includes": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "isSystem": None,
+ "backtrace": None,
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "isSystem": True,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_include_directories",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "defines": [
+ {
+ "define": "EMPTY_C=1",
+ "backtrace": None,
+ },
+ {
+ "define": "SRC_DUMMY",
+ "backtrace": None,
+ },
+ {
+ "define": "GENERATED_EXE=1",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "define": "TGT_DUMMY",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ },
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
+ ],
+ "includes": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "isSystem": True,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_include_directories",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ "defines": [
+ {
+ "define": "GENERATED_EXE=1",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "define": "TGT_DUMMY",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
+ },
+ ],
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ "folder": None,
+ "nameOnDisk": "^generated_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe(\\.exe)?$",
+ "_dllExtra": False,
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe\\.pdb$",
+ "_dllExtra": True,
+ },
+ ],
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "install": None,
+ "link": {
+ "language": "CXX",
+ "lto": None,
+ },
+ "archive": None,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@[0-9a-f]+$",
+ "backtrace": None,
+ },
+ ],
+ },
+ ]
+
+ if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")):
+ for e in expected:
+ try:
+ e["link"]["lto"] = None
+ except TypeError: # "link" is not a dict, no problem.
+ pass
+ try:
+ e["archive"]["lto"] = None
+ except TypeError: # "archive" is not a dict, no problem.
+ pass
+
+ if inSource:
+ for e in expected:
+ if e["sources"] is not None:
+ for s in e["sources"]:
+ s["path"] = s["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1)
+ if e["sourceGroups"] is not None:
+ for g in e["sourceGroups"]:
+ g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]]
+ if e["compileGroups"] is not None:
+ for g in e["compileGroups"]:
+ g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]]
+
+ if matches(g, "^Visual Studio "):
+ expected = filter_list(lambda e: e["name"] not in ("ZERO_CHECK") or e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$", expected)
+ for e in expected:
+ if e["type"] == "UTILITY":
+ if e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$":
+ e["sources"] = [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$",
+ "isGenerated": True,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": None,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ]
+ e["sourceGroups"] = [
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/([0-9a-f]+/)?generate\\.stamp\\.rule$",
+ ],
+ },
+ ]
+ elif e["name"] in ("ALL_BUILD"):
+ e["sources"] = []
+ e["sourceGroups"] = None
+ if e["dependencies"] is not None:
+ for d in e["dependencies"]:
+ if matches(d["id"], "^\\^ZERO_CHECK::@"):
+ d["id"] = "^ZERO_CHECK::@6890427a1f51a3e7e1df$"
+
+ elif g == "Xcode":
+ if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
+ expected = filter_list(lambda e: e["name"] not in ("link_imported_object_exe"), expected)
+ for e in expected:
+ e["dependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^link_imported_object_exe::@"), e["dependencies"])
+ if e["name"] in ("c_object_lib", "cxx_object_lib"):
+ e["artifacts"] = None
+
+ else:
+ for e in expected:
+ e["dependencies"] = filter_list(lambda d: not matches(d["id"], "^\\^ZERO_CHECK::@"), e["dependencies"])
+
+ expected = filter_list(lambda t: t["name"] not in ("ALL_BUILD", "ZERO_CHECK"), expected)
+
+ if sys.platform not in ("win32", "cygwin", "msys"):
+ for e in expected:
+ e["artifacts"] = filter_list(lambda a: not a["_dllExtra"], e["artifacts"])
+
+ return expected
+
+def check_targets(c, g, inSource):
+ check_list_match(lambda a, e: matches(a["id"], e["id"]),
+ c["targets"], gen_check_targets(c, g, inSource),
+ check=check_target(c),
+ check_exception=lambda a, e: "Target ID: %s" % a["id"],
+ missing_exception=lambda e: "Target ID: %s" % e["id"],
+ extra_exception=lambda a: "Target ID: %s" % a["id"])
+
+def gen_check_projects(c, g):
+ expected = [
+ {
+ "name": "codemodel-v2",
+ "parentName": None,
+ "childNames": [
+ "Alias",
+ "Custom",
+ "Cxx",
+ "Imported",
+ "Object",
+ "External",
+ ],
+ "directorySources": [
+ "^\\.$",
+ "^dir$",
+ "^dir/dir$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@6890427a1f51a3e7e1df$",
+ "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "^interface_exe::@6890427a1f51a3e7e1df$",
+ "^c_lib::@6890427a1f51a3e7e1df$",
+ "^c_exe::@6890427a1f51a3e7e1df$",
+ "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "^c_static_exe::@6890427a1f51a3e7e1df$",
+ ],
+ },
+ {
+ "name": "Cxx",
+ "parentName": "codemodel-v2",
+ "childNames": None,
+ "directorySources": [
+ "^cxx$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@a56b12a3f5c0529fb296$",
+ "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ ],
+ },
+ {
+ "name": "Alias",
+ "parentName": "codemodel-v2",
+ "childNames": None,
+ "directorySources": [
+ "^alias$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@53632cba2752272bb008$",
+ "^ZERO_CHECK::@53632cba2752272bb008$",
+ "^c_alias_exe::@53632cba2752272bb008$",
+ "^cxx_alias_exe::@53632cba2752272bb008$",
+ ],
+ },
+ {
+ "name": "Object",
+ "parentName": "codemodel-v2",
+ "childNames": None,
+ "directorySources": [
+ "^object$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
+ "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ ],
+ },
+ {
+ "name": "Imported",
+ "parentName": "codemodel-v2",
+ "childNames": None,
+ "directorySources": [
+ "^imported$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
+ "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ ],
+ },
+ {
+ "name": "Custom",
+ "parentName": "codemodel-v2",
+ "childNames": None,
+ "directorySources": [
+ "^custom$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@c11385ffed57b860da63$",
+ "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "^custom_tgt::@c11385ffed57b860da63$",
+ "^custom_exe::@c11385ffed57b860da63$",
+ ],
+ },
+ {
+ "name": "External",
+ "parentName": "codemodel-v2",
+ "childNames": None,
+ "directorySources": [
+ "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@[0-9a-f]+$",
+ "^ZERO_CHECK::@[0-9a-f]+$",
+ "^generated_exe::@[0-9a-f]+$",
+ ],
+ },
+ ]
+
+ if matches(g, "^Visual Studio "):
+ for e in expected:
+ if e["parentName"] is not None:
+ e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"])
+
+ elif g == "Xcode":
+ if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
+ for e in expected:
+ e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"])
+
+ else:
+ for e in expected:
+ e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(ALL_BUILD|ZERO_CHECK)"), e["targetIds"])
+
+ return expected
+
+def check_projects(c, g):
+ check_list_match(lambda a, e: is_string(a["name"], e["name"]), c["projects"], gen_check_projects(c, g),
+ check=check_project(c),
+ check_exception=lambda a, e: "Project name: %s" % a["name"],
+ missing_exception=lambda e: "Project name: %s" % e["name"],
+ extra_exception=lambda a: "Project name: %s" % a["name"])
+
+def check_object_codemodel_configuration(c, g, inSource):
+ assert sorted(c.keys()) == ["directories", "name", "projects", "targets"]
+ assert is_string(c["name"])
+ check_directories(c, g)
+ check_targets(c, g, inSource)
+ check_projects(c, g)
+
+def check_object_codemodel(g):
+ def _check(o):
+ assert sorted(o.keys()) == ["configurations", "kind", "paths", "version"]
+ # The "kind" and "version" members are handled by check_index_object.
+ assert is_dict(o["paths"])
+ assert sorted(o["paths"].keys()) == ["build", "source"]
+ assert matches(o["paths"]["build"], "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build$")
+ assert matches(o["paths"]["source"], "^.*/Tests/RunCMake/FileAPI$")
+
+ inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"]
+
+ if matches(g, "^(Visual Studio |Xcode$)"):
+ assert sorted([c["name"] for c in o["configurations"]]) == ["Debug", "MinSizeRel", "RelWithDebInfo", "Release"]
+ else:
+ assert len(o["configurations"]) == 1
+ assert o["configurations"][0]["name"] in ("", "Debug", "Release", "RelWithDebInfo", "MinSizeRel")
+
+ for c in o["configurations"]:
+ check_object_codemodel_configuration(c, g, inSource)
+ return _check
+
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_objects(index["objects"], index["cmake"]["generator"]["name"])
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2.cmake b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
new file mode 100644
index 000000000..72073d538
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2.cmake
@@ -0,0 +1,35 @@
+enable_language(C)
+
+include("${CMAKE_CURRENT_LIST_DIR}/include_test.cmake")
+
+add_library(c_lib empty.c)
+add_executable(c_exe empty.c)
+target_link_libraries(c_exe PRIVATE c_lib)
+
+add_library(c_shared_lib SHARED empty.c)
+add_executable(c_shared_exe empty.c)
+target_link_libraries(c_shared_exe PRIVATE c_shared_lib)
+
+add_library(c_static_lib STATIC empty.c)
+add_executable(c_static_exe empty.c)
+target_link_libraries(c_static_exe PRIVATE c_static_lib)
+
+add_subdirectory(cxx)
+add_subdirectory(alias)
+add_subdirectory(object)
+add_subdirectory(imported)
+add_subdirectory(custom)
+add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../FileAPIExternalSource" "${CMAKE_CURRENT_BINARY_DIR}/../FileAPIExternalBuild")
+add_subdirectory(dir)
+
+set_property(TARGET c_shared_lib PROPERTY LIBRARY_OUTPUT_DIRECTORY lib)
+set_property(TARGET c_shared_lib PROPERTY RUNTIME_OUTPUT_DIRECTORY lib)
+
+include(CheckIPOSupported)
+check_ipo_supported(RESULT _ipo LANGUAGES C)
+if(_ipo)
+ set_property(TARGET c_shared_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
+ set_property(TARGET c_shared_exe PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
+ set_property(TARGET c_static_lib PROPERTY INTERPROCEDURAL_OPTIMIZATION ON)
+ file(WRITE "${CMAKE_BINARY_DIR}/ipo_enabled.txt" "")
+endif()
diff --git a/Tests/RunCMake/FileAPI/custom/CMakeLists.txt b/Tests/RunCMake/FileAPI/custom/CMakeLists.txt
new file mode 100644
index 000000000..1cdf5c20a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/custom/CMakeLists.txt
@@ -0,0 +1,5 @@
+project(Custom)
+
+add_custom_target(custom_tgt COMMAND ${CMAKE_COMMAND} -E echo "Building custom_tgt")
+add_executable(custom_exe ../empty.c)
+add_dependencies(custom_exe custom_tgt)
diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
new file mode 100644
index 000000000..29b61b84f
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
@@ -0,0 +1,15 @@
+project(Cxx)
+enable_language(CXX)
+
+add_library(cxx_lib ../empty.cxx)
+add_executable(cxx_exe ../empty.cxx)
+target_link_libraries(cxx_exe PRIVATE cxx_lib)
+set_property(TARGET cxx_exe PROPERTY FOLDER bin)
+
+add_library(cxx_shared_lib SHARED ../empty.cxx)
+add_executable(cxx_shared_exe ../empty.cxx)
+target_link_libraries(cxx_shared_exe PRIVATE cxx_shared_lib)
+
+add_library(cxx_static_lib STATIC ../empty.cxx)
+add_executable(cxx_static_exe ../empty.cxx)
+target_link_libraries(cxx_static_exe PRIVATE cxx_static_lib)
diff --git a/Tests/RunCMake/FileAPI/dir/CMakeLists.txt b/Tests/RunCMake/FileAPI/dir/CMakeLists.txt
new file mode 100644
index 000000000..780445d6b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/dir/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(dir)
diff --git a/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt b/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/dir/dir/CMakeLists.txt
diff --git a/Tests/RunCMake/FileAPI/dir/dirtest.cmake b/Tests/RunCMake/FileAPI/dir/dirtest.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/dir/dirtest.cmake
diff --git a/Tests/RunCMake/FileAPI/empty.c b/Tests/RunCMake/FileAPI/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/empty.c
diff --git a/Tests/RunCMake/FileAPI/empty.cxx b/Tests/RunCMake/FileAPI/empty.cxx
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/empty.cxx
diff --git a/Tests/RunCMake/FileAPI/imported/CMakeLists.txt b/Tests/RunCMake/FileAPI/imported/CMakeLists.txt
new file mode 100644
index 000000000..d36d88ba8
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/imported/CMakeLists.txt
@@ -0,0 +1,24 @@
+project(Imported)
+
+add_library(imported_lib UNKNOWN IMPORTED)
+add_executable(imported_exe IMPORTED)
+add_executable(link_imported_exe ../empty.c)
+target_link_libraries(link_imported_exe PRIVATE imported_lib)
+
+add_library(imported_shared_lib SHARED IMPORTED)
+add_executable(link_imported_shared_exe ../empty.c)
+target_link_libraries(link_imported_shared_exe PRIVATE imported_shared_lib)
+
+add_library(imported_static_lib STATIC IMPORTED)
+add_executable(link_imported_static_exe ../empty.c)
+target_link_libraries(link_imported_static_exe PRIVATE imported_static_lib)
+
+if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
+ add_library(imported_object_lib OBJECT IMPORTED)
+ add_executable(link_imported_object_exe ../empty.c)
+ target_link_libraries(link_imported_object_exe PRIVATE imported_object_lib)
+endif()
+
+add_library(imported_interface_lib INTERFACE IMPORTED)
+add_executable(link_imported_interface_exe ../empty.c)
+target_link_libraries(link_imported_interface_exe PRIVATE imported_interface_lib)
diff --git a/Tests/RunCMake/FileAPI/include_test.cmake b/Tests/RunCMake/FileAPI/include_test.cmake
new file mode 100644
index 000000000..c74d26431
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/include_test.cmake
@@ -0,0 +1,9 @@
+add_library(interface_lib INTERFACE)
+target_compile_definitions(interface_lib INTERFACE COMPILED_WITH_INTERFACE_LIB)
+add_executable(interface_exe empty.c)
+target_link_libraries(interface_exe PRIVATE inteface_lib)
+set_property(TARGET interface_exe PROPERTY ENABLE_EXPORTS ON)
+set_property(TARGET interface_exe PROPERTY RUNTIME_OUTPUT_DIRECTORY bin)
+set_property(TARGET interface_exe PROPERTY ARCHIVE_OUTPUT_DIRECTORY lib)
+set_property(TARGET interface_exe PROPERTY OUTPUT_NAME my_interface_exe)
+set_property(TARGET interface_exe PROPERTY SUFFIX .myexe)
diff --git a/Tests/RunCMake/FileAPI/object/CMakeLists.txt b/Tests/RunCMake/FileAPI/object/CMakeLists.txt
new file mode 100644
index 000000000..9773b8148
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/object/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.13)
+project(Object)
+enable_language(CXX)
+
+add_library(c_object_lib OBJECT ../empty.c)
+add_executable(c_object_exe ../empty.c)
+target_link_libraries(c_object_exe PRIVATE c_object_lib)
+
+add_library(cxx_object_lib OBJECT ../empty.cxx)
+add_executable(cxx_object_exe ../empty.cxx)
+target_link_libraries(cxx_object_exe PRIVATE cxx_object_lib)
+
+install(TARGETS c_object_exe cxx_object_exe DESTINATION bin)
diff --git a/Tests/RunCMake/FileAPIDummyFile.cmake b/Tests/RunCMake/FileAPIDummyFile.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPIDummyFile.cmake
diff --git a/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
new file mode 100644
index 000000000..f5670a727
--- /dev/null
+++ b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
@@ -0,0 +1,12 @@
+project(External)
+enable_language(CXX)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" "")
+add_executable(generated_exe empty.c)
+target_sources(generated_exe PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx")
+source_group("Generated Source Files" FILES "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/generated.cxx" PROPERTY GENERATED ON)
+set_property(SOURCE empty.c PROPERTY COMPILE_DEFINITIONS EMPTY_C=1 SRC_DUMMY)
+set_property(SOURCE empty.c PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")
+target_include_directories(generated_exe SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
+target_compile_definitions(generated_exe PRIVATE GENERATED_EXE=1 -DTGT_DUMMY)
diff --git a/Tests/RunCMake/FileAPIExternalSource/empty.c b/Tests/RunCMake/FileAPIExternalSource/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPIExternalSource/empty.c
diff --git a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
index 5d0577b2d..eef350c6c 100644
--- a/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindBoost/RunCMakeTest.cmake
@@ -1,4 +1,5 @@
include(RunCMake)
+unset(ENV{Boost_ROOT})
run_cmake(CMakePackage)
run_cmake(NoCXX)
diff --git a/Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt b/Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt
new file mode 100644
index 000000000..a3a7c6cbb
--- /dev/null
+++ b/Tests/RunCMake/Framework/InstallBeforeFramework-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Warning \(dev\) at InstallBeforeFramework.cmake:4 \(install\):
+ Target 'foo' was changed to a FRAMEWORK sometime after install\(\). This may
+ result in the wrong install DESTINATION. Set the FRAMEWORK property
+ earlier.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/GNUInstallDirs/Opt-FreeBSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Opt-FreeBSD-stderr.txt
new file mode 100644
index 000000000..feb747b18
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/Opt-FreeBSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='bin'
+CMAKE_INSTALL_DATADIR='share'
+CMAKE_INSTALL_DATAROOTDIR='share'
+CMAKE_INSTALL_DOCDIR='share/doc/Opt'
+CMAKE_INSTALL_INCLUDEDIR='include'
+CMAKE_INSTALL_INFODIR='share/info'
+CMAKE_INSTALL_LIBDIR='(lib|lib64)'
+CMAKE_INSTALL_LIBEXECDIR='libexec'
+CMAKE_INSTALL_LOCALEDIR='share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='man'
+CMAKE_INSTALL_SBINDIR='sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/opt/Opt/bin'
+CMAKE_INSTALL_FULL_DATADIR='/opt/Opt/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/opt/Opt/share'
+CMAKE_INSTALL_FULL_DOCDIR='/opt/Opt/share/doc/Opt'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/opt/Opt/include'
+CMAKE_INSTALL_FULL_INFODIR='/opt/Opt/share/info'
+CMAKE_INSTALL_FULL_LIBDIR='/opt/Opt/(lib|lib64)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/opt/Opt/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/opt/Opt/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var/opt/Opt'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run/opt/Opt'
+CMAKE_INSTALL_FULL_MANDIR='/opt/Opt/man'
+CMAKE_INSTALL_FULL_SBINDIR='/opt/Opt/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/opt/Opt/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/etc/opt/Opt'$
diff --git a/Tests/RunCMake/GNUInstallDirs/Root-FreeBSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Root-FreeBSD-stderr.txt
new file mode 100644
index 000000000..4284a15b1
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/Root-FreeBSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='usr/bin'
+CMAKE_INSTALL_DATADIR='usr/share'
+CMAKE_INSTALL_DATAROOTDIR='usr/share'
+CMAKE_INSTALL_DOCDIR='usr/share/doc/Root'
+CMAKE_INSTALL_INCLUDEDIR='usr/include'
+CMAKE_INSTALL_INFODIR='usr/share/info'
+CMAKE_INSTALL_LIBDIR='usr/(lib|lib64)'
+CMAKE_INSTALL_LIBEXECDIR='usr/libexec'
+CMAKE_INSTALL_LOCALEDIR='usr/share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='usr/man'
+CMAKE_INSTALL_SBINDIR='usr/sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='usr/com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/usr/bin'
+CMAKE_INSTALL_FULL_DATADIR='/usr/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/share'
+CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Root'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include'
+CMAKE_INSTALL_FULL_INFODIR='/usr/share/info'
+CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run'
+CMAKE_INSTALL_FULL_MANDIR='/usr/man'
+CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/etc'$
diff --git a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
index e00af581b..d671ee0ab 100644
--- a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
@@ -1,7 +1,11 @@
include(RunCMake)
-if(SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$")
- set(EXPECT_BSD 1)
+if(SYSTEM_NAME STREQUAL "FreeBSD")
+ set(variant "-FreeBSD")
+elseif(SYSTEM_NAME MATCHES "^(([^k].*)?BSD|DragonFly)$")
+ set(variant "-BSD")
+else()
+ set(variant "")
endif()
foreach(case
@@ -10,8 +14,6 @@ foreach(case
Usr
UsrLocal
)
- if(EXPECT_BSD)
- set(RunCMake-stderr-file ${case}-BSD-stderr.txt)
- endif()
+ set(RunCMake-stderr-file ${case}${variant}-stderr.txt)
run_cmake(${case})
endforeach()
diff --git a/Tests/RunCMake/GNUInstallDirs/Usr-FreeBSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/Usr-FreeBSD-stderr.txt
new file mode 100644
index 000000000..9efc1103e
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/Usr-FreeBSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='bin'
+CMAKE_INSTALL_DATADIR='share'
+CMAKE_INSTALL_DATAROOTDIR='share'
+CMAKE_INSTALL_DOCDIR='share/doc/Usr'
+CMAKE_INSTALL_INCLUDEDIR='include'
+CMAKE_INSTALL_INFODIR='share/info'
+CMAKE_INSTALL_LIBDIR='(lib|lib64|lib/arch)'
+CMAKE_INSTALL_LIBEXECDIR='libexec'
+CMAKE_INSTALL_LOCALEDIR='share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='man'
+CMAKE_INSTALL_SBINDIR='sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/usr/bin'
+CMAKE_INSTALL_FULL_DATADIR='/usr/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/share'
+CMAKE_INSTALL_FULL_DOCDIR='/usr/share/doc/Usr'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/include'
+CMAKE_INSTALL_FULL_INFODIR='/usr/share/info'
+CMAKE_INSTALL_FULL_LIBDIR='/usr/(lib|lib64|lib/arch)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/usr/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/var/run'
+CMAKE_INSTALL_FULL_MANDIR='/usr/man'
+CMAKE_INSTALL_FULL_SBINDIR='/usr/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/etc'$
diff --git a/Tests/RunCMake/GNUInstallDirs/UsrLocal-FreeBSD-stderr.txt b/Tests/RunCMake/GNUInstallDirs/UsrLocal-FreeBSD-stderr.txt
new file mode 100644
index 000000000..505bf08ef
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/UsrLocal-FreeBSD-stderr.txt
@@ -0,0 +1,30 @@
+^CMAKE_INSTALL_BINDIR='bin'
+CMAKE_INSTALL_DATADIR='share'
+CMAKE_INSTALL_DATAROOTDIR='share'
+CMAKE_INSTALL_DOCDIR='share/doc/UsrLocal'
+CMAKE_INSTALL_INCLUDEDIR='include'
+CMAKE_INSTALL_INFODIR='share/info'
+CMAKE_INSTALL_LIBDIR='(lib|lib64)'
+CMAKE_INSTALL_LIBEXECDIR='libexec'
+CMAKE_INSTALL_LOCALEDIR='share/locale'
+CMAKE_INSTALL_LOCALSTATEDIR='var'
+CMAKE_INSTALL_RUNSTATEDIR='var/run'
+CMAKE_INSTALL_MANDIR='man'
+CMAKE_INSTALL_SBINDIR='sbin'
+CMAKE_INSTALL_SHAREDSTATEDIR='com'
+CMAKE_INSTALL_SYSCONFDIR='etc'
+CMAKE_INSTALL_FULL_BINDIR='/usr/local/bin'
+CMAKE_INSTALL_FULL_DATADIR='/usr/local/share'
+CMAKE_INSTALL_FULL_DATAROOTDIR='/usr/local/share'
+CMAKE_INSTALL_FULL_DOCDIR='/usr/local/share/doc/UsrLocal'
+CMAKE_INSTALL_FULL_INCLUDEDIR='/usr/local/include'
+CMAKE_INSTALL_FULL_INFODIR='/usr/local/share/info'
+CMAKE_INSTALL_FULL_LIBDIR='/usr/local/(lib|lib64)'
+CMAKE_INSTALL_FULL_LIBEXECDIR='/usr/local/libexec'
+CMAKE_INSTALL_FULL_LOCALEDIR='/usr/local/share/locale'
+CMAKE_INSTALL_FULL_LOCALSTATEDIR='/usr/local/var'
+CMAKE_INSTALL_FULL_RUNSTATEDIR='/usr/local/var/run'
+CMAKE_INSTALL_FULL_MANDIR='/usr/local/man'
+CMAKE_INSTALL_FULL_SBINDIR='/usr/local/sbin'
+CMAKE_INSTALL_FULL_SHAREDSTATEDIR='/usr/local/com'
+CMAKE_INSTALL_FULL_SYSCONFDIR='/usr/local/etc'$
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake
new file mode 100644
index 000000000..520bf3dcd
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-NEW-generated.txt" content)
+
+set(expected "101011")
+if(NOT content STREQUAL expected)
+ set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake
new file mode 100644
index 000000000..ee85c0d36
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-NEW.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT CMP0085-NEW-generated.txt CONTENT
+ "$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>"
+ )
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake
new file mode 100644
index 000000000..c387db77c
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-OLD-generated.txt" content)
+
+set(expected "000011")
+if(NOT content STREQUAL expected)
+ set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake
new file mode 100644
index 000000000..31b6a51b4
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-OLD.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT CMP0085-OLD-generated.txt CONTENT
+ "$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>"
+ )
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake
new file mode 100644
index 000000000..f7bcf0ff1
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-check.cmake
@@ -0,0 +1,6 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/CMP0085-WARN-generated.txt" content)
+
+set(expected "000011")
+if(NOT content STREQUAL expected)
+ set(RunCMake_TEST_FAILED "actual content:\n [[${content}]]\nbut expected:\n [[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt
new file mode 100644
index 000000000..81bd45028
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN-stderr.txt
@@ -0,0 +1,33 @@
+CMake Warning \(dev\) at CMP0085-WARN\.cmake:[0-9]+ \(file\):
+ Policy CMP0085 is not set: \$<IN_LIST:\.\.\.> handles empty list items\. Run
+ "cmake --help-policy CMP0085" for policy details\. Use the cmake_policy
+ command to set the policy and suppress this warning\.
+
+ Search Item:
+
+ ""
+
+ List:
+
+ ""
+
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+
+CMake Warning \(dev\) at CMP0085-WARN\.cmake:[0-9]+ \(file\):
+ Policy CMP0085 is not set: \$<IN_LIST:\.\.\.> handles empty list items\. Run
+ "cmake --help-policy CMP0085" for policy details\. Use the cmake_policy
+ command to set the policy and suppress this warning\.
+
+ Search Item:
+
+ ""
+
+ List:
+
+ ";a"
+
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake
new file mode 100644
index 000000000..59c782653
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/CMP0085-WARN.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT CMP0085-WARN-generated.txt CONTENT
+ "$<IN_LIST:,>$<IN_LIST:,a>$<IN_LIST:,;a>$<IN_LIST:a,>$<IN_LIST:a,a>$<IN_LIST:a,;a>"
+ )
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt
index fd954e6cc..ed6840057 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt
@@ -1,7 +1,7 @@
^CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Error evaluating generator expression:
- \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY1>>
+ \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
Dependency loop found.
Call Stack \(most recent call first\):
@@ -11,7 +11,7 @@ Call Stack \(most recent call first\):
CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Loop step 1
- \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
+ \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY1>>
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
@@ -20,7 +20,7 @@ Call Stack \(most recent call first\):
CMake Error at GENEX_EVAL-recursion2.cmake:8 \(add_custom_target\):
Loop step 2
- \$<TARGET_GENEX_EVAL:recursion,\$<TARGET_PROPERTY:recursion,CUSTOM_PROPERTY1>>
+ \$<GENEX_EVAL:\$<TARGET_PROPERTY:CUSTOM_PROPERTY2>>
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake
index ab8988b26..153cd176f 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake
+++ b/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake
@@ -7,5 +7,6 @@ add_library (example SHARED empty.c)
set_property (TARGET example PROPERTY CUSTOM_PROPERTY1 "PROPERTY1")
set_property (TARGET example PROPERTY CUSTOM_PROPERTY2 "$<TARGET_PROPERTY:CUSTOM_PROPERTY1>")
set_property (TARGET example PROPERTY CUSTOM_PROPERTY3 "$<GENEX_EVAL:BEFORE_$<TARGET_PROPERTY:CUSTOM_PROPERTY2>_AFTER>")
+set_property (TARGET example PROPERTY CUSTOM_PROPERTY4 "$<GENEX_EVAL:$<TARGET_PROPERTY:CUSTOM_PROPERTY3>>")
-file(GENERATE OUTPUT "GENEX_EVAL-generated.txt" CONTENT "$<TARGET_GENEX_EVAL:example,$<TARGET_PROPERTY:example,CUSTOM_PROPERTY3>>")
+file(GENERATE OUTPUT "GENEX_EVAL-generated.txt" CONTENT "$<TARGET_GENEX_EVAL:example,$<TARGET_PROPERTY:example,CUSTOM_PROPERTY4>>")
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-stderr.txt
new file mode 100644
index 000000000..fc1324807
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at NonValidTarget-Fortran_COMPILER_ID.cmake:1 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<Fortran_COMPILER_ID>
+
+ \$<Fortran_COMPILER_ID> may only be used with binary targets. It may not be
+ used with add_custom_command or add_custom_target.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID.cmake
new file mode 100644
index 000000000..88a0bfb99
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_ID.cmake
@@ -0,0 +1,4 @@
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.c" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<Fortran_COMPILER_ID>.c"
+)
+add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c")
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-stderr.txt
new file mode 100644
index 000000000..f8a41205c
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at NonValidTarget-Fortran_COMPILER_VERSION.cmake:1 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<Fortran_COMPILER_VERSION>
+
+ \$<Fortran_COMPILER_VERSION> may only be used with binary targets. It may
+ not be used with add_custom_command or add_custom_target.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION.cmake
new file mode 100644
index 000000000..34a4884d4
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-Fortran_COMPILER_VERSION.cmake
@@ -0,0 +1,4 @@
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c"
+ COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.c" "${CMAKE_CURRENT_BINARY_DIR}/copied_file$<Fortran_COMPILER_VERSION>.c"
+)
+add_custom_target(drive DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied_file.c")
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 3905c5f99..8a5604c7a 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -15,8 +15,10 @@ run_cmake(BadSHELL_PATH)
run_cmake(CMP0044-WARN)
run_cmake(NonValidTarget-C_COMPILER_ID)
run_cmake(NonValidTarget-CXX_COMPILER_ID)
+run_cmake(NonValidTarget-Fortran_COMPILER_ID)
run_cmake(NonValidTarget-C_COMPILER_VERSION)
run_cmake(NonValidTarget-CXX_COMPILER_VERSION)
+run_cmake(NonValidTarget-Fortran_COMPILER_VERSION)
run_cmake(NonValidTarget-TARGET_BUNDLE_DIR)
run_cmake(NonValidTarget-TARGET_BUNDLE_CONTENT_DIR)
run_cmake(NonValidTarget-TARGET_PROPERTY)
@@ -61,3 +63,13 @@ if(LINKER_SUPPORTS_PDB)
else()
run_cmake(NonValidCompiler-TARGET_PDB_FILE)
endif()
+
+set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD)
+run_cmake(CMP0085-OLD)
+unset(RunCMake_TEST_OPTIONS)
+
+run_cmake(CMP0085-WARN)
+
+set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=NEW)
+run_cmake(CMP0085-NEW)
+unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
index 27250cba7..27ede066e 100644
--- a/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorPlatform/RunCMakeTest.cmake
@@ -3,7 +3,7 @@ include(RunCMake)
set(RunCMake_GENERATOR_PLATFORM "")
run_cmake(NoPlatform)
-if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[01245])( 20[0-9][0-9])?$")
+if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[012456])( 20[0-9][0-9])?$")
set(RunCMake_GENERATOR_PLATFORM "x64")
run_cmake(x64Platform)
else()
@@ -17,7 +17,7 @@ set(RunCMake_TEST_OPTIONS -A "Extra Platform")
run_cmake(TwoPlatforms)
unset(RunCMake_TEST_OPTIONS)
-if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[01245])( 20[0-9][0-9])?$")
+if("${RunCMake_GENERATOR}" MATCHES "^Visual Studio ([89]|1[012456])( 20[0-9][0-9])?$")
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestPlatform-toolchain.cmake)
run_cmake(TestPlatformToolchain)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
index 164d3aa79..7067423f4 100644
--- a/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetHostArchTwice-stderr.txt
@@ -5,6 +5,6 @@ CMake Error at CMakeLists.txt:[0-9]+ \(project\):
given toolset specification
- Test Toolset,host=x64,host=x64
+ Test Toolset,host=x64,host=x86
that contains duplicate field key 'host'\.$
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index d1738a0c3..ef8fd2540 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -3,7 +3,7 @@ include(RunCMake)
set(RunCMake_GENERATOR_TOOLSET "")
run_cmake(NoToolset)
-if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]")
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset")
run_cmake(TestToolset)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,cuda=Test Cuda")
@@ -12,20 +12,22 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]")
run_cmake(TestToolsetCudaOnly)
set(RunCMake_GENERATOR_TOOLSET "cuda=Test Cuda")
run_cmake(TestToolsetCudaOnly)
- if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[245]")
+ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[2456]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64")
run_cmake(TestToolsetHostArchBoth)
set(RunCMake_GENERATOR_TOOLSET ",host=x64")
- run_cmake(TestToolsetHostArchOnly)
+ run_cmake(TestToolsetHostArchOnly_x64)
set(RunCMake_GENERATOR_TOOLSET "host=x64")
- run_cmake(TestToolsetHostArchOnly)
+ run_cmake(TestToolsetHostArchOnly_x64)
+ set(RunCMake_GENERATOR_TOOLSET "host=x86")
+ run_cmake(TestToolsetHostArchOnly_x86)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset")
run_cmake(TestToolsetHostArchNone)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x65")
run_cmake(BadToolsetHostArch)
- set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x64")
+ set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86")
run_cmake(BadToolsetHostArchTwice)
- if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 15")
+ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version")
run_cmake(TestToolsetVersionBoth)
set(RunCMake_GENERATOR_TOOLSET ",version=Test Toolset Version")
@@ -59,7 +61,7 @@ set(RunCMake_TEST_OPTIONS -T "Extra Toolset")
run_cmake(TwoToolsets)
unset(RunCMake_TEST_OPTIONS)
-if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[01245]|Xcode")
+if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]|Xcode")
set(RunCMake_TEST_OPTIONS -DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/TestToolset-toolchain.cmake)
run_cmake(TestToolsetToolchain)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
index 576b40cc0..e5e6c8da9 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone-stdout.txt
@@ -1,2 +1,2 @@
-- CMAKE_VS_PLATFORM_TOOLSET='Test Toolset'
--- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE=''
+-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='.*'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
index 26926f9db..085bb6b17 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchNone.cmake
@@ -1,2 +1,15 @@
message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'")
+
+if(CMAKE_GENERATOR MATCHES "Visual Studio 1[6]")
+ cmake_host_system_information(RESULT is_64_bit QUERY IS_64BIT)
+ if(is_64_bit)
+ if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "x64")
+ message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not 'x64' as expected.")
+ endif()
+ endif()
+else()
+ if(NOT "${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" STREQUAL "")
+ message(FATAL_ERROR "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE is not empty as expected.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt
index 8271bd487..8271bd487 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly-stdout.txt
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64-stdout.txt
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake
index 26926f9db..26926f9db 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly.cmake
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x64.cmake
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt
new file mode 100644
index 000000000..c7293dc42
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+'
+-- CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='x86'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake
new file mode 100644
index 000000000..26926f9db
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetHostArchOnly_x86.cmake
@@ -0,0 +1,2 @@
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE='${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}'")
diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt
new file mode 100644
index 000000000..5a353d8c8
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts-stdout.txt
@@ -0,0 +1,3 @@
+-- GetPrequisites\(.*script.sh\) : ignoring script file
+-- GetPrequisites\(.*script.bat\) : ignoring script file
+-- GetPrequisites\(.*script\) : ignoring script file
diff --git a/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
new file mode 100644
index 000000000..d1bc9b1d4
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/ExecutableScripts.cmake
@@ -0,0 +1,19 @@
+include(GetPrerequisites)
+
+function(check_script script)
+ set(prereqs "")
+ get_prerequisites(${script} prereqs 1 1 "" "")
+ if(NOT "${prereqs}" STREQUAL "")
+ message(FATAL_ERROR "Prerequisites for ${script} not empty")
+ endif()
+endfunction()
+
+# Should not throw any errors
+# Regular executable
+get_prerequisites(${CMAKE_COMMAND} cmake_prereqs 1 1 "" "")
+# Shell script
+check_script(${CMAKE_CURRENT_LIST_DIR}/script.sh)
+# Batch script
+check_script(${CMAKE_CURRENT_LIST_DIR}/script.bat)
+# Shell script without extension
+check_script(${CMAKE_CURRENT_LIST_DIR}/script)
diff --git a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
index 3856c54b6..a635e385e 100644
--- a/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GetPrerequisites/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake_command(TargetMissing ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/TargetMissing.cmake)
+run_cmake_command(ExecutableScripts ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ExecutableScripts.cmake)
diff --git a/Tests/RunCMake/GetPrerequisites/script b/Tests/RunCMake/GetPrerequisites/script
new file mode 100755
index 000000000..23bf47c06
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/script
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo "Hello World"
diff --git a/Tests/RunCMake/GetPrerequisites/script.bat b/Tests/RunCMake/GetPrerequisites/script.bat
new file mode 100755
index 000000000..338ae039b
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/script.bat
@@ -0,0 +1,3 @@
+@echo off
+
+echo "Hello world"
diff --git a/Tests/RunCMake/GetPrerequisites/script.sh b/Tests/RunCMake/GetPrerequisites/script.sh
new file mode 100755
index 000000000..23bf47c06
--- /dev/null
+++ b/Tests/RunCMake/GetPrerequisites/script.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+echo "Hello World"
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index 3b2b8f593..82db6b742 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -16,5 +16,22 @@ run_TargetMessages(OFF)
run_TargetMessages(VAR-ON -DCMAKE_TARGET_MESSAGES=ON)
run_TargetMessages(VAR-OFF -DCMAKE_TARGET_MESSAGES=OFF)
+function(run_VerboseBuild)
+ run_cmake(VerboseBuild)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VerboseBuild-build)
+ if(RunCMake_GENERATOR STREQUAL "Watcom WMake")
+ # wmake does not actually show the verbose output.
+ set(RunCMake-stdout-file VerboseBuild-build-watcom-stdout.txt)
+ endif()
+ run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first)
+ unset(RunCMake-stdout-file)
+ if(MAKE_IS_GNU)
+ set(RunCMake-stdout-file VerboseBuild-nowork-gnu-stdout.txt)
+ endif()
+ run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose)
+endfunction()
+run_VerboseBuild()
+
run_cmake(CustomCommandDepfile-ERROR)
run_cmake(IncludeRegexSubdir)
diff --git a/Tests/RunCMake/Make/VerboseBuild-build-stdout.txt b/Tests/RunCMake/Make/VerboseBuild-build-stdout.txt
new file mode 100644
index 000000000..884bf953e
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild-build-stdout.txt
@@ -0,0 +1 @@
+.*DEFINE_FOR_VERBOSE_DETECTION.*hello.dir.*
diff --git a/Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt b/Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt
new file mode 100644
index 000000000..9c558e357
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild-build-watcom-stdout.txt
@@ -0,0 +1 @@
+.
diff --git a/Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt b/Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt
new file mode 100644
index 000000000..3e65cd95f
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild-nowork-gnu-stdout.txt
@@ -0,0 +1 @@
+.*Nothing to be done for.*hello.*
diff --git a/Tests/RunCMake/Make/VerboseBuild.cmake b/Tests/RunCMake/Make/VerboseBuild.cmake
new file mode 100644
index 000000000..70a971d13
--- /dev/null
+++ b/Tests/RunCMake/Make/VerboseBuild.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+
+# Make sure compile command is not hidden in a temp file.
+string(REPLACE "${CMAKE_START_TEMP_FILE}" "" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
+string(REPLACE "${CMAKE_END_TEMP_FILE}" "" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
+
+add_executable(hello hello.c)
+target_compile_definitions(hello PRIVATE "DEFINE_FOR_VERBOSE_DETECTION")
diff --git a/Tests/RunCMake/Make/hello.c b/Tests/RunCMake/Make/hello.c
new file mode 100644
index 000000000..aac8b4e0f
--- /dev/null
+++ b/Tests/RunCMake/Make/hello.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(void)
+{
+ printf("Hello world!\n");
+ return 0;
+}
diff --git a/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt
new file mode 100644
index 000000000..d2cd86d13
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.13)
+if(DEFINED CMAKE_GENERATOR)
+ project(${RunCMake_TEST} NONE)
+endif()
+include("${CMAKE_CURRENT_LIST_DIR}/${TEST_NAME}.cmake")
diff --git a/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in
new file mode 100644
index 000000000..fee3eda2f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/CMakeLists.txt.in
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.12)
+project(MaxRecursionDepth NONE)
diff --git a/Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake b/Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake
new file mode 100644
index 000000000..354bc7a4e
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/CTestCustom.cmake
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+ctest_read_custom_files("${CMAKE_CURRENT_LIST_DIR}")
diff --git a/Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake b/Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake
new file mode 100644
index 000000000..3cbb99e87
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/FindRecursivePackage.cmake
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+find_package(RecursivePackage)
diff --git a/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake b/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
new file mode 100644
index 000000000..c5a859d87
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/RunCMakeTest.cmake
@@ -0,0 +1,49 @@
+include(RunCMake)
+include(RunCTest)
+
+function(run_cmake_recursive name)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+ run_cmake(${name}-default)
+ unset(RunCMake_TEST_OPTIONS)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+ run_cmake(${name}-var)
+ unset(RunCMake_TEST_OPTIONS)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
+ run_cmake(${name}-invalid-var)
+ unset(RunCMake_TEST_OPTIONS)
+
+ run_cmake_command(${name}-default-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+ run_cmake_command(${name}-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10 -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+ run_cmake_command(${name}-invalid-var-script ${CMAKE_COMMAND} "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a -P "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt")
+endfunction()
+
+function(run_ctest_recursive name)
+ run_ctest(${name}-default "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name})
+ run_ctest(${name}-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+ run_ctest(${name}-invalid-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=${name} -DCMAKE_MAXIMUM_RECURSION_DEPTH=a)
+endfunction()
+
+run_cmake_recursive(function)
+run_cmake_recursive(macro)
+run_cmake_recursive(include)
+run_cmake_recursive(find_package)
+run_cmake_recursive(variable_watch)
+
+# We run these tests separately and only with a small limit because they are
+# taxing and slow. The "implicit" and "invalid" cases are already thoroughly
+# covered by the other tests above.
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=add_subdirectory -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+run_cmake(add_subdirectory-var)
+unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=try_compile -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
+run_cmake(try_compile-var)
+unset(RunCMake_TEST_OPTIONS)
+
+run_ctest_recursive(ctest_read_custom_files)
+
+# We run the ctest_run_script() test separately and only with an explicit limit
+# because ctest_run_script() is taxing and slow, and because the implicit
+# recursion limit is hit by CTestScriptMode.cmake before we can test it
+# properly. The "implicit" and "invalid" cases are already thoroughly covered
+# by the other tests above.
+run_ctest(ctest_run_script-var "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" -DTEST_NAME=ctest_run_script -DCMAKE_MAXIMUM_RECURSION_DEPTH=10)
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt
new file mode 100644
index 000000000..23fb5c65b
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory-var-stderr.txt
@@ -0,0 +1,10 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at add_subdirectory/CMakeLists\.txt:1 \(message\):
+ Maximum recursion depth of 10 exceeded$
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake
new file mode 100644
index 000000000..36c21f30a
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory.cmake
@@ -0,0 +1,2 @@
+set(x 3)
+add_subdirectory(add_subdirectory)
diff --git a/Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt
new file mode 100644
index 000000000..a8244affe
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/add_subdirectory/CMakeLists.txt
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+add_subdirectory(. dir)
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-result.txt
index b57e2deb7..b57e2deb7 100644
--- a/Tests/RunCMake/ctest_submit/FailDrop-cp-result.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-result.txt
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt
new file mode 100644
index 000000000..7dbbb3e72
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-result.txt
index b57e2deb7..b57e2deb7 100644
--- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-result.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-result.txt
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt
new file mode 100644
index 000000000..7dbbb3e72
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-result.txt
index b57e2deb7..b57e2deb7 100644
--- a/Tests/RunCMake/ctest_submit/FailDrop-scp-result.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-result.txt
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt
new file mode 100644
index 000000000..bc89703a0
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var-stderr.txt
@@ -0,0 +1,34 @@
+^2
+3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:1 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake:3 \(ctest_read_custom_files\)
+ .*/Tests/RunCMake/MaxRecursionDepth/ctest_read_custom_files-var/test\.cmake:10 \(ctest_read_custom_files\)
+
+
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake
+Problem reading custom configuration: .*/Tests/RunCMake/MaxRecursionDepth/CTestCustom\.cmake$
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-result.txt
index b57e2deb7..b57e2deb7 100644
--- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-result.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-result.txt
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt
new file mode 100644
index 000000000..b10b26d32
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var-stderr.txt
@@ -0,0 +1,51 @@
+^2
+3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_11\.cmake:1 \(cmake_minimum_required\):
+ Maximum recursion depth of 10 exceeded
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_10\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_9\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_8\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_7\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_6\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_5\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_4\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_3\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script_2\.cmake:13 \(message\):
+ Nested script failed
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/ctest_run_script-var/test\.cmake:19 \(message\):
+ Nested script failed$
diff --git a/Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in
new file mode 100644
index 000000000..d4f28c456
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/ctest_run_script.cmake.in
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.12)
+set(CTEST_RUN_CURRENT_SCRIPT 0)
+
+message("@LEVEL_CURRENT@")
+
+set(CTEST_SOURCE_DIRECTORY "@CTEST_SOURCE_DIRECTORY@")
+set(CTEST_BINARY_DIRECTORY "@CTEST_BINARY_DIRECTORY@")
+set(CTEST_COMMAND "@CTEST_COMMAND@")
+
+ctest_run_script("${CMAKE_CURRENT_LIST_DIR}/ctest_run_script_@LEVEL_NEXT@.cmake" RETURN_VALUE val)
+
+if(NOT val EQUAL 0)
+ message(FATAL_ERROR "Nested script failed")
+endif()
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt
new file mode 100644
index 000000000..b8557ab64
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt
new file mode 100644
index 000000000..5d31e295b
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt
new file mode 100644
index 000000000..b8557ab64
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt
new file mode 100644
index 000000000..5d31e295b
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ FindRecursivePackage\.cmake:3 \(find_package\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt
new file mode 100644
index 000000000..53145515a
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/FindRecursivePackage\.cmake:1 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/FindRecursivePackage\.cmake:3 \(find_package\)
+ .*/find_package\.cmake:2 \(find_package\)
+ .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt
new file mode 100644
index 000000000..b47a13a17
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at FindRecursivePackage\.cmake:1 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ FindRecursivePackage\.cmake:3 \(find_package\)
+ find_package\.cmake:2 \(find_package\)
+ CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/find_package.cmake b/Tests/RunCMake/MaxRecursionDepth/find_package.cmake
new file mode 100644
index 000000000..a235f7d41
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/find_package.cmake
@@ -0,0 +1,2 @@
+set(x 3)
+find_package(RecursivePackage)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt
new file mode 100644
index 000000000..92de1fb3c
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/function\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt
new file mode 100644
index 000000000..5c25c4b12
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at function\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt
new file mode 100644
index 000000000..92de1fb3c
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/function\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt
new file mode 100644
index 000000000..5c25c4b12
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at function\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ function\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt
new file mode 100644
index 000000000..61304b13f
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/function\.cmake:2 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:4 \(recursive\)
+ .*/function\.cmake:7 \(recursive\)
+ .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt
new file mode 100644
index 000000000..54e72aff4
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at function\.cmake:2 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ function\.cmake:4 \(recursive\)
+ function\.cmake:4 \(recursive\)
+ function\.cmake:4 \(recursive\)
+ function\.cmake:4 \(recursive\)
+ function\.cmake:4 \(recursive\)
+ function\.cmake:4 \(recursive\)
+ function\.cmake:4 \(recursive\)
+ function\.cmake:4 \(recursive\)
+ function\.cmake:7 \(recursive\)
+ CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/function.cmake b/Tests/RunCMake/MaxRecursionDepth/function.cmake
new file mode 100644
index 000000000..581cb8917
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/function.cmake
@@ -0,0 +1,7 @@
+function(recursive x)
+ message("${x}")
+ math(EXPR y "${x} + 1")
+ recursive(${y})
+endfunction()
+
+recursive(3)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt
new file mode 100644
index 000000000..0510e7c37
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt
new file mode 100644
index 000000000..b1494a8e1
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at include_recursive\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt
new file mode 100644
index 000000000..0510e7c37
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt
new file mode 100644
index 000000000..b1494a8e1
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at include_recursive\.cmake:1 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ include_recursive\.cmake:3 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt
new file mode 100644
index 000000000..f55f50536
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/include_recursive\.cmake:1 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include_recursive\.cmake:3 \(include\)
+ .*/include\.cmake:2 \(include\)
+ .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt
new file mode 100644
index 000000000..ff3398504
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at include_recursive\.cmake:1 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ include_recursive\.cmake:3 \(include\)
+ include_recursive\.cmake:3 \(include\)
+ include_recursive\.cmake:3 \(include\)
+ include_recursive\.cmake:3 \(include\)
+ include_recursive\.cmake:3 \(include\)
+ include_recursive\.cmake:3 \(include\)
+ include_recursive\.cmake:3 \(include\)
+ include_recursive\.cmake:3 \(include\)
+ include\.cmake:2 \(include\)
+ CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/include.cmake b/Tests/RunCMake/MaxRecursionDepth/include.cmake
new file mode 100644
index 000000000..5e86a40cb
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include.cmake
@@ -0,0 +1,2 @@
+set(x 3)
+include("${CMAKE_CURRENT_LIST_DIR}/include_recursive.cmake")
diff --git a/Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake b/Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake
new file mode 100644
index 000000000..b3f744e38
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/include_recursive.cmake
@@ -0,0 +1,3 @@
+message("${x}")
+math(EXPR x "${x} + 1")
+include("${CMAKE_CURRENT_LIST_FILE}")
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt
new file mode 100644
index 000000000..c67be57d2
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/macro\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt
new file mode 100644
index 000000000..0b271627d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-default-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at macro\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt
new file mode 100644
index 000000000..c67be57d2
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-script-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at .*/macro\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt
new file mode 100644
index 000000000..0b271627d
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-invalid-var-stderr.txt
@@ -0,0 +1,5 @@
+[0-9]+
+CMake Error at macro\.cmake:2 \(message\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ macro\.cmake:4 \(recursive\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt
new file mode 100644
index 000000000..142e068a0
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-script-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/macro\.cmake:2 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:4 \(recursive\)
+ .*/macro\.cmake:7 \(recursive\)
+ .*/CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt
new file mode 100644
index 000000000..71de55376
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro-var-stderr.txt
@@ -0,0 +1,21 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at macro\.cmake:2 \(message\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:4 \(recursive\)
+ macro\.cmake:7 \(recursive\)
+ CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/macro.cmake b/Tests/RunCMake/MaxRecursionDepth/macro.cmake
new file mode 100644
index 000000000..a7cbfc2ad
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/macro.cmake
@@ -0,0 +1,7 @@
+macro(recursive x)
+ message("${x}")
+ math(EXPR y "${x} + 1")
+ recursive(${y})
+endmacro()
+
+recursive(3)
diff --git a/Tests/RunCMake/MaxRecursionDepth/test.cmake.in b/Tests/RunCMake/MaxRecursionDepth/test.cmake.in
new file mode 100644
index 000000000..fd1fc10a5
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/test.cmake.in
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 3.12)
+set(CTEST_RUN_CURRENT_SCRIPT 0)
+
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_SOURCE_DIR@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@")
+set(CTEST_COMMAND "${CMAKE_CTEST_COMMAND}")
+
+if(TEST_NAME STREQUAL "ctest_read_custom_files")
+ set(x 2)
+ ctest_read_custom_files("@RunCMake_SOURCE_DIR@")
+elseif(TEST_NAME STREQUAL "ctest_run_script")
+ foreach(LEVEL_CURRENT RANGE 2 15)
+ math(EXPR LEVEL_NEXT "${LEVEL_CURRENT} + 1")
+ configure_file("@RunCMake_SOURCE_DIR@/ctest_run_script.cmake.in" "@RunCMake_BINARY_DIR@/ctest_run_script_${LEVEL_CURRENT}.cmake" @ONLY)
+ endforeach()
+
+ ctest_run_script("@RunCMake_BINARY_DIR@/ctest_run_script_2.cmake" RETURN_VALUE val)
+ if(NOT val EQUAL 0)
+ message(FATAL_ERROR "Nested script failed")
+ endif()
+endif()
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt
new file mode 100644
index 000000000..130db346b
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile-var-stderr.txt
@@ -0,0 +1,48 @@
+^3
+4
+5
+6
+7
+8
+9
+10
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:1 \(cmake_minimum_required\):
+ Maximum recursion depth of 10 exceeded
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at .*/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists\.txt:5 \(try_compile\):
+ Failed to configure test project build system\.
+
+
+CMake Error at try_compile\.cmake:1 \(try_compile\):
+ Failed to configure test project build system\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:5 \(include\)$
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile.cmake b/Tests/RunCMake/MaxRecursionDepth/try_compile.cmake
new file mode 100644
index 000000000..c40fb0612
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile.cmake
@@ -0,0 +1,6 @@
+try_compile(result
+ "${CMAKE_CURRENT_BINARY_DIR}/try_compile"
+ "${CMAKE_CURRENT_SOURCE_DIR}/try_compile"
+ try_compile
+ CMAKE_FLAGS -Dx:STRING=3
+ )
diff --git a/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt b/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt
new file mode 100644
index 000000000..227109061
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/try_compile/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.12)
+
+message("${x}")
+math(EXPR x "${x} + 1")
+try_compile(result
+ "${CMAKE_CURRENT_BINARY_DIR}/try_compile"
+ "${CMAKE_CURRENT_SOURCE_DIR}"
+ try_compile
+ CMAKE_FLAGS -Dx:STRING=${x}
+ )
+
+# We put this last to avoid prematurely triggering the recursion limit
+project(try_compile NONE)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
new file mode 100644
index 000000000..4dddc96c8
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/variable_watch\.cmake:5 \(set\)
+ .*/variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
new file mode 100644
index 000000000..a8b4756da
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at variable_watch\.cmake:9999 \(update_x\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ variable_watch\.cmake:5 \(set\)
+ variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
new file mode 100644
index 000000000..4dddc96c8
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ .*/variable_watch\.cmake:5 \(set\)
+ .*/variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
new file mode 100644
index 000000000..a8b4756da
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
@@ -0,0 +1,6 @@
+[0-9]+
+CMake Error at variable_watch\.cmake:9999 \(update_x\):
+ Maximum recursion depth of [0-9]+ exceeded
+Call Stack \(most recent call first\):
+ variable_watch\.cmake:5 \(set\)
+ variable_watch\.cmake:9999 \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-result.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
new file mode 100644
index 000000000..00b2b3c11
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
@@ -0,0 +1,22 @@
+^4
+6
+8
+10
+CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ .*/variable_watch\.cmake:5 \(set\)
+ .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:5 \(set\)
+ .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:5 \(set\)
+ .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:5 \(set\)
+ .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:9 \(set\)
+ .*/CMakeLists\.txt:5 \(include\)
+
+
+CMake Error: Error in cmake code at
+Unknown:0:
+A command failed during the invocation of callback "update_x"\.$
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
new file mode 100644
index 000000000..8f27bf1c2
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
@@ -0,0 +1,22 @@
+^4
+6
+8
+10
+CMake Error at variable_watch\.cmake:9999 \(update_x\):
+ Maximum recursion depth of 10 exceeded
+Call Stack \(most recent call first\):
+ variable_watch\.cmake:5 \(set\)
+ variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:5 \(set\)
+ variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:5 \(set\)
+ variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:5 \(set\)
+ variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:9 \(set\)
+ CMakeLists\.txt:5 \(include\)
+
+
+CMake Error: Error in cmake code at
+Unknown:0:
+A command failed during the invocation of callback "update_x"\.$
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake b/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
new file mode 100644
index 000000000..b3c7b8dfe
--- /dev/null
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch.cmake
@@ -0,0 +1,9 @@
+function(update_x)
+ message("${x}")
+ math(EXPR y "${x} + 2")
+ variable_watch(x update_x)
+ set(x "${y}")
+endfunction()
+
+variable_watch(x update_x)
+set(x 4)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 9e1e9a5fd..8fa650a61 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -30,6 +30,15 @@ function(run_NoWorkToDo)
endfunction()
run_NoWorkToDo()
+function(run_VerboseBuild)
+ run_cmake(VerboseBuild)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/VerboseBuild-build)
+ run_cmake_command(VerboseBuild-build ${CMAKE_COMMAND} --build . -v --clean-first)
+ run_cmake_command(VerboseBuild-nowork ${CMAKE_COMMAND} --build . --verbose)
+endfunction()
+run_VerboseBuild()
+
function(run_CMP0058 case)
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0058-${case}-build)
diff --git a/Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt b/Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt
new file mode 100644
index 000000000..884bf953e
--- /dev/null
+++ b/Tests/RunCMake/Ninja/VerboseBuild-build-stdout.txt
@@ -0,0 +1 @@
+.*DEFINE_FOR_VERBOSE_DETECTION.*hello.dir.*
diff --git a/Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt b/Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt
new file mode 100644
index 000000000..60a9228b0
--- /dev/null
+++ b/Tests/RunCMake/Ninja/VerboseBuild-nowork-stdout.txt
@@ -0,0 +1 @@
+^ninja: no work to do
diff --git a/Tests/RunCMake/Ninja/VerboseBuild.cmake b/Tests/RunCMake/Ninja/VerboseBuild.cmake
new file mode 100644
index 000000000..424e54eec
--- /dev/null
+++ b/Tests/RunCMake/Ninja/VerboseBuild.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+add_executable(hello hello.c)
+target_compile_definitions(hello PRIVATE "DEFINE_FOR_VERBOSE_DETECTION")
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index c73732f90..6ca33b800 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -45,6 +45,7 @@ run_object_lib_build2(LinkObjRHSObject)
run_object_lib_build(LinkObjRHSShared2)
run_object_lib_build(LinkObjRHSStatic2)
run_object_lib_build2(LinkObjRHSObject2)
+run_object_lib_build(TransitiveDependencies)
run_cmake(MissingSource)
run_cmake(ObjWithObj)
diff --git a/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake
new file mode 100644
index 000000000..e41cf2ec9
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/TransitiveDependencies.cmake
@@ -0,0 +1,7 @@
+add_library(lib1 STATIC depends_obj0.c)
+add_library(lib2 OBJECT a.c)
+target_link_libraries(lib2 PRIVATE lib1)
+
+add_executable(test exe2.c)
+
+target_link_libraries(test PUBLIC lib2)
diff --git a/Tests/RunCMake/ObjectLibrary/exe2.c b/Tests/RunCMake/ObjectLibrary/exe2.c
new file mode 100644
index 000000000..66e0caf95
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/exe2.c
@@ -0,0 +1,6 @@
+extern int myobj_foo(void);
+
+int main(void)
+{
+ return myobj_foo();
+}
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/CMakeLists.txt b/Tests/RunCMake/ParseImplicitIncludeInfo/CMakeLists.txt
new file mode 100644
index 000000000..289710955
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.0)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
new file mode 100644
index 000000000..a39a52984
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
@@ -0,0 +1,115 @@
+cmake_minimum_required(VERSION 3.14)
+project(Minimal NONE)
+
+#
+# list of targets to test. to add a target: put its files in the data
+# subdirectory and add it to this list... we run each target's
+# data/*.input file through the parser and check to see if it matches
+# the corresponding data/*.output file. note that the empty-* case
+# has special handling (it should not parse).
+#
+set(targets
+ aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+ craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
+ craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+ craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
+ craype-Fortran-Intel-18.0.2.20180210
+ darwin-C-AppleClang-8.0.0.8000042 darwin-CXX-AppleClang-8.0.0.8000042
+ darwin_nostdinc-C-AppleClang-8.0.0.8000042
+ darwin_nostdinc-CXX-AppleClang-8.0.0.8000042
+ empty-C empty-CXX
+ freebsd-C-Clang-3.3.0 freebsd-CXX-Clang-3.3.0 freebsd-Fortran-GNU-4.6.4
+ linux-C-GNU-7.3.0 linux-CXX-GNU-7.3.0 linux-Fortran-GNU-7.3.0
+ linux-C-Intel-18.0.0.20170811 linux-CXX-Intel-18.0.0.20170811
+ linux-C-PGI-18.10.1 linux-CXX-PGI-18.10.1
+ linux-Fortran-PGI-18.10.1 linux_pgf77-Fortran-PGI-18.10.1
+ linux_nostdinc-C-PGI-18.10.1 linux_nostdinc-CXX-PGI-18.10.1
+ linux_nostdinc-Fortran-PGI-18.10.1
+ linux-C-XL-12.1.0 linux-CXX-XL-12.1.0 linux-Fortran-XL-14.1.0
+ linux_nostdinc-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
+ linux_nostdinc_i-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
+ linux-C-XL-16.1.0.0 linux-CXX-XL-16.1.0.0
+ linux-CUDA-NVIDIA-9.2.148
+ mingw.org-C-GNU-4.9.3 mingw.org-CXX-GNU-4.9.3
+ netbsd-C-GNU-4.8.5 netbsd-CXX-GNU-4.8.5
+ netbsd_nostdinc-C-GNU-4.8.5 netbsd_nostdinc-CXX-GNU-4.8.5
+ openbsd-C-Clang-5.0.1 openbsd-CXX-Clang-5.0.1
+ sunos-C-SunPro-5.13.0 sunos-CXX-SunPro-5.13.0 sunos-Fortran-SunPro-8.8.0
+ )
+
+if(CMAKE_HOST_WIN32)
+ # The KWSys actual-case cache breaks case sensitivity on Windows.
+ list(FILTER targets EXCLUDE REGEX "-XL|-SunPro")
+else()
+ # Windows drive letters are not recognized as absolute on other platforms.
+ list(FILTER targets EXCLUDE REGEX "mingw")
+endif()
+
+include(${CMAKE_ROOT}/Modules/CMakeParseImplicitIncludeInfo.cmake)
+
+#
+# load_compiler_info: read infile, parsing out cmake compiler info
+# variables as we go. returns language, a list of variables we set
+# (so we can clear them later), and the remaining verbose output
+# from the compiler.
+#
+function(load_compiler_info infile lang_var outcmvars_var outstr_var)
+ unset(lang)
+ unset(outcmvars)
+ unset(outstr)
+ file(READ "${infile}" in)
+ string(REGEX REPLACE "\r?\n" ";" in_lines "${in}")
+ foreach(line IN LISTS in_lines)
+ # check for special CMAKE variable lines and parse them if found
+ if("${line}" MATCHES "^CMAKE_([_A-Za-z0-9]+)=(.*)$")
+ if("${CMAKE_MATCH_1}" STREQUAL "LANG") # handle CMAKE_LANG here
+ set(lang "${CMAKE_MATCH_2}")
+ else()
+ set(CMAKE_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" PARENT_SCOPE)
+ list(APPEND outcmvars "CMAKE_${CMAKE_MATCH_1}")
+ endif()
+ else()
+ string(APPEND outstr "${line}\n")
+ endif()
+ endforeach()
+ if(NOT lang)
+ message("load_compiler_info: ${infile} no LANG info; default to C")
+ set(lang C)
+ endif()
+ set(${lang_var} "${lang}" PARENT_SCOPE)
+ set(${outcmvars_var} "${outcmvars}" PARENT_SCOPE)
+ set(${outstr_var} "${outstr}" PARENT_SCOPE)
+endfunction()
+
+#
+# unload_compiler_info: clear out any CMAKE_* vars load previously set
+#
+function(unload_compiler_info cmvars)
+ foreach(var IN LISTS cmvars)
+ unset("${var}" PARENT_SCOPE)
+ endforeach()
+endfunction()
+
+#
+# main test loop
+#
+foreach(t ${targets})
+ set(infile "${CMAKE_SOURCE_DIR}/data/${t}.input")
+ set(outfile "${CMAKE_SOURCE_DIR}/data/${t}.output")
+ if (NOT EXISTS ${infile} OR NOT EXISTS ${outfile})
+ message("missing files for target ${t} in ${CMAKE_SOURCE_DIR}/data")
+ continue()
+ endif()
+ load_compiler_info(${infile} lang cmvars input)
+ file(READ ${outfile} output)
+ string(STRIP "${output}" output)
+ cmake_parse_implicit_include_info("${input}" "${lang}" idirs log state)
+ if(t MATCHES "^empty-") # empty isn't supposed to parse
+ if("${state}" STREQUAL "done")
+ message("empty parse failed: ${idirs}, log=${log}")
+ endif()
+ elseif(NOT "${state}" STREQUAL "done" OR NOT "${output}" STREQUAL "${idirs}")
+ message("parse failed: state=${state}, ${output} != ${idirs}, log=${log}")
+ endif()
+ unload_compiler_info("${cmvars}")
+endforeach(t)
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/RunCMakeTest.cmake b/Tests/RunCMake/ParseImplicitIncludeInfo/RunCMakeTest.cmake
new file mode 100644
index 000000000..6266b500d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(ParseImplicitIncludeInfo)
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt b/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
new file mode 100644
index 000000000..b854e2ea2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
@@ -0,0 +1,87 @@
+#
+# helper CMakeLists.txt file that can be used to generate input files
+# for the Tests/RunCMake/ParseImplicitIncludeInfo test.
+#
+# usage:
+# [create a temporary build directory and chdir to it]
+# cmake [-D options] $CMAKE_SRC/Tests/RunCMake/ParseImplicitIncludeInfo/data
+#
+# where useful -D options include:
+# -DLANGUAGES="C;CXX" -- list of languages to generate inputs for
+# -DUNAME="Darwin" -- operating system name (def: CMAKE_SYSTEM_NAME)
+#
+
+cmake_minimum_required(VERSION 3.3)
+
+set(lngs C CXX)
+set(LANGUAGES "${lngs}" CACHE STRING "List of languages to generate inputs for")
+
+project(gen_implicit_include_data ${LANGUAGES})
+
+set(UNAME "${CMAKE_SYSTEM_NAME}" CACHE STRING "System uname")
+string(TOLOWER "${UNAME}" UNAME)
+message("Generate input for system type: ${UNAME}")
+
+# CMAKE_<LANG>_COMPILER_* variables we save in the resultfile
+set(compvars ABI AR ARCHITECTURE_ID EXTERNAL_TOOLCHAIN ID LAUNCHER LOADED
+ RANLIB TARGET VERSION VERSION_INTERAL)
+
+foreach(lang IN ITEMS ${LANGUAGES})
+
+ if("${lang}" STREQUAL "C")
+ set(file ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
+ elseif("${lang}" STREQUAL "CXX")
+ set(file ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
+ elseif("${lang}" STREQUAL "CUDA")
+ set(file ${CMAKE_ROOT}/Modules/CMakeCUDACompilerABI.cu)
+ elseif("${lang}" STREQUAL "Fortran")
+ set(file ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
+ else()
+ message(FATAL_ERROR "unknown language ${lang}")
+ endif()
+
+ set(resultfile "${CMAKE_BINARY_DIR}/")
+ string(APPEND resultfile ${UNAME}-${lang}-${CMAKE_${lang}_COMPILER_ID})
+ string(APPEND resultfile -${CMAKE_${lang}_COMPILER_VERSION})
+ string(APPEND resultfile .input)
+ message("Generate input for language ${lang}")
+ message("Input file: ${file}")
+ message("Result file: ${resultfile}")
+
+ # replicate logic from CMakeDetermineCompilerABI
+ set(outfile "${CMAKE_PLATFORM_INFO_DIR}/test${lang}.out")
+ set(CMAKE_FLAGS )
+ set(COMPILE_DEFINITIONS )
+ if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
+ set(CMAKE_FLAGS "-DEXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
+ set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_FLAG}")
+ endif()
+ if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG)
+ set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}")
+ endif()
+ if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
+ # Avoid adding our own platform standard libraries for compilers
+ # from which we might detect implicit link libraries.
+ list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=")
+ endif()
+
+ try_compile(rv ${CMAKE_BINARY_DIR} ${file}
+ CMAKE_FLAGS ${CMAKE_FLAGS}
+ COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS}
+ CMAKE_FLAGS ${CMAKE_FLAGS}
+ OUTPUT_VARIABLE output
+ COPY_FILE "${outfile}"
+ COPY_FILE_ERROR copy_error)
+
+ if(NOT rv)
+ message(FATAL_ERROR "${lang} compile failed!!")
+ endif()
+
+ set(result "CMAKE_LANG=${lang}\n")
+ foreach(var IN ITEMS ${compvars})
+ list(APPEND result
+ "CMAKE_${lang}_COMPILER_${var}=${CMAKE_${lang}_COMPILER_${var}}\n")
+ endforeach()
+
+ file(WRITE ${resultfile} ${result} ${output})
+endforeach()
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/README b/Tests/RunCMake/ParseImplicitIncludeInfo/data/README
new file mode 100644
index 000000000..4f19b3c23
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/README
@@ -0,0 +1,25 @@
+This directory contains sample input files for the implicit include
+directories parser for testing. For each configuration there is one
+".input" file and one ".output" file.
+
+To generate ".input" files for a system, create a temporary build
+directory and chdir to it. Then run cmake pointing to this directory.
+The CMakeLists.txt file here will generate ".input" files in your
+build directory. The default set of languages is C and CXX. This
+can be changed with -DLANGUAGES=language_list. For example:
+-DLANGUAGES=Fortran will generate Fortran parser input.
+
+The ".output" files should be generated by hand from the input files.
+The test will compare the parser output to the manually generated
+".output" file. The two should match.
+
+For compilers that support "-nostdinc"-like flags, you can generate
+a test for this with a command like:
+cmake -DUNAME=netbsd_nostdinc \
+ -DCMAKE_C_FLAGS=-nostdinc -DCMAKE_CXX_FLAGS=-nostdinc .
+
+Here is an example for testing the XL compiler with both -I and nostdinc:
+
+env CC=xlc CXX=xlC cmake -DUNAME=linux_nostdinc_i \
+ -DCMAKE_C_FLAGS='-qnostdinc -I/tmp/ii/test_c' \
+ -DCMAKE_CXX_FLAGS='-qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx' .
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input
new file mode 100644
index 000000000..14517c5cb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=13.1.3
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_424d1/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_424d1.dir/build.make CMakeFiles/cmTC_424d1.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o
+/opt/IBM/xlc/13.1.3/bin/xlc -qthreaded -qhalt=e -V -o CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o -c /tmp/CMake/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlc
+export XL_ASMOBJFILES=/tmp/xlcASvf7aid
+export "XL_DIS=/opt/IBM/xlc/13.1.3/exe/dis -o "CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/opt/IBM/xlc/13.1.3/exe/xlcentry -qosvar=aix.7.2 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX50 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_IBMR2 -D_POWER -qthreaded -qhalt=e -qasm_as=/bin/as -qc_stdinc=/opt/IBM/xlc/13.1.3/include:/opt/IBM/xlmass/8.1.3/include:/usr/include -qvac_include_path=/opt/IBM/xlc/13.1.3/include -oCMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o /tmp/CMake/Modules/CMakeCCompilerABI.c /tmp/xlcW0uR7aia /tmp/xlcW1uV7aib /dev/null /tmp/xlcLvj7aieF.lst /dev/null /tmp/xlcW2vb7aic
+export XL_BACKEND=/opt/IBM/xlc/13.1.3/exe/xlCcode
+export XL_LINKER=/bin/ld
+/opt/IBM/xlc/13.1.3/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qthreaded -qhalt=e /tmp/xlcW0uR7aia /tmp/xlcW1uV7aib CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o /tmp/xlcLvj7aieB.lst /tmp/xlcW2vb7aic
+rm /tmp/xlcASvf7aid
+rm /tmp/xlcLvj7aie
+rm /tmp/xlcW0uR7aia
+rm /tmp/xlcW1uV7aib
+rm /tmp/xlcW2vb7aic
+Linking C executable cmTC_424d1
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_424d1.dir/link.txt --verbose=1
+/opt/IBM/xlc/13.1.3/bin/xlc -qthreaded -qhalt=e -Wl,-bnoipath -Wl,-brtl -V -Wl,-bexpall CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o -o cmTC_424d1 -Wl,-blibpath:/usr/lib:/lib
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlc
+/bin/ld -b32 /lib/crt0.o -bpT:0x10000000 -bpD:0x20000000 -bnoipath -brtl -bexpall CMakeFiles/cmTC_424d1.dir/CMakeCCompilerABI.c.o -o cmTC_424d1 -blibpath:/usr/lib:/lib -L/opt/IBM/xlmass/8.1.3/lib/aix61 -L/opt/IBM/xlc/13.1.3/lib -lxlopt -lxlipa -lxl -lc
+rm /tmp/xlcW0wn7aia
+rm /tmp/xlcW1wr7aib
+rm /tmp/xlcW2wz7aic
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output
new file mode 100644
index 000000000..91b35ad15
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output
@@ -0,0 +1 @@
+/opt/IBM/xlc/13.1.3/include;/opt/IBM/xlmass/8.1.3/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input
new file mode 100644
index 000000000..5aec849e1
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input
@@ -0,0 +1,44 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=13.1.3
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_e8f3a/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_e8f3a.dir/build.make CMakeFiles/cmTC_e8f3a.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o
+/opt/IBM/xlC/13.1.3/bin/xlC -+ -qthreaded -qhalt=s -V -o CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o -c /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlC
+export XL_XLCMP_PATH=/opt/IBM/xlc/13.1.3:/opt/IBM/xlC/13.1.3
+export XL_COMPILER=xlc++
+export XL_ASMOBJFILES=/tmp/xlcAS3F7aid
+export "XL_DIS=/opt/IBM/xlc/13.1.3/exe/dis -o "CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/opt/IBM/xlC/13.1.3/exe/xlCentry -qosvar=aix.7.2 -qalias=ansi -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX50 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -D_IBMR2 -D_POWER -qthreaded -qhalt=s -qasm_as=/bin/as -qcpp_stdinc=/opt/IBM/xlC/13.1.3/include:/opt/IBM/xlmass/8.1.3/include:/usr/include -qc_stdinc=/opt/IBM/xlc/13.1.3/include:/opt/IBM/xlmass/8.1.3/include:/usr/include -oCMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW03r7aia /tmp/xlcW1347aib /dev/null /tmp/xlcL3J7aieF.lst /dev/null /tmp/xlcW2387aic
+export XL_BACKEND=/opt/IBM/xlc/13.1.3/exe/xlCcode
+export XL_LINKER=/bin/ld
+/opt/IBM/xlc/13.1.3/exe/xlCcode -qalias=ansi -qthreaded -qhalt=s /tmp/xlcW03r7aia /tmp/xlcW1347aib CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcL3J7aieB.lst /tmp/xlcW2387aic
+rm /tmp/xlcAS3F7aid
+rm /tmp/xlcL3J7aie
+rm /tmp/xlcW03r7aia
+rm /tmp/xlcW1347aib
+rm /tmp/xlcW2387aic
+Linking CXX executable cmTC_e8f3a
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e8f3a.dir/link.txt --verbose=1
+/opt/IBM/xlC/13.1.3/bin/xlC -qthreaded -qhalt=s -Wl,-bnoipath -Wl,-brtl -V -Wl,-bexpall CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e8f3a -Wl,-blibpath:/usr/lib:/lib
+export XL_CONFIG=/opt/IBM/xlc/13.1.3/etc/xlc.cfg.72:xlC
+/bin/ld -b32 /lib/crt0.o /lib/crti.o -bpT:0x10000000 -bpD:0x20000000 -bnoipath -brtl -bexpall CMakeFiles/cmTC_e8f3a.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_e8f3a -blibpath:/usr/lib:/lib -bcdtors:all:0:s -btmplrename -L/opt/IBM/xlmass/8.1.3/lib/aix61 -L/opt/IBM/xlc/13.1.3/lib -lxlopt -lxlipa -lxl -L/opt/IBM/xlC/13.1.3/lib -lC -lm -lc |
+/opt/IBM/xlC/13.1.3/bin/c++filt -S |
+/bin/sed '/317.*::virtual-fn-table-ptr$/ s/^\(.*: \)*{*\([^}]*\)\(}*.*\)::virtual-fn-table-ptr$/\1Virtual table for class "\2": Some possible causes are: first non-inline virtual function in "\2" is not defined or the class is a template instantiation and an explicit instantiation definition of the class is missing./'
+rm /tmp/xlcW04Jtaea
+rm /tmp/xlcW14Vtaeb
+rm /tmp/xlcW24Vtaec
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output
new file mode 100644
index 000000000..264e4fe3b
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output
@@ -0,0 +1 @@
+/opt/IBM/xlC/13.1.3/include;/opt/IBM/xlmass/8.1.3/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.input
new file mode 100644
index 000000000..b3218a2f5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.input
@@ -0,0 +1,53 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=Cray
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=8.7
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_cb7b8/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_cb7b8.dir/build.make CMakeFiles/cmTC_cb7b8.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_cb7b8.dir/CMakeCCompilerABI.c.o
+/opt/cray/pe/craype/2.5.15/bin/cc -v -o CMakeFiles/cmTC_cb7b8.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake/Modules/CMakeCCompilerABI.c
+rm /tmp/pe_15430/CMakeCCompilerABI_1.s
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/ccfe -hc -hcpu=haswell -D __CRAYXC -D __CRAY_HASWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -hnetwork=aries -nostdinc -isystem /opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs -isystem /opt/cray/pe/cce/8.7.4/cce/x86_64/include/basic -isystem /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include -isystem /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include-fixed -isystem /opt/gcc/6.1.0/snos/include -isystem /usr/include -I /opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include -D__PEDRVR_GCC_BASE_ACTIVE__ -hpl=/tmp/pe_15430//pldir -rx8503 -ru87000 -CZ /tmp/pe_15430/CMakeCCompilerABI.T -Cx -CX /tmp/pe_15430/CMakeCCompilerABI.xml -hdecompile=/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_cb7b8.dir/CMakeCCompilerABI. -S /tmp/pe_15430/CMakeCCompilerABI_1.s -hipa3 -ufile_id=1 /usr/share/cmake/Modules/CMakeCCompilerABI.c
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/optcg /tmp/pe_15430//pldir 1
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_cb7b8.dir/CMakeCCompilerABI.c.o --64 /tmp/pe_15430/CMakeCCompilerABI_1.s
+rm /tmp/pe_15430/CMakeCCompilerABI_1.s
+rm /tmp/pe_15430//CMakeCCompilerABI_1.cif.Ttmp
+rm /tmp/pe_15430//CMakeCCompilerABI.Tfe
+rm /tmp/pe_15430//CMakeCCompilerABI.T
+rm /tmp/pe_15430//CMakeCCompilerABI_1.xml.Ttmp
+rm /tmp/pe_15430//pldir/PL_path
+rm /tmp/pe_15430//pldir/iline_1
+rm /tmp/pe_15430//pldir/PL_module_list
+rm /tmp/pe_15430//pldir/CMakeCCompilerABI_1.inl
+rm /tmp/pe_15430//pldir/gline_1
+rm /tmp/pe_15430//pldir/PL_global_data
+rmdir /tmp/pe_15430//pldir
+rm /tmp/pe_15430//CMakeCCompilerABI.xml
+rmdir /tmp/pe_15430/
+Linking C executable cmTC_cb7b8
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cb7b8.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/cc -v CMakeFiles/cmTC_cb7b8.dir/CMakeCCompilerABI.c.o -o cmTC_cb7b8
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld /usr/lib64//crt1.o /usr/lib64//crti.o /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtbeginT.o /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtfastmath.o /opt/cray/pe/cce/8.7.4/cce/x86_64/lib/no_mmap.o CMakeFiles/cmTC_cb7b8.dir/CMakeCCompilerABI.c.o -Bstatic -rpath=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib -L /opt/gcc/6.1.0/snos/lib64 -rpath=/opt/cray/pe/gcc-libs -L /opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/lib -L /opt/cray/dmapp/default/lib64 -L /opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib -L /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L /opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/lib64 -L /opt/cray/pe/pmi/5.0.14/lib64 -L /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L /opt/cray/pe/atp/2.1.3/libApp -L /opt/cray/pe/cce/8.7.4/cce/x86_64/lib/pkgconfig/../ -L /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -L /usr/lib64 -L /lib64 -rpath=/usr/lib64 -rpath=/lib64 -lpthread -lsci_cray_mpi_mp -lm -lf -lsci_cray_mp -lcraymp -lm -lpthread -lf -lhugetlbfs -lmpich_cray -lrt -lpthread -lugni -lpmi -lpgas-dmapp -lfi -lu -lrt --undefined=dmapp_get_flag_nbi -ldmapp -lugni -ludreg -lpthread -lm -lcray-c++-rts -lstdc++ -lxpmem -ldmapp -lpthread -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lugni -lpthread -lalpsutil -lpthread -lrca -ludreg -lquadmath -lm -lomp -lrt -lcraymp -lpthread -lrt -ldl -lcray-c++-rts -lstdc++ -lm -lmodules -lm -lrt -lfi -lm -lquadmath -lrt -lcraymath -lm -lgfortran -lquadmath -lrt -lf -lm -lpthread -lrt -lu -lrt -ldl -lcray-c++-rts -lstdc++ -lm -lcsup -lrt --as-needed -latomic --no-as-needed -lstdc++ -lpthread --start-group -lc -lcsup -lgcc_eh -lm -lgcc --end-group -T/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/2.23.1.cce.ld -L /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0 -L /opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_cb7b8 --undefined=__pthread_initialize_minimal /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtend.o /usr/lib64//crtn.o
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_cb7b8
+rm /tmp/pe_15450//pldir/PL_path
+rm /tmp/pe_15450//pldir/PL_module_list
+rm /tmp/pe_15450//pldir/PL_global_data
+rmdir /tmp/pe_15450//pldir
+rmdir /tmp/pe_15450/
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.output
new file mode 100644
index 000000000..cbd213278
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs;/opt/cray/pe/cce/8.7.4/cce/x86_64/include/basic;/opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include;/opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include-fixed;/opt/gcc/6.1.0/snos/include;/usr/include;/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.input
new file mode 100644
index 000000000..2dc60aff2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.input
@@ -0,0 +1,79 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=7.3.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_61245/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_61245.dir/build.make CMakeFiles/cmTC_61245.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o
+/opt/cray/pe/craype/2.5.15/bin/cc -v -o CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake/Modules/CMakeCCompilerABI.c
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/gcc
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o' '-c' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/cc1 -quiet -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include -D __CRAYXC -D __CRAY_HASWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -D __TARGET_LINUX__ /usr/share/cmake/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -march=core-avx2 -auxbase-strip CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o -version -o /tmp/ccNvdQ8R.s
+GNU C11 (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../x86_64-suse-linux/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include
+ /usr/local/include
+ /opt/gcc/7.3.0/snos/include
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed
+ /usr/include
+End of search list.
+GNU C11 (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 4ecdcb30ed2f7ac4fb078d81fd42f086
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o' '-c' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ as -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include --64 -o CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o /tmp/ccNvdQ8R.s
+GNU assembler version 2.31.1 (x86_64-suse-linux) using BFD version (GNU Binutils SUSE Linux Enterprise 12) 2.31.1.20180828-9.26
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o' '-c' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+Linking C executable cmTC_61245
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_61245.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/cc -v CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o -o cmTC_61245
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/gcc
+COLLECT_LTO_WRAPPER=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_61245' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64' '-L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64' '-L/opt/cray/pe/pmi/5.0.14/lib64' '-L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64' '-L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/collect2 -plugin /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/liblto_plugin.so -plugin-opt=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccG3uxpY.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc -m elf_x86_64 -static -o cmTC_61245 -u pthread_mutex_destroy /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtbeginT.o -L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L/opt/cray/pe/pmi/5.0.14/lib64 -L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../.. CMakeFiles/cmTC_61245.dir/CMakeCCompilerABI.c.o -rpath=/opt/cray/pe/gcc-libs --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -lpthread -lsci_gnu_71_mpi -lsci_gnu_71 -lpthread -lhugetlbfs -lmpich_gnu_71 -lrt -lugni -lpthread -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lalpsutil -lpthread -lrca -lxpmem -lugni -lpthread -ludreg --as-needed -lgfortran -lquadmath --no-as-needed --as-needed -lmvec --no-as-needed --as-needed -lm --no-as-needed --as-needed -lpthread --no-as-needed --start-group -lgcc -lgcc_eh -lc --end-group /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtend.o /usr/lib/../lib64/crtn.o
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_61245' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64' '-L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64' '-L/opt/cray/pe/pmi/5.0.14/lib64' '-L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64' '-L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64'
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.output
new file mode 100644
index 000000000..64f127ef2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.output
@@ -0,0 +1 @@
+/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include;/usr/local/include;/opt/gcc/7.3.0/snos/include;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.input
new file mode 100644
index 000000000..8c68e5bf5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=Intel
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.0.2.20180210
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_96fde/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_96fde.dir/build.make CMakeFiles/cmTC_96fde.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o
+/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/bin/intel64/icc -v -o CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake/Modules/CMakeCCompilerABI.c
+icc version 18.0.2 (gcc version 6.3.0 compatibility)
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/mcpcom --target_efi2 --lang=c -_g -mP3OPT_inline_alloca -D__ICC=1800 -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=2 -D__PTRDIFF_TYPE__=long "-D__SIZE_TYPE__=unsigned long" -D__WCHAR_TYPE__=int "-D__WINT_TYPE__=unsigned int" "-D__INTMAX_TYPE__=long int" "-D__UINTMAX_TYPE__=long unsigned int" -D__LONG_MAX__=9223372036854775807L -D__QMSPP_ -D__OPTIMIZE__ -D__NO_MATH_INLINES -D__NO_STRING_INLINES -D__GNUC_GNU_INLINE__ -D__GNUC__=6 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__LP64__ -D_LP64 -D__GXX_ABI_VERSION=1010 "-D__USER_LABEL_PREFIX__= " -D__REGISTER_PREFIX__= -D__INTEL_RTTI__ -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -B -Dunix -Dlinux "-_Asystem(unix)" -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ "-_Acpu(x86_64)" "-_Amachine(x86_64)" -D__INTEL_COMPILER_BUILD_DATE=20180210 -D__INTEL_OFFLOAD -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -_k -_8 -_l --has_new_stdarg_support -_a -_b --gnu_version=60300 -_W5 --gcc-extern-inline --multibyte_chars -mGLOB_diag_suppress_sys --system_preinclude /usr/include/stdc-predef.h --array_section --simd --simd_func --offload_mode=1 --offload_target_names=gfx,GFX,mic,MIC --offload_unique_string=icc1641499230JViDRp -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-v -o CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o -c" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/icc6TGEr2as_.s -mIPOPT_activate -mIPOPT_lite -mGLOB_instruction_tuning=0x0 -mGLOB_uarch_tuning=0x0 -mGLOB_product_id_code=0x22006d92 -mCG_bnl_movbe=T -mGLOB_extended_instructions=0x8 -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icc1641499230JViDRp -mP2OPT_hlo_level=2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_lto_object_enabled -mIPOPT_lto_object_value=1 -mIPOPT_obj_output_file_name=CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o -mIPOPT_whole_archive_fixup_file_name=/tmp/iccwarchM4gS0h -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/icctempfileMGADNU -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_C -mP1OPT_source_file_name=/usr/share/cmake/Modules/CMakeCCompilerABI.c -mP1OPT_full_source_file_name=/usr/share/cmake/Modules/CMakeCCompilerABI.c /usr/share/cmake/Modules/CMakeCCompilerABI.c
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include
+ /usr/local/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed
+ /opt/gcc/6.3.0/snos/include/
+ /usr/include
+End of search list.
+Linking C executable cmTC_96fde
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_96fde.dir/link.txt --verbose=1
+/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/bin/intel64/icc -v CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o -o cmTC_96fde -rdynamic
+icc version 18.0.2 (gcc version 6.3.0 compatibility)
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/mcpcom -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-v -o cmTC_96fde -rdynamic" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/iccRJ58KYas_.s -mGLOB_dashboard_use_source_name -mIPOPT_activate -mGLOB_product_id_code=0x22006d92 -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mGLOB_opt_report_use_source_name -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icc0762718770pMrhfB -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_link -mIPOPT_ipo_activate -mIPOPT_mo_activate -mIPOPT_source_files_list=/tmp/iccslisYmrmw5 -mIPOPT_mo_global_data -mIPOPT_link_script_file=/tmp/iccscript8Dy5AI "-mIPOPT_cmdline_link="/usr/lib/../lib64/crt1.o" "/usr/lib/../lib64/crti.o" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbegin.o" "-export-dynamic" "--eh-frame-hdr" "--build-id" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-m" "elf_x86_64" "-o" "cmTC_96fde" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/" "-L/lib/../lib64" "-L/lib/../lib64/" "-L/usr/lib/../lib64" "-L/usr/lib/../lib64/" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../" "-L/lib64" "-L/lib/" "-L/usr/lib64" "-L/usr/lib" "CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o" "-Bdynamic" "-Bstatic" "-limf" "-lsvml" "-lirng" "-Bdynamic" "-lm" "-Bstatic" "-lipgo" "-ldecimal" "--as-needed" "-Bdynamic" "-lcilkrts" "-lstdc++" "--no-as-needed" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc" "-lsvml" "-Bdynamic" "-lc" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc_s" "-Bdynamic" "-ldl" "-lc" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o" "/usr/lib/../lib64/crtn.o"" -mIPOPT_il_in_obj -mIPOPT_ipo_activate_warn=FALSE -mIPOPT_obj_output_file_name=/tmp/ipo_icclnz13i.o -mIPOPT_whole_archive_fixup_file_name=/tmp/iccwarch0d1B2R -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/icctempfilelBn98u -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=/tmp/ipo_icclnz13i.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_NONE -mP1OPT_source_file_name=ipo_out.c CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o -mIPOPT_object_files=T -mIPOPT_assembly_files=/tmp/iccalisA2xsdz -mIPOPT_generated_tempfiles=/tmp/iccelisbUgbic -mIPOPT_embedded_object_base_name=/tmp/icceobjEt9TmP -mIPOPT_cmdline_link_new_name=/tmp/iccllisYEcDrs
+ld /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbegin.o -export-dynamic --eh-frame-hdr --build-id -dynamic-linker /lib64/ld-linux-x86-64.so.2 -m elf_x86_64 -o cmTC_96fde -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64 -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64 -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib CMakeFiles/cmTC_96fde.dir/CMakeCCompilerABI.c.o -Bdynamic -Bstatic -limf -lsvml -lirng -Bdynamic -lm -Bstatic -lipgo -ldecimal --as-needed -Bdynamic -lcilkrts -lstdc++ --no-as-needed -lgcc -lgcc_s -Bstatic -lirc -lsvml -Bdynamic -lc -lgcc -lgcc_s -Bstatic -lirc_s -Bdynamic -ldl -lc /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o /usr/lib/../lib64/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.output
new file mode 100644
index 000000000..a26a007ce
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.output
@@ -0,0 +1 @@
+/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include;/usr/local/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed;/opt/gcc/6.3.0/snos/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.input
new file mode 100644
index 000000000..73c9c8a7f
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.input
@@ -0,0 +1,53 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=Cray
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=8.7
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_f3b1f/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_f3b1f.dir/build.make CMakeFiles/cmTC_f3b1f.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_f3b1f.dir/CMakeCXXCompilerABI.cpp.o
+/opt/cray/pe/craype/2.5.15/bin/CC -v -o CMakeFiles/cmTC_f3b1f.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp
+rm /tmp/pe_15530/CMakeCXXCompilerABI_1.s
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/ccfe -hcpu=haswell -D __CRAYXC -D __CRAY_HASWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -hnetwork=aries -nostdinc -isystem /opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs -isystem /opt/gcc/6.1.0/snos/include/g++ -isystem /opt/gcc/6.1.0/snos/include/g++/x86_64-suse-linux -isystem /opt/gcc/6.1.0/snos/include/g++/backward -isystem /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include -isystem /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include-fixed -isystem /opt/cray/pe/cce/8.7.4/cce/x86_64/include/c++ -isystem /opt/cray/pe/cce/8.7.4/cce/x86_64/include/basic -isystem /opt/gcc/6.1.0/snos/include -isystem /usr/include -I /opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include -D__PEDRVR_GCC_BASE_ACTIVE__ -hpl=/tmp/pe_15530//pldir -rx8503 -ru87000 -hipafrom=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/libcray-c++-rts.a -CZ /tmp/pe_15530/CMakeCXXCompilerABI.T -Cx -CX /tmp/pe_15530/CMakeCXXCompilerABI.xml -hdecompile=/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_f3b1f.dir/CMakeCXXCompilerABI. -S /tmp/pe_15530/CMakeCXXCompilerABI_1.s -hipa4 -ufile_id=1 /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/optcg /tmp/pe_15530//pldir 1
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_f3b1f.dir/CMakeCXXCompilerABI.cpp.o --64 /tmp/pe_15530/CMakeCXXCompilerABI_1.s
+rm /tmp/pe_15530/CMakeCXXCompilerABI_1.s
+rm /tmp/pe_15530//CMakeCXXCompilerABI.xml
+rm /tmp/pe_15530//CMakeCXXCompilerABI_1.cif.Ttmp
+rm /tmp/pe_15530//CMakeCXXCompilerABI.T
+rm /tmp/pe_15530//pldir/PL_path
+rm /tmp/pe_15530//pldir/CMakeCXXCompilerABI_1.inl
+rm /tmp/pe_15530//pldir/iline_1
+rm /tmp/pe_15530//pldir/PL_module_list
+rm /tmp/pe_15530//pldir/gline_1
+rm /tmp/pe_15530//pldir/PL_global_data
+rmdir /tmp/pe_15530//pldir
+rm /tmp/pe_15530//CMakeCXXCompilerABI.Tfe
+rm /tmp/pe_15530//CMakeCXXCompilerABI_1.xml.Ttmp
+rmdir /tmp/pe_15530/
+Linking CXX executable cmTC_f3b1f
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f3b1f.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/CC -v CMakeFiles/cmTC_f3b1f.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f3b1f
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld /usr/lib64//crt1.o /usr/lib64//crti.o /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtbeginT.o /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtfastmath.o /opt/cray/pe/cce/8.7.4/cce/x86_64/lib/no_mmap.o CMakeFiles/cmTC_f3b1f.dir/CMakeCXXCompilerABI.cpp.o -Bstatic -rpath=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib -L /opt/gcc/6.1.0/snos/lib64 -rpath=/opt/cray/pe/gcc-libs -L /opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/lib -L /opt/cray/dmapp/default/lib64 -L /opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib -L /opt/cray/dmapp/default/lib64 -L /opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib -L /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L /opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/lib64 -L /opt/cray/pe/pmi/5.0.14/lib64 -L /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L /opt/cray/pe/atp/2.1.3/libApp -L /opt/cray/pe/cce/8.7.4/cce/x86_64/lib/pkgconfig/../ -L /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -L /usr/lib64 -L /lib64 -rpath=/usr/lib64 -rpath=/lib64 -lpthread -lsci_cray_mpi_mp -lm -lf -lsci_cray_mp -lcraymp -lm -lpthread -lf -lhugetlbfs -lmpichcxx_cray -lrt -lpthread -lugni -lpmi -lmpich_cray -lrt -lpthread -lugni -lpmi -lpgas-dmapp -lfi -lu -lrt --undefined=dmapp_get_flag_nbi -ldmapp -lugni -ludreg -lpthread -lm -lcray-c++-rts -lstdc++ -lxpmem -ldmapp -lpthread -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lugni -lpthread -lalpsutil -lpthread -lrca -ludreg -lquadmath -lm -lomp -lrt -lcraymp -lpthread -lrt -ldl -lcray-c++-rts -lstdc++ -lm -lmodules -lm -lrt -lfi -lm -lquadmath -lrt -lcraymath -lm -lgfortran -lquadmath -lrt -lf -lm -lpthread -lrt -lu -lrt -ldl -lcray-c++-rts -lstdc++ -lm -lcsup -lrt --as-needed -latomic --no-as-needed -lcray-c++-rts -lstdc++ -lsupc++ -lstdc++ -lpthread --start-group -lc -lcsup -lgcc_eh -lm -lgcc --end-group -T/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/2.23.1.cce.ld -L /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0 -L /opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_f3b1f --undefined=__pthread_initialize_minimal /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtend.o /usr/lib64//crtn.o
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_f3b1f
+rm /tmp/pe_15566//pldir/PL_path
+rm /tmp/pe_15566//pldir/PL_module_list
+rm /tmp/pe_15566//pldir/PL_global_data
+rmdir /tmp/pe_15566//pldir
+rmdir /tmp/pe_15566/
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.output
new file mode 100644
index 000000000..259c42af4
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs;/opt/gcc/6.1.0/snos/include/g++;/opt/gcc/6.1.0/snos/include/g++/x86_64-suse-linux;/opt/gcc/6.1.0/snos/include/g++/backward;/opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include;/opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0/include-fixed;/opt/cray/pe/cce/8.7.4/cce/x86_64/include/c++;/opt/cray/pe/cce/8.7.4/cce/x86_64/include/basic;/opt/gcc/6.1.0/snos/include;/usr/include;/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.input
new file mode 100644
index 000000000..50f2859c7
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.input
@@ -0,0 +1,82 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=7.3.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_66e70/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_66e70.dir/build.make CMakeFiles/cmTC_66e70.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o
+/opt/cray/pe/craype/2.5.15/bin/CC -v -o CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/g++
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/cc1plus -quiet -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include -D_GNU_SOURCE -D __CRAYXC -D __CRAY_HASWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -D __TARGET_LINUX__ /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -march=core-avx2 -auxbase-strip CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o -version -o /tmp/ccH9m9Qh.s
+GNU C++14 (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../x86_64-suse-linux/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/gcc/7.3.0/snos/include/g++
+ /opt/gcc/7.3.0/snos/include/g++/x86_64-suse-linux
+ /opt/gcc/7.3.0/snos/include/g++/backward
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include
+ /usr/local/include
+ /opt/gcc/7.3.0/snos/include
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed
+ /usr/include
+End of search list.
+GNU C++14 (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: f544672a0be6a74646c0fce634253d7e
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ as -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include --64 -o CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccH9m9Qh.s
+GNU assembler version 2.31.1 (x86_64-suse-linux) using BFD version (GNU Binutils SUSE Linux Enterprise 12) 2.31.1.20180828-9.26
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+Linking CXX executable cmTC_66e70
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_66e70.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/CC -v CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_66e70
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/g++
+COLLECT_LTO_WRAPPER=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_66e70' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64' '-L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64' '-L/opt/cray/pe/pmi/5.0.14/lib64' '-L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64' '-L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/collect2 -plugin /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/liblto_plugin.so -plugin-opt=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccPBC8Um.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lc -m elf_x86_64 -static -o cmTC_66e70 -u pthread_mutex_destroy /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtbeginT.o -L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L/opt/cray/pe/pmi/5.0.14/lib64 -L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../.. CMakeFiles/cmTC_66e70.dir/CMakeCXXCompilerABI.cpp.o -rpath=/opt/cray/pe/gcc-libs --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -lpthread -lsci_gnu_71_mpi -lsci_gnu_71 -lpthread -lhugetlbfs -lmpichcxx_gnu_71 -lrt -lugni -lpthread -lpmi -lmpich_gnu_71 -lrt -lugni -lpthread -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lalpsutil -lpthread -lrca -lugni -lpthread -lxpmem -ludreg --as-needed -lgfortran -lquadmath --no-as-needed --as-needed -lmvec --no-as-needed --as-needed -lm --no-as-needed --as-needed -lpthread --no-as-needed -lstdc++ -lm --start-group -lgcc -lgcc_eh -lc --end-group /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtend.o /usr/lib/../lib64/crtn.o
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-static' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-u' 'pthread_mutex_destroy' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_66e70' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64' '-L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64' '-L/opt/cray/pe/pmi/5.0.14/lib64' '-L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64' '-L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64'
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.output
new file mode 100644
index 000000000..d9095f7c6
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.output
@@ -0,0 +1 @@
+/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include;/opt/gcc/7.3.0/snos/include/g++;/opt/gcc/7.3.0/snos/include/g++/x86_64-suse-linux;/opt/gcc/7.3.0/snos/include/g++/backward;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include;/usr/local/include;/opt/gcc/7.3.0/snos/include;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.input
new file mode 100644
index 000000000..e25f7cf9d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.input
@@ -0,0 +1,43 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=Intel
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.0.2.20180210
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_7f9a2/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_7f9a2.dir/build.make CMakeFiles/cmTC_7f9a2.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o
+/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/bin/intel64/icpc -v -o CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp
+icpc version 18.0.2 (gcc version 6.3.0 compatibility)
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/mcpcom --target_efi2 --lang=c++ -_g -mP3OPT_inline_alloca -D__ICC=1800 -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=2 -D__PTRDIFF_TYPE__=long "-D__SIZE_TYPE__=unsigned long" -D__WCHAR_TYPE__=int "-D__WINT_TYPE__=unsigned int" "-D__INTMAX_TYPE__=long int" "-D__UINTMAX_TYPE__=long unsigned int" -D__GLIBCXX_TYPE_INT_N_0=__int128 -D__GLIBCXX_BITSIZE_INT_N_0=128 -D__LONG_MAX__=9223372036854775807L -D__QMSPP_ -D__OPTIMIZE__ -D__NO_MATH_INLINES -D__NO_STRING_INLINES -D__GNUC_GNU_INLINE__ -D__GNUG__=6 -D__GNUC__=6 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__LP64__ -D_LP64 -D_GNU_SOURCE=1 -D__DEPRECATED=1 -D__GXX_WEAK__=1 -D__GXX_ABI_VERSION=1010 "-D__USER_LABEL_PREFIX__= " -D__REGISTER_PREFIX__= -D__INTEL_RTTI__ -D__EXCEPTIONS=1 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -B -Dunix -Dlinux "-_Asystem(unix)" -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ "-_Acpu(x86_64)" "-_Amachine(x86_64)" -D__INTEL_COMPILER_BUILD_DATE=20180210 -D__INTEL_OFFLOAD -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -_k -_8 -_l --has_new_stdarg_support -_a -_b --gnu_version=60300 -_W5 --gcc-extern-inline -p --bool -tused -x --multibyte_chars -mGLOB_diag_suppress_sys --system_preinclude /usr/include/stdc-predef.h --array_section --simd --simd_func --offload_mode=1 --offload_target_names=gfx,GFX,mic,MIC --offload_unique_string=icpc0677339003u7vp5M --bool -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-v -o CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o -c" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/icpc9QgBnwas_.s -mIPOPT_activate -mIPOPT_lite -mGLOB_instruction_tuning=0x0 -mGLOB_uarch_tuning=0x0 -mGLOB_product_id_code=0x22006d8f -mCG_bnl_movbe=T -mGLOB_extended_instructions=0x8 -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icpc0677339003u7vp5M -mP2OPT_hlo_level=2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_lto_object_enabled -mIPOPT_lto_object_value=1 -mIPOPT_obj_output_file_name=CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o -mIPOPT_whole_archive_fixup_file_name=/tmp/icpcwarchdKZxrN -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/icpctempfilejCzFYq -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_C_PLUS_PLUS -mP1OPT_source_file_name=/usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp -mP1OPT_full_source_file_name=/usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp -mGLOB_eh_linux /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include
+ /opt/gcc/6.3.0/snos/include/g++
+ /opt/gcc/6.3.0/snos/include/g++/x86_64-suse-linux
+ /opt/gcc/6.3.0/snos/include/g++/backward
+ /usr/local/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed
+ /opt/gcc/6.3.0/snos/include/
+ /usr/include
+End of search list.
+Linking CXX executable cmTC_7f9a2
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7f9a2.dir/link.txt --verbose=1
+/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/bin/intel64/icpc -v CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_7f9a2 -rdynamic
+icpc version 18.0.2 (gcc version 6.3.0 compatibility)
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/mcpcom -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-v -o cmTC_7f9a2 -rdynamic" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/icpczXhKsFas_.s -mGLOB_dashboard_use_source_name -mIPOPT_activate -mGLOB_product_id_code=0x22006d8f -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mGLOB_opt_report_use_source_name -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icpc0782944392Xjn3gY -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_link -mIPOPT_ipo_activate -mIPOPT_mo_activate -mIPOPT_source_files_list=/tmp/icpcslis0WLMWJ -mIPOPT_mo_global_data -mIPOPT_link_script_file=/tmp/icpcscriptx5xyMn "-mIPOPT_cmdline_link="/usr/lib/../lib64/crt1.o" "/usr/lib/../lib64/crti.o" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbegin.o" "-export-dynamic" "--eh-frame-hdr" "--build-id" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-m" "elf_x86_64" "-o" "cmTC_7f9a2" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/" "-L/lib/../lib64" "-L/lib/../lib64/" "-L/usr/lib/../lib64" "-L/usr/lib/../lib64/" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../" "-L/lib64" "-L/lib/" "-L/usr/lib64" "-L/usr/lib" "CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o" "-Bdynamic" "-Bstatic" "-limf" "-lsvml" "-lirng" "-Bdynamic" "-lstdc++" "-lm" "-Bstatic" "-lipgo" "-ldecimal" "--as-needed" "-Bdynamic" "-lcilkrts" "--no-as-needed" "-lstdc++" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc" "-lsvml" "-Bdynamic" "-lc" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc_s" "-Bdynamic" "-ldl" "-lc" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o" "/usr/lib/../lib64/crtn.o"" -mIPOPT_il_in_obj -mIPOPT_ipo_activate_warn=FALSE -mIPOPT_obj_output_file_name=/tmp/ipo_icpcP4kcWS.o -mIPOPT_whole_archive_fixup_file_name=/tmp/icpcwarchR2OJ1A -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/icpctempfileWiVxTe -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=/tmp/ipo_icpcP4kcWS.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_NONE -mP1OPT_source_file_name=ipo_out.c CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o -mIPOPT_object_files=T -mIPOPT_assembly_files=/tmp/icpcalis76IIBa -mIPOPT_generated_tempfiles=/tmp/icpcelisj58trO -mIPOPT_embedded_object_base_name=/tmp/icpceobjgmHfhs -mIPOPT_cmdline_link_new_name=/tmp/icpcllis3p9065
+ld /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbegin.o -export-dynamic --eh-frame-hdr --build-id -dynamic-linker /lib64/ld-linux-x86-64.so.2 -m elf_x86_64 -o cmTC_7f9a2 -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64 -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64 -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib CMakeFiles/cmTC_7f9a2.dir/CMakeCXXCompilerABI.cpp.o -Bdynamic -Bstatic -limf -lsvml -lirng -Bdynamic -lstdc++ -lm -Bstatic -lipgo -ldecimal --as-needed -Bdynamic -lcilkrts --no-as-needed -lstdc++ -lgcc -lgcc_s -Bstatic -lirc -lsvml -Bdynamic -lc -lgcc -lgcc_s -Bstatic -lirc_s -Bdynamic -ldl -lc /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o /usr/lib/../lib64/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.output
new file mode 100644
index 000000000..31f8a11e5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.output
@@ -0,0 +1 @@
+/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include;/opt/gcc/6.3.0/snos/include/g++;/opt/gcc/6.3.0/snos/include/g++/x86_64-suse-linux;/opt/gcc/6.3.0/snos/include/g++/backward;/usr/local/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed;/opt/gcc/6.3.0/snos/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input
new file mode 100644
index 000000000..4c4e2f483
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input
@@ -0,0 +1,52 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=ELF
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=Cray
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=8.7
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_9c3ab/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_9c3ab.dir/build.make CMakeFiles/cmTC_9c3ab.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.5.15/bin/ftn -em -J. -v -c /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/ftnfe -h cpu=haswell -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -h network=aries -em -J. -I/opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs -I/usr/include -I/usr/include -I/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -hpl=/tmp/pe_32428//pldir -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/libmodules.a -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/libomp.a -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/omp_lib.a -usystem_mod=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/libopenacc.a -usystem_mod=/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include -usystem_mod=/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include -usystem_mod=/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -usystem_mod=/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -usystem_mod=/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -usystem_mod=/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -usystem_mod=/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include -usystem_mod=/opt/cray/pe/pmi/5.0.14/include -usystem_mod=/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -usystem_mod=/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -usystem_mod=/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -usystem_mod=/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -usystem_mod=/opt/cray-hss-devel/8.0.0/include -ux=x8503 -udv=87000 -ffixed -CZ/tmp/pe_32428/CMakeFortranCompilerABI.T -Cx -CX/tmp/pe_32428/CMakeFortranCompilerABI.xml -hdecompile=/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI. -S /tmp/pe_32428/CMakeFortranCompilerABI_1.s -Oipa3 -uo=/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o -ufile_id=1 /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F
+
+/opt/cray/pe/cce/8.7.4/cce/x86_64/bin/optcg /tmp/pe_32428//pldir 1
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/bin/as -o CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o --64 /tmp/pe_32428/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_32428/CMakeFortranCompilerABI_1.s
+rm /tmp/pe_32428//pldir/PL_path
+rm /tmp/pe_32428//pldir/iline_1
+rm /tmp/pe_32428//pldir/gline_1
+rm /tmp/pe_32428//pldir/PL_global_data
+rm /tmp/pe_32428//pldir/PL_module_list
+rm /tmp/pe_32428//pldir/CMakeFortranCompilerABI_1.inl
+rmdir /tmp/pe_32428//pldir
+rm /tmp/pe_32428//CMakeFortranCompilerABI_1.xml.Ttmp
+rm /tmp/pe_32428//CMakeFortranCompilerABI.T
+rm /tmp/pe_32428//CMakeFortranCompilerABI_1.cif.Ttmp
+rm /tmp/pe_32428//CMakeFortranCompilerABI.Tfe
+rm /tmp/pe_32428//CMakeFortranCompilerABI.xml
+rmdir /tmp/pe_32428/
+Linking Fortran executable cmTC_9c3ab
+/usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9c3ab.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -dynamic CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o -o cmTC_9c3ab
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_x86_64 --enable-new-dtags --dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib64//crt1.o /usr/lib64//crti.o /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtbegin.o /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtfastmath.o /opt/cray/pe/cce/8.7.4/cce/x86_64/lib/no_mmap.o CMakeFiles/cmTC_9c3ab.dir/CMakeFortranCompilerABI.F.o -Bdynamic -rpath=/opt/cray/pe/cce/8.7.4/cce/x86_64/lib -L/opt/gcc/6.1.0/snos/lib64 -rpath=/opt/cray/pe/gcc-libs -L/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/pe/cce/8.7.4/cce/x86_64/lib/pkgconfig/../ --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -L/usr/lib64 -L/lib64 -rpath=/usr/lib64 -rpath=/lib64 -lrca --as-needed -lsci_cray_mpi_mp --no-as-needed --as-needed -lsci_cray_mp --no-as-needed --as-needed -lmpich_cray --no-as-needed --as-needed -lmpichf90_cray --no-as-needed --as-needed -lpgas-dmapp --no-as-needed -lquadmath -lomp -lcraymp -lmodules -lfi -lcraymath -lf -lu -lcsup --as-needed -latomic --no-as-needed --as-needed -lgfortran --no-as-needed --whole-archive -ltcmalloc_minimal --no-whole-archive -lstdc++ -lpthread --start-group -lc -lcsup -lgcc_eh -lm -lgcc --end-group -L /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0 -L /opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-pc-linux-gnu/..//x86_64-unknown-linux-gnu/lib -EL -o cmTC_9c3ab /opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0//crtend.o /usr/lib64//crtn.o
+
+/opt/cray/pe/cce/8.7.4/binutils/x86_64/bin/objcopy --remove-section=.note.ftn_module_data cmTC_9c3ab
+rm /tmp/pe_32450//pldir/PL_path
+rm /tmp/pe_32450//pldir/PL_global_data
+rm /tmp/pe_32450//pldir/PL_module_list
+rmdir /tmp/pe_32450//pldir
+rmdir /tmp/pe_32450/
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output
new file mode 100644
index 000000000..daa34e2ea
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output
@@ -0,0 +1 @@
+/opt/cray/pe/cce/8.7.4/cce/x86_64/include/craylibs;/usr/include;/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input
new file mode 100644
index 000000000..bee298c37
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input
@@ -0,0 +1,83 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=/usr/bin/gcc-ar
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=GNU
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=/usr/bin/gcc-ranlib
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=7.3.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_390ef/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_390ef.dir/build.make CMakeFiles/cmTC_390ef.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -c /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/gfortran
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-c' '-o' 'CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/f951 /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -ffixed-form -cpp=/tmp/ccxLli6i.f90 -quiet -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include -D __CRAYXC -D __CRAY_HASWELL -D __CRAYXT_COMPUTE_LINUX_TARGET -D __TARGET_LINUX__ /usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -quiet -dumpbase CMakeFortranCompilerABI.F -march=core-avx2 -auxbase-strip CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -version -fintrinsic-modules-path /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/finclude -o /tmp/ccqY0cGk.s
+GNU Fortran (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../x86_64-suse-linux/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/finclude
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include
+ /usr/local/include
+ /opt/gcc/7.3.0/snos/include
+ /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed
+ /usr/include
+End of search list.
+GNU Fortran2008 (GCC) version 7.3.0 20180125 (Cray Inc.) (x86_64-suse-linux)
+ compiled by GNU C version 7.3.0 20180125 (Cray Inc.), GMP version 6.0.0, MPFR version 3.1.3, MPC version 1.0.3, isl version isl-0.15-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-c' '-o' 'CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+ as -v -I /opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I /opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I /opt/cray/pe/pmi/5.0.14/include -I /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I /opt/cray-hss-devel/8.0.0/include --64 -o CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o /tmp/ccqY0cGk.s
+GNU assembler version 2.31.1 (x86_64-suse-linux) using BFD version (GNU Binutils SUSE Linux Enterprise 12) 2.31.1.20180828-9.26
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-c' '-o' 'CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include'
+Linking Fortran executable cmTC_390ef
+/usr/projects/hpcsoft/cle6.0/common/cmake/3.10.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_390ef.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -dynamic CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -o cmTC_390ef
+Driving: /opt/gcc/7.3.0/bin/../snos/bin/gfortran -march=core-avx2 -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -D__TARGET_LINUX__ -v CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -o cmTC_390ef -Wl,-rpath=/opt/cray/pe/gcc-libs -Wl,-Bdynamic -I/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -Wl,--no-as-needed,-lAtpSigHandler,-lAtpSigHCommData -Wl,--undefined=_ATP_Data_Globals -Wl,--undefined=__atpHandlerInstall -lrca -Wl,--as-needed,-lsci_gnu_71_mpi,--no-as-needed -Wl,--as-needed,-lsci_gnu_71,--no-as-needed -Wl,--as-needed,-lmpich_gnu_71,--no-as-needed -Wl,--as-needed,-lmpichf90_gnu_71,--no-as-needed -Wl,--as-needed,-lgfortran,-lquadmath,--no-as-needed -Wl,--as-needed,-lpthread,--no-as-needed -l gfortran -l m -shared-libgcc
+Using built-in specs.
+COLLECT_GCC=/opt/gcc/7.3.0/bin/../snos/bin/gfortran
+COLLECT_LTO_WRAPPER=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper
+Target: x86_64-suse-linux
+Configured with: ../cray-gcc-7.3.0-201801270210.d61239fc6000b/configure --prefix=/opt/gcc/7.3.0/snos --disable-nls --libdir=/opt/gcc/7.3.0/snos/lib --enable-languages=c,c++,fortran --with-gxx-include-dir=/opt/gcc/7.3.0/snos/include/g++ --with-slibdir=/opt/gcc/7.3.0/snos/lib --with-system-zlib --enable-shared --enable-__cxa_atexit --build=x86_64-suse-linux --with-ppl --with-cloog --disable-multilib
+Thread model: posix
+gcc version 7.3.0 20180125 (Cray Inc.) (GCC)
+Reading specs from /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/libgfortran.spec
+rename spec lib to liborig
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_390ef' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-shared-libgcc'
+COMPILER_PATH=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/
+LIBRARY_PATH=/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_390ef' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-shared-libgcc'
+ /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/collect2 -plugin /opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/liblto_plugin.so -plugin-opt=/opt/gcc/7.3.0/snos/libexec/gcc/x86_64-suse-linux/7.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc1AyzSl.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_390ef /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtbegin.o -L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/../../.. CMakeFiles/cmTC_390ef.dir/CMakeFortranCompilerABI.F.o -rpath=/opt/cray/pe/gcc-libs -Bdynamic --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -lrca --as-needed -lsci_gnu_71_mpi --no-as-needed --as-needed -lsci_gnu_71 --no-as-needed --as-needed -lmpich_gnu_71 --no-as-needed --as-needed -lmpichf90_gnu_71 --no-as-needed --as-needed -lgfortran -lquadmath --no-as-needed --as-needed -lpthread --no-as-needed -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/crtend.o /usr/lib/../lib64/crtn.o
+COLLECT_GCC_OPTIONS='-march=core-avx2' '-D' '__CRAYXC' '-D' '__CRAY_HASWELL' '-D' '__CRAYXT_COMPUTE_LINUX_TARGET' '-D' '__TARGET_LINUX__' '-v' '-o' 'cmTC_390ef' '-I' '/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include' '-I' '/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include' '-I' '/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include' '-I' '/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include' '-I' '/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include' '-I' '/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include' '-I' '/opt/cray/pe/pmi/5.0.14/include' '-I' '/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include' '-I' '/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include' '-I' '/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include' '-I' '/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include' '-I' '/opt/cray-hss-devel/8.0.0/include' '-L/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/dmapp/default/lib64' '-L/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib' '-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64' '-L/opt/cray/pe/atp/2.1.3/libApp' '-shared-libgcc'
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output
new file mode 100644
index 000000000..5b96c9d08
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output
@@ -0,0 +1 @@
+/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/finclude;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include;/usr/local/include;/opt/gcc/7.3.0/snos/include;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0/include-fixed;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input
new file mode 100644
index 000000000..4cdff74ec
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input
@@ -0,0 +1,80 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=ELF
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=Intel
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.0.2.20180210
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_7523d/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_7523d.dir/build.make CMakeFiles/cmTC_7523d.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o
+/opt/cray/pe/craype/2.5.15/bin/ftn -v -c /usr/share/cmake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o
+ifort version 18.0.2
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/fpp -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=2 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -Dunix -Dlinux -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ -D__INTEL_COMPILER_BUILD_DATE=20180210 -D__INTEL_OFFLOAD -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -D__AVX__ -D__AVX_I__ -D__AVX2__ -D__FMA__ -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -I. -I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64 -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include -I/usr/local/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed -I/opt/gcc/6.3.0/snos/include/ -I/usr/include -fixed -4Ycpp -4Ncvf -f_com=yes -MX /usr/share/cmake/Modules/CMakeFortranCompilerABI.F /tmp/ifortjocHCJ.i
+#include "..." search starts here:
+#include <...> search starts here:
+ .
+ /opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include
+ /usr/local/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed
+ /opt/gcc/6.3.0/snos/include/
+ /usr/include
+End of search list.
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/fortcom -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=2 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -Dunix -Dlinux -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ -D__INTEL_COMPILER_BUILD_DATE=20180210 -D__INTEL_OFFLOAD -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE3__ -D__SSSE3__ -D__SSE4_1__ -D__SSE4_2__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -D__AVX__ -D__AVX_I__ -D__AVX2__ -D__FMA__ -mGLOB_pack_sort_init_list -I/usr/share/cmake/Modules -I. -I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64 -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc -I/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include -I/usr/local/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include -I/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed -I/opt/gcc/6.3.0/snos/include/ -I/usr/include -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -O2 "-reentrancy none" -simd -offload_host -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 -mP2OPT_static_promotion -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -xCORE-AVX2 -static -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -v -c -o CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/ifortYH2Bi3as_.s -mIPOPT_activate -mIPOPT_lite -mGLOB_instruction_tuning=0x0 -mGLOB_uarch_tuning=0x0 -mGLOB_product_id_code=0x22006d90 -mCG_bnl_movbe=T -mGLOB_extended_instructions=0x4000 -mGLOB_advanced_optim=TRUE -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=ifort0690104118gDFZUy -mP2OPT_hlo_level=2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_lto_object_enabled -mIPOPT_lto_object_value=1 -mIPOPT_obj_output_file_name=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarch8cLx6A -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/iforttempfiledtmF0m -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_FORTRAN -mP1OPT_source_file_name=/usr/share/cmake/Modules/CMakeFortranCompilerABI.F -mP1OPT_full_source_file_name=/usr/share/cmake/Modules/CMakeFortranCompilerABI.F -mP2OPT_symtab_type_copy=true /tmp/ifortjocHCJ.i
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/share/cmake/Modules
+ .
+ /opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include
+ /opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include
+ /opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include
+ /opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include
+ /opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include
+ /opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include
+ /opt/cray/pe/pmi/5.0.14/include
+ /opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include
+ /opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include
+ /opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include
+ /opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include
+ /opt/cray-hss-devel/8.0.0/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc
+ /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include
+ /usr/local/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include
+ /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed
+ /opt/gcc/6.3.0/snos/include/
+ /usr/include
+End of search list.
+Linking Fortran executable cmTC_7523d
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_7523d.dir/link.txt --verbose=1
+/opt/cray/pe/craype/2.5.15/bin/ftn -v CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -o cmTC_7523d
+ifort version 18.0.2
+/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/fortcom -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mGLOB_source_language=GLOB_SOURCE_LANGUAGE_F90 -mP2OPT_static_promotion -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=630 "-mGLOB_options_string=-I/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include -I/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include -I/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include -I/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include -I/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include -I/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include -I/opt/cray/pe/pmi/5.0.14/include -I/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include -I/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include -I/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include -I/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include -I/opt/cray-hss-devel/8.0.0/include -xCORE-AVX2 -static -D__CRAYXC -D__CRAY_HASWELL -D__CRAYXT_COMPUTE_LINUX_TARGET -v -o cmTC_7523d -L/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L/opt/cray/pe/pmi/5.0.14/lib64 -L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 -Wl,-Ttext-segment=0x20000000,-zmax-page-size=0x20000000 -Wl,--whole-archive,-lhugetlbfs,--no-whole-archive -Wl,--no-as-needed,-lAtpSigHandler,-lAtpSigHCommData -Wl,--undefined=_ATP_Data_Globals -Wl,--undefined=__atpHandlerInstall -lpthread -lmpichf90_intel -lrt -lugni -lpmi -lm -lpthread -ldl -lsci_intel_mpi -lsci_intel -lm -ldl -lmpich_intel -lrt -lugni -lpthread -lpmi -lm -ldl -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lalpsutil -lpthread -lrca -lxpmem -lugni -lpthread -ludreg -lsci_intel -lm -lpthread -ldl -lhugetlbfs -Wl,--as-needed,-limf,--no-as-needed -Wl,--as-needed,-lm,--no-as-needed -Wl,--as-needed,-lpthread,--no-as-needed" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/ifort3JZMSVas_.s -mGLOB_dashboard_use_source_name -mIPOPT_activate -mGLOB_product_id_code=0x22006d90 -mGLOB_extended_instructions=0x4000 -mGLOB_advanced_optim=TRUE -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mGLOB_opt_report_use_source_name -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=ifort0690373519HAIHNw -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_link -mIPOPT_ipo_activate -mIPOPT_mo_activate -mIPOPT_source_files_list=/tmp/ifortslis6v0DlA -mIPOPT_mo_global_data -mIPOPT_link_script_file=/tmp/ifortscriptsKB8Qm "-mIPOPT_cmdline_link="/usr/lib/../lib64/crt1.o" "/usr/lib/../lib64/crti.o" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbeginT.o" "--build-id" "-static" "-m" "elf_x86_64" "-L/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/lib" "-L/opt/cray/dmapp/default/lib64" "-L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib" "-L/opt/cray/dmapp/default/lib64" "-L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib" "-L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64" "-L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64" "-L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64" "-L/opt/cray/pe/pmi/5.0.14/lib64" "-L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64" "-L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64" "-L/opt/cray/pe/atp/2.1.3/libApp" "-L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64" "-o" "cmTC_7523d" "/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin/for_main.o" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/" "-L/lib/../lib64" "-L/lib/../lib64/" "-L/usr/lib/../lib64" "-L/usr/lib/../lib64/" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/" "-L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../" "-L/lib64" "-L/lib/" "-L/usr/lib64" "-L/usr/lib" "CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o" "-Ttext-segment=0x20000000" "-zmax-page-size=0x20000000" "--whole-archive" "-lhugetlbfs" "--no-whole-archive" "--no-as-needed" "-lAtpSigHandler" "-lAtpSigHCommData" "--undefined=_ATP_Data_Globals" "--undefined=__atpHandlerInstall" "-lpthread" "-lmpichf90_intel" "-lrt" "-lugni" "-lpmi" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-lpthread" "-ldl" "-lsci_intel_mpi" "-lsci_intel" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-ldl" "-lmpich_intel" "-lrt" "-lugni" "-lpthread" "-lpmi" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-ldl" "-lpmi" "-lpthread" "-lalpslli" "-lpthread" "-lwlm_detect" "-lalpsutil" "-lpthread" "-lrca" "-lxpmem" "-lugni" "-lpthread" "-ludreg" "-lsci_intel" "-L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin" "-limf" "-lm" "-lpthread" "-ldl" "-lhugetlbfs" "--as-needed" "-limf" "--no-as-needed" "--as-needed" "-lm" "--no-as-needed" "--as-needed" "-lpthread" "--no-as-needed" "-lifport" "-lifcore" "-limf" "-lsvml" "-lm" "-lipgo" "-lirc" "-lsvml" "-lc" "-lgcc" "-lgcc_eh" "-lirc_s" "-ldl" "-lc" "/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o" "/usr/lib/../lib64/crtn.o"" -mIPOPT_il_in_obj -mIPOPT_ipo_activate_warn=FALSE -mIPOPT_obj_output_file_name=/tmp/ipo_ifort5KgIiT.o -mIPOPT_whole_archive_fixup_file_name=/tmp/ifortwarchltBXsh -mGLOB_linker_version=2.31.1.20180828 -mGLOB_driver_tempfile_name=/tmp/iforttempfilesugt03 -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=/tmp/ipo_ifort5KgIiT.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_NONE -mP1OPT_source_file_name=ipo_out.f -mP2OPT_symtab_type_copy=true CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -mIPOPT_object_files=T -mIPOPT_assembly_files=/tmp/ifortalisCY2Fjs -mIPOPT_generated_tempfiles=/tmp/ifortelisXEqaPe -mIPOPT_embedded_object_base_name=/tmp/iforteobjRoVEk1 -mIPOPT_cmdline_link_new_name=/tmp/ifortllisJHg9PN
+ld /usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtbeginT.o --build-id -static -m elf_x86_64 -L/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/dmapp/default/lib64 -L/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib -L/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64 -L/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64 -L/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64 -L/opt/cray/pe/pmi/5.0.14/lib64 -L/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64 -L/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64 -L/opt/cray/pe/atp/2.1.3/libApp -L/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64 -o cmTC_7523d /opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin/for_main.o -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64 -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64 -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64/ -L/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib CMakeFiles/cmTC_7523d.dir/CMakeFortranCompilerABI.F.o -Ttext-segment=0x20000000 -zmax-page-size=0x20000000 --whole-archive -lhugetlbfs --no-whole-archive --no-as-needed -lAtpSigHandler -lAtpSigHCommData --undefined=_ATP_Data_Globals --undefined=__atpHandlerInstall -lpthread -lmpichf90_intel -lrt -lugni -lpmi -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -lpthread -ldl -lsci_intel_mpi -lsci_intel -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -ldl -lmpich_intel -lrt -lugni -lpthread -lpmi -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -ldl -lpmi -lpthread -lalpslli -lpthread -lwlm_detect -lalpsutil -lpthread -lrca -lxpmem -lugni -lpthread -ludreg -lsci_intel -L/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin -limf -lm -lpthread -ldl -lhugetlbfs --as-needed -limf --no-as-needed --as-needed -lm --no-as-needed --as-needed -lpthread --no-as-needed -lifport -lifcore -limf -lsvml -lm -lipgo -lirc -lsvml -lc -lgcc -lgcc_eh -lirc_s -ldl -lc /opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/crtend.o /usr/lib/../lib64/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output
new file mode 100644
index 000000000..8e484bca6
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output
@@ -0,0 +1 @@
+/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/include;/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/include;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/include;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/include;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/include;/opt/cray/gni-headers/5.0.12-6.0.5.0_2.15__g2ef1ebc.ari/include;/opt/cray/pe/pmi/5.0.14/include;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/include;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/include;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/include;/opt/cray/krca/2.2.2-6.0.5.1_13.47__g4614cf3.ari/include;/opt/cray-hss-devel/8.0.0/include;/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/include;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/intel64;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include/icc;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/include;/usr/local/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0/include-fixed;/opt/gcc/6.3.0/snos/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.input
new file mode 100644
index 000000000..4bc26bcba
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.input
@@ -0,0 +1,50 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=AppleClang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=8.0.0.8000042
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_0c33e/fast"
+/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_0c33e.dir/build.make CMakeFiles/cmTC_0c33e.dir/build
+Building C object CMakeFiles/cmTC_0c33e.dir/CMakeCCompilerABI.c.o
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -v -Wl,-v -o CMakeFiles/cmTC_0c33e.dir/CMakeCCompilerABI.c.o -c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: -Wl,-v: 'linker' input unused
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -coverage-file /private/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_0c33e.dir/CMakeCCompilerABI.c.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -fdebug-compilation-dir /private/tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_0c33e.dir/CMakeCCompilerABI.c.o -x c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
+ignoring nonexistent directory "/usr/local/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
+ /usr/include
+ /System/Library/Frameworks (framework directory)
+ /Library/Frameworks (framework directory)
+End of search list.
+Linking C executable cmTC_0c33e
+/usr/local/pkg.1804/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0c33e.dir/link.txt --verbose=1
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_0c33e.dir/CMakeCCompilerABI.c.o -o cmTC_0c33e
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o cmTC_0c33e -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_0c33e.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
+@(#)PROGRAM:ld PROJECT:ld64-274.2
+configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
+Library search paths:
+ /usr/lib
+ /usr/local/lib
+Framework search paths:
+ /Library/Frameworks/
+ /System/Library/Frameworks/
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..20f9b0e94
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.output
@@ -0,0 +1 @@
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.input
new file mode 100644
index 000000000..907a92e24
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.input
@@ -0,0 +1,52 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=AppleClang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=8.0.0.8000042
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_b7e96/fast"
+/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b7e96.dir/build.make CMakeFiles/cmTC_b7e96.dir/build
+Building CXX object CMakeFiles/cmTC_b7e96.dir/CMakeCXXCompilerABI.cpp.o
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -v -Wl,-v -o CMakeFiles/cmTC_b7e96.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: -Wl,-v: 'linker' input unused
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -coverage-file /private/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_b7e96.dir/CMakeCXXCompilerABI.cpp.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /private/tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_b7e96.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
+ignoring nonexistent directory "/usr/include/c++/v1"
+ignoring nonexistent directory "/usr/local/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/include
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
+ /usr/include
+ /System/Library/Frameworks (framework directory)
+ /Library/Frameworks (framework directory)
+End of search list.
+Linking CXX executable cmTC_b7e96
+/usr/local/pkg.1804/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b7e96.dir/link.txt --verbose=1
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_b7e96.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_b7e96
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o cmTC_b7e96 -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_b7e96.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
+@(#)PROGRAM:ld PROJECT:ld64-274.2
+configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
+Library search paths:
+ /usr/lib
+ /usr/local/lib
+Framework search paths:
+ /Library/Frameworks/
+ /System/Library/Frameworks/
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..b10b2af54
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.output
@@ -0,0 +1 @@
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.0.0/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input
new file mode 100644
index 000000000..effaedf55
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input
@@ -0,0 +1,44 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=AppleClang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=8.0.0.8000042
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_ba7aa/fast"
+/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_ba7aa.dir/build.make CMakeFiles/cmTC_ba7aa.dir/build
+Building C object CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -nostdinc -v -Wl,-v -o CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: -Wl,-v: 'linker' input unused
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -coverage-file /private/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -nostdsysteminc -nobuiltininc -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -fdebug-compilation-dir /private/tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -x c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
+#include "..." search starts here:
+End of search list.
+Linking C executable cmTC_ba7aa
+/usr/local/pkg.1804/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ba7aa.dir/link.txt --verbose=1
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -nostdinc -v -Wl,-v -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -o cmTC_ba7aa
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: argument unused during compilation: '-nostdinc'
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o cmTC_ba7aa -v -search_paths_first -headerpad_max_install_names CMakeFiles/cmTC_ba7aa.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
+@(#)PROGRAM:ld PROJECT:ld64-274.2
+configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
+Library search paths:
+ /usr/lib
+ /usr/local/lib
+Framework search paths:
+ /Library/Frameworks/
+ /System/Library/Frameworks/
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input
new file mode 100644
index 000000000..5504e9472
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input
@@ -0,0 +1,44 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=AppleClang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=8.0.0.8000042
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_638bd/fast"
+/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_638bd.dir/build.make CMakeFiles/cmTC_638bd.dir/build
+Building CXX object CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -nostdinc -v -Wl,-v -o CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: -Wl,-v: 'linker' input unused
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.2 -v -dwarf-column-info -debugger-tuning=lldb -coverage-file /private/tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -nostdsysteminc -nobuiltininc -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /private/tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -o CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/pkg.1804/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 8.0.0 (clang-800.0.42.1) default target x86_64-apple-darwin15.6.0
+#include "..." search starts here:
+End of search list.
+Linking CXX executable cmTC_638bd
+/usr/local/pkg.1804/bin/cmake -E cmake_link_script CMakeFiles/cmTC_638bd.dir/link.txt --verbose=1
+/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -nostdinc -v -Wl,-v -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_638bd
+Apple LLVM version 8.0.0 (clang-800.0.42.1)
+Target: x86_64-apple-darwin15.6.0
+Thread model: posix
+InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
+clang: warning: argument unused during compilation: '-nostdinc'
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -o cmTC_638bd -v -search_paths_first -headerpad_max_install_names CMakeFiles/cmTC_638bd.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin/libclang_rt.osx.a
+@(#)PROGRAM:ld PROJECT:ld64-274.2
+configured to support archs: armv6 armv7 armv7s arm64 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em (tvOS)
+Library search paths:
+ /usr/lib
+ /usr/local/lib
+Framework search paths:
+ /Library/Frameworks/
+ /System/Library/Frameworks/
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.input
new file mode 100644
index 000000000..b27eb027d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.input
@@ -0,0 +1,14 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=7.3.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+
+This is a test and there is nothing here to parse.
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-C.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.input
new file mode 100644
index 000000000..b983d6b63
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.input
@@ -0,0 +1,14 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=7.3.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+
+This is a test and there is nothing here to parse.
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/empty-CXX.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.input
new file mode 100644
index 000000000..81626f932
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.input
@@ -0,0 +1,38 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=Clang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=3.3.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/local/bin/gmake" "cmTC_0c44b/fast"
+/usr/local/bin/gmake -f CMakeFiles/cmTC_0c44b.dir/build.make CMakeFiles/cmTC_0c44b.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_0c44b.dir/CMakeCCompilerABI.c.o
+/usr/bin/cc -v -o CMakeFiles/cmTC_0c44b.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake-3.7/Modules/CMakeCCompilerABI.c
+FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
+Target: x86_64-unknown-freebsd10.0
+Thread model: posix
+ "/usr/bin/cc" -cc1 -triple x86_64-unknown-freebsd10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name CMakeCCompilerABI.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /tmp/ii/CMakeFiles/cmTC_0c44b.dir/CMakeCCompilerABI.c.o -resource-dir /usr/bin/../lib/clang/3.3 -fdebug-compilation-dir /tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fdiagnostics-show-option -backend-option -vectorize-loops -o CMakeFiles/cmTC_0c44b.dir/CMakeCCompilerABI.c.o -x c /usr/local/share/cmake-3.7/Modules/CMakeCCompilerABI.c
+clang -cc1 version 3.3 based upon LLVM 3.3 default target x86_64-unknown-freebsd10.0
+ignoring nonexistent directory "/usr/bin/../lib/clang/3.3/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/clang/3.3
+ /usr/include
+End of search list.
+Linking C executable cmTC_0c44b
+/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0c44b.dir/link.txt --verbose=1
+/usr/bin/cc -v CMakeFiles/cmTC_0c44b.dir/CMakeCCompilerABI.c.o -o cmTC_0c44b
+FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
+Target: x86_64-unknown-freebsd10.0
+Thread model: posix
+ "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o cmTC_0c44b /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib CMakeFiles/cmTC_0c44b.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.output
new file mode 100644
index 000000000..893ec4972
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.output
@@ -0,0 +1 @@
+/usr/include/clang/3.3;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.input
new file mode 100644
index 000000000..1f7758b17
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.input
@@ -0,0 +1,45 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=Clang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=3.3.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/local/bin/gmake" "cmTC_c3442/fast"
+/usr/local/bin/gmake -f CMakeFiles/cmTC_c3442.dir/build.make CMakeFiles/cmTC_c3442.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_c3442.dir/CMakeCXXCompilerABI.cpp.o
+/usr/bin/CC -v -o CMakeFiles/cmTC_c3442.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake-3.7/Modules/CMakeCXXCompilerABI.cpp
+FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
+Target: x86_64-unknown-freebsd10.0
+Thread model: posix
+ "/usr/bin/CC" -cc1 -triple x86_64-unknown-freebsd10.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -coverage-file /tmp/ii/CMakeFiles/cmTC_c3442.dir/CMakeCXXCompilerABI.cpp.o -resource-dir /usr/bin/../lib/clang/3.3 -internal-isystem /usr/include/c++/v1 -fdeprecated-macro -fdebug-compilation-dir /tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -mstackrealign -fobjc-runtime=gnustep -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fdiagnostics-show-option -backend-option -vectorize-loops -o CMakeFiles/cmTC_c3442.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/share/cmake-3.7/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 3.3 based upon LLVM 3.3 default target x86_64-unknown-freebsd10.0
+ignoring nonexistent directory "/usr/include/c++/4.2/backward/backward"
+ignoring nonexistent directory "/usr/bin/../lib/clang/3.3/include"
+ignoring duplicate directory "/usr/include/c++/4.2"
+ignoring duplicate directory "/usr/include/c++/4.2/backward"
+ignoring duplicate directory "/usr/include/c++/4.2/backward"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/v1
+ /usr/include/c++/4.2
+ /usr/include/c++/4.2/backward
+ /usr/include/clang/3.3
+ /usr/include
+End of search list.
+Linking CXX executable cmTC_c3442
+/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_c3442.dir/link.txt --verbose=1
+/usr/bin/CC -v CMakeFiles/cmTC_c3442.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_c3442
+FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
+Target: x86_64-unknown-freebsd10.0
+Thread model: posix
+ "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o cmTC_c3442 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib CMakeFiles/cmTC_c3442.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.output
new file mode 100644
index 000000000..cd64264f8
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.output
@@ -0,0 +1 @@
+/usr/include/c++/v1;/usr/include/c++/4.2;/usr/include/c++/4.2/backward;/usr/include/clang/3.3;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input
new file mode 100644
index 000000000..8a5d7411a
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input
@@ -0,0 +1,78 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=GNU
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=4.6.4
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/local/bin/gmake" "cmTC_9ec75/fast"
+/usr/local/bin/gmake -f CMakeFiles/cmTC_9ec75.dir/build.make CMakeFiles/cmTC_9ec75.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o
+/usr/local/bin/gfortran46 -v -c /usr/local/share/cmake-3.7/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o
+Using built-in specs.
+COLLECT_GCC=/usr/local/bin/gfortran46
+COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/lto-wrapper
+Target: x86_64-portbld-freebsd10.0
+Configured with: ./../gcc-4.6.4/configure --disable-bootstrap --disable-nls --libdir=/usr/local/lib/gcc46 --libexecdir=/usr/local/libexec/gcc46 --program-suffix=46 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc46 --build=x86_64-portbld-freebsd10.0
+Thread model: posix
+gcc version 4.6.4 (FreeBSD Ports Collection)
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ /usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/f951 /usr/local/share/cmake-3.7/Modules/CMakeFortranCompilerABI.F -ffixed-form -cpp=/tmp//ccp5PsLd.f90 -quiet -v /usr/local/share/cmake-3.7/Modules/CMakeFortranCompilerABI.F -quiet -dumpbase CMakeFortranCompilerABI.F -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -version -fintrinsic-modules-path /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/finclude -o /tmp//ccGWxrQ5.s
+GNU Fortran (FreeBSD Ports Collection) version 4.6.4 (x86_64-portbld-freebsd10.0)
+ compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 3.3 (tags/RELEASE_33/final 183502), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/finclude
+ /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include
+ /usr/local/include
+ /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include-fixed
+ /usr/include
+End of search list.
+GNU Fortran (FreeBSD Ports Collection) version 4.6.4 (x86_64-portbld-freebsd10.0)
+ compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 3.3 (tags/RELEASE_33/final 183502), GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ /usr/local/bin/as -v -o CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o /tmp//ccGWxrQ5.s
+GNU assembler version 2.23.2 (x86_64-portbld-freebsd10.0) using BFD version (GNU Binutils) 2.23.2
+COMPILER_PATH=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/bin/
+LIBRARY_PATH=/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/lib/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+Linking Fortran executable cmTC_9ec75
+/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9ec75.dir/link.txt --verbose=1
+/usr/local/bin/gfortran46 -v CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -o cmTC_9ec75
+Driving: /usr/local/bin/gfortran46 -v CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -o cmTC_9ec75 -l gfortran -l m -shared-libgcc
+Using built-in specs.
+COLLECT_GCC=/usr/local/bin/gfortran46
+COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/lto-wrapper
+Target: x86_64-portbld-freebsd10.0
+Configured with: ./../gcc-4.6.4/configure --disable-bootstrap --disable-nls --libdir=/usr/local/lib/gcc46 --libexecdir=/usr/local/libexec/gcc46 --program-suffix=46 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc46/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc46 --build=x86_64-portbld-freebsd10.0
+Thread model: posix
+gcc version 4.6.4 (FreeBSD Ports Collection)
+Reading specs from /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../libgfortran.spec
+rename spec lib to liborig
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_9ec75' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+COMPILER_PATH=/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/bin/
+LIBRARY_PATH=/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/lib/:/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_9ec75' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/local/libexec/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/collect2 --eh-frame-hdr -V -dynamic-linker /libexec/ld-elf.so.1 -o cmTC_9ec75 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/crtbegin.o -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4 -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../../../../x86_64-portbld-freebsd10.0/lib -L/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/../../.. CMakeFiles/cmTC_9ec75.dir/CMakeFortranCompilerABI.F.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/crtend.o /usr/lib/crtn.o
+GNU ld (GNU Binutils) 2.23.2
+ Supported emulations:
+ elf_x86_64_fbsd
+ elf_i386_fbsd
+ elf_x86_64
+ elf_i386
+ elf_l1om
+ elf_l1om_fbsd
+ elf_k1om
+ elf_k1om_fbsd
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output
new file mode 100644
index 000000000..c0aee1118
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output
@@ -0,0 +1 @@
+/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/finclude;/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include;/usr/local/include;/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4/include-fixed;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.input
new file mode 100644
index 000000000..ee296a7a1
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.input
@@ -0,0 +1,72 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=7.3.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_1f304/fast"
+/usr/bin/make -f CMakeFiles/cmTC_1f304.dir/build.make CMakeFiles/cmTC_1f304.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o
+/usr/bin/cc -v -o CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/cc1 -quiet -v -imultiarch x86_64-linux-gnu /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/cc3JNm0a.s
+GNU C11 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/lib/gcc/x86_64-linux-gnu/7/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU C11 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: c8081a99abb72bbfd9129549110a350c
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o /tmp/cc3JNm0a.s
+GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
+Linking C executable cmTC_1f304
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1f304.dir/link.txt --verbose=1
+/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o -o cmTC_1f304
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_1f304' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccg3L1R6.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_1f304 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_1f304.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
+COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_1f304' '-mtune=generic' '-march=x86-64'
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.output
new file mode 100644
index 000000000..dcd6565d7
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.output
@@ -0,0 +1 @@
+/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.input
new file mode 100644
index 000000000..1e6544b90
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.input
@@ -0,0 +1,43 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=Intel
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.0.0.20170811
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_a5f0a/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_a5f0a.dir/build.make CMakeFiles/cmTC_a5f0a.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icc -v -o CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o -c /tmp/CMake/Modules/CMakeCCompilerABI.c
+icc version 18.0.0 (gcc version 4.8.5 compatibility)
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/mcpcom --target_efi2 --lang=c -_g -mP3OPT_inline_alloca -D__ICC=1800 -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=0 -D__PTRDIFF_TYPE__=long "-D__SIZE_TYPE__=unsigned long" -D__WCHAR_TYPE__=int "-D__WINT_TYPE__=unsigned int" "-D__INTMAX_TYPE__=long int" "-D__UINTMAX_TYPE__=long unsigned int" -D__LONG_MAX__=9223372036854775807L -D__QMSPP_ -D__OPTIMIZE__ -D__NO_MATH_INLINES -D__NO_STRING_INLINES -D__GNUC_GNU_INLINE__ -D__GNUC__=4 -D__GNUC_MINOR__=8 -D__GNUC_PATCHLEVEL__=5 -D__LP64__ -D_LP64 -D__GXX_ABI_VERSION=1002 "-D__USER_LABEL_PREFIX__= " -D__REGISTER_PREFIX__= -D__INTEL_RTTI__ -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -B -Dunix -Dlinux "-_Asystem(unix)" -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ "-_Acpu(x86_64)" "-_Amachine(x86_64)" -D__INTEL_COMPILER_BUILD_DATE=20170811 -D__INTEL_OFFLOAD -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -_k -_8 -_l --has_new_stdarg_support -_a -_b --gnu_version=40805 -_W5 --gcc-extern-inline --multibyte_chars -mGLOB_diag_suppress_sys --system_preinclude /usr/include/stdc-predef.h --array_section --simd --simd_func --offload_mode=1 --offload_target_names=gfx,GFX,mic,MIC --offload_unique_string=icc1018727407m03RCD -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=485 "-mGLOB_options_string=-v -o CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o -c" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/iccMjPSufas_.s -mIPOPT_activate -mIPOPT_lite -mGLOB_instruction_tuning=0x0 -mGLOB_uarch_tuning=0x0 -mGLOB_product_id_code=0x22006d92 -mCG_bnl_movbe=T -mGLOB_extended_instructions=0x8 -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icc1018727407m03RCD -mP2OPT_hlo_level=2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_lto_object_enabled -mIPOPT_lto_object_value=1 -mIPOPT_obj_output_file_name=CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o -mIPOPT_whole_archive_fixup_file_name=/tmp/iccwarchDkkYqW -mGLOB_linker_version=2.27 -mGLOB_driver_tempfile_name=/tmp/icctempfileg2vfUM -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_C -mP1OPT_source_file_name=/tmp/CMake/Modules/CMakeCCompilerABI.c -mP1OPT_full_source_file_name=/tmp/CMake/Modules/CMakeCCompilerABI.c /tmp/CMake/Modules/CMakeCCompilerABI.c
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/pstl/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/intel64
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/icc
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include
+ /usr/include/
+ /usr/include
+End of search list.
+Linking C executable cmTC_a5f0a
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a5f0a.dir/link.txt --verbose=1
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icc -v -rdynamic CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o -o cmTC_a5f0a
+icc version 18.0.0 (gcc version 4.8.5 compatibility)
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/mcpcom -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=485 "-mGLOB_options_string=-v -rdynamic -o cmTC_a5f0a" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/iccSNrbyQas_.s -mGLOB_dashboard_use_source_name -mIPOPT_activate -mGLOB_product_id_code=0x22006d92 -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mGLOB_opt_report_use_source_name -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icc0131594309ugIRtJ -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_link -mIPOPT_ipo_activate -mIPOPT_mo_activate -mIPOPT_source_files_list=/tmp/iccslis4FFYii -mIPOPT_mo_global_data -mIPOPT_link_script_file=/tmp/iccscriptV37728 "-mIPOPT_cmdline_link="/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o" "-export-dynamic" "--eh-frame-hdr" "--build-id" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-m" "elf_x86_64" "-o" "cmTC_a5f0a" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/" "-L/lib/../lib64" "-L/lib/../lib64/" "-L/usr/lib/../lib64" "-L/usr/lib/../lib64/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7/" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../" "-L/lib64" "-L/lib/" "-L/usr/lib64" "-L/usr/lib" "CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o" "-Bdynamic" "-Bstatic" "-limf" "-lsvml" "-lirng" "-Bdynamic" "-lm" "-Bstatic" "-lipgo" "-ldecimal" "--as-needed" "-Bdynamic" "-lcilkrts" "-lstdc++" "--no-as-needed" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc" "-lsvml" "-Bdynamic" "-lc" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc_s" "-Bdynamic" "-ldl" "-lc" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o"" -mIPOPT_il_in_obj -mIPOPT_ipo_activate_warn=FALSE -mIPOPT_obj_output_file_name=/tmp/ipo_iccYpsdQb.o -mIPOPT_whole_archive_fixup_file_name=/tmp/iccwarchgEXmQo -mGLOB_linker_version=2.27 -mGLOB_driver_tempfile_name=/tmp/icctempfilemNLlCf -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=/tmp/ipo_iccYpsdQb.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_NONE -mP1OPT_source_file_name=ipo_out.c CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o -mIPOPT_object_files=T -mIPOPT_assembly_files=/tmp/iccalisRmwrkT -mIPOPT_generated_tempfiles=/tmp/iccelisUgbz4J -mIPOPT_embedded_object_base_name=/tmp/icceobj0agHOA -mIPOPT_cmdline_link_new_name=/tmp/iccllis0qIPyr
+ld /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o -export-dynamic --eh-frame-hdr --build-id -dynamic-linker /lib64/ld-linux-x86-64.so.2 -m elf_x86_64 -o cmTC_a5f0a -L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64 -L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7 -L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7 -L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib CMakeFiles/cmTC_a5f0a.dir/CMakeCCompilerABI.c.o -Bdynamic -Bstatic -limf -lsvml -lirng -Bdynamic -lm -Bstatic -lipgo -ldecimal --as-needed -Bdynamic -lcilkrts -lstdc++ --no-as-needed -lgcc -lgcc_s -Bstatic -lirc -lsvml -Bdynamic -lc -lgcc -lgcc_s -Bstatic -lirc_s -Bdynamic -ldl -lc /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.output
new file mode 100644
index 000000000..714131c3e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.output
@@ -0,0 +1 @@
+/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/pstl/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/icc;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include;/usr/local/include;/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input
new file mode 100644
index 000000000..cfc3e7b1c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input
@@ -0,0 +1,36 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=PGI
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.10.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_81a12/fast"
+/usr/bin/make -f CMakeFiles/cmTC_81a12.dir/build.make CMakeFiles/cmTC_81a12.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o
+/mnt/pgi/linux86-64/2018/bin/pgcc -v -o CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -stdinc /mnt/pgi/linux86-64/18.10/include-gcc70:/mnt/pgi/linux86-64/18.10/include:/usr/lib/gcc/x86_64-linux-gnu/7/include:/usr/local/include:/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed:/usr/include/x86_64-linux-gnu:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -predicate '#machine(x86_64) #lint(off) #system(posix) #cpu(x86_64)' -cmdline '+pgcc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -v -o CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -c' -outfile CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -x 123 0x80000000 -x 123 4 -x 2 0x400 -preinclude _c_macros.h -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -asm /tmp/pgccl1BeHkOmG3zk.s
+PGC/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgccl1BeHkOmG3zk.s -o CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o
+Unlinking /tmp/pgccl1BeHkOmG3zk.s
+Unlinking /tmp/pgccJ1BePEjJHZ9x.ll
+Linking C executable cmTC_81a12
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_81a12.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgcc -v CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -o cmTC_81a12
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_81a12.dir/CMakeCCompilerABI.c.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_81a12 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output
new file mode 100644
index 000000000..289c530a6
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input
new file mode 100644
index 000000000..a6d9e5a48
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input
@@ -0,0 +1,42 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=12.1.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_79cdf/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_79cdf.dir/build.make CMakeFiles/cmTC_79cdf.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qthreaded -qhalt=e -V -o CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcASgBamaX
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlcentry -qosvar=rhel.6.9 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qthreaded -qhalt=e -qasm_as=/usr/bin/as -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qvac_include_path=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -oCMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c /tmp/xlcW06RQxFR /tmp/xlcW1Og9D2y /dev/null /tmp/xlcLUravVDF.lst /dev/null /tmp/xlcW2kTjRpg
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -qtls -qthreaded -qhalt=e /tmp/xlcW06RQxFR /tmp/xlcW1Og9D2y CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o /tmp/xlcLUravVDB.lst /tmp/xlcW2kTjRpg
+rm /tmp/xlcASgBamaX
+rm /tmp/xlcLUravVD
+rm /tmp/xlcW06RQxFR
+rm /tmp/xlcW1Og9D2y
+rm /tmp/xlcW2kTjRpg
+Linking C executable cmTC_79cdf
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_79cdf.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qthreaded -qhalt=e -V CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o -o cmTC_79cdf -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_79cdf.dir/CMakeCCompilerABI.c.o -o cmTC_79cdf -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0JVPZO4
+rm /tmp/xlcW1cwDxtZ
+rm /tmp/xlcW2j5Va8T
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output
new file mode 100644
index 000000000..eceacf954
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output
@@ -0,0 +1 @@
+/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include;/usr/local/include;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input
new file mode 100644
index 000000000..97fa28be9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=16.1.0.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_56ad1/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_56ad1.dir/build.make CMakeFiles/cmTC_56ad1.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o
+/opt/ibm/xlC/16.1.0/bin/xlc -qthreaded -V -o CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o -c "/tmp/CMake/Modules/CMakeCCompilerABI.c"
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc
+export XL_ASMOBJFILES=/tmp/xlcASSb1cI4
+export "XL_DIS=/opt/ibm/xlC/16.1.0/exe/dis -o "CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/opt/ibm/xlC/16.1.0/exe/xlCentry -qosvar=centos.7.0 -qlanglvl=extc99 -qalias=ansi -qthreaded -D_REENTRANT -D__VACPP_MULTI__ -qtls -q64 -D_CALL_SYSV -D__NO_MATH_INLINES -D_CALL_ELF=2 -Wno-parentheses -Wno-unused-value -maltivec -qtls -q64 -qgnu_version=4.8.5 -qthreaded -qasm_as=/usr/bin/as -qc_stdinc=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include -qgcc_c_stdinc=/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qcomplexgccincl=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include:/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qvac_include_path=/opt/ibm/xlC/16.1.0/include -oCMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o "/tmp/CMake/Modules/CMakeCCompilerABI.c" /tmp/xlcW0T1FYwj /tmp/xlcW1fu4lVT /dev/null /tmp/xlcLWBpG6EF.lst /dev/null /tmp/xlcW2TKQJju
+export XL_BACKEND=/opt/ibm/xlC/16.1.0/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/opt/ibm/xlC/16.1.0/exe/xlCcode -qlanglvl=extc99 -qalias=ansi -qthreaded -qtls -maltivec -qtls -qthreaded /tmp/xlcW0T1FYwj /tmp/xlcW1fu4lVT CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o /tmp/xlcLWBpG6EB.lst /tmp/xlcW2TKQJju
+rm /tmp/xlcASSb1cI4
+rm /tmp/xlcLWBpG6E
+rm /tmp/xlcW0T1FYwj
+rm /tmp/xlcW1fu4lVT
+rm /tmp/xlcW2TKQJju
+Linking C executable cmTC_56ad1
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_56ad1.dir/link.txt --verbose=1
+/opt/ibm/xlC/16.1.0/bin/xlc -qthreaded -V -Wl,-export-dynamic CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o -o cmTC_56ad1
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc
+/usr/bin/ld --eh-frame-hdr -Qy -melf64lppc -dynamic-linker /lib64/ld64.so.2 --enable-new-dtags /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtbegin.o -L/opt/ibm/xlsmp/5.1.0/lib -L/opt/ibm/xlmass/9.1.0/lib -L/opt/ibm/xlC/16.1.0/lib -R/opt/ibm/lib -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../.. -export-dynamic CMakeFiles/cmTC_56ad1.dir/CMakeCCompilerABI.c.o -o cmTC_56ad1 -lxlopt -lxl --as-needed -ldl --no-as-needed -lgcc_s --as-needed -lpthread --no-as-needed -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crtn.o
+rm /tmp/xlcW0S2fv6n
+rm /tmp/xlcW11wDdxY
+rm /tmp/xlcW2JqnWXy
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output
new file mode 100644
index 000000000..6dac25fb4
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output
@@ -0,0 +1 @@
+/opt/ibm/xlsmp/5.1.0/include;/opt/ibm/xlmass/9.1.0/include;/opt/ibm/xlC/16.1.0/include;/usr/local/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input
new file mode 100644
index 000000000..5dd36508e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input
@@ -0,0 +1,124 @@
+CMAKE_LANG=CUDA
+CMAKE_CUDA_COMPILER_ABI=ELF
+CMAKE_CUDA_COMPILER_AR=
+CMAKE_CUDA_COMPILER_ARCHITECTURE_ID=
+CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CUDA_COMPILER_ID=NVIDIA
+CMAKE_CUDA_COMPILER_LAUNCHER=
+CMAKE_CUDA_COMPILER_LOADED=1
+CMAKE_CUDA_COMPILER_RANLIB=
+CMAKE_CUDA_COMPILER_TARGET=
+CMAKE_CUDA_COMPILER_VERSION=9.2.148
+CMAKE_CUDA_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_5996d/fast"
+/usr/bin/make -f CMakeFiles/cmTC_5996d.dir/build.make CMakeFiles/cmTC_5996d.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CUDA object CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o
+/usr/bin/nvcc -Xcompiler=-v -x cu -c "/tmp/CMake/Modules/CMakeCUDACompilerABI.cu" -o CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o
+Using built-in specs.
+COLLECT_GCC=gcc-5
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-E' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS -D __CUDACC__ -D __NVCC__ -D __CUDACC_VER_BUILD__=148 -D __CUDACC_VER_MINOR__=2 -D __CUDACC_VER_MAJOR__=9 -include cuda_runtime.h /tmp/CMake/Modules/CMakeCUDACompilerABI.cu -m64 -mtune=generic -march=x86-64 -std=c++14
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/5
+ /usr/include/x86_64-linux-gnu/c++/5
+ /usr/include/c++/5/backward
+ /usr/lib/gcc/x86_64-linux-gnu/5/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-E' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+Using built-in specs.
+COLLECT_GCC=gcc-5
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COLLECT_GCC_OPTIONS='-std=c++14' '-E' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDACC__ -D __NVCC__ -D __CUDACC_VER_BUILD__=148 -D __CUDACC_VER_MINOR__=2 -D __CUDACC_VER_MAJOR__=9 -include cuda_runtime.h /tmp/CMake/Modules/CMakeCUDACompilerABI.cu -m64 -mtune=generic -march=x86-64 -std=c++14
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/5
+ /usr/include/x86_64-linux-gnu/c++/5
+ /usr/include/c++/5/backward
+ /usr/lib/gcc/x86_64-linux-gnu/5/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-std=c++14' '-E' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+Using built-in specs.
+COLLECT_GCC=gcc-5
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS /tmp/tmpxft_00002df4_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -quiet -dumpbase tmpxft_00002df4_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -m64 -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o -std=c++14 -version -o /tmp/ccSDI00n.s
+GNU C++14 (Debian 5.5.0-12) version 5.5.0 20171010 (x86_64-linux-gnu)
+ compiled by GNU C version 5.5.0 20171010, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0
+warning: MPFR header version 4.0.1 differs from library version 4.0.2-rc1.
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/5
+ /usr/include/x86_64-linux-gnu/c++/5
+ /usr/include/c++/5/backward
+ /usr/lib/gcc/x86_64-linux-gnu/5/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU C++14 (Debian 5.5.0-12) version 5.5.0 20171010 (x86_64-linux-gnu)
+ compiled by GNU C version 5.5.0 20171010, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0
+warning: MPFR header version 4.0.1 differs from library version 4.0.2-rc1.
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 3caa6244fa07ed8a2b405a77ac6cb692
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o /tmp/ccSDI00n.s
+GNU assembler version 2.31.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.31.1
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
+Linking CUDA device code CMakeFiles/cmTC_5996d.dir/cmake_device_link.o
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_5996d.dir/dlink.txt --verbose=1
+/usr/bin/nvcc -Xcompiler=-fPIC -Wno-deprecated-gpu-targets -shared -dlink CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o -o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -L"/usr/lib/x86_64-linux-gnu"
+Linking CUDA executable cmTC_5996d
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_5996d.dir/link.txt --verbose=1
+/usr/lib/nvidia-cuda-toolkit/bin/g++ -v CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -o cmTC_5996d -L"/usr/lib/x86_64-linux-gnu/stubs" -lcudadevrt -lcudart_static -lrt -lpthread -ldl
+Using built-in specs.
+COLLECT_GCC=g++-5
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_5996d' '-L/usr/lib/x86_64-linux-gnu/stubs' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc85GscA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_5996d /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/x86_64-linux-gnu/stubs -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -lcudadevrt -lcudart_static -lrt -lpthread -ldl -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.output
new file mode 100644
index 000000000..4f49cd1e9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.output
@@ -0,0 +1 @@
+/usr/include/c++/5;/usr/include/x86_64-linux-gnu/c++/5;/usr/include/c++/5/backward;/usr/lib/gcc/x86_64-linux-gnu/5/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.input
new file mode 100644
index 000000000..633a0efa7
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.input
@@ -0,0 +1,76 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=7.3.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_63146/fast"
+/usr/bin/make -f CMakeFiles/cmTC_63146.dir/build.make CMakeFiles/cmTC_63146.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o
+/usr/bin/c++ -v -o CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccXqnn3f.s
+GNU C++14 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/7"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/7
+ /usr/include/x86_64-linux-gnu/c++/7
+ /usr/include/c++/7/backward
+ /usr/lib/gcc/x86_64-linux-gnu/7/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU C++14 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 1bfae38ae5df64de6196cbd8c3b07d86
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o /tmp/ccXqnn3f.s
+GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+Linking CXX executable cmTC_63146
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_63146.dir/link.txt --verbose=1
+/usr/bin/c++ -v -rdynamic CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_63146
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_63146' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/cca3NVun.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_63146 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_63146.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
+COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_63146' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.output
new file mode 100644
index 000000000..6f5d07194
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.output
@@ -0,0 +1 @@
+/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.input
new file mode 100644
index 000000000..22d871598
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.input
@@ -0,0 +1,46 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=Intel
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.0.0.20170811
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_d768a/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_d768a.dir/build.make CMakeFiles/cmTC_d768a.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icpc -v -o CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o -c /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp
+icpc version 18.0.0 (gcc version 4.8.5 compatibility)
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/mcpcom --target_efi2 --lang=c++ -_g -mP3OPT_inline_alloca -D__ICC=1800 -D__INTEL_COMPILER=1800 -D__INTEL_COMPILER_UPDATE=0 -D__PTRDIFF_TYPE__=long "-D__SIZE_TYPE__=unsigned long" -D__WCHAR_TYPE__=int "-D__WINT_TYPE__=unsigned int" "-D__INTMAX_TYPE__=long int" "-D__UINTMAX_TYPE__=long unsigned int" -D__LONG_MAX__=9223372036854775807L -D__QMSPP_ -D__OPTIMIZE__ -D__NO_MATH_INLINES -D__NO_STRING_INLINES -D__GNUC_GNU_INLINE__ -D__GNUG__=4 -D__GNUC__=4 -D__GNUC_MINOR__=8 -D__GNUC_PATCHLEVEL__=5 -D__LP64__ -D_LP64 -D_GNU_SOURCE=1 -D__DEPRECATED=1 -D__GXX_WEAK__=1 -D__GXX_ABI_VERSION=1002 "-D__USER_LABEL_PREFIX__= " -D__REGISTER_PREFIX__= -D__INTEL_RTTI__ -D__EXCEPTIONS=1 -D__unix__ -D__unix -D__linux__ -D__linux -D__gnu_linux__ -B -Dunix -Dlinux "-_Asystem(unix)" -D__ELF__ -D__x86_64 -D__x86_64__ -D__amd64 -D__amd64__ "-_Acpu(x86_64)" "-_Amachine(x86_64)" -D__INTEL_COMPILER_BUILD_DATE=20170811 -D__INTEL_OFFLOAD -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -D__pentium4 -D__pentium4__ -D__tune_pentium4__ -D__SSE2__ -D__SSE2_MATH__ -D__SSE__ -D__SSE_MATH__ -D__MMX__ -_k -_8 -_l --has_new_stdarg_support -_a -_b --gnu_version=40805 -_W5 --gcc-extern-inline -p --bool -tused -x --multibyte_chars -mGLOB_diag_suppress_sys --system_preinclude /usr/include/stdc-predef.h --array_section --simd --simd_func --offload_mode=1 --offload_target_names=gfx,GFX,mic,MIC --offload_unique_string=icpc1792177319iuY4UR --bool -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=485 "-mGLOB_options_string=-v -o CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o -c" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/icpcv8rR8Aas_.s -mIPOPT_activate -mIPOPT_lite -mGLOB_instruction_tuning=0x0 -mGLOB_uarch_tuning=0x0 -mGLOB_product_id_code=0x22006d8f -mCG_bnl_movbe=T -mGLOB_extended_instructions=0x8 -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icpc1792177319iuY4UR -mP2OPT_hlo_level=2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_lto_object_enabled -mIPOPT_lto_object_value=1 -mIPOPT_obj_output_file_name=CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o -mIPOPT_whole_archive_fixup_file_name=/tmp/icpcwarchqQRwIj -mGLOB_linker_version=2.27 -mGLOB_driver_tempfile_name=/tmp/icpctempfilekXiB0a -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_C_PLUS_PLUS -mP1OPT_source_file_name=/tmp/CMake/Modules/CMakeCXXCompilerABI.cpp -mP1OPT_full_source_file_name=/tmp/CMake/Modules/CMakeCXXCompilerABI.cpp -mGLOB_eh_linux /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp
+#include "..." search starts here:
+#include <...> search starts here:
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/pstl/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/include
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/intel64
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/icc
+ /opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include
+ /usr/include/c++/4.8.5
+ /usr/include/c++/4.8.5/x86_64-redhat-linux
+ /usr/include/c++/4.8.5/backward
+ /usr/local/include
+ /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include
+ /usr/include/
+ /usr/include
+End of search list.
+Linking CXX executable cmTC_d768a
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d768a.dir/link.txt --verbose=1
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/icpc -v -rdynamic CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_d768a
+icpc version 18.0.0 (gcc version 4.8.5 compatibility)
+/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/mcpcom -mGLOB_em64t=TRUE -mP1OPT_version=18.0-intel64 -mGLOB_diag_file=CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.diag -mGLOB_long_size_64 -mGLOB_routine_pointer_size_64 -mP1OPT_print_version=FALSE -mCG_use_gas_got_workaround=F -mP2OPT_align_option_used=TRUE -mGLOB_gcc_version=485 "-mGLOB_options_string=-v -rdynamic -o cmTC_d768a" -mGLOB_cxx_limited_range=FALSE -mCG_extend_parms=FALSE -mGLOB_compiler_bin_directory=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64 -mGLOB_as_output_backup_file_name=/tmp/icpczjpPCuas_.s -mGLOB_dashboard_use_source_name -mIPOPT_activate -mGLOB_product_id_code=0x22006d8f -mP3OPT_use_mspp_call_convention -mP2OPT_subs_out_of_bound=FALSE -mP2OPT_disam_type_based_disam=2 -mP2OPT_disam_assume_ansi_c -mP2OPT_checked_disam_ansi_alias=TRUE -mGLOB_ansi_alias -mPGOPTI_value_profile_use=T -mGLOB_opt_report_use_source_name -mP2OPT_il0_array_sections=TRUE -mGLOB_offload_mode=1 -mP2OPT_offload_unique_var_string=icpc1401760296yQqGc2 -mP2OPT_hlo -mP2OPT_hpo_rtt_control=0 -mIPOPT_args_in_regs=0 -mP2OPT_disam_assume_nonstd_intent_in=FALSE -mGLOB_imf_mapping_library=/opt/intel/compilers_and_libraries_2018.0.128/linux/bin/intel64/libiml_attr.so -mPGOPTI_gen_threadsafe_level=0 -mIPOPT_link -mIPOPT_ipo_activate -mIPOPT_mo_activate -mIPOPT_source_files_list=/tmp/icpcslis4PdBUT -mIPOPT_mo_global_data -mIPOPT_link_script_file=/tmp/icpcscript0uzJtL "-mIPOPT_cmdline_link="/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o" "-export-dynamic" "--eh-frame-hdr" "--build-id" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-m" "elf_x86_64" "-o" "cmTC_d768a" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/" "-L/lib/../lib64" "-L/lib/../lib64/" "-L/usr/lib/../lib64" "-L/usr/lib/../lib64/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin/" "-L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7/" "-L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../" "-L/lib64" "-L/lib/" "-L/usr/lib64" "-L/usr/lib" "CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o" "-Bdynamic" "-Bstatic" "-limf" "-lsvml" "-lirng" "-Bdynamic" "-lstdc++" "-lm" "-Bstatic" "-lipgo" "-ldecimal" "--as-needed" "-Bdynamic" "-lcilkrts" "--no-as-needed" "-lstdc++" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc" "-lsvml" "-Bdynamic" "-lc" "-lgcc" "-lgcc_s" "-Bstatic" "-lirc_s" "-Bdynamic" "-ldl" "-lc" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o" "/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o"" -mIPOPT_il_in_obj -mIPOPT_ipo_activate_warn=FALSE -mIPOPT_obj_output_file_name=/tmp/ipo_icpcGEmWvI.o -mIPOPT_whole_archive_fixup_file_name=/tmp/icpcwarchvs7jo5 -mGLOB_linker_version=2.27 -mGLOB_driver_tempfile_name=/tmp/icpctempfileQPMrZW -mP3OPT_asm_target=P3OPT_ASM_TARGET_GAS -mGLOB_async_unwind_tables=TRUE -mGLOB_obj_output_file=/tmp/ipo_icpcGEmWvI.o -mGLOB_source_dialect=GLOB_SOURCE_DIALECT_NONE -mP1OPT_source_file_name=ipo_out.c CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o -mIPOPT_object_files=T -mIPOPT_assembly_files=/tmp/icpcalisfym8Dr -mIPOPT_generated_tempfiles=/tmp/icpcelisfz0edj -mIPOPT_embedded_object_base_name=/tmp/icpceobjS73lMa -mIPOPT_cmdline_link_new_name=/tmp/icpcllisTgrtl2
+ld /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o -export-dynamic --eh-frame-hdr --build-id -dynamic-linker /lib64/ld-linux-x86-64.so.2 -m elf_x86_64 -o cmTC_d768a -L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64 -L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin -L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7 -L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7 -L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/ -L/lib/../lib64 -L/lib/../lib64/ -L/usr/lib/../lib64 -L/usr/lib/../lib64/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin/ -L/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7/ -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../ -L/lib64 -L/lib/ -L/usr/lib64 -L/usr/lib CMakeFiles/cmTC_d768a.dir/CMakeCXXCompilerABI.cpp.o -Bdynamic -Bstatic -limf -lsvml -lirng -Bdynamic -lstdc++ -lm -Bstatic -lipgo -ldecimal --as-needed -Bdynamic -lcilkrts --no-as-needed -lstdc++ -lgcc -lgcc_s -Bstatic -lirc -lsvml -Bdynamic -lc -lgcc -lgcc_s -Bstatic -lirc_s -Bdynamic -ldl -lc /usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crtn.o
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.output
new file mode 100644
index 000000000..1bf571123
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.output
@@ -0,0 +1 @@
+/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/pstl/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/include;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include/icc;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/include;/usr/include/c++/4.8.5;/usr/include/c++/4.8.5/x86_64-redhat-linux;/usr/include/c++/4.8.5/backward;/usr/local/include;/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input
new file mode 100644
index 000000000..f95627ee4
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=PGI
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.10.1
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_9932f/fast"
+/usr/bin/make -f CMakeFiles/cmTC_9932f.dir/build.make CMakeFiles/cmTC_9932f.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o
+/mnt/pgi/linux86-64/2018/bin/pgc++ -v -o CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp1 --llalign -Dunix -D__unix -D__unix__ -Dlinux -D__linux -D__linux__ -D__NO_MATH_INLINES -D__LP64__ -D__x86_64 -D__x86_64__ -D__LONG_MAX__=9223372036854775807L '-D__SIZE_TYPE__=unsigned long int' '-D__PTRDIFF_TYPE__=long int' -D__extension__= -D__amd_64__amd64__ -D__k8 -D__k8__ -D__SSE__ -D__MMX__ -D__SSE2__ -D__SSE3__ -D__PGI -D_GNU_SOURCE -D_PGCG_SOURCE -I- -I/mnt/pgi/linux86-64/18.10/include-gcc70 -I/mnt/pgi/linux86-64/18.10/include -I/usr/include/c++/7 -I/usr/include/x86_64-linux-gnu/c++/7 -I/usr/include/c++/7/backward -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include --preinclude _cplus_preinclude.h --preinclude_macros _cplus_macros.h --gnu_version=70300 -D__pgnu_vsn=70300 -q -o /tmp/pgc++9bCe3jXUexoO.il /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp2 /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -fn /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -il /tmp/pgc++9bCe3jXUexoO.il -x 117 0x600 -x 123 0x80000000 -x 123 4 -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -gnuvsn 70300 -x 69 0x200 -cmdline '+pgc++ /tmp/pgc++9bCe3jXUexoO.il -v -o CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -c' -asm /tmp/pgc++LbCeVyAxx_Yt.s
+PGCC/x86 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgc++LbCeVyAxx_Yt.s -o CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o
+Action(ReadTIFile(./CMakeCXXCompilerABI.ti))
+Unlinking /tmp/pgc++9bCe3jXUexoO.il
+Unlinking /tmp/pgc++LbCeVyAxx_Yt.s
+Unlinking /tmp/pgc++nbCeNEnzNVv3.ll
+Linking CXX executable cmTC_9932f
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9932f.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgc++ -v CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_9932f
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_9932f.dir/CMakeCXXCompilerABI.cpp.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_9932f -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -latomic -lpgatm -lstdc++ -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output
new file mode 100644
index 000000000..8c9d24ae5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input
new file mode 100644
index 000000000..494b45c14
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input
@@ -0,0 +1,42 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=12.1.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_a9a18/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_a9a18.dir/build.make CMakeFiles/cmTC_a9a18.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlc++ -+ -qthreaded -qhalt=e -V -o CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc++
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcAS0adOWz
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/exe/xlCentry -qosvar=rhel.6.9 -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qthreaded -qhalt=e -qasm_as=/usr/bin/as -qcpp_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ppc64-redhat-linux:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -oCMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW0C4fVNg /tmp/xlcW1gn9wsn /dev/null /tmp/xlcLo7QvMFF.lst /dev/null /tmp/xlcW2svId7t
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qalias=ansi -qtls -qtls -qthreaded -qhalt=e /tmp/xlcW0C4fVNg /tmp/xlcW1gn9wsn CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLo7QvMFB.lst /tmp/xlcW2svId7t
+rm /tmp/xlcAS0adOWz
+rm /tmp/xlcLo7QvMF
+rm /tmp/xlcW0C4fVNg
+rm /tmp/xlcW1gn9wsn
+rm /tmp/xlcW2svId7t
+Linking CXX executable cmTC_a9a18
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a9a18.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlc++ -qthreaded -qhalt=e -V CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_a9a18 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc++
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_a9a18.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_a9a18 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -libmc++ -lxlopt -lxl -lstdc++ -lm -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0zyCKVs
+rm /tmp/xlcW1UOt3GL
+rm /tmp/xlcW2lKGvs4
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output
new file mode 100644
index 000000000..a2d8c26d0
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output
@@ -0,0 +1 @@
+/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include;/usr/include/c++/4.4.7;/usr/include/c++/4.4.7/ppc64-redhat-linux;/usr/include/c++/4.4.7/backward;/usr/local/include;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input
new file mode 100644
index 000000000..37aa450fb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=16.1.0.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_f0c9c/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_f0c9c.dir/build.make CMakeFiles/cmTC_f0c9c.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o
+/opt/ibm/xlC/16.1.0/bin/xlc++ -+ -qthreaded -V -o CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o -c "/tmp/CMake/Modules/CMakeCXXCompilerABI.cpp"
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc++
+export XL_ASMOBJFILES=/tmp/xlcASfU5Npd
+export "XL_DIS=/opt/ibm/xlC/16.1.0/exe/dis -o "CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/opt/ibm/xlC/16.1.0/exe/xlCentry -qosvar=centos.7.0 -qalias=ansi -qthreaded -D_REENTRANT -D__VACPP_MULTI__ -qtls -q64 -D_CALL_SYSV -D__NO_MATH_INLINES -D_CALL_ELF=2 -Wno-parentheses -Wno-unused-value -maltivec -qtls -q64 -qgnu_version=4.8.5 -qthreaded -xc++ -qasm_as=/usr/bin/as -qcpp_stdinc=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include -qc_stdinc=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5:/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/ppc64le-redhat-linux:/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward:/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qgcc_c_stdinc=/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -qcomplexgccincl=/opt/ibm/xlsmp/5.1.0/include:/opt/ibm/xlmass/9.1.0/include:/opt/ibm/xlC/16.1.0/include:/opt/ibm/xlC/16.1.0/include:/usr/local/include:/opt/ibm/xlC/16.1.0/include:/usr/include -oCMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o "/tmp/CMake/Modules/CMakeCXXCompilerABI.cpp" /tmp/xlcW02F8mZr /tmp/xlcW1xG0Ns2 /dev/null /tmp/xlcLI57mTNF.lst /dev/null /tmp/xlcW2qVifWC
+export XL_BACKEND=/opt/ibm/xlC/16.1.0/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/opt/ibm/xlC/16.1.0/exe/xlCcode -qalias=ansi -qthreaded -qtls -maltivec -qtls -qthreaded /tmp/xlcW02F8mZr /tmp/xlcW1xG0Ns2 CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLI57mTNB.lst /tmp/xlcW2qVifWC
+rm /tmp/xlcASfU5Npd
+rm /tmp/xlcLI57mTN
+rm /tmp/xlcW02F8mZr
+rm /tmp/xlcW1xG0Ns2
+rm /tmp/xlcW2qVifWC
+Linking CXX executable cmTC_f0c9c
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_f0c9c.dir/link.txt --verbose=1
+/opt/ibm/xlC/16.1.0/bin/xlc++ -qthreaded -V -Wl,-export-dynamic CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f0c9c
+export XL_CONFIG=/opt/ibm/xlC/16.1.0/etc/xlc.cfg.centos.7.gcc.4.8.5:xlc++
+/usr/bin/ld --eh-frame-hdr -Qy -melf64lppc -dynamic-linker /lib64/ld64.so.2 --enable-new-dtags /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crt1.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crti.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtbegin.o -L/opt/ibm/xlsmp/5.1.0/lib -L/opt/ibm/xlmass/9.1.0/lib -L/opt/ibm/xlC/16.1.0/lib -R/opt/ibm/lib -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../.. -export-dynamic CMakeFiles/cmTC_f0c9c.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_f0c9c -lxlopt -lxl -libmc++ -lstdc++ -lm -ldl -lgcc_s -lgcc --as-needed -lpthread --no-as-needed -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtend.o /usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crtn.o
+rm /tmp/xlcW0HSoDlw
+rm /tmp/xlcW1dUcwR6
+rm /tmp/xlcW25pPonH
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output
new file mode 100644
index 000000000..6994f3cd6
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output
@@ -0,0 +1 @@
+/opt/ibm/xlsmp/5.1.0/include;/opt/ibm/xlmass/9.1.0/include;/opt/ibm/xlC/16.1.0/include;/usr/include/c++/4.8.5;/usr/include/c++/4.8.5/ppc64le-redhat-linux;/usr/include/c++/4.8.5/backward;/usr/local/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input
new file mode 100644
index 000000000..4582433de
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input
@@ -0,0 +1,76 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=GNU
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=7.3.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_1cf45/fast"
+/usr/bin/make -f CMakeFiles/cmTC_1cf45.dir/build.make CMakeFiles/cmTC_1cf45.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o
+/usr/bin/f95 -v -c /proj/TableFS/data/chuck/cmake/f/share/cmake-3.13/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o
+Using built-in specs.
+COLLECT_GCC=/usr/bin/f95
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/f951 /proj/TableFS/data/chuck/cmake/f/share/cmake-3.13/Modules/CMakeFortranCompilerABI.F -ffixed-form -cpp=/tmp/cc9yADLU.f90 -quiet -v -imultiarch x86_64-linux-gnu /proj/TableFS/data/chuck/cmake/f/share/cmake-3.13/Modules/CMakeFortranCompilerABI.F -quiet -dumpbase CMakeFortranCompilerABI.F -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -version -fintrinsic-modules-path /usr/lib/gcc/x86_64-linux-gnu/7/finclude -o /tmp/ccH7qQQk.s
+GNU Fortran (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/7/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/lib/gcc/x86_64-linux-gnu/7/finclude
+ /usr/lib/gcc/x86_64-linux-gnu/7/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU Fortran2008 (Ubuntu 7.3.0-27ubuntu1~18.04) version 7.3.0 (x86_64-linux-gnu)
+ compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version isl-0.19-GMP
+
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o /tmp/ccH7qQQk.s
+GNU assembler version 2.30 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.30
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-c' '-o' 'CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o' '-mtune=generic' '-march=x86-64'
+Linking Fortran executable cmTC_1cf45
+/proj/TableFS/data/chuck/cmake/f/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1cf45.dir/link.txt --verbose=1
+/usr/bin/f95 -v CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -o cmTC_1cf45
+Driving: /usr/bin/f95 -v CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -o cmTC_1cf45 -l gfortran -l m -shared-libgcc
+Using built-in specs.
+COLLECT_GCC=/usr/bin/f95
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
+OFFLOAD_TARGET_NAMES=nvptx-none
+OFFLOAD_TARGET_DEFAULT=1
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.3.0-27ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
+Reading specs from /usr/lib/gcc/x86_64-linux-gnu/7/libgfortran.spec
+rename spec lib to liborig
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1cf45' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/7/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/7/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1cf45' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/7/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper -plugin-opt=-fresolution=/tmp/ccS0UYIY.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lquadmath -plugin-opt=-pass-through=-lm -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o cmTC_1cf45 /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/7 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/7/../../.. CMakeFiles/cmTC_1cf45.dir/CMakeFortranCompilerABI.F.o -lgfortran -lm -lgcc_s -lgcc -lquadmath -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/crtn.o
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_1cf45' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output
new file mode 100644
index 000000000..d84842b6f
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output
@@ -0,0 +1 @@
+/usr/lib/gcc/x86_64-linux-gnu/7/finclude;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input
new file mode 100644
index 000000000..fe49bcdee
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input
@@ -0,0 +1,47 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=PGI
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.10.1
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_1e8d2/fast"
+/usr/bin/make -f CMakeFiles/cmTC_1e8d2.dir/build.make CMakeFiles/cmTC_1e8d2.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o
+/mnt/pgi/linux86-64/2018/bin/pgfortran -v -c /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgf901 /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -nohpf -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp k8 -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -x 120 0x200 -stdinc /mnt/pgi/linux86-64/18.10/include-gcc70:/mnt/pgi/linux86-64/18.10/include:/usr/lib/gcc/x86_64-linux-gnu/7/include:/usr/local/include:/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed:/usr/include/x86_64-linux-gnu:/usr/include -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -v -c -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -preprocess -nofreeform -vect 48 -x 54 1 -x 70 0x40000000 -y 163 0xc0000000 -x 189 0x10 -modexport /tmp/pgfortranSoCeegQjDEd5.cmod -modindex /tmp/pgfortranmoCeK26CaVn7.cmdx -output /tmp/pgfortranSoCeeXSv8E7w.ilm
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/mnt/pgi/linux86-64/18.10/bin/pgf902 /tmp/pgfortranSoCeeXSv8E7w.ilm -fn /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -x 51 0x20 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -x 120 0x200 -astype 0 -x 68 0x20 -x 70 0x40000000 -x 164 0x800000 -x 124 1 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -v -c -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o' -asm /tmp/pgfortranSoCeeRr681iB.s
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgfortranSoCeeRr681iB.s -o CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o
+
+/mnt/pgi/linux86-64/18.10/bin/pgappend -noerror CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o -name .IPDINFO /tmp/pgfortranSoCeegQjDEd5.cmod -name .IPEINFO /tmp/pgfortranmoCeK26CaVn7.cmdx
+Unlinking /tmp/pgfortranSoCeeXSv8E7w.ilm
+Unlinking /tmp/pgfortranmoCeK5sPGGfq.stb
+Unlinking /tmp/pgfortranSoCeegQjDEd5.cmod
+Unlinking /tmp/pgfortranmoCeK26CaVn7.cmdx
+Unlinking /tmp/pgfortranSoCeeRr681iB.s
+Unlinking /tmp/pgfortranmoCeKdFYP9Gu.ll
+Linking Fortran executable cmTC_1e8d2
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1e8d2.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgfortran -v CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o -o cmTC_1e8d2
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o /mnt/pgi/linux86-64/18.10/lib/f90main.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_1e8d2.dir/CMakeFortranCompilerABI.F.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_1e8d2 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgf90rtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lrt -lpthread -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output
new file mode 100644
index 000000000..289c530a6
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input
new file mode 100644
index 000000000..d80cedef7
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input
@@ -0,0 +1,50 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=ELF
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=XL
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=14.1.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_d05a9/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_d05a9.dir/build.make CMakeFiles/cmTC_d05a9.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/bin/xlf -qthreaded -qhalt=e -V -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/xlf.cfg.rhel6.9.gcc447:xlf
+export XLF_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/V1R2M4.xlf.cfg.rhel6.9.gcc447
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/dis -o "CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o" "CMakeFortranCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/cpp /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F /tmp/F841970obBXFf -C -I/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include -I/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/include
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfentry /tmp/F841970obBXFf /tmp/F841970QXWvB4 /tmp/F841970QXWvB4F.lst xlfsmsg.cat xlfmsg.cat /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeFortranCompilerABI.F "OSVAR(rhel.6.9)" NOZEROSIZE SAVE "ALIAS(intptr)" "POSITION(appendold)" "XLF90(noautodealloc,nosignedzero,oldpad)" "XLF77(intarg,intxor,persistent,noleadzero,gedit77,noblankpad,oldboz,softeof)" "XLF2003(nopolymorphic,nobozlitargs,nostopexcept,novolatile,noautorealloc,oldnaninf)" "XLF2008(nocheckpresence)" 64 "GNU_VERSION(4.4.7)" "SAVEOPTFILE(/tmp/optf.41970mydp8V)" "SAVEVERSIONFILE(/tmp/version.41970sjsfYH)" THREADED "HALT(e)" "WSTREAMS(/tmp/F8419704oFzOth1,/tmp/F8419704oFzOtb1,/tmp/F8419704oFzOts1)" "DEFMSG(/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/msg/en_US)" -I/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include -I/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/include
+COMMAND LINE 1520-061 (W) The XLF77(PERSISTENT) option stores entities in static storage. This may affect the thread safety of your code.
+COMMAND LINE 1520-061 (W) The SAVE option stores entities in static storage. This may affect the thread safety of your code.
+** cmakefortrancompilerabi === End of Compilation 1 ===
+rm /tmp/F841970obBXFf
+export XL_FRONTEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfentry
+export XL_ASTI=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfhot
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfcode
+export XL_LINKER=/usr/bin/ld
+export XL_BOLT=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/bolt
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfhot /tmp/F8419704oFzOth1 /tmp/F8419704oFzOth2 /tmp/F8419704oFzOtb1 /tmp/F8419704oFzOtb2 /tmp/F8419704oFzOts1 /tmp/F8419704oFzOts2 /tmp/F841970QXWvB4 /tmp/F841970QXWvB4A.lst
+export XL_FRONTEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfentry
+export XL_ASTI=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfhot
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfcode
+export XL_LINKER=/usr/bin/ld
+export XL_BOLT=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/bolt
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/exe/xlfcode /tmp/F8419704oFzOth2 /tmp/F8419704oFzOtb2 CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o /tmp/F841970QXWvB4B.lst /tmp/F8419704oFzOts2
+1501-510 Compilation successful for file CMakeFortranCompilerABI.F.
+rm /tmp/optf.41970mydp8V
+Linking Fortran executable cmTC_d05a9
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d05a9.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/bin/xlf -V -qthreaded -qhalt=e CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o -o cmTC_d05a9 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/xlf.cfg.rhel6.9.gcc447:xlf
+export XLF_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/etc/V1R2M4.xlf.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_d05a9.dir/CMakeFortranCompilerABI.F.o -o cmTC_d05a9 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlf90 -lxlopt -lxlomp_ser -lxl -lxlfmath -lgcc_s -ldl -lrt -lpthread -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/optf.419839KEged
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output
new file mode 100644
index 000000000..39a28a46b
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output
@@ -0,0 +1 @@
+/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include;/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input
new file mode 100644
index 000000000..5e2e49ab8
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input
@@ -0,0 +1,36 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=PGI
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=18.10.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_a7f0d/fast"
+/usr/bin/make -f CMakeFiles/cmTC_a7f0d.dir/build.make CMakeFiles/cmTC_a7f0d.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o
+/mnt/pgi/linux86-64/2018/bin/pgcc -Mnostdinc -v -o CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -c /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -nostdinc -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -predicate '#machine(x86_64) #lint(off) #system(posix) #cpu(x86_64)' -cmdline '+pgcc /usr/share/cmake-3.10/Modules/CMakeCCompilerABI.c -Mnostdinc -v -o CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -c' -outfile CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -x 123 0x80000000 -x 123 4 -x 2 0x400 -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -asm /tmp/pgccjRkfBrHQsITu.s
+PGC/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgccjRkfBrHQsITu.s -o CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o
+Unlinking /tmp/pgccjRkfBrHQsITu.s
+Unlinking /tmp/pgccrRkfZClhdaSG.ll
+Linking C executable cmTC_a7f0d
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a7f0d.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgcc -Mnostdinc -v CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -o cmTC_a7f0d
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_a7f0d.dir/CMakeCCompilerABI.c.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_a7f0d -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input
new file mode 100644
index 000000000..8b1e2860b
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input
@@ -0,0 +1,42 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=12.1.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_b8c4a/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_b8c4a.dir/build.make CMakeFiles/cmTC_b8c4a.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -V -o CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcASEFMkoN
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlcentry -qosvar=rhel.6.9 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -qasm_as=/usr/bin/as -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qvac_include_path=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -oCMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c /tmp/xlcW0cUFNRj /tmp/xlcW1YJsgzt /dev/null /tmp/xlcLI4MvwXF.lst /dev/null /tmp/xlcW2sIonhD
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW0cUFNRj /tmp/xlcW1YJsgzt CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o /tmp/xlcLI4MvwXB.lst /tmp/xlcW2sIonhD
+rm /tmp/xlcASEFMkoN
+rm /tmp/xlcLI4MvwX
+rm /tmp/xlcW0cUFNRj
+rm /tmp/xlcW1YJsgzt
+rm /tmp/xlcW2sIonhD
+Linking C executable cmTC_b8c4a
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b8c4a.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -V CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o -o cmTC_b8c4a -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_b8c4a.dir/CMakeCCompilerABI.c.o -o cmTC_b8c4a -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW03gDCly
+rm /tmp/xlcW1oa6XxW
+rm /tmp/xlcW2fQXnKk
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input
new file mode 100644
index 000000000..dd2b55d91
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=PGI
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=18.10.1
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_90855/fast"
+/usr/bin/make -f CMakeFiles/cmTC_90855.dir/build.make CMakeFiles/cmTC_90855.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o
+/mnt/pgi/linux86-64/2018/bin/pgc++ -Mnostdinc -v -o CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -c /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp1 --llalign -Dunix -D__unix -D__unix__ -Dlinux -D__linux -D__linux__ -D__NO_MATH_INLINES -D__LP64__ -D__x86_64 -D__x86_64__ -D__LONG_MAX__=9223372036854775807L '-D__SIZE_TYPE__=unsigned long int' '-D__PTRDIFF_TYPE__=long int' -D__extension__= -D__amd_64__amd64__ -D__k8 -D__k8__ -D__SSE__ -D__MMX__ -D__SSE2__ -D__SSE3__ -D__PGI -D_GNU_SOURCE -D_PGCG_SOURCE -I- -I/mnt/pgi/linux86-64/18.10/include-gcc70 -I/mnt/pgi/linux86-64/18.10/include -I/usr/include/c++/7 -I/usr/include/x86_64-linux-gnu/c++/7 -I/usr/include/c++/7/backward -I/usr/lib/gcc/x86_64-linux-gnu/7/include -I/usr/local/include -I/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed -I/usr/include/x86_64-linux-gnu -I/usr/include --preinclude _cplus_preinclude.h --preinclude_macros _cplus_macros.h --gnu_version=70300 -D__pgnu_vsn=70300 -q -o /tmp/pgc++X3kftwl3x0Hl.il /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp
+
+/mnt/pgi/linux86-64/18.10/bin/pggpp2 /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -astype 0 -fn /usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp -il /tmp/pgc++X3kftwl3x0Hl.il -x 117 0x600 -x 123 0x80000000 -x 123 4 -x 119 0x20 -def __pgnu_vsn=70300 -x 120 0x200000 -x 70 0x40000000 -x 164 0x800000 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -gnuvsn 70300 -x 69 0x200 -cmdline '+pgc++ /tmp/pgc++X3kftwl3x0Hl.il -Mnostdinc -v -o CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -c' -asm /tmp/pgc++53kfRignAQXZ.s
+PGCC/x86 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgc++53kfRignAQXZ.s -o CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o
+Action(ReadTIFile(./CMakeCXXCompilerABI.ti))
+Unlinking /tmp/pgc++X3kftwl3x0Hl.il
+Unlinking /tmp/pgc++53kfRignAQXZ.s
+Unlinking /tmp/pgc++b3kfdox2AAgc.ll
+Linking CXX executable cmTC_90855
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_90855.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgc++ -Mnostdinc -v CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_90855
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_90855.dir/CMakeCXXCompilerABI.cpp.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_90855 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -latomic -lpgatm -lstdc++ -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output
new file mode 100644
index 000000000..8c9d24ae5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/include/c++/7;/usr/include/x86_64-linux-gnu/c++/7;/usr/include/c++/7/backward;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input
new file mode 100644
index 000000000..f6b5d9111
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input
@@ -0,0 +1,42 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=12.1.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_98791/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_98791.dir/build.make CMakeFiles/cmTC_98791.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -+ -qnostdinc -V -o CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcAS82INiZ
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/exe/xlCentry -qosvar=rhel.6.9 -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -qasm_as=/usr/bin/as -qcpp_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ppc64-redhat-linux:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -oCMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW0SEqGeR /tmp/xlcW1AfQ1jy /dev/null /tmp/xlcLmUAPcJF.lst /dev/null /tmp/xlcW2OCErpf
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW0SEqGeR /tmp/xlcW1AfQ1jy CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLmUAPcJB.lst /tmp/xlcW2OCErpf
+rm /tmp/xlcAS82INiZ
+rm /tmp/xlcLmUAPcJ
+rm /tmp/xlcW0SEqGeR
+rm /tmp/xlcW1AfQ1jy
+rm /tmp/xlcW2OCErpf
+Linking CXX executable cmTC_98791
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_98791.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -qnostdinc -V CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_98791 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_98791.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_98791 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -libmc++ -lxlopt -lxl -lstdc++ -lm -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0DcBWi8
+rm /tmp/xlcW14NqGs6
+rm /tmp/xlcW2Z8nuC4
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input
new file mode 100644
index 000000000..12727f048
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input
@@ -0,0 +1,47 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=PGI
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.10.1
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_b7462/fast"
+/usr/bin/make -f CMakeFiles/cmTC_b7462.dir/build.make CMakeFiles/cmTC_b7462.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o
+/mnt/pgi/linux86-64/2018/bin/pgfortran -Mnostdinc -v -c /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgf901 /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -nohpf -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp k8 -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -x 120 0x200 -nostdinc -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -Mnostdinc -v -c -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -preprocess -nofreeform -vect 48 -x 54 1 -x 70 0x40000000 -y 163 0xc0000000 -x 189 0x10 -modexport /tmp/pgfortranoelfQQWHVV3l.cmod -modindex /tmp/pgfortran_elf6-1UcVhp.cmdx -output /tmp/pgfortranUelfk_cqURUw.ilm
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/mnt/pgi/linux86-64/18.10/bin/pgf902 /tmp/pgfortranUelfk_cqURUw.ilm -fn /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -x 51 0x20 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -x 124 0x1400 -y 15 2 -x 57 0x3b0000 -x 58 0x48000000 -x 49 0x100 -x 120 0x200 -astype 0 -x 68 0x20 -x 70 0x40000000 -x 164 0x800000 -x 124 1 -y 163 0xc0000000 -x 189 0x10 -y 189 0x4000000 -cmdline '+pgfortran /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -Mnostdinc -v -c -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o' -asm /tmp/pgfortranUelfk-LC2Ixm.s
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGF90/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgfortranUelfk-LC2Ixm.s -o CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o
+
+/mnt/pgi/linux86-64/18.10/bin/pgappend -noerror CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o -name .IPDINFO /tmp/pgfortranoelfQQWHVV3l.cmod -name .IPEINFO /tmp/pgfortran_elf6-1UcVhp.cmdx
+Unlinking /tmp/pgfortranUelfk_cqURUw.ilm
+Unlinking /tmp/pgfortranEelfAVAFcE2q.stb
+Unlinking /tmp/pgfortranoelfQQWHVV3l.cmod
+Unlinking /tmp/pgfortran_elf6-1UcVhp.cmdx
+Unlinking /tmp/pgfortranUelfk-LC2Ixm.s
+Unlinking /tmp/pgfortranEelfA4vWZ2Nt.ll
+Linking Fortran executable cmTC_b7462
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b7462.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgfortran -v -Mnostdinc CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o -o cmTC_b7462
+Export PGI_CURR_CUDA_HOME=/mnt/pgi/linux86-64/2018/cuda/9.1
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o /mnt/pgi/linux86-64/18.10/lib/f90main.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_b7462.dir/CMakeFortranCompilerABI.F.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_b7462 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgf90rtl -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lrt -lpthread -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input
new file mode 100644
index 000000000..a552d7052
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input
@@ -0,0 +1,42 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=XL
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=12.1.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_76ec2/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_76ec2.dir/build.make CMakeFiles/cmTC_76ec2.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -I/tmp/ii/test_c -V -o CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcASknvctJ
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o" "CMakeCCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlcentry -qosvar=rhel.6.9 -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -I/tmp/ii/test_c -qasm_as=/usr/bin/as -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qvac_include_path=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -oCMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCCompilerABI.c /tmp/xlcW0buijl3 /tmp/xlcW1Cx9kxW /dev/null /tmp/xlcLVbqvUBF.lst /dev/null /tmp/xlcW2hWVoJP
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qlanglvl=extc99 -qcpluscmt -qkeyword=inline -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW0buijl3 /tmp/xlcW1Cx9kxW CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o /tmp/xlcLVbqvUBB.lst /tmp/xlcW2hWVoJP
+rm /tmp/xlcASknvctJ
+rm /tmp/xlcLVbqvUB
+rm /tmp/xlcW0buijl3
+rm /tmp/xlcW1Cx9kxW
+rm /tmp/xlcW2hWVoJP
+Linking C executable cmTC_76ec2
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_76ec2.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/bin/xlc -qnostdinc -I/tmp/ii/test_c -V CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o -o cmTC_76ec2 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlc
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_76ec2.dir/CMakeCCompilerABI.c.o -o cmTC_76ec2 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0ka8GHg
+rm /tmp/xlcW1k1R1fn
+rm /tmp/xlcW2s4HnOt
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output
new file mode 100644
index 000000000..38f0b3734
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output
@@ -0,0 +1 @@
+/tmp/ii/test_c
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input
new file mode 100644
index 000000000..4b20f2ee4
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input
@@ -0,0 +1,42 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=XL
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=12.1.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/gmake" "cmTC_026f6/fast"
+/usr/bin/gmake -f CMakeFiles/cmTC_026f6.dir/build.make CMakeFiles/cmTC_026f6.dir/build
+gmake[1]: Entering directory `/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -+ -qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx -V -o CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o -c /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+export XL_ASMOBJFILES=/tmp/xlcAS6jiX2k
+export "XL_DIS=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/dis -o "CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o" "CMakeCXXCompilerABI.o""
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/exe/xlCentry -qosvar=rhel.6.9 -qalias=ansi -qtls -D_CALL_SYSV -D__null=0 -D__NO_MATH_INLINES -qtls -q64 -qgnu_version=4.4.7 -qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx -qasm_as=/usr/bin/as -qcpp_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/include -qc_stdinc=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include -qgcc_cpp_stdinc=/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ppc64-redhat-linux:/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/backward:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qgcc_c_stdinc=/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -qcomplexgccincl=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/include:/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/include:/usr/local/include:/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/crt/include:/usr/include -oCMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o /soft/buildtools/cmake/3.5.2/share/cmake-3.5/Modules/CMakeCXXCompilerABI.cpp /tmp/xlcW00ICris /tmp/xlcW1eYwBrK /dev/null /tmp/xlcLG2pVwDF.lst /dev/null /tmp/xlcW2YVJhA2
+export XL_BACKEND=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode
+export XL_LINKER=/usr/bin/ld
+/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/exe/xlCcode -qalias=ansi -qtls -qtls -qnostdinc /tmp/xlcW00ICris /tmp/xlcW1eYwBrK CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o /tmp/xlcLG2pVwDB.lst /tmp/xlcW2YVJhA2
+rm /tmp/xlcAS6jiX2k
+rm /tmp/xlcLG2pVwD
+rm /tmp/xlcW00ICris
+rm /tmp/xlcW1eYwBrK
+rm /tmp/xlcW2YVJhA2
+Linking CXX executable cmTC_026f6
+/soft/buildtools/cmake/3.5.2/bin/cmake -E cmake_link_script CMakeFiles/cmTC_026f6.dir/link.txt --verbose=1
+/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/bin/xlC -qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx -V CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_026f6 -Wl,-export-dynamic
+export XL_CONFIG=/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/etc/vac.cfg.rhel6.9.gcc447:xlC
+export XLC_USR_CONFIG=/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/etc/V1R2M4.vac.cfg.rhel6.9.gcc447
+/usr/bin/ld --eh-frame-hdr -Qy -melf64ppc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtbegin.o -L/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64 -L/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64 -L/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64 -L/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64 -R/soft/compilers/ibmcmp-oct2017/lib64/bg -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../.. CMakeFiles/cmTC_026f6.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_026f6 -export-dynamic -dynamic-linker /lib64/ld64.so.1 -lxlopt -lxl -libmc++ -lxlopt -lxl -lstdc++ -lm -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc -ldl -lgcc_s -lgcc -lm -lc -lgcc_s -lgcc /usr/lib/gcc/ppc64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/ppc64-redhat-linux/4.4.7/../../../../lib64/crtn.o
+rm /tmp/xlcW0rO54CG
+rm /tmp/xlcW1Q6xB5c
+rm /tmp/xlcW2TnvdyJ
+gmake[1]: Leaving directory `/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output
new file mode 100644
index 000000000..727afdbc0
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output
@@ -0,0 +1 @@
+/tmp/ii/test_c;/tmp/ii/test_cxx
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input
new file mode 100644
index 000000000..01abe8d50
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input
@@ -0,0 +1,35 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=PGI
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.10.1
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_ea063/fast"
+/usr/bin/make -f CMakeFiles/cmTC_ea063.dir/build.make CMakeFiles/cmTC_ea063.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o
+/mnt/pgi/linux86-64/2018/bin/pgf77 -v -c /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o
+Export PGI=/mnt/pgi
+
+/mnt/pgi/linux86-64/18.10/bin/pgftnc /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -opt 1 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -tp k8 -x 120 0x1000 -x 51 0x20 -x 124 0x1401 -astype 0 -stdinc /mnt/pgi/linux86-64/18.10/include-gcc70:/mnt/pgi/linux86-64/18.10/include:/usr/lib/gcc/x86_64-linux-gnu/7/include:/usr/local/include:/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed:/usr/include/x86_64-linux-gnu:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -preprocess -cmdline '+pgf77 /usr/share/cmake-3.10/Modules/CMakeFortranCompilerABI.F -v -c -o CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o' -x 70 0x40000000 -x 164 0x800000 -x 124 1 -asm /tmp/pgf77RxHebkuzkjES.s
+ 0 inform, 0 warnings, 0 severes, 0 fatal for cmakefortrancompilerabi
+PGFTN/x86-64 Linux 18.10-1: compilation successful
+
+/usr/bin/as /tmp/pgf77RxHebkuzkjES.s -o CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o
+Unlinking /tmp/pgf77RxHebkuzkjES.s
+Unlinking /tmp/pgf77dxHejAvLAzcs.ll
+Linking Fortran executable cmTC_ea063
+/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ea063.dir/link.txt --verbose=1
+/mnt/pgi/linux86-64/2018/bin/pgf77 -v CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o -o cmTC_ea063
+Export PGI=/mnt/pgi
+
+/usr/bin/ld /usr/lib/x86_64-linux-gnu/crt1.o /usr/lib/x86_64-linux-gnu/crti.o /mnt/pgi/linux86-64/18.10/lib/trace_init.o /usr/lib/gcc/x86_64-linux-gnu/7/crtbegin.o /mnt/pgi/linux86-64/18.10/lib/initmp.o /mnt/pgi/linux86-64/18.10/lib/pgfmain.o --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 /mnt/pgi/linux86-64/18.10/lib/pgi.ld -L/mnt/pgi/linux86-64/18.10/lib -L/usr/lib64 -L/usr/lib/gcc/x86_64-linux-gnu/7 CMakeFiles/cmTC_ea063.dir/CMakeFortranCompilerABI.F.o -rpath /mnt/pgi/linux86-64/18.10/lib -rpath /usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -o cmTC_ea063 -L/usr/lib/gcc/x86_64-linux-gnu/7/../../../../lib64 -lpgftnrtl -lpgmp -lnuma -lpthread --start-group -lpgmath -lnspgc -lpgc --end-group -lrt -lpthread -lm -lgcc -lc -lgcc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/7/crtend.o /usr/lib/x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output
new file mode 100644
index 000000000..289c530a6
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output
@@ -0,0 +1 @@
+/mnt/pgi/linux86-64/18.10/include-gcc70;/mnt/pgi/linux86-64/18.10/include;/usr/lib/gcc/x86_64-linux-gnu/7/include;/usr/local/include;/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.input
new file mode 100644
index 000000000..81e9ee04b
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.input
@@ -0,0 +1,70 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=C:/DoesNotExist/MinGW/bin/gcc-ar.exe
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=C:/DoesNotExist/MinGW/bin/gcc-ranlib.exe
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=4.9.3
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: C:/tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"C:/DoesNotExist/MinGW/bin/mingw32-make.exe" "cmTC_ab097/fast"
+C:/DoesNotExist/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_ab097.dir\build.make CMakeFiles/cmTC_ab097.dir/build
+mingw32-make.exe[1]: Entering directory 'C:/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_ab097.dir/CMakeCCompilerABI.c.obj
+C:\DoesNotExist\MinGW\bin\gcc.exe -v -o CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj -c "C:\CMake\Modules\CMakeCCompilerABI.c"
+Using built-in specs.
+COLLECT_GCC=C:\DoesNotExist\MinGW\bin\gcc.exe
+Target: mingw32
+Configured with: ../src/gcc-4.9.3/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-nls
+Thread model: win32
+gcc version 4.9.3 (GCC)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=i586'
+ c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/cc1.exe -quiet -v -iprefix c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/ C:\CMake\Modules\CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=i586 -auxbase-strip CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj -version -o C:\Users\DASHBO~1\AppData\Local\Temp\ccKRBU4I.s
+GNU C (GCC) version 4.9.3 (mingw32)
+ compiled by GNU C version 4.9.3, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.2
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/../../../../mingw32/include"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/include"
+ignoring duplicate directory "/mingw/lib/gcc/mingw32/4.9.3/../../../../include"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../include"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/include-fixed"
+ignoring nonexistent directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/../../../../mingw32/include"
+ignoring duplicate directory "/mingw/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/include
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/../../../../include
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/include-fixed
+End of search list.
+GNU C (GCC) version 4.9.3 (mingw32)
+ compiled by GNU C version 4.9.3, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.2
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 32bccaa1a45d39107471fe656e1c3cd5
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=i586'
+ c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/as.exe -v -o CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj C:\Users\DASHBO~1\AppData\Local\Temp\ccKRBU4I.s
+GNU assembler version 2.25.1 (mingw32) using BFD version (GNU Binutils) 2.25.1
+COMPILER_PATH=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../libexec/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/
+LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../lib/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/lib/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=i586'
+Linking C executable cmTC_ab097.exe
+"C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_ab097.dir\link.txt --verbose=1
+"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_ab097.dir/objects.a
+C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_ab097.dir/objects.a @CMakeFiles\cmTC_ab097.dir\objects1.rsp
+C:\DoesNotExist\MinGW\bin\gcc.exe -v -Wl,--whole-archive CMakeFiles\cmTC_ab097.dir/objects.a -Wl,--no-whole-archive -o cmTC_ab097.exe -Wl,--out-implib,libcmTC_ab097.dll.a -Wl,--major-image-version,0,--minor-image-version,0
+Using built-in specs.
+COLLECT_GCC=C:\DoesNotExist\MinGW\bin\gcc.exe
+COLLECT_LTO_WRAPPER=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/lto-wrapper.exe
+Target: mingw32
+Configured with: ../src/gcc-4.9.3/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-nls
+Thread model: win32
+gcc version 4.9.3 (GCC)
+COMPILER_PATH=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../libexec/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/
+LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../lib/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/lib/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_ab097.exe' '-mtune=generic' '-march=i586'
+ c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/collect2.exe -plugin c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/liblto_plugin-0.dll -plugin-opt=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\DASHBO~1\AppData\Local\Temp\ccEGcsW8.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -Bdynamic -o cmTC_ab097.exe c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../crt2.o c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/crtbegin.o -Lc:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3 -Lc:/DoesNotExist/mingw/bin/../lib/gcc -Lc:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/lib -Lc:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../.. --whole-archive CMakeFiles\cmTC_ab097.dir/objects.a --no-whole-archive --out-implib libcmTC_ab097.dll.a --major-image-version 0 --minor-image-version 0 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/crtend.o
+mingw32-make.exe[1]: Leaving directory 'C:/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.output
new file mode 100644
index 000000000..d23e7fe7c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.output
@@ -0,0 +1 @@
+C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3/include;C:/DoesNotExist/mingw/include;C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3/include-fixed
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.input
new file mode 100644
index 000000000..cd773402c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.input
@@ -0,0 +1,76 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=C:/DoesNotExist/MinGW/bin/gcc-ar.exe
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=C:/DoesNotExist/MinGW/bin/gcc-ranlib.exe
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=4.9.3
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: C:/tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"C:/DoesNotExist/MinGW/bin/mingw32-make.exe" "cmTC_2b790/fast"
+C:/DoesNotExist/MinGW/bin/mingw32-make.exe -f CMakeFiles\cmTC_2b790.dir\build.make CMakeFiles/cmTC_2b790.dir/build
+mingw32-make.exe[1]: Entering directory 'C:/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_2b790.dir/CMakeCXXCompilerABI.cpp.obj
+C:\DoesNotExist\MinGW\bin\g++.exe -v -o CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj -c "C:\CMake\Modules\CMakeCXXCompilerABI.cpp"
+Using built-in specs.
+COLLECT_GCC=C:\DoesNotExist\MinGW\bin\g++.exe
+Target: mingw32
+Configured with: ../src/gcc-4.9.3/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-nls
+Thread model: win32
+gcc version 4.9.3 (GCC)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj' '-c' '-shared-libgcc' '-mtune=generic' '-march=i586'
+ c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/cc1plus.exe -quiet -v -iprefix c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/ C:\CMake\Modules\CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=generic -march=i586 -auxbase-strip CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj -version -o C:\Users\DASHBO~1\AppData\Local\Temp\cceEHFvQ.s
+GNU C++ (GCC) version 4.9.3 (mingw32)
+ compiled by GNU C version 4.9.3, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.2
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring nonexistent directory "c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/../../../../mingw32/include"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/include/c++"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/include/c++/mingw32"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/include/c++/backward"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/include"
+ignoring duplicate directory "/mingw/lib/gcc/mingw32/4.9.3/../../../../include"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../include"
+ignoring duplicate directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/include-fixed"
+ignoring nonexistent directory "c:/DoesNotExist/mingw/lib/gcc/../../lib/gcc/mingw32/4.9.3/../../../../mingw32/include"
+ignoring duplicate directory "/mingw/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/include/c++
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/include/c++/mingw32
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/include/c++/backward
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/include
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/../../../../include
+ c:\DoesNotExist\mingw\bin\../lib/gcc/mingw32/4.9.3/include-fixed
+End of search list.
+GNU C++ (GCC) version 4.9.3 (mingw32)
+ compiled by GNU C version 4.9.3, GMP version 5.1.2, MPFR version 3.1.2, MPC version 1.0.2
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 5086496b116ea21cdc0e479568243b88
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj' '-c' '-shared-libgcc' '-mtune=generic' '-march=i586'
+ c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/as.exe -v -o CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj C:\Users\DASHBO~1\AppData\Local\Temp\cceEHFvQ.s
+GNU assembler version 2.25.1 (mingw32) using BFD version (GNU Binutils) 2.25.1
+COMPILER_PATH=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../libexec/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/
+LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../lib/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/lib/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj' '-c' '-shared-libgcc' '-mtune=generic' '-march=i586'
+Linking CXX executable cmTC_2b790.exe
+"C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_2b790.dir\link.txt --verbose=1
+"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_2b790.dir/objects.a
+C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_2b790.dir/objects.a @CMakeFiles\cmTC_2b790.dir\objects1.rsp
+C:\DoesNotExist\MinGW\bin\g++.exe -v -Wl,--whole-archive CMakeFiles\cmTC_2b790.dir/objects.a -Wl,--no-whole-archive -o cmTC_2b790.exe -Wl,--out-implib,libcmTC_2b790.dll.a -Wl,--major-image-version,0,--minor-image-version,0
+Using built-in specs.
+COLLECT_GCC=C:\DoesNotExist\MinGW\bin\g++.exe
+COLLECT_LTO_WRAPPER=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/lto-wrapper.exe
+Target: mingw32
+Configured with: ../src/gcc-4.9.3/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --with-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-nls
+Thread model: win32
+gcc version 4.9.3 (GCC)
+COMPILER_PATH=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../libexec/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/bin/
+LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist/mingw/bin/../lib/gcc/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/lib/;c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_2b790.exe' '-shared-libgcc' '-mtune=generic' '-march=i586'
+ c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/collect2.exe -plugin c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/liblto_plugin-0.dll -plugin-opt=c:/DoesNotExist/mingw/bin/../libexec/gcc/mingw32/4.9.3/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\DASHBO~1\AppData\Local\Temp\ccYpt7zh.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -Bdynamic -u ___register_frame_info -u ___deregister_frame_info -o cmTC_2b790.exe c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../crt2.o c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/crtbegin.o -Lc:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3 -Lc:/DoesNotExist/mingw/bin/../lib/gcc -Lc:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../../../mingw32/lib -Lc:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/../../.. --whole-archive CMakeFiles\cmTC_2b790.dir/objects.a --no-whole-archive --out-implib libcmTC_2b790.dll.a --major-image-version 0 --minor-image-version 0 -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/crtend.o
+mingw32-make.exe[1]: Leaving directory 'C:/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.output
new file mode 100644
index 000000000..7a5e447cf
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.output
@@ -0,0 +1 @@
+C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3/include/c++;C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3/include/c++/mingw32;C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3/include/c++/backward;C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3/include;C:/DoesNotExist/mingw/include;C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3/include-fixed
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.input
new file mode 100644
index 000000000..b46848433
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.input
@@ -0,0 +1,60 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=CMAKE_C_COMPILER_AR-NOTFOUND
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=CMAKE_C_COMPILER_RANLIB-NOTFOUND
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=4.8.5
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/pkg/bin/gmake" "cmTC_9a517/fast"
+/usr/pkg/bin/gmake -f CMakeFiles/cmTC_9a517.dir/build.make CMakeFiles/cmTC_9a517.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o
+/usr/bin/cc -v -o CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o -c /usr/pkg/share/cmake-3.9/Modules/CMakeCCompilerABI.c
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+ /usr/libexec/cc1 -quiet -v /usr/pkg/share/cmake-3.9/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=nocona -march=i486 -auxbase-strip CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o -version -o /var/tmp//ccXQW9Zo.s
+GNU C (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/gcc-4.8
+ /usr/include
+End of search list.
+GNU C (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+Compiler executable checksum: 468b91b49af5cfeb6bb696ad20c66c1c
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+ as -v -o CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o /var/tmp//ccXQW9Zo.s
+GNU assembler version 2.23.2 (i486--netbsdelf) using BFD version (NetBSD Binutils nb1) 2.23.2
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+Linking C executable cmTC_9a517
+/usr/pkg/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9a517.dir/link.txt --verbose=1
+/usr/bin/cc -v CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o -o cmTC_9a517
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_9a517' '-mtune=nocona' '-march=i486'
+ ld --eh-frame-hdr -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o cmTC_9a517 /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o CMakeFiles/cmTC_9a517.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.output
new file mode 100644
index 000000000..6b69b2d7c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.output
@@ -0,0 +1 @@
+/usr/include/gcc-4.8;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.input
new file mode 100644
index 000000000..e3c5f72e9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.input
@@ -0,0 +1,62 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=CMAKE_CXX_COMPILER_AR-NOTFOUND
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=CMAKE_CXX_COMPILER_RANLIB-NOTFOUND
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=4.8.5
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/pkg/bin/gmake" "cmTC_cca06/fast"
+/usr/pkg/bin/gmake -f CMakeFiles/cmTC_cca06.dir/build.make CMakeFiles/cmTC_cca06.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o
+/usr/bin/c++ -v -o CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o -c /usr/pkg/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ /usr/libexec/cc1plus -quiet -v /usr/pkg/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=nocona -march=i486 -auxbase-strip CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o -version -o /var/tmp//ccqeRxzZ.s
+GNU C++ (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/g++
+ /usr/include/g++/backward
+ /usr/include/gcc-4.8
+ /usr/include
+End of search list.
+GNU C++ (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+Compiler executable checksum: 961550adc452c84b614bf799df00d02b
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ as -v -o CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o /var/tmp//ccqeRxzZ.s
+GNU assembler version 2.23.2 (i486--netbsdelf) using BFD version (NetBSD Binutils nb1) 2.23.2
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+Linking CXX executable cmTC_cca06
+/usr/pkg/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cca06.dir/link.txt --verbose=1
+/usr/bin/c++ -v CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_cca06
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_cca06' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ ld --eh-frame-hdr -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o cmTC_cca06 /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o CMakeFiles/cmTC_cca06.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm --as-needed -lgcc_s --no-as-needed -lgcc -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.output
new file mode 100644
index 000000000..7b1e11ece
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.output
@@ -0,0 +1 @@
+/usr/include/g++;/usr/include/g++/backward;/usr/include/gcc-4.8;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input
new file mode 100644
index 000000000..cd5845ae5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input
@@ -0,0 +1,58 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=CMAKE_C_COMPILER_AR-NOTFOUND
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=CMAKE_C_COMPILER_RANLIB-NOTFOUND
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=4.8.5
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/pkg/bin/gmake" "cmTC_b8d65/fast"
+/usr/pkg/bin/gmake -f CMakeFiles/cmTC_b8d65.dir/build.make CMakeFiles/cmTC_b8d65.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o
+/usr/bin/cc -nostdinc -v -o CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -c /usr/pkg/share/cmake-3.9/Modules/CMakeCCompilerABI.c
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+ /usr/libexec/cc1 -quiet -nostdinc -v /usr/pkg/share/cmake-3.9/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=nocona -march=i486 -auxbase-strip CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -version -o /var/tmp//ccPEfYnQ.s
+GNU C (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+#include "..." search starts here:
+#include <...> search starts here:
+End of search list.
+GNU C (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+Compiler executable checksum: 468b91b49af5cfeb6bb696ad20c66c1c
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+ as -v -o CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o /var/tmp//ccPEfYnQ.s
+GNU assembler version 2.23.2 (i486--netbsdelf) using BFD version (NetBSD Binutils nb1) 2.23.2
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=nocona' '-march=i486'
+Linking C executable cmTC_b8d65
+/usr/pkg/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b8d65.dir/link.txt --verbose=1
+/usr/bin/cc -nostdinc -v CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -o cmTC_b8d65
+Using built-in specs.
+COLLECT_GCC=/usr/bin/cc
+COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'cmTC_b8d65' '-mtune=nocona' '-march=i486'
+ ld --eh-frame-hdr -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o cmTC_b8d65 /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o CMakeFiles/cmTC_b8d65.dir/CMakeCCompilerABI.c.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input
new file mode 100644
index 000000000..b9a585cc1
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input
@@ -0,0 +1,58 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=CMAKE_CXX_COMPILER_AR-NOTFOUND
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=CMAKE_CXX_COMPILER_RANLIB-NOTFOUND
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=4.8.5
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/pkg/bin/gmake" "cmTC_bbb1e/fast"
+/usr/pkg/bin/gmake -f CMakeFiles/cmTC_bbb1e.dir/build.make CMakeFiles/cmTC_bbb1e.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o
+/usr/bin/c++ -nostdinc -v -o CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -c /usr/pkg/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ /usr/libexec/cc1plus -quiet -nostdinc -v /usr/pkg/share/cmake-3.9/Modules/CMakeCXXCompilerABI.cpp -quiet -dumpbase CMakeCXXCompilerABI.cpp -mtune=nocona -march=i486 -auxbase-strip CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -version -o /var/tmp//cclVebp0.s
+GNU C++ (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+#include "..." search starts here:
+#include <...> search starts here:
+End of search list.
+GNU C++ (nb2 20150115) version 4.8.5 (i486--netbsdelf)
+ compiled by GNU C version 4.8.5, GMP version 5.1.3, MPFR version 3.1.2, MPC version 1.0.1
+GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=81803
+Compiler executable checksum: 961550adc452c84b614bf799df00d02b
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ as -v -o CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o /var/tmp//cclVebp0.s
+GNU assembler version 2.23.2 (i486--netbsdelf) using BFD version (NetBSD Binutils nb1) 2.23.2
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o' '-c' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+Linking CXX executable cmTC_bbb1e
+/usr/pkg/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bbb1e.dir/link.txt --verbose=1
+/usr/bin/c++ -nostdinc -v CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_bbb1e
+Using built-in specs.
+COLLECT_GCC=/usr/bin/c++
+COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
+Target: i486--netbsdelf
+Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=i486--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --with-arch=i486 --with-tune=nocona --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/i386/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/i386 --enable-tls --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=i486--netbsdelf --with-sysroot=/var/obj/mknative/i386/usr/7/src/destdir.i386
+Thread model: posix
+gcc version 4.8.5 (nb2 20150115)
+COMPILER_PATH=/usr/libexec/
+LIBRARY_PATH=/usr/lib/
+COLLECT_GCC_OPTIONS='-nostdinc' '-v' '-o' 'cmTC_bbb1e' '-shared-libgcc' '-mtune=nocona' '-march=i486'
+ ld --eh-frame-hdr -dc -dp -e __start -dynamic-linker /usr/libexec/ld.elf_so -o cmTC_bbb1e /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o CMakeFiles/cmTC_bbb1e.dir/CMakeCXXCompilerABI.cpp.o -lstdc++ -lm --as-needed -lgcc_s --no-as-needed -lgcc -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.input
new file mode 100644
index 000000000..9f34f3d41
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.input
@@ -0,0 +1,37 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=CMAKE_C_COMPILER_AR-NOTFOUND
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=Clang
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=CMAKE_C_COMPILER_RANLIB-NOTFOUND
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=5.0.1
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_f5360/fast"
+/usr/bin/make -f CMakeFiles/cmTC_f5360.dir/build.make CMakeFiles/cmTC_f5360.dir/build
+Building C object CMakeFiles/cmTC_f5360.dir/CMakeCCompilerABI.c.o
+/usr/bin/cc -v -o CMakeFiles/cmTC_f5360.dir/CMakeCCompilerABI.c.o -c /usr/local/share/cmake/Modules/CMakeCCompilerABI.c
+OpenBSD clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1)
+Target: amd64-unknown-openbsd6.3
+Thread model: posix
+InstalledDir: /usr/bin
+ "/usr/bin/cc" -cc1 -triple amd64-unknown-openbsd6.3 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 1 -pic-is-pie -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_f5360.dir/CMakeCCompilerABI.c.gcno -resource-dir /usr/lib/clang/5.0.1 -fdebug-compilation-dir /tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -femulated-tls -fwrapv -stack-protector 2 -fobjc-runtime=gnustep -fdiagnostics-show-option -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -o CMakeFiles/cmTC_f5360.dir/CMakeCCompilerABI.c.o -x c /usr/local/share/cmake/Modules/CMakeCCompilerABI.c
+clang -cc1 version 5.0.1 based upon LLVM 5.0.1 default target amd64-unknown-openbsd6.3
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/lib/clang/5.0.1/include
+ /usr/include
+End of search list.
+Linking C executable cmTC_f5360
+/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_f5360.dir/link.txt --verbose=1
+/usr/bin/cc -v CMakeFiles/cmTC_f5360.dir/CMakeCCompilerABI.c.o -o cmTC_f5360 -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib
+OpenBSD clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1)
+Target: amd64-unknown-openbsd6.3
+Thread model: posix
+InstalledDir: /usr/bin
+ "/usr/bin/ld" -e __start --eh-frame-hdr -Bdynamic -dynamic-linker /usr/libexec/ld.so -o cmTC_f5360 /usr/bin/../lib/crt0.o /usr/bin/../lib/crtbegin.o -L/usr/bin/../lib -L/usr/lib CMakeFiles/cmTC_f5360.dir/CMakeCCompilerABI.c.o -rpath-link /usr/X11R6/lib:/usr/local/lib -lcompiler_rt -lc -lcompiler_rt /usr/bin/../lib/crtend.o
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.output
new file mode 100644
index 000000000..60dbe246a
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.output
@@ -0,0 +1 @@
+/usr/lib/clang/5.0.1/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.input
new file mode 100644
index 000000000..93f1a9570
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.input
@@ -0,0 +1,38 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=CMAKE_CXX_COMPILER_AR-NOTFOUND
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=Clang
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=CMAKE_CXX_COMPILER_RANLIB-NOTFOUND
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=5.0.1
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_a2bf8/fast"
+/usr/bin/make -f CMakeFiles/cmTC_a2bf8.dir/build.make CMakeFiles/cmTC_a2bf8.dir/build
+Building CXX object CMakeFiles/cmTC_a2bf8.dir/CMakeCXXCompilerABI.cpp.o
+/usr/bin/c++ -v -o CMakeFiles/cmTC_a2bf8.dir/CMakeCXXCompilerABI.cpp.o -c /usr/local/share/cmake/Modules/CMakeCXXCompilerABI.cpp
+OpenBSD clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1)
+Target: amd64-unknown-openbsd6.3
+Thread model: posix
+InstalledDir: /usr/bin
+ "/usr/bin/c++" -cc1 -triple amd64-unknown-openbsd6.3 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 1 -pic-is-pie -mthread-model posix -mdisable-fp-elim -relaxed-aliasing -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -coverage-notes-file /tmp/ii/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_a2bf8.dir/CMakeCXXCompilerABI.cpp.gcno -resource-dir /usr/lib/clang/5.0.1 -internal-isystem /usr/include/c++/v1 -fdeprecated-macro -fdebug-compilation-dir /tmp/ii/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -femulated-tls -fwrapv -stack-protector 2 -fobjc-runtime=gnustep -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -o CMakeFiles/cmTC_a2bf8.dir/CMakeCXXCompilerABI.cpp.o -x c++ /usr/local/share/cmake/Modules/CMakeCXXCompilerABI.cpp
+clang -cc1 version 5.0.1 based upon LLVM 5.0.1 default target amd64-unknown-openbsd6.3
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/v1
+ /usr/lib/clang/5.0.1/include
+ /usr/include
+End of search list.
+Linking CXX executable cmTC_a2bf8
+/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_a2bf8.dir/link.txt --verbose=1
+/usr/bin/c++ -v CMakeFiles/cmTC_a2bf8.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_a2bf8 -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib
+OpenBSD clang version 5.0.1 (tags/RELEASE_501/final) (based on LLVM 5.0.1)
+Target: amd64-unknown-openbsd6.3
+Thread model: posix
+InstalledDir: /usr/bin
+ "/usr/bin/ld" -e __start --eh-frame-hdr -Bdynamic -dynamic-linker /usr/libexec/ld.so -o cmTC_a2bf8 /usr/bin/../lib/crt0.o /usr/bin/../lib/crtbegin.o -L/usr/bin/../lib -L/usr/lib CMakeFiles/cmTC_a2bf8.dir/CMakeCXXCompilerABI.cpp.o -rpath-link /usr/X11R6/lib:/usr/local/lib -lc++ -lc++abi -lpthread -lm -lcompiler_rt -lc -lcompiler_rt /usr/bin/../lib/crtend.o
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.output
new file mode 100644
index 000000000..6da139842
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.output
@@ -0,0 +1 @@
+/usr/include/c++/v1;/usr/lib/clang/5.0.1/include;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.input
new file mode 100644
index 000000000..b0b504acb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.input
@@ -0,0 +1,35 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=
+CMAKE_C_COMPILER_AR=
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=SunPro
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=5.13.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/opt/csw/bin/gmake" "cmTC_55079/fast"
+/opt/csw/bin/gmake -f CMakeFiles/cmTC_55079.dir/build.make CMakeFiles/cmTC_55079.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building C object CMakeFiles/cmTC_55079.dir/CMakeCCompilerABI.c.o
+/opt/solarisstudio12.4/bin/cc -# -o CMakeFiles/cmTC_55079.dir/CMakeCCompilerABI.c.o -c /tmp/CMake/Modules/CMakeCCompilerABI.c
+### cc: Note: NLSPATH = /opt/solarisstudio12.4/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/solarisstudio12.4/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -# -oCMakeFiles/cmTC_55079.dir/CMakeCCompilerABI.c.o -c /tmp/CMake/Modules/CMakeCCompilerABI.c
+/opt/solarisstudio12.4/lib/compilers/acomp -Qy -std=c11 -i /tmp/CMake/Modules/CMakeCCompilerABI.c -D__SunOS_5_10 -D__SUNPRO_C=0x5130 -D__unix -D__SVR4 -D__sun -D__SunOS -D__sparcv8 -D__sparc -D__BUILTIN_VA_ARG_INCR -D__C11FEATURES__ -D__C99FEATURES__ -D__PRAGMA_REDEFINE_EXTNAME -Dunix -Dsun -Dsparc -D__RESTRICT -D__FLT_EVAL_METHOD__=0 -D__SUN_PREFETCH -D__NOVECTORSIZE__ -I-xbuiltin -I/opt/solarisstudio12.4/lib/compilers/include/cc -xbuiltin=%none -fsimple=0 -m32 -fparam_ir -fparam_ir -xdebuginfo=%none -xF=%none -xdbggen=dwarf+usedonly+incl -xldscope=global -xivdep=loop "-g/opt/solarisstudio12.4/bin/cc -c " -destination_ir=yabe -y-fbe -y/opt/solarisstudio12.4/bin/fbe -y-xmemalign=8i -y-verbose -y-comdat -y-xdebuginfo=%none -y-xarch=generic -y-m32 -y-comdat -y-xthreadvar=no%dynamic -y-xannotate=yes -y-o -yCMakeFiles/cmTC_55079.dir/CMakeCCompilerABI.c.o
+Linking C executable cmTC_55079
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_55079.dir/link.txt --verbose=1
+/opt/solarisstudio12.4/bin/cc -# CMakeFiles/cmTC_55079.dir/CMakeCCompilerABI.c.o -o cmTC_55079
+### cc: Note: NLSPATH = /opt/solarisstudio12.4/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/solarisstudio12.4/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -# CMakeFiles/cmTC_55079.dir/CMakeCCompilerABI.c.o -ocmTC_55079
+### cc: Note: LD_LIBRARY_PATH = (null)
+### cc: Note: LD_RUN_PATH = (null)
+### cc: Note: LD_OPTIONS = (null)
+ln -s /opt/solarisstudio12.4/lib/compilers /tmp/lib_link.1547820951.9061.01
+/usr/ccs/bin/ld -zld32=-S/tmp/lib_link.1547820951.9061.01/libldstab_ws.so -zld64=-S/tmp/lib_link.1547820951.9061.01/sparcv9/libldstab_ws.so -zld32=-S/tmp/lib_link.1547820951.9061.01/libld_annotate.so -zld64=-S/tmp/lib_link.1547820951.9061.01/sparcv9/libld_annotate.so /opt/solarisstudio12.4/lib/compilers/crti.o /opt/solarisstudio12.4/lib/compilers/crt1.o /opt/solarisstudio12.4/lib/compilers/misalign.o /opt/solarisstudio12.4/lib/compilers/values-xa.o CMakeFiles/cmTC_55079.dir/CMakeCCompilerABI.c.o -o cmTC_55079 -Y "P,/opt/solarisstudio12.4/lib/compilers/staticlib:/opt/solarisstudio12.4/lib/compilers/sparc:/opt/solarisstudio12.4/lib/compilers:/usr/ccs/lib:/lib:/usr/lib" -Qy -lc /opt/solarisstudio12.4/lib/compilers/crtn.o
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output
new file mode 100644
index 000000000..27c452d26
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output
@@ -0,0 +1 @@
+/opt/solarisstudio12.4/lib/compilers/include/cc;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.input
new file mode 100644
index 000000000..9abd06a28
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.input
@@ -0,0 +1,38 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=
+CMAKE_CXX_COMPILER_AR=
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=SunPro
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=5.13.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/opt/csw/bin/gmake" "cmTC_cc4b2/fast"
+/opt/csw/bin/gmake -f CMakeFiles/cmTC_cc4b2.dir/build.make CMakeFiles/cmTC_cc4b2.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CXX object CMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o
+/opt/solarisstudio12.4/bin/CC -v -o CMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o -c /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp
+### CC: Note: NLSPATH = /opt/solarisstudio12.4/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/solarisstudio12.4/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -v -oCMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o -c /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp
+/opt/solarisstudio12.4/lib/compilers/ccfe -D__SunOS_5_10 -D__SUNPRO_CC=0x5130 -D__unix -D__SVR4 -D__sun -D__SunOS -D__sparcv8 -D__sparc -D__BUILTIN_VA_ARG_INCR -Dunix -Dsun -Dsparc -D__SUN_PREFETCH -D__SUNPRO_CC_COMPAT=5 -D__NOVECTORSIZE__ -I-xbuiltin -I/opt/solarisstudio12.4/lib/compilers/include/CC/Cstd -I/opt/solarisstudio12.4/lib/compilers/include/CC -I/opt/solarisstudio12.4/lib/compilers/include/cc -ptf /tmp/ccfe.1547820952.9069.02.%1.%2 -ptx /opt/solarisstudio12.4/bin/CC -ptk "-v -c " -compat=5 -xdebuginfo=%none -instlib=/opt/solarisstudio12.4/lib/compilers/libCstd.a -xdbggen=dwarf+usedonly+incl -xF=%none -xbuiltin=%none -xldscope=global -xivdep=loop -O0 -xarrayloc /tmp/CMake/Modules/CMakeCXXCompilerABI.cpp -ptb CMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o -y-fbe -y/opt/solarisstudio12.4/bin/fbe -y-xmemalign=8i -y-verbose -y-comdat -y-xdebuginfo=%none -y-xarch=generic -y-m32 -y-comdat -y-xthreadvar=no%dynamic -y-xannotate=yes -y-o -yCMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o 2> /tmp/ccfe.1547820952.9069.01.err
+rm /tmp/ccfe.1547820952.9069.01.err
+Linking CXX executable cmTC_cc4b2
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cc4b2.dir/link.txt --verbose=1
+/opt/solarisstudio12.4/bin/CC -v CMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_cc4b2
+### CC: Note: NLSPATH = /opt/solarisstudio12.4/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/solarisstudio12.4/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -v CMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o -ocmTC_cc4b2
+### CC: Note: LD_LIBRARY_PATH = (null)
+### CC: Note: LD_RUN_PATH = (null)
+### CC: Note: LD_OPTIONS = (null)
+ln -s /opt/solarisstudio12.4/lib/compilers /tmp/lib_link.1547820952.9076.01
+/usr/ccs/bin/ld -zld32=-S/tmp/lib_link.1547820952.9076.01/libldstab_ws.so -zld64=-S/tmp/lib_link.1547820952.9076.01/sparcv9/libldstab_ws.so -zld32=-S/tmp/lib_link.1547820952.9076.01/libld_annotate.so -zld64=-S/tmp/lib_link.1547820952.9076.01/sparcv9/libld_annotate.so -zld32=-S/tmp/lib_link.1547820952.9076.01/libCCexcept.so.1 -zld64=-S/tmp/lib_link.1547820952.9076.01/sparcv9/libCCexcept.so.1 /opt/solarisstudio12.4/lib/compilers/crti.o -u __1cH__CimplKcplus_init6F_v_ /opt/solarisstudio12.4/lib/compilers/CCrti.o /opt/solarisstudio12.4/lib/compilers/crt1.o /opt/solarisstudio12.4/lib/compilers/misalign.o /opt/solarisstudio12.4/lib/compilers/values-xa.o CMakeFiles/cmTC_cc4b2.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_cc4b2 -Y "P,/opt/solarisstudio12.4/lib/compilers/sparc:/opt/solarisstudio12.4/lib/compilers:/opt/solarisstudio12.4/lib/sparc:/opt/solarisstudio12.4/lib:/usr/ccs/lib:/lib:/usr/lib" -Qy "-R/opt/solarisstudio12.4/lib/sparc:/opt/solarisstudio12.4/lib" -lCstd -lCrun -lm -lc /opt/solarisstudio12.4/lib/compilers/CCrtn.o /opt/solarisstudio12.4/lib/compilers/crtn.o 2> /tmp/ld.1547820952.9076.02.err
+rm /tmp/lib_link.1547820952.9076.01
+rm /tmp/ld.1547820952.9076.02.err
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output
new file mode 100644
index 000000000..be851c2ac
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output
@@ -0,0 +1 @@
+/opt/solarisstudio12.4/lib/compilers/include/CC/Cstd;/opt/solarisstudio12.4/lib/compilers/include/CC;/opt/solarisstudio12.4/lib/compilers/include/cc;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input
new file mode 100644
index 000000000..4a2bedd87
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input
@@ -0,0 +1,40 @@
+CMAKE_LANG=Fortran
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=SunPro
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=8.8.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/opt/csw/bin/gmake" "cmTC_adcec/fast"
+/opt/csw/bin/gmake -f CMakeFiles/cmTC_adcec.dir/build.make CMakeFiles/cmTC_adcec.dir/build
+gmake[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building Fortran object CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o
+/opt/developerstudio12.6/bin/sunf95 -v -c /tmp/CMake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o
+### f90: Note: NLSPATH = /opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -v -c /tmp/CMake/Modules/CMakeFortranCompilerABI.F -o CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o
+/opt/developerstudio12.6/bin/fpp -undef -vax=bslash -Y/opt/developerstudio12.6/lib/compilers/include/f95 -D__SunOS_5_10 -D__SunOS_RELEASE=0x051000 -D__SUNPRO_F90=0x880 -D__SUNPRO_F95=0x880 -D__unix -D__SVR4__ -D__svr4__ -D__SVR4 -D__sun -D__sun__ -D__SunOS -D__sparcv8 -D__sparcv8plus -D__sparc -D__sparc__ -Dsun -Dunix -Dsparc -D__SUN_PREFETCH -I/opt/developerstudio12.6/lib/compilers/include/f95 /tmp/CMake/Modules/CMakeFortranCompilerABI.F /tmp/fpp.1548681160.26580.01.f
+/opt/developerstudio12.6/lib/compilers/bin/f90comp -E/tmp/CMake/Modules/CMakeFortranCompilerABI.F -m3 -ev -xall -xivdep=loop -H "/opt/developerstudio12.6/bin/f90 -v -c " -I/opt/developerstudio12.6/lib/compilers/include/f95 -p/opt/developerstudio12.6/lib/compilers/modules -m32 -y-m32 -xmemalign=8i -iorounding=processor-defined -xhasc=yes -xdebuginfo=%none -y-xdebuginfo=%none -y-xglobalize=no -xcache=generic -y-xcache=generic -y-xassume_control=optimize -xassume_control=optimize -y-xdbggen=dwarf+incl -keepmod=yes -y-ir -y/tmp/f90comp.1548681160.26580.02.ir /tmp/fpp.1548681160.26580.01.f
+/opt/developerstudio12.6/lib/compilers/bin/cg -Qy -fsimple=0 -xarch=sparcvis2 -m32 -xchip=generic -xcache=generic -comdat -ftrap=division,invalid,overflow -xdebuginfo=%none -xbuiltin=%none -xcode=abs32 -xannotate=yes -xmemalign=8i -xprefetch=auto,explicit -xprefetch_auto_type=no%indirect_array_access -xcheck=stkovf -xcheck=noreturn -xvector=no -oo CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -ir /tmp/f90comp.1548681160.26580.02.ir
+rm /tmp/f90comp.1548681160.26580.02.ir
+rm /tmp/fpp.1548681160.26580.01.f
+Linking Fortran executable cmTC_adcec
+/tmp/CMake/bin/cmake -E cmake_link_script CMakeFiles/cmTC_adcec.dir/link.txt --verbose=1
+/opt/developerstudio12.6/bin/sunf95 -v CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -o cmTC_adcec
+### f90: Note: NLSPATH = /opt/developerstudio12.6/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/opt/developerstudio12.6/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
+### command line files and options (expanded):
+### -v CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -o cmTC_adcec
+### f90: Note: LD_LIBRARY_PATH = (null)
+### f90: Note: LD_RUN_PATH = (null)
+### f90: Note: LD_OPTIONS = (null)
+ln -s /opt/developerstudio12.6/lib/compilers /tmp/lib_link.1548681161.26655.01
+/usr/ccs/bin/ld -zld32=-S/tmp/lib_link.1548681161.26655.01/libldstab_ws.so -zld64=-S/tmp/lib_link.1548681161.26655.01/sparcv9/libldstab_ws.so -zld32=-S/tmp/lib_link.1548681161.26655.01/libld_annotate.so -zld64=-S/tmp/lib_link.1548681161.26655.01/sparcv9/libld_annotate.so /opt/developerstudio12.6/lib/compilers/crti.o /opt/developerstudio12.6/lib/compilers/crt1.o /opt/developerstudio12.6/lib/compilers/misalign.o /opt/developerstudio12.6/lib/compilers/values-xi.o CMakeFiles/cmTC_adcec.dir/CMakeFortranCompilerABI.F.o -o cmTC_adcec -Y "P,/opt/developerstudio12.6/lib/compilers/sparcvis2:/opt/developerstudio12.6/lib/compilers:/opt/developerstudio12.6/lib:/usr/ccs/lib:/lib:/usr/lib" -Qy -R/opt/developerstudio12.6/lib -t -lfsu -lsunmath -lmtsk -lm -lc /opt/developerstudio12.6/lib/compilers/crtn.o
+rm /tmp/lib_link.1548681161.26655.01
+gmake[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output
new file mode 100644
index 000000000..3c31e16c9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output
@@ -0,0 +1 @@
+/opt/developerstudio12.6/lib/compilers/include/f95
diff --git a/Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_new-check.cmake b/Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_new-check.cmake
new file mode 100644
index 000000000..255e63de4
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_new-check.cmake
@@ -0,0 +1,22 @@
+
+include ("${RunCMake_TEST_BINARY_DIR}/${RunCMake_TEST_CONFIG}/CMP0083_config.cmake")
+
+
+# retrieve default type of executable
+check_executable ("${cmp0083_ref}" ref)
+
+if (ref STREQUAL "PIE")
+ # check no_pie executable is really no position independent
+ check_executable ("${cmp0083_new_no_pie}" new_no_pie)
+ if (NOT new_no_pie STREQUAL "NO_PIE")
+ set (RunCMake_TEST_FAILED "CMP0083(NEW) do not produce expected executable.")
+ endif()
+elseif (ref STREQUAL "NO_PIE")
+ # check pie executable is really position independent
+ check_executable ("${cmp0083_new_pie}" new_pie)
+ if (NOT new_pie MATCHES "PIE")
+ set (RunCMake_TEST_FAILED "CMP0083(NEW) do not produce expected executable.")
+ endif()
+else()
+ set (RunCMake_TEST_FAILED "CMP0083(NEW) unexpected result.")
+endif()
diff --git a/Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_old-check.cmake b/Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_old-check.cmake
new file mode 100644
index 000000000..b66b67286
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/CMP0083-cmp0083_old-check.cmake
@@ -0,0 +1,20 @@
+
+include ("${RunCMake_TEST_BINARY_DIR}/${RunCMake_TEST_CONFIG}/CMP0083_config.cmake")
+
+
+# retrieve default type of executable
+check_executable ("${cmp0083_ref}" ref)
+
+# POSITION_INDEPENDENT_CODE must not have influence on executable
+# pie and no_pie executable must have same type as reference
+check_executable ("${cmp0083_old_pie}" old_pie)
+if (NOT old_pie STREQUAL ref)
+ set (RunCMake_TEST_FAILED "CMP0083(OLD) do not produce expected executable.")
+ return()
+endif()
+
+check_executable ("${cmp0083_old_no_pie}" old_no_pie)
+if (NOT old_no_pie STREQUAL ref)
+ set (RunCMake_TEST_FAILED "CMP0083(OLD) do not produce expected executable.")
+ return()
+endif()
diff --git a/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake b/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake
new file mode 100644
index 000000000..749ac793e
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/CMP0083.cmake
@@ -0,0 +1,47 @@
+
+# create reference to detect default : PIE or not
+add_executable (cmp0083_ref main.cpp)
+
+
+set (CMAKE_POSITION_INDEPENDENT_CODE ON)
+
+cmake_policy(SET CMP0083 NEW)
+include(CheckPIESupported)
+check_pie_supported()
+add_executable (cmp0083_new_pie main.cpp)
+
+
+cmake_policy(SET CMP0083 OLD)
+add_executable (cmp0083_old_pie main.cpp)
+
+
+set (CMAKE_POSITION_INDEPENDENT_CODE OFF)
+
+cmake_policy(SET CMP0083 NEW)
+add_executable (cmp0083_new_no_pie main.cpp)
+
+
+cmake_policy(SET CMP0083 OLD)
+add_executable (cmp0083_old_no_pie main.cpp)
+
+# high-level targets
+add_custom_target(cmp0083_new)
+add_dependencies(cmp0083_new cmp0083_ref cmp0083_new_pie cmp0083_new_no_pie)
+
+# high-level targets
+add_custom_target(cmp0083_old)
+add_dependencies(cmp0083_old cmp0083_ref cmp0083_old_pie cmp0083_old_no_pie)
+
+
+# generate file holding paths to executables
+file (GENERATE OUTPUT "${CMAKE_BINARY_DIR}/$<CONFIG>/CMP0083_config.cmake"
+ CONTENT
+[==[
+include ("${RunCMake_TEST_SOURCE_DIR}/PIE_validator.cmake")
+
+set (cmp0083_ref "$<TARGET_FILE:cmp0083_ref>")
+set (cmp0083_new_pie "$<TARGET_FILE:cmp0083_new_pie>")
+set (cmp0083_old_pie "$<TARGET_FILE:cmp0083_old_pie>")
+set (cmp0083_new_no_pie "$<TARGET_FILE:cmp0083_new_no_pie>")
+set (cmp0083_old_no_pie "$<TARGET_FILE:cmp0083_old_no_pie>")
+]==])
diff --git a/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
new file mode 100644
index 000000000..61e1b6d3e
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/CheckPIESupported.cmake
@@ -0,0 +1,18 @@
+
+cmake_policy(SET CMP0083 NEW)
+
+include (CheckPIESupported)
+
+check_pie_supported()
+
+if (CMAKE_CXX_LINK_PIE_SUPPORTED)
+ file(WRITE "${PIE_SUPPORTED}" "\nset(PIE_SUPPORTED TRUE)\n")
+else()
+ file(WRITE "${PIE_SUPPORTED}" "\nset(PIE_SUPPORTED FALSE)\n")
+endif()
+
+if (CMAKE_CXX_LINK_NO_PIE_SUPPORTED)
+ file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED TRUE)\n")
+else()
+ file(APPEND "${PIE_SUPPORTED}" "\nset(NO_PIE_SUPPORTED FALSE)\n")
+endif()
diff --git a/Tests/RunCMake/PositionIndependentCode/Genex1-result.txt b/Tests/RunCMake/PositionIndependentCode/Genex1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Genex1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/PositionIndependentCode/Genex1-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Genex1-stderr.txt
new file mode 100644
index 000000000..c242a05cb
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Genex1-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error: Property POSITION_INDEPENDENT_CODE on target "conflict1" does
+not match the INTERFACE_POSITION_INDEPENDENT_CODE property requirement
+of dependency "genex_pic".
diff --git a/Tests/RunCMake/PositionIndependentCode/Genex1.cmake b/Tests/RunCMake/PositionIndependentCode/Genex1.cmake
new file mode 100644
index 000000000..a91be3eec
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Genex1.cmake
@@ -0,0 +1,9 @@
+
+add_library(genex_pic UNKNOWN IMPORTED)
+# PIC is ON if sibling target is a library, OFF if it is an executable
+set_property(TARGET genex_pic PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE $<NOT:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>>)
+
+
+add_library(conflict1 STATIC main.cpp)
+set_property(TARGET conflict1 PROPERTY POSITION_INDEPENDENT_CODE OFF)
+target_link_libraries(conflict1 PRIVATE genex_pic)
diff --git a/Tests/RunCMake/PositionIndependentCode/Genex2-result.txt b/Tests/RunCMake/PositionIndependentCode/Genex2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Genex2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/PositionIndependentCode/Genex2-stderr.txt b/Tests/RunCMake/PositionIndependentCode/Genex2-stderr.txt
new file mode 100644
index 000000000..735a926ed
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Genex2-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error: Property POSITION_INDEPENDENT_CODE on target "conflict2" does
+not match the INTERFACE_POSITION_INDEPENDENT_CODE property requirement
+of dependency "genex_pic".
diff --git a/Tests/RunCMake/PositionIndependentCode/Genex2.cmake b/Tests/RunCMake/PositionIndependentCode/Genex2.cmake
new file mode 100644
index 000000000..fb0a5dbda
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/Genex2.cmake
@@ -0,0 +1,9 @@
+
+add_library(genex_pic UNKNOWN IMPORTED)
+# PIC is ON if sibling target is a library, OFF if it is an executable
+set_property(TARGET genex_pic PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE $<NOT:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>>)
+
+
+add_executable(conflict2 main.cpp)
+set_property(TARGET conflict2 PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_link_libraries(conflict2 PRIVATE genex_pic)
diff --git a/Tests/RunCMake/PositionIndependentCode/PIE-pie_off-check.cmake b/Tests/RunCMake/PositionIndependentCode/PIE-pie_off-check.cmake
new file mode 100644
index 000000000..096395c08
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/PIE-pie_off-check.cmake
@@ -0,0 +1,7 @@
+
+include ("${RunCMake_TEST_BINARY_DIR}/${RunCMake_TEST_CONFIG}/PIE_config.cmake")
+
+check_executable ("${pie_off}" status)
+if (NOT status STREQUAL "NO_PIE")
+ set (RunCMake_TEST_FAILED "Executable is NOT 'no PIE' (${status}).")
+endif()
diff --git a/Tests/RunCMake/PositionIndependentCode/PIE-pie_on-check.cmake b/Tests/RunCMake/PositionIndependentCode/PIE-pie_on-check.cmake
new file mode 100644
index 000000000..bf3d0186d
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/PIE-pie_on-check.cmake
@@ -0,0 +1,7 @@
+
+include ("${RunCMake_TEST_BINARY_DIR}/${RunCMake_TEST_CONFIG}/PIE_config.cmake")
+
+check_executable ("${pie_on}" status)
+if (NOT status STREQUAL "PIE")
+ set (RunCMake_TEST_FAILED "Executable is NOT 'PIE' (${status}).")
+endif()
diff --git a/Tests/RunCMake/PositionIndependentCode/PIE.cmake b/Tests/RunCMake/PositionIndependentCode/PIE.cmake
new file mode 100644
index 000000000..16ed89ce6
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/PIE.cmake
@@ -0,0 +1,22 @@
+
+cmake_policy(SET CMP0083 NEW)
+
+include(CheckPIESupported)
+check_pie_supported()
+
+add_executable (pie_on main.cpp)
+set_property(TARGET pie_on PROPERTY POSITION_INDEPENDENT_CODE ON)
+
+add_executable (pie_off main.cpp)
+set_property(TARGET pie_off PROPERTY POSITION_INDEPENDENT_CODE OFF)
+
+
+# generate file holding paths to executables
+file (GENERATE OUTPUT "${CMAKE_BINARY_DIR}/$<CONFIG>/PIE_config.cmake"
+ CONTENT
+[==[
+include ("${RunCMake_TEST_SOURCE_DIR}/PIE_validator.cmake")
+
+set (pie_on "$<TARGET_FILE:pie_on>")
+set (pie_off "$<TARGET_FILE:pie_off>")
+]==])
diff --git a/Tests/RunCMake/PositionIndependentCode/PIE_validator.cmake b/Tests/RunCMake/PositionIndependentCode/PIE_validator.cmake
new file mode 100644
index 000000000..7be35db6a
--- /dev/null
+++ b/Tests/RunCMake/PositionIndependentCode/PIE_validator.cmake
@@ -0,0 +1,32 @@
+
+include_guard(GLOBAL)
+
+function (CHECK_EXECUTABLE executable result)
+ set (${result} "UNKNOWN" PARENT_SCOPE)
+
+ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ set (tool otool -hv)
+ else()
+ set (tool "${CMAKE_COMMAND}" -E env LANG=C LC_ALL=C readelf -lW)
+ endif()
+
+ execute_process(COMMAND ${tool} "${executable}"
+ OUTPUT_VARIABLE output
+ ERROR_VARIABLE output)
+
+ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ if (output MATCHES "( |\t)PIE( |\n|$)")
+ set (${result} "PIE" PARENT_SCOPE)
+ else()
+ set (${result} "NO_PIE" PARENT_SCOPE)
+ endif()
+ else()
+ if (output MATCHES "Elf file type is DYN")
+ set (${result} "PIE" PARENT_SCOPE)
+ elseif (output MATCHES "Elf file type is EXEC")
+ set (${result} "NO_PIE" PARENT_SCOPE)
+ else()
+ message(SEND_ERROR "Did not find a known file type")
+ endif()
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
index 6a67e3cad..6efa0d402 100644
--- a/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PositionIndependentCode/RunCMakeTest.cmake
@@ -7,3 +7,67 @@ run_cmake(Conflict4)
run_cmake(Conflict5)
run_cmake(Conflict6)
run_cmake(Debug)
+run_cmake(Genex1)
+run_cmake(Genex2)
+
+set(RunCMake_TEST_OPTIONS "-DPIE_SUPPORTED=${RunCMake_BINARY_DIR}/PIESupported.cmake")
+run_cmake(CheckPIESupported)
+include ("${RunCMake_BINARY_DIR}/PIESupported.cmake" OPTIONAL)
+
+if (PIE_SUPPORTED OR NO_PIE_SUPPORTED)
+ if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|(Free|Net|Open)BSD)$")
+ # try to locate readelf needed for validation
+ find_program (READELF NAMES readelf)
+ endif()
+ if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ # try to locate otool needed for validation
+ find_program (OTOOL NAMES otool)
+ endif()
+
+ if ((READELF OR OTOOL) AND
+ (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
+ OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"
+ OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
+ macro(run_cmake_target test subtest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_CONFIG Release)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --config Release --target ${subtest} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ endmacro()
+
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_SOURCE_DIR}")
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ endif()
+
+ run_cmake(PIE)
+ if (PIE_SUPPORTED)
+ run_cmake_target(PIE pie_on)
+ endif()
+ if (NO_PIE_SUPPORTED)
+ run_cmake_target(PIE pie_off)
+ endif()
+
+ run_cmake(CMP0083)
+ run_cmake_target(CMP0083 cmp0083_ref)
+
+ # retrieve default mode
+ include("${RunCMake_SOURCE_DIR}/PIE_validator.cmake")
+ include("${RunCMake_BINARY_DIR}/CMP0083-build/Release/CMP0083_config.cmake")
+ check_executable("${cmp0083_ref}" cmp0083_ref_mode)
+
+ if ((cmp0083_ref_mode STREQUAL "PIE" AND NO_PIE_SUPPORTED)
+ OR (cmp0083_ref_mode STREQUAL "NO_PIE" AND PIE_SUPPORTED))
+ run_cmake_target(CMP0083 cmp0083_new)
+ endif()
+ run_cmake_target(CMP0083 cmp0083_old)
+
+ unset(RunCMake_TEST_SOURCE_DIR)
+ unset(RunCMake_TEST_OPTIONS)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+ endif()
+endif()
diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst
index 08b51d9c7..d8b43feef 100644
--- a/Tests/RunCMake/README.rst
+++ b/Tests/RunCMake/README.rst
@@ -65,3 +65,14 @@ but do not actually build anything. To add a test:
Top of test binary tree
and an failure must store a message in ``RunCMake_TEST_FAILED``.
+
+To speed up local testing, you can choose to run only a subset of
+``run_cmake()`` tests in a ``RunCMakeTest.cmake`` script by using the
+``RunCMake_TEST_FILTER`` environment variable. If this variable is set,
+it is treated as a regular expression, and any tests whose names don't
+match the regular expression are not run. For example::
+
+ $ RunCMake_TEST_FILTER="^example" ctest -R '^RunCMake\.Example$'
+
+This will only run subtests in ``RunCMake.Example`` that start with
+``example``.
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index c076ad9b2..ce7167701 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -9,6 +9,10 @@ foreach(arg
endforeach()
function(run_cmake test)
+ if(DEFINED ENV{RunCMake_TEST_FILTER} AND NOT test MATCHES "$ENV{RunCMake_TEST_FILTER}")
+ return()
+ endif()
+
set(top_src "${RunCMake_SOURCE_DIR}")
set(top_bin "${RunCMake_BINARY_DIR}")
if(EXISTS ${top_src}/${test}-result.txt)
@@ -45,6 +49,11 @@ function(run_cmake test)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
endif()
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ if(RunCMake-prep-file AND EXISTS ${top_src}/${RunCMake-prep-file})
+ include(${top_src}/${RunCMake-prep-file})
+ else()
+ include(${top_src}/${test}-prep.cmake OPTIONAL)
+ endif()
if(NOT DEFINED RunCMake_TEST_OPTIONS)
set(RunCMake_TEST_OPTIONS "")
endif()
diff --git a/Tests/RunCMake/RunCTest.cmake b/Tests/RunCMake/RunCTest.cmake
index 89e16ee69..98fdf20ac 100644
--- a/Tests/RunCMake/RunCTest.cmake
+++ b/Tests/RunCMake/RunCTest.cmake
@@ -3,8 +3,12 @@ include(RunCMake)
function(run_ctest CASE_NAME)
configure_file(${RunCMake_SOURCE_DIR}/test.cmake.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/test.cmake @ONLY)
- configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
- ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY)
+ if(EXISTS "${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in")
+ configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake @ONLY)
+ else()
+ file(REMOVE ${RunCMake_BINARY_DIR}/${CASE_NAME}/CTestConfig.cmake)
+ endif()
configure_file(${RunCMake_SOURCE_DIR}/CMakeLists.txt.in
${RunCMake_BINARY_DIR}/${CASE_NAME}/CMakeLists.txt @ONLY)
run_cmake_command(${CASE_NAME} ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/RunCMake/RuntimePath/Relative.cmake b/Tests/RunCMake/RuntimePath/Relative.cmake
new file mode 100644
index 000000000..203241ff0
--- /dev/null
+++ b/Tests/RunCMake/RuntimePath/Relative.cmake
@@ -0,0 +1,69 @@
+enable_language(C)
+
+if(NOT CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN)
+ if(CMAKE_C_PLATFORM_ID STREQUAL "Linux")
+ # Sanity check for platform that is definitely known to support $ORIGIN.
+ message(FATAL_ERROR "Platform fails to report relative RPATH support")
+ else()
+ message(STATUS "Platform does not support relative RPATHs, skipping")
+ endif()
+ return()
+endif()
+set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
+
+function(CheckRpath target rpath)
+ add_custom_command(
+ TARGET ${target}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -Dfile=$<TARGET_FILE:${target}> -Drpath=${rpath}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/RelativeCheck.cmake"
+ VERBATIM
+ )
+endfunction()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "XL" AND CMAKE_BINARY_DIR MATCHES " ")
+ # XL 16.1.0.0 fails building the library if the output path contains a space.
+ set(externDir)
+ message(STATUS "Skipping external library test because of a toolchain bug")
+else()
+ get_filename_component(externDir "${CMAKE_BINARY_DIR}" DIRECTORY)
+ set(externDir "${externDir}/Relative-extern")
+endif()
+
+add_library(utils SHARED A.c)
+add_library(utils-sub SHARED A.c)
+set_property(TARGET utils-sub PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libs)
+if(externDir)
+ add_library(utils-extern SHARED A.c)
+ set_property(TARGET utils-extern PROPERTY LIBRARY_OUTPUT_DIRECTORY ${externDir})
+endif()
+
+add_executable(main main.c)
+target_link_libraries(main utils)
+CheckRpath(main "\$ORIGIN")
+
+add_executable(main-norel main.c)
+target_link_libraries(main-norel utils)
+set_property(TARGET main-norel PROPERTY BUILD_RPATH_USE_ORIGIN OFF)
+CheckRpath(main-norel "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_executable(mainsub main.c)
+target_link_libraries(mainsub utils)
+set_property(TARGET mainsub PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+CheckRpath(mainsub "\$ORIGIN/../")
+
+add_executable(main-sub main.c)
+target_link_libraries(main-sub utils-sub)
+CheckRpath(main-sub "\$ORIGIN/libs")
+
+add_executable(mainsub-sub main.c)
+target_link_libraries(mainsub-sub utils-sub)
+set_property(TARGET mainsub-sub PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+CheckRpath(mainsub-sub "\$ORIGIN/../libs")
+
+if(externDir)
+ # Binaries linking to libraries outside the build tree should have an absolute RPATH.
+ add_executable(main-extern main.c)
+ target_link_libraries(main-extern utils-extern)
+ CheckRpath(main-extern "${externDir}")
+endif()
diff --git a/Tests/RunCMake/RuntimePath/RelativeCheck.cmake b/Tests/RunCMake/RuntimePath/RelativeCheck.cmake
new file mode 100644
index 000000000..9ee403ff9
--- /dev/null
+++ b/Tests/RunCMake/RuntimePath/RelativeCheck.cmake
@@ -0,0 +1,4 @@
+file(RPATH_CHECK FILE "${file}" RPATH "${rpath}")
+if(NOT EXISTS "${file}")
+ message(FATAL_ERROR "RPATH for ${file} did not contain the expected value")
+endif()
diff --git a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
index 3f238f295..6f1baa1d9 100644
--- a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
+++ b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
@@ -16,3 +16,17 @@ function(run_SymlinkImplicit)
${CMAKE_COMMAND} -Ddir=${RunCMake_TEST_BINARY_DIR} -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake)
endfunction()
run_SymlinkImplicit()
+
+function(run_Relative)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Relative-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(Relative)
+ run_cmake_command(Relative-build ${CMAKE_COMMAND} --build . --config Debug)
+endfunction()
+run_Relative()
diff --git a/Tests/RunCMake/RuntimePath/main.c b/Tests/RunCMake/RuntimePath/main.c
index 8488f4e58..181cd0973 100644
--- a/Tests/RunCMake/RuntimePath/main.c
+++ b/Tests/RunCMake/RuntimePath/main.c
@@ -1,4 +1,6 @@
+extern int libA(void);
+
int main(void)
{
- return 0;
+ return libA();
}
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 2441a9cad..0bcf88678 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -26,6 +26,7 @@
\* CMP0073
\* CMP0076
\* CMP0081
+ \* CMP0083
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt
index 6e891047c..fec12ae83 100644
--- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName-stderr.txt
@@ -1,47 +1,47 @@
-^(CMake Error at BadInvalidName1/CMakeLists.txt:2 \(include_directories\):
+^(CMake Error at BadInvalidName1/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:Invali/dTarget,INCLUDE_DIRECTORIES>
Target name not supported.
-+)+(CMake Error at BadInvalidName2/CMakeLists.txt:2 \(include_directories\):
++)+(CMake Error at BadInvalidName2/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:Invali/dTarget,Invali/dProperty>
Target name and property name not supported.
-+)+(CMake Error at BadInvalidName3/CMakeLists.txt:2 \(include_directories\):
++)+(CMake Error at BadInvalidName3/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:Invali/dProperty>
Property name not supported.
-+)+(CMake Error at BadInvalidName4/CMakeLists.txt:2 \(include_directories\):
++)+(CMake Error at BadInvalidName4/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:BadInvalidName4,Invali/dProperty>
Property name not supported.
-+)+(CMake Error at BadInvalidName5/CMakeLists.txt:2 \(include_directories\):
++)+(CMake Error at BadInvalidName5/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:,>
\$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name and
property name.
-+)+(CMake Error at BadInvalidName6/CMakeLists.txt:2 \(include_directories\):
++)+(CMake Error at BadInvalidName6/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:,ValidProperty>
\$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name.
-+)+(CMake Error at BadInvalidName7/CMakeLists.txt:2 \(include_directories\):
++)+(CMake Error at BadInvalidName7/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:BadInvalidName7,>
\$<TARGET_PROPERTY:...> expression requires a non-empty property name.
-+)+(CMake Error at BadInvalidName8/CMakeLists.txt:2 \(include_directories\):
++)+(CMake Error at BadInvalidName8/CMakeLists\.txt:[0-9]+ \(include_directories\):
Error evaluating generator expression:
\$<TARGET_PROPERTY:>
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt
index 3adf73ea0..75865adc1 100644
--- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt
@@ -5,4 +5,4 @@ CMake Error at BadNonTarget.cmake:7 \(include_directories\):
Target "NonExistent" not found.
Call Stack \(most recent call first\):
- CMakeLists.txt:8 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt
index 7e002f547..8bff68e08 100644
--- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle1-stderr.txt
@@ -7,4 +7,4 @@ CMake Error at LinkImplementationCycle1.cmake:5 \(target_link_libraries\):
target property which is transitive over the link libraries, creating a
recursion.
Call Stack \(most recent call first\):
- CMakeLists.txt:8 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt
index 2f72de6ec..044b77cc6 100644
--- a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle2-stderr.txt
@@ -7,4 +7,4 @@ CMake Error at LinkImplementationCycle2.cmake:5 \(target_link_libraries\):
target property which is transitive over the link libraries, creating a
recursion.
Call Stack \(most recent call first\):
- CMakeLists.txt:8 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt b/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt
index 217c7626a..bd888eed5 100644
--- a/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt
+++ b/Tests/RunCMake/TargetSources/CMP0076-WARN-stderr.txt
@@ -1,4 +1,4 @@
-CMake Warning \(dev\) at CMP0076-WARN/CMakeLists.txt:2 \(target_sources\):
+CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\):
Policy CMP0076 is not set: target_sources\(\) command converts relative paths
to absolute. Run "cmake --help-policy CMP0076" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
@@ -6,7 +6,7 @@ CMake Warning \(dev\) at CMP0076-WARN/CMakeLists.txt:2 \(target_sources\):
An interface source of target "publiclib" has a relative path.
This warning is for project developers. Use -Wno-dev to suppress it.
-CMake Warning \(dev\) at CMP0076-WARN/CMakeLists.txt:2 \(target_sources\):
+CMake Warning \(dev\) at CMP0076-WARN/CMakeLists\.txt:[0-9]+ \(target_sources\):
Policy CMP0076 is not set: target_sources\(\) command converts relative paths
to absolute. Run "cmake --help-policy CMP0076" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
diff --git a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt
index 11bc96cf9..a40f46315 100644
--- a/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt
+++ b/Tests/RunCMake/TargetSources/OriginDebug-stderr.txt
@@ -4,7 +4,7 @@ CMake Debug Log at OriginDebug.cmake:13 \(add_library\):
\* .*Tests/RunCMake/TargetSources/empty_2.cpp
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
.*
CMake Debug Log at OriginDebug.cmake:16 \(set_property\):
Used sources for target OriginDebug:
@@ -12,7 +12,7 @@ CMake Debug Log at OriginDebug.cmake:16 \(set_property\):
\* .*Tests/RunCMake/TargetSources/empty_3.cpp
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
.*
CMake Debug Log at OriginDebug.cmake:20 \(target_sources\):
Used sources for target OriginDebug:
@@ -20,7 +20,7 @@ CMake Debug Log at OriginDebug.cmake:20 \(target_sources\):
\* .*Tests/RunCMake/TargetSources/empty_4.cpp
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
.*
CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\):
Used sources for target OriginDebug:
@@ -28,4 +28,4 @@ CMake Debug Log at OriginDebug.cmake:14 \(target_link_libraries\):
\* .*Tests/RunCMake/TargetSources/empty_1.cpp
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories-toolchain.cmake b/Tests/RunCMake/ToolchainFile/IncludeDirectories-toolchain.cmake
new file mode 100644
index 000000000..e77e9fe10
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories-toolchain.cmake
@@ -0,0 +1 @@
+include_directories(${CMAKE_CURRENT_LIST_DIR}/IncludeDirectories)
diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories.c b/Tests/RunCMake/ToolchainFile/IncludeDirectories.c
new file mode 100644
index 000000000..81b2465a1
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories.c
@@ -0,0 +1,5 @@
+#include <IncDir.h>
+
+void IncDir(void)
+{
+}
diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories.cmake b/Tests/RunCMake/ToolchainFile/IncludeDirectories.cmake
new file mode 100644
index 000000000..616cff4c3
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories.cmake
@@ -0,0 +1,2 @@
+enable_language(C)
+add_library(IncDir STATIC IncludeDirectories.c)
diff --git a/Tests/RunCMake/ToolchainFile/IncludeDirectories/IncDir.h b/Tests/RunCMake/ToolchainFile/IncludeDirectories/IncDir.h
new file mode 100644
index 000000000..bca9c2c6f
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/IncludeDirectories/IncDir.h
@@ -0,0 +1 @@
+/* IncDir.h */
diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
index 8a202008f..7eb4485d0 100644
--- a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
@@ -9,3 +9,11 @@ run_cmake_toolchain(CallEnableLanguage)
run_cmake_toolchain(CallProject)
run_cmake_toolchain(FlagsInit)
run_cmake_toolchain(LinkFlagsInit)
+
+function(run_IncludeDirectories)
+ run_cmake_toolchain(IncludeDirectories)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/IncludeDirectories-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(IncludeDirectories-build ${CMAKE_COMMAND} --build . --config Debug)
+endfunction()
+run_IncludeDirectories()
diff --git a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt
index bc8da4c29..d89d1744d 100644
--- a/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt
+++ b/Tests/RunCMake/UseSWIG/CMP0078-WARN-stderr.txt
@@ -1,9 +1,10 @@
-CMake Warning \(dev\) at .*/Modules/UseSWIG.cmake:[0-9]+ \(message\):
- Policy CMP0078 is not set. Run "cmake --help-policy CMP0078" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
+CMake Warning \(dev\) at .*/Modules/UseSWIG\.cmake:[0-9]+ \(message\):
+ Policy CMP0078 is not set: UseSWIG generates standard target names\. Run
+ "cmake --help-policy CMP0078" for policy details\. Use the cmake_policy
+ command to set the policy and suppress this warning\.
+
Call Stack \(most recent call first\):
- CMP0078-common.cmake:6 \(swig_add_library\)
- CMP0078-WARN.cmake:1 \(include\)
- CMakeLists.txt:3 \(include\)
+ CMP0078-common\.cmake:8 \(swig_add_library\)
+ CMP0078-WARN\.cmake:1 \(include\)
+ CMakeLists\.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/UseSWIG/CMP0078-common.cmake b/Tests/RunCMake/UseSWIG/CMP0078-common.cmake
index 6cf39dcf8..b13796b55 100644
--- a/Tests/RunCMake/UseSWIG/CMP0078-common.cmake
+++ b/Tests/RunCMake/UseSWIG/CMP0078-common.cmake
@@ -1,4 +1,6 @@
+cmake_policy(SET CMP0086 NEW)
+
set(SWIG_EXECUTABLE "swig")
set(SWIG_DIR "/swig")
include(UseSWIG)
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake b/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake
new file mode 100644
index 000000000..ea8b2cdcb
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-NEW-nuild-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/new_example.py")
+ set (RunCMake_TEST_FAILED "Not found expected file: '${RunCMake_TEST_BINARY_DIR}/new_example.py'.")
+endif()
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake b/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake
new file mode 100644
index 000000000..b54338d6a
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0086 NEW)
+include(CMP0086-common.cmake)
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake b/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake
new file mode 100644
index 000000000..96b5295a3
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-OLD-build-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/example.py")
+ set (RunCMake_TEST_FAILED "Not found expected file: '${RunCMake_TEST_BINARY_DIR}/example.py'.")
+endif()
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake b/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake
new file mode 100644
index 000000000..6a63d4cd0
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0086 OLD)
+include(CMP0086-common.cmake)
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt
new file mode 100644
index 000000000..af4102144
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-WARN-stderr.txt
@@ -0,0 +1,11 @@
+CMake Warning \(dev\) at .*/Modules/UseSWIG.cmake:[0-9]+ \(message\):
+ Policy CMP0086 is not set: UseSWIG honors SWIG_MODULE_NAME via -module
+ flag. Run "cmake --help-policy CMP0086" for policy details\. Use the
+ cmake_policy command to set the policy and suppress this warning\.
+
+Call Stack \(most recent call first\):
+ .*/Modules/UseSWIG.cmake:[0-9]+ \(SWIG_ADD_SOURCE_TO_MODULE\)
+ CMP0086-common\.cmake:[0-9]+ \(swig_add_library\)
+ CMP0086-WARN\.cmake:1 \(include\)
+ CMakeLists\.txt:3 \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake b/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake
new file mode 100644
index 000000000..69c2d9db7
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-WARN.cmake
@@ -0,0 +1 @@
+include(CMP0086-common.cmake)
diff --git a/Tests/RunCMake/UseSWIG/CMP0086-common.cmake b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake
new file mode 100644
index 000000000..c02592a94
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0086-common.cmake
@@ -0,0 +1,11 @@
+
+cmake_policy(SET CMP0078 NEW)
+
+find_package(Python REQUIRED COMPONENTS Development)
+find_package (SWIG REQUIRED)
+include(UseSWIG)
+
+set_property (SOURCE example.i PROPERTY SWIG_MODULE_NAME "new_example")
+
+swig_add_library(example LANGUAGE python TYPE MODULE SOURCES example.i)
+target_link_libraries(example PRIVATE Python::Python)
diff --git a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake
index b96622ae3..6acf7199c 100644
--- a/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake
+++ b/Tests/RunCMake/UseSWIG/RunCMakeTest.cmake
@@ -3,3 +3,23 @@ include(RunCMake)
run_cmake(CMP0078-WARN)
run_cmake(CMP0078-OLD)
run_cmake(CMP0078-NEW)
+
+run_cmake(CMP0086-WARN)
+
+if (CMake_TEST_FindPython)
+
+ macro(run_cmake_target test subtest target)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ endmacro()
+
+ run_cmake(CMP0086-OLD)
+ run_cmake_target(CMP0086-OLD build example)
+ run_cmake(CMP0086-NEW)
+ run_cmake_target(CMP0086-NEW build example)
+
+endif()
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 4bfb2f2e9..df253a913 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -1,6 +1,8 @@
include(RunCMake)
+run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
+run_cmake(SourceGroupCMakeLists)
run_cmake(VsConfigurationType)
run_cmake(VsTargetsFileReferences)
@@ -12,5 +14,7 @@ run_cmake(VsDebuggerEnvironment)
run_cmake(VsCSharpCustomTags)
run_cmake(VsCSharpReferenceProps)
run_cmake(VsCSharpWithoutSources)
+run_cmake(VsCSharpDeployFiles)
+run_cmake(VSCSharpDefines)
run_cmake(VsSdkDirectories)
run_cmake(VsGlobals)
diff --git a/Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake
new file mode 100644
index 000000000..c2a94bbbe
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake
@@ -0,0 +1,33 @@
+set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj.filters")
+if(NOT EXISTS "${vcFiltersFile}")
+ set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
+ return()
+endif()
+
+set(foundFileFilter 0)
+set(foundFilter 0)
+file(STRINGS "${vcFiltersFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "<Filter>CMakeListsSourceGroup</Filter>")
+ set(rule "${CMAKE_MATCH_1}")
+ if(foundFileFilter)
+ set(RunCMake_TEST_FAILED "Multiple files listed with filter for CMakeListsSourceGroup.")
+ return()
+ endif()
+ set(foundFileFilter 1)
+ endif()
+ if(line MATCHES "<Filter.*Include=\"CMakeListsSourceGroup\"")
+ set(rule "${CMAKE_MATCH_1}")
+ if(foundFilter)
+ set(RunCMake_TEST_FAILED "Multiple copies of CMakeListsSourceGroup filter listed.")
+ return()
+ endif()
+ set(foundFilter 1)
+ endif()
+endforeach()
+if(NOT foundFileFilter)
+ set(RunCMake_TEST_FAILED "File filter for CMakeListsSourceGroup not found.")
+endif()
+if(NOT foundFilter)
+ set(RunCMake_TEST_FAILED "Filter CMakeListsSourceGroup not found.")
+endif()
diff --git a/Tests/RunCMake/VS10Project/SourceGroupCMakeLists.cmake b/Tests/RunCMake/VS10Project/SourceGroupCMakeLists.cmake
new file mode 100644
index 000000000..4ad87ec8d
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/SourceGroupCMakeLists.cmake
@@ -0,0 +1,3 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+add_custom_target(foo)
+source_group("CMakeListsSourceGroup" FILES CMakeLists.txt)
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake
new file mode 100644
index 000000000..3e418c34b
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts-check.cmake
@@ -0,0 +1,64 @@
+#
+# Check C# VS project for required elements.
+#
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+
+set(inDebug FALSE)
+set(inRelease FALSE)
+set(debugOK FALSE)
+set(releaseOK FALSE)
+
+
+file(STRINGS "${csProjectFile}" lines)
+foreach(line IN LISTS lines)
+ #message(STATUS ${line})
+ if(line MATCHES "^ *<PropertyGroup .*Debug\\|(Win32|x64).*")
+ set(inDebug TRUE)
+ elseif(line MATCHES "^ *<PropertyGroup .*Release\\|(Win32|x64).*")
+ set(inRelease TRUE)
+ elseif(line MATCHES "^ *</PropertyGroup> *$")
+ set(inRelease FALSE)
+ set(inDebug FALSE)
+ elseif(inDebug AND
+ (line MATCHES "^ *<NoWarn>.*505.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*707.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*808.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*909.*</NoWarn> *$")
+ )
+ set(debugOK TRUE)
+ elseif(inRelease AND
+ (NOT (line MATCHES "^ *<NoWarn>.*505.*</NoWarn> *$")) AND
+ (line MATCHES "^ *<NoWarn>.*707.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*808.*</NoWarn> *$") AND
+ (line MATCHES "^ *<NoWarn>.*909.*</NoWarn> *$")
+ )
+ set(releaseOK TRUE)
+ endif()
+endforeach()
+
+function(print_csprojfile)
+ file(STRINGS "${csProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ message(STATUS ${line})
+ endforeach()
+endfunction()
+
+
+if(NOT debugOK)
+ message(STATUS "Failed to set Debug configuration warning config correctly.")
+ set(RunCMake_TEST_FAILED "Failed to set Debug configuration defines correctly.")
+ print_csprojfile()
+ return()
+endif()
+
+if(NOT releaseOK)
+ message(STATUS "Failed to set Release configuration warning config correctly.")
+ set(RunCMake_TEST_FAILED "Failed to set Release configuration defines correctly.")
+ print_csprojfile()
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake
new file mode 100644
index 000000000..85af38be9
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpCompilerOpts.cmake
@@ -0,0 +1,14 @@
+enable_language(CSharp)
+
+add_library(foo SHARED
+ foo.cs)
+
+set_target_properties(foo PROPERTIES
+ LINKER_LANGUAGE CSharp)
+
+
+# Issue 18878
+target_compile_options(foo PRIVATE "/platform:anycpu" "/nowarn:707,808" "/nowarn:909" )
+
+# Debug only warning disable
+set(CMAKE_CSharp_FLAGS_DEBUG "${CMAKE_CSharp_FLAGS_DEBUG} /nowarn:505")
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake
new file mode 100644
index 000000000..152bf9c93
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDefines-check.cmake
@@ -0,0 +1,64 @@
+#
+# Check C# VS project for required elements.
+#
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+
+set(inDebug FALSE)
+set(inRelease FALSE)
+set(debugOK FALSE)
+set(releaseOK FALSE)
+
+
+file(STRINGS "${csProjectFile}" lines)
+foreach(line IN LISTS lines)
+ #message(STATUS ${line})
+ if(line MATCHES "^ *<PropertyGroup .*Debug\\|(Win32|x64).*")
+ set(inDebug TRUE)
+ elseif(line MATCHES "^ *<PropertyGroup .*Release\\|(Win32|x64).*")
+ set(inRelease TRUE)
+ elseif(line MATCHES "^ *</PropertyGroup> *$")
+ set(inRelease FALSE)
+ set(inDebug FALSE)
+ elseif(inDebug AND
+ (line MATCHES "^ *<DefineConstants>.*MY_FOO_DEFINE.*</DefineConstants> *$") AND
+ (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_DEBUG.*</DefineConstants> *$") AND
+ (line MATCHES "^ *<DefineConstants>.*MY_BAR_ASSIGNMENT=bar.*</DefineConstants> *$") AND
+ (NOT (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_RELEASE.*</DefineConstants> *$"))
+ )
+ set(debugOK TRUE)
+ elseif(inRelease AND
+ (line MATCHES "^ *<DefineConstants>.*MY_FOO_DEFINE.*</DefineConstants> *$") AND
+ (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_RELEASE.*</DefineConstants> *$") AND
+ (line MATCHES "^ *<DefineConstants>.*MY_BAR_ASSIGNMENT=bar.*</DefineConstants> *$") AND
+ (NOT (line MATCHES "^ *<DefineConstants>.*DEFINE_ONLY_FOR_DEBUG.*</DefineConstants> *$"))
+ )
+ set(releaseOK TRUE)
+ endif()
+endforeach()
+
+function(print_csprojfile)
+ file(STRINGS "${csProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ message(STATUS ${line})
+ endforeach()
+endfunction()
+
+
+if(NOT debugOK)
+ message(STATUS "Failed to set Debug configuration defines correctly.")
+ set(RunCMake_TEST_FAILED "Failed to set Debug configuration defines correctly.")
+ print_csprojfile()
+ return()
+endif()
+
+if(NOT releaseOK)
+ message(STATUS "Failed to set Release configuration defines correctly.")
+ set(RunCMake_TEST_FAILED "Failed to set Release configuration defines correctly.")
+ print_csprojfile()
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDefines.cmake b/Tests/RunCMake/VS10Project/VsCSharpDefines.cmake
new file mode 100644
index 000000000..62c19c521
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDefines.cmake
@@ -0,0 +1,18 @@
+enable_language(CSharp)
+
+add_library(foo SHARED
+ foo.cs)
+
+set_target_properties(foo PROPERTIES
+ LINKER_LANGUAGE CSharp)
+
+
+# Issue 18698
+target_compile_definitions(
+ foo
+ PUBLIC
+ MY_FOO_DEFINE
+ "MY_BAR_ASSIGNMENT=bar"
+ $<$<CONFIG:Debug>:DEFINE_ONLY_FOR_DEBUG>
+ $<$<CONFIG:Release>:DEFINE_ONLY_FOR_RELEASE>
+)
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDeployFiles-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles-check.cmake
new file mode 100644
index 000000000..c29f2ae42
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles-check.cmake
@@ -0,0 +1,67 @@
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+
+set(inNode1 FALSE)
+set(foundNode1 FALSE)
+set(foundCopyDirective1 FALSE)
+
+set(inNode2 FALSE)
+set(foundNode2 FALSE)
+set(foundCopyDirective2 FALSE)
+
+set(foundNode3 FALSE)
+
+file(STRINGS "${csProjectFile}" lines)
+
+foreach(line IN LISTS lines)
+ if( inNode1 )
+ if(line MATCHES " *<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> *$")
+ set(foundCopyDirective1 TRUE)
+ elseif( line MATCHES " *</Content> *$")
+ set(inNode1 FALSE)
+ endif()
+ elseif( inNode2 )
+ if(line MATCHES " *<CopyToOutputDirectory>Always</CopyToOutputDirectory> *$")
+ set(foundCopyDirective2 TRUE)
+ elseif( line MATCHES " *</Content> *$")
+ set(inNode2 FALSE)
+ endif()
+ elseif(line MATCHES "^ *<Content *Include *= *\".*content1\\.txt\"> *")
+ set(foundNode1 TRUE)
+ set(inNode1 TRUE)
+ elseif(line MATCHES "^ *<Content *Include *= *\".*content2\\.txt\"> *")
+ set(foundNode2 TRUE)
+ set(inNode2 TRUE)
+ elseif(line MATCHES "^ *<None *Include *= *\".*content3\\.txt\"> *")
+ set(foundNode3 TRUE)
+ endif()
+endforeach()
+
+if(NOT foundNode1)
+ set(RunCMake_TEST_FAILED "Did not find <Content> item content1.txt.")
+ return()
+endif()
+
+if(NOT foundCopyDirective1)
+ set(RunCMake_TEST_FAILED "Did not find PreserveNewest for <Content> item content1.txt.")
+ return()
+endif()
+
+if(NOT foundNode2)
+ set(RunCMake_TEST_FAILED "Did not find <Content> item content2.txt.")
+ return()
+endif()
+
+if(NOT foundCopyDirective2)
+ set(RunCMake_TEST_FAILED "Did not find Always for <Content> item content2.txt.")
+ return()
+endif()
+
+if(NOT foundNode3)
+ set(RunCMake_TEST_FAILED "Did not find <None> item content3.txt.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDeployFiles.cmake b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles.cmake
new file mode 100644
index 000000000..cb77fa7dd
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDeployFiles.cmake
@@ -0,0 +1,27 @@
+enable_language(CSharp)
+
+set(fileNames
+ "${CMAKE_CURRENT_BINARY_DIR}/content1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/content2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/content3.txt")
+
+foreach(f ${fileNames})
+ message(STATUS "touch ${f}")
+ file(TOUCH ${f})
+endforeach()
+
+set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/content1.txt"
+ PROPERTIES
+ VS_COPY_TO_OUT_DIR PreserveNewest
+)
+
+set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/content2.txt"
+ PROPERTIES
+ VS_COPY_TO_OUT_DIR Always
+)
+
+
+add_library(foo SHARED
+ foo.cs
+ ${fileNames}
+)
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
index 440f9f263..00288d483 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerCommand-check.cmake
@@ -1,22 +1,24 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
- set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
- return()
-endif()
+foreach(target foo bar)
+ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${target}.vcxproj")
+ if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+ endif()
-set(debuggerCommandSet FALSE)
+ set(debuggerCommandSet FALSE)
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<LocalDebuggerCommand[^>]*>([^<>]+)</LocalDebuggerCommand>$")
- if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-command foo")
- message(STATUS "foo.vcxproj has debugger command set")
- set(debuggerCommandSet TRUE)
+ file(STRINGS "${vcProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<LocalDebuggerCommand[^>]*>([^<>]+)</LocalDebuggerCommand>$")
+ if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-command foo")
+ message(STATUS "${target}.vcxproj has debugger command set")
+ set(debuggerCommandSet TRUE)
+ endif()
endif()
+ endforeach()
+
+ if(NOT debuggerCommandSet)
+ set(RunCMake_TEST_FAILED "LocalDebuggerCommand not found or not set correctly.")
+ return()
endif()
endforeach()
-
-if(NOT debuggerCommandSet)
- set(RunCMake_TEST_FAILED "LocalDebuggerCommand not found or not set correctly.")
- return()
-endif()
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerCommand.cmake b/Tests/RunCMake/VS10Project/VsDebuggerCommand.cmake
index 5dcb6d131..54f91549f 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerCommand.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerCommand.cmake
@@ -1,5 +1,6 @@
enable_language(CXX)
add_library(foo foo.cpp)
+add_custom_target(bar)
-set_target_properties(foo PROPERTIES
+set_target_properties(foo bar PROPERTIES
VS_DEBUGGER_COMMAND "my-debugger-command $<TARGET_PROPERTY:foo,NAME>")
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments-check.cmake
index b2e0a4372..87555d1f5 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments-check.cmake
@@ -1,22 +1,24 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
- set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
- return()
-endif()
+foreach(target foo bar)
+ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${target}.vcxproj")
+ if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+ endif()
-set(debuggerCommandArgumentsSet FALSE)
+ set(debuggerCommandArgumentsSet FALSE)
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<LocalDebuggerCommandArguments[^>]*>([^<>]+)</LocalDebuggerCommandArguments>$")
- if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-command-arguments foo")
- message(STATUS "foo.vcxproj has debugger command arguments set")
- set(debuggerCommandArgumentsSet TRUE)
+ file(STRINGS "${vcProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<LocalDebuggerCommandArguments[^>]*>([^<>]+)</LocalDebuggerCommandArguments>$")
+ if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-command-arguments foo")
+ message(STATUS "${target}.vcxproj has debugger command arguments set")
+ set(debuggerCommandArgumentsSet TRUE)
+ endif()
endif()
+ endforeach()
+
+ if(NOT debuggerCommandArgumentsSet)
+ set(RunCMake_TEST_FAILED "LocalDebuggerCommandArguments not found or not set correctly.")
+ return()
endif()
endforeach()
-
-if(NOT debuggerCommandArgumentsSet)
- set(RunCMake_TEST_FAILED "LocalDebuggerCommandArguments not found or not set correctly.")
- return()
-endif()
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments.cmake b/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments.cmake
index aa87cdc4d..1f7d0be49 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerCommandArguments.cmake
@@ -1,5 +1,6 @@
enable_language(CXX)
add_library(foo foo.cpp)
+add_custom_target(bar)
-set_target_properties(foo PROPERTIES
+set_target_properties(foo bar PROPERTIES
VS_DEBUGGER_COMMAND_ARGUMENTS "my-debugger-command-arguments $<TARGET_PROPERTY:foo,NAME>")
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerEnvironment-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerEnvironment-check.cmake
index 2427ad454..fee121a5e 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerEnvironment-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerEnvironment-check.cmake
@@ -1,22 +1,24 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
- set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
- return()
-endif()
+foreach(target foo bar)
+ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${target}.vcxproj")
+ if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+ endif()
-set(debuggerEnvironmentSet FALSE)
+ set(debuggerEnvironmentSet FALSE)
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<LocalDebuggerEnvironment[^>]*>([^<>]+)</LocalDebuggerEnvironment>$")
- if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-environment foo")
- message(STATUS "foo.vcxproj has debugger environment set")
- set(debuggerEnvironmentSet TRUE)
+ file(STRINGS "${vcProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<LocalDebuggerEnvironment[^>]*>([^<>]+)</LocalDebuggerEnvironment>$")
+ if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-environment foo")
+ message(STATUS "${target}.vcxproj has debugger environment set")
+ set(debuggerEnvironmentSet TRUE)
+ endif()
endif()
+ endforeach()
+
+ if(NOT debuggerEnvironmentSet)
+ set(RunCMake_TEST_FAILED "LocalDebuggerEnvironment not found or not set correctly.")
+ return()
endif()
endforeach()
-
-if(NOT debuggerEnvironmentSet)
- set(RunCMake_TEST_FAILED "LocalDebuggerEnvironment not found or not set correctly.")
- return()
-endif()
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerEnvironment.cmake b/Tests/RunCMake/VS10Project/VsDebuggerEnvironment.cmake
index d5bec4c56..c594f3532 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerEnvironment.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerEnvironment.cmake
@@ -1,5 +1,6 @@
enable_language(CXX)
add_library(foo foo.cpp)
+add_custom_target(bar)
-set_target_properties(foo PROPERTIES
+set_target_properties(foo bar PROPERTIES
VS_DEBUGGER_ENVIRONMENT "my-debugger-environment $<TARGET_PROPERTY:foo,NAME>")
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake
index 6a142f81e..9d3f2a850 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir-check.cmake
@@ -1,22 +1,24 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
- set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
- return()
-endif()
+foreach(target foo bar)
+ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${target}.vcxproj")
+ if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+ endif()
-set(debuggerWorkDirSet FALSE)
+ set(debuggerWorkDirSet FALSE)
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<LocalDebuggerWorkingDirectory[^>]*>([^<>]+)</LocalDebuggerWorkingDirectory>$")
- if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-directory foo")
- message(STATUS "foo.vcxproj has debugger working dir set")
- set(debuggerWorkDirSet TRUE)
+ file(STRINGS "${vcProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<LocalDebuggerWorkingDirectory[^>]*>([^<>]+)</LocalDebuggerWorkingDirectory>$")
+ if("${CMAKE_MATCH_1}" STREQUAL "my-debugger-directory foo")
+ message(STATUS "${target}.vcxproj has debugger working dir set")
+ set(debuggerWorkDirSet TRUE)
+ endif()
endif()
+ endforeach()
+
+ if(NOT debuggerWorkDirSet)
+ set(RunCMake_TEST_FAILED "LocalDebuggerWorkingDirectory not found or not set correctly.")
+ return()
endif()
endforeach()
-
-if(NOT debuggerWorkDirSet)
- set(RunCMake_TEST_FAILED "LocalDebuggerWorkingDirectory not found or not set correctly.")
- return()
-endif()
diff --git a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake
index 36daed00e..69ed85c62 100644
--- a/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake
+++ b/Tests/RunCMake/VS10Project/VsDebuggerWorkingDir.cmake
@@ -1,5 +1,6 @@
enable_language(CXX)
add_library(foo foo.cpp)
+add_custom_target(bar)
-set_target_properties(foo PROPERTIES
+set_target_properties(foo bar PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY "my-debugger-directory $<TARGET_PROPERTY:foo,NAME>")
diff --git a/Tests/RunCMake/VS10ProjectWinCE/CMakeLists.txt b/Tests/RunCMake/VS10ProjectWinCE/CMakeLists.txt
new file mode 100644
index 000000000..91baae7eb
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.5.0)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake b/Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake
new file mode 100644
index 000000000..2c9067f75
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/RunCMakeTest.cmake
@@ -0,0 +1,9 @@
+include(RunCMake)
+
+set(RunCMake_GENERATOR "Visual Studio 12 2013")
+set(RunCMake_GENERATOR_TOOLSET CE800)
+set(RunCMake_GENERATOR_INSTANCE "")
+set(RunCMake_TEST_OPTIONS -DCMAKE_SYSTEM_NAME=WindowsCE )
+
+run_cmake(VsCEDebuggerDeploy)
+run_cmake(VSCSharpCFProject)
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
new file mode 100644
index 000000000..6ab3833bf
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
@@ -0,0 +1,42 @@
+set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
+if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+endif()
+
+
+if( NOT ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsCE" )
+ set(RunCMake_TEST_FAILED "Test only valid for WindowsCE")
+ return()
+endif()
+
+
+set(FoundCEAdditionalFiles FALSE)
+set(FoundRemoteDirectory FALSE)
+set(FoundToolsVersion4 FALSE)
+
+file(STRINGS "${vcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<CEAdditionalFiles> *foo\\.dll\\|\\\\foo\\\\src\\\\dir\\\\on\\\\host\\|\\$\\(RemoteDirectory\\)\\|0;bar\\.dll\\|\\\\bar\\\\src\\\\dir\\|\\$\\(RemoteDirectory\\)bardir\\|0.*</CEAdditionalFiles> *$")
+ set(FoundCEAdditionalFiles TRUE)
+ elseif(line MATCHES " *<RemoteDirectory>[A-Za-z0-9\\]+</RemoteDirectory> *$")
+ set(FoundRemoteDirectory TRUE)
+ elseif(line MATCHES " *<Project +.*ToolsVersion=\"4.0\".*> *$")
+ set(FoundToolsVersion4 TRUE)
+ endif()
+endforeach()
+
+if(NOT FoundCEAdditionalFiles)
+ set(RunCMake_TEST_FAILED "CEAddionalFiles not found or not set correctly.")
+ return()
+endif()
+
+if(NOT FoundRemoteDirectory)
+ set(RunCMake_TEST_FAILED "RemoteDirectory not found or not set correctly.")
+ return()
+endif()
+
+if(NOT FoundToolsVersion4)
+ set(RunCMake_TEST_FAILED "Failed to find correct ToolsVersion=\"4.0\" .")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake
new file mode 100644
index 000000000..948f14c7b
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy.cmake
@@ -0,0 +1,13 @@
+enable_language(CXX)
+
+set(DEPLOY_DIR
+ "temp\\foodir"
+)
+
+add_library(foo foo.cpp)
+
+set_target_properties(foo
+ PROPERTIES
+ DEPLOYMENT_ADDITIONAL_FILES "foo.dll|\\foo\\src\\dir\\on\\host|$(RemoteDirectory)|0;bar.dll|\\bar\\src\\dir|$(RemoteDirectory)bardir|0"
+ DEPLOYMENT_REMOTE_DIRECTORY ${DEPLOY_DIR}
+)
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject-check.cmake
new file mode 100644
index 000000000..618896ec0
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject-check.cmake
@@ -0,0 +1,54 @@
+#
+# Check C# Compact Framework project for required elements.
+#
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+if( NOT ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsCE" )
+ set(RunCMake_TEST_FAILED "Test only valid for WindowsCE")
+ return()
+endif()
+
+set(FoundTargetFrameworkTargetsVersion FALSE)
+set(FoundDotNetFrameworkVersion FALSE)
+set(FoundTargetFrameworkIdentifier FALSE)
+set(FoundCFTargetsImport FALSE)
+
+
+file(STRINGS "${csProjectFile}" lines)
+foreach(line IN LISTS lines)
+ #message(STATUS ${line})
+ if(line MATCHES "^ *<TargetFrameworkIdentifier>WindowsEmbeddedCompact</TargetFrameworkIdentifier> *$")
+ set(FoundTargetFrameworkIdentifier TRUE)
+ elseif(line MATCHES " *<TargetFrameworkVersion>v3.9</TargetFrameworkVersion> *$")
+ set(FoundDotNetFrameworkVersion TRUE)
+ elseif(line MATCHES " *<TargetFrameworkTargetsVersion>v8.0</TargetFrameworkTargetsVersion> *$")
+ set(FoundTargetFrameworkTargetsVersion TRUE)
+ elseif( line MATCHES " *<Import Project=\"\\$\\(MSBuildExtensionsPath\\)\\\\Microsoft\\\\\\$\\(TargetFrameworkIdentifier\\)\\\\\\$\\(TargetFrameworkTargetsVersion\\)\\\\Microsoft\\.\\$\\(TargetFrameworkIdentifier\\)\\.CSharp\\.targets\" */> *" )
+ set(FoundCFTargetsImport TRUE)
+ endif()
+endforeach()
+
+
+if(NOT FoundTargetFrameworkTargetsVersion)
+ set(RunCMake_TEST_FAILED "TargetFrameworkIdentifier not found or not set correctly.")
+ return()
+endif()
+
+if(NOT FoundDotNetFrameworkVersion)
+ set(RunCMake_TEST_FAILED "TargetFrameworkVersion not found or not set correctly.")
+ return()
+endif()
+
+if(NOT FoundTargetFrameworkIdentifier)
+ set(RunCMake_TEST_FAILED "TargetFrameworkTargetsVersion not found or not set correctly.")
+ return()
+endif()
+
+if(NOT FoundCFTargetsImport)
+ set(RunCMake_TEST_FAILED "Import of Compact Framework targets file not found or not set correctly.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject.cmake
new file mode 100644
index 000000000..fb2acbbe6
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCSharpCFProject.cmake
@@ -0,0 +1,8 @@
+enable_language(CSharp)
+
+add_library(foo SHARED foo.cs )
+
+set_target_properties(foo
+ PROPERTIES
+ DOTNET_TARGET_FRAMEWORK_VERSION "v3.9"
+)
diff --git a/Tests/RunCMake/VS10ProjectWinCE/foo.cpp b/Tests/RunCMake/VS10ProjectWinCE/foo.cpp
new file mode 100644
index 000000000..3695dc91e
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/foo.cpp
@@ -0,0 +1,3 @@
+void foo()
+{
+}
diff --git a/Tests/RunCMake/VS10ProjectWinCE/foo.cs b/Tests/RunCMake/VS10ProjectWinCE/foo.cs
new file mode 100644
index 000000000..3695dc91e
--- /dev/null
+++ b/Tests/RunCMake/VS10ProjectWinCE/foo.cs
@@ -0,0 +1,3 @@
+void foo()
+{
+}
diff --git a/Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in b/Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in
deleted file mode 100644
index 022623069..000000000
--- a/Tests/RunCMake/WorkingDirectory/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestTestWorkingDir.@CASE_NAME@")
diff --git a/Tests/RunCMake/WriteBasicConfigVersionFile/All.cmake b/Tests/RunCMake/WriteBasicConfigVersionFile/All.cmake
new file mode 100644
index 000000000..425365239
--- /dev/null
+++ b/Tests/RunCMake/WriteBasicConfigVersionFile/All.cmake
@@ -0,0 +1,884 @@
+# Hard-code architecture for test without a real compiler.
+set(CMAKE_SIZEOF_VOID_P 4)
+
+include(WriteBasicConfigVersionFile)
+
+set(_compatibilities AnyNewerVersion
+ SameMajorVersion
+ SameMinorVersion
+ ExactVersion)
+
+function(TEST_WRITE_BASIC_CONFIG_VERSION_FILE_PREPARE _version_installed)
+ set(_same_CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
+ set(_no_CMAKE_SIZEOF_VOID_P "")
+ math(EXPR _diff_CMAKE_SIZEOF_VOID_P "${CMAKE_SIZEOF_VOID_P} + 1")
+ foreach(_compat ${_compatibilities})
+ set(_pkg ${_compat}${_version_installed})
+ string(REPLACE "." "" _pkg ${_pkg})
+ set(_filename "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}ConfigVersion.cmake")
+ set(_filename_novoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}NoVoidConfigVersion.cmake")
+ set(_filename_diffvoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}DiffVoidConfigVersion.cmake")
+
+ set(CMAKE_SIZEOF_VOID_P ${_same_CMAKE_SIZEOF_VOID_P})
+ write_basic_config_version_file("${_filename}"
+ VERSION ${_version_installed}
+ COMPATIBILITY ${_compat})
+
+ # Test that an empty CMAKE_SIZEOF_VOID_P is accepted:
+ set(CMAKE_SIZEOF_VOID_P ${_no_CMAKE_SIZEOF_VOID_P})
+ write_basic_config_version_file("${_filename_novoid}"
+ VERSION ${_version_installed}
+ COMPATIBILITY ${_compat})
+
+ # Test that a different CMAKE_SIZEOF_VOID_P results in
+ # PACKAGE_VERSION_UNSUITABLE
+ set(CMAKE_SIZEOF_VOID_P ${_diff_CMAKE_SIZEOF_VOID_P})
+ write_basic_config_version_file("${_filename_diffvoid}"
+ VERSION ${_version_installed}
+ COMPATIBILITY ${_compat})
+ endforeach()
+endfunction()
+
+macro(TEST_WRITE_BASIC_CONFIG_VERSION_FILE_CHECK _filename)
+ include("${_filename}")
+
+ if(_expected_compatible AND NOT PACKAGE_VERSION_COMPATIBLE)
+ message(SEND_ERROR "Did not find package with version ${_version_installed} (${_version_requested} was requested)!")
+ elseif(NOT _expected_compatible AND PACKAGE_VERSION_COMPATIBLE)
+ message(SEND_ERROR "Found package with version ${_version_installed}, but ${_version_requested} was requested!")
+ endif()
+
+ if(${_expected_exact} AND NOT PACKAGE_VERSION_EXACT)
+ message(SEND_ERROR "PACKAGE_VERSION_EXACT not set, although it should be!")
+ elseif(NOT ${_expected_exact} AND PACKAGE_VERSION_EXACT)
+ message(SEND_ERROR "PACKAGE_VERSION_EXACT set, although it should not be!")
+ endif()
+
+ if(${_expected_unsuitable} AND NOT PACKAGE_VERSION_UNSUITABLE)
+ message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE set, although it should not be!")
+ elseif(NOT ${_expected_unsuitable} AND PACKAGE_VERSION_UNSUITABLE)
+ message(SEND_ERROR "PACKAGE_VERSION_UNSUITABLE not set, although it should be!")
+ endif()
+
+ unset(PACKAGE_VERSION_COMPATIBLE)
+ unset(PACKAGE_VERSION_EXACT)
+ unset(PACKAGE_VERSION_UNSUITABLE)
+endmacro()
+
+function(TEST_WRITE_BASIC_CONFIG_VERSION_FILE _version_installed
+ _version_requested
+ _expected_compatible_AnyNewerVersion
+ _expected_compatible_SameMajorVersion
+ _expected_compatible_SameMinorVersion
+ _expected_compatible_ExactVersion)
+ set(PACKAGE_FIND_VERSION ${_version_requested})
+ if("${PACKAGE_FIND_VERSION}" MATCHES [[(^([0-9]+)(\.([0-9]+)(\.([0-9]+)(\.([0-9]+))?)?)?)?$]])
+ set(PACKAGE_FIND_VERSION_MAJOR "${CMAKE_MATCH_2}")
+ set(PACKAGE_FIND_VERSION_MINOR "${CMAKE_MATCH_4}")
+ set(PACKAGE_FIND_VERSION_PATCH "${CMAKE_MATCH_6}")
+ set(PACKAGE_FIND_VERSION_TWEAK "${CMAKE_MATCH_8}")
+ else()
+ message(FATAL_ERROR "_version_requested (${_version_requested}) should be a version number")
+ endif()
+
+ if ("${_version_installed}" STREQUAL "${_version_requested}")
+ set(_expected_exact 1)
+ else()
+ set(_expected_exact 0)
+ endif()
+
+ unset(PACKAGE_VERSION_COMPATIBLE)
+ unset(PACKAGE_VERSION_EXACT)
+ unset(PACKAGE_VERSION_UNSUITABLE)
+
+ foreach(_compat ${_compatibilities})
+ set(_pkg ${_compat}${_version_installed})
+ string(REPLACE "." "" _pkg ${_pkg})
+ set(_filename "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}ConfigVersion.cmake")
+ set(_filename_novoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}NoVoidConfigVersion.cmake")
+ set(_filename_diffvoid "${CMAKE_CURRENT_BINARY_DIR}/${_pkg}DiffVoidConfigVersion.cmake")
+
+ set(_expected_compatible ${_expected_compatible_${_compat}})
+
+ # Test "normal" version
+ set(_expected_unsuitable 0)
+ message(STATUS "TEST write_basic_config_version_file(VERSION ${_version_installed} \
+COMPATIBILITY ${_compat}) vs. ${_version_requested} \
+(expected compatible = ${_expected_compatible}, exact = ${_expected_exact}, unsuitable = ${_expected_unsuitable})")
+ test_write_basic_config_version_file_check("${_filename}")
+
+ # test empty CMAKE_SIZEOF_VOID_P version:
+ set(_expected_unsuitable 0)
+ message(STATUS "TEST write_basic_config_version_file(VERSION ${_version_installed} \
+COMPATIBILITY ${_compat}) vs. ${_version_requested} (no CMAKE_SIZEOF_VOID_P) \
+(expected compatible = ${_expected_compatible}, exact = ${_expected_exact}, unsuitable = ${_expected_unsuitable})")
+ test_write_basic_config_version_file_check("${_filename_novoid}")
+
+ # test different CMAKE_SIZEOF_VOID_P version:
+ set(_expected_unsuitable 1)
+ message(STATUS "TEST write_basic_config_version_file(VERSION ${_version_installed} \
+COMPATIBILITY ${_compat}) vs. ${_version_requested} (different CMAKE_SIZEOF_VOID_P) \
+(expected compatible = ${_expected_compatible}, exact = ${_expected_exact}, unsuitable = ${_expected_unsuitable})")
+ test_write_basic_config_version_file_check("${_filename_diffvoid}")
+
+ endforeach()
+endfunction()
+
+
+test_write_basic_config_version_file_prepare(4)
+test_write_basic_config_version_file_prepare(4.5)
+test_write_basic_config_version_file_prepare(4.5.6)
+test_write_basic_config_version_file_prepare(4.5.6.7)
+
+# AnyNewerVersion
+# | SameMajorVersion
+# | | SameMinorVersion
+# | | | ExactVersion
+# | | | |
+test_write_basic_config_version_file(4 0 1 0 0 0) # Request 0
+test_write_basic_config_version_file(4 2 1 0 0 0) # Request [older major]
+test_write_basic_config_version_file(4 4 1 1 1 1) # Request [same major]
+test_write_basic_config_version_file(4 9 0 0 0 0) # Request [newer major]
+
+test_write_basic_config_version_file(4 0.0 1 0 0 0) # Request 0.0
+test_write_basic_config_version_file(4 0.9 1 0 0 0) # Request 0.[newer minor]
+test_write_basic_config_version_file(4 2.0 1 0 0 0) # Request [older major].0
+test_write_basic_config_version_file(4 2.9 1 0 0 0) # Request [older major].[newer minor]
+test_write_basic_config_version_file(4 4.0 1 1 0 0) # Request [same major].0
+test_write_basic_config_version_file(4 4.9 0 0 0 0) # Request [same major].[newer minor]
+test_write_basic_config_version_file(4 9.0 0 0 0 0) # Request [newer major].0
+test_write_basic_config_version_file(4 9.9 0 0 0 0) # Request [newer major].[newer minor]
+
+test_write_basic_config_version_file(4 0.0.0 1 0 0 0) # Request 0.0.0
+test_write_basic_config_version_file(4 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
+test_write_basic_config_version_file(4 0.9.0 1 0 0 0) # Request 0.[newer minor].0
+test_write_basic_config_version_file(4 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
+test_write_basic_config_version_file(4 2.0.0 1 0 0 0) # Request [older major].0.0
+test_write_basic_config_version_file(4 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
+test_write_basic_config_version_file(4 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
+test_write_basic_config_version_file(4 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4 4.0.0 1 1 0 0) # Request [same major].0.0
+test_write_basic_config_version_file(4 4.0.9 0 0 0 0) # Request [same major].0.[newer patch]
+test_write_basic_config_version_file(4 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
+test_write_basic_config_version_file(4 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4 9.0.0 0 0 0 0) # Request [newer major].0.0
+test_write_basic_config_version_file(4 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
+test_write_basic_config_version_file(4 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
+test_write_basic_config_version_file(4 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
+
+test_write_basic_config_version_file(4 0.0.0.0 1 0 0 0) # Request 0.0.0.0
+test_write_basic_config_version_file(4 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
+test_write_basic_config_version_file(4 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
+test_write_basic_config_version_file(4 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
+test_write_basic_config_version_file(4 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
+test_write_basic_config_version_file(4 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
+test_write_basic_config_version_file(4 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
+test_write_basic_config_version_file(4 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
+test_write_basic_config_version_file(4 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
+test_write_basic_config_version_file(4 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
+test_write_basic_config_version_file(4 4.0.0.9 0 0 0 0) # Request [same major].0.0.[newer tweak]
+test_write_basic_config_version_file(4 4.0.9.0 0 0 0 0) # Request [same major].0.[newer patch].0
+test_write_basic_config_version_file(4 4.0.9.9 0 0 0 0) # Request [same major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
+test_write_basic_config_version_file(4 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
+test_write_basic_config_version_file(4 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
+test_write_basic_config_version_file(4 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
+test_write_basic_config_version_file(4 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
+test_write_basic_config_version_file(4 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
+
+
+
+test_write_basic_config_version_file(4.5 0 1 0 0 0) # Request 0
+test_write_basic_config_version_file(4.5 2 1 0 0 0) # Request [older major]
+test_write_basic_config_version_file(4.5 4 1 1 0 0) # Request [same major]
+test_write_basic_config_version_file(4.5 9 0 0 0 0) # Request [newer major]
+
+test_write_basic_config_version_file(4.5 0.0 1 0 0 0) # Request 0.0
+test_write_basic_config_version_file(4.5 0.2 1 0 0 0) # Request 0.[older minor]
+test_write_basic_config_version_file(4.5 0.5 1 0 0 0) # Request 0.[same minor]
+test_write_basic_config_version_file(4.5 0.9 1 0 0 0) # Request 0.[newer minor]
+test_write_basic_config_version_file(4.5 2.0 1 0 0 0) # Request [older major].0
+test_write_basic_config_version_file(4.5 2.2 1 0 0 0) # Request [older major].[older minor]
+test_write_basic_config_version_file(4.5 2.5 1 0 0 0) # Request [older major].[same minor]
+test_write_basic_config_version_file(4.5 2.9 1 0 0 0) # Request [older major].[newer minor]
+test_write_basic_config_version_file(4.5 4.0 1 1 0 0) # Request [same major].0
+test_write_basic_config_version_file(4.5 4.2 1 1 0 0) # Request [same major].[older minor]
+test_write_basic_config_version_file(4.5 4.5 1 1 1 1) # Request [same major].[same minor]
+test_write_basic_config_version_file(4.5 4.9 0 0 0 0) # Request [same major].[newer minor]
+test_write_basic_config_version_file(4.5 9.0 0 0 0 0) # Request [newer major].0
+test_write_basic_config_version_file(4.5 9.1 0 0 0 0) # Request [newer major].[older minor]
+test_write_basic_config_version_file(4.5 9.5 0 0 0 0) # Request [newer major].[same minor]
+test_write_basic_config_version_file(4.5 9.9 0 0 0 0) # Request [newer major].[newer minor]
+
+test_write_basic_config_version_file(4.5 0.0.0 1 0 0 0) # Request 0.0.0
+test_write_basic_config_version_file(4.5 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
+test_write_basic_config_version_file(4.5 0.2.0 1 0 0 0) # Request 0.[older minor].0
+test_write_basic_config_version_file(4.5 0.2.9 1 0 0 0) # Request 0.[older minor].[newer patch]
+test_write_basic_config_version_file(4.5 0.5.0 1 0 0 0) # Request 0.[same minor].0
+test_write_basic_config_version_file(4.5 0.5.9 1 0 0 0) # Request 0.[same minor].[newer patch]
+test_write_basic_config_version_file(4.5 0.9.0 1 0 0 0) # Request 0.[newer minor].0
+test_write_basic_config_version_file(4.5 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5 2.0.0 1 0 0 0) # Request [older major].0.0
+test_write_basic_config_version_file(4.5 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
+test_write_basic_config_version_file(4.5 2.2.0 1 0 0 0) # Request [older major].[older minor].0
+test_write_basic_config_version_file(4.5 2.2.9 1 0 0 0) # Request [older major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5 2.5.0 1 0 0 0) # Request [older major].[same minor].0
+test_write_basic_config_version_file(4.5 2.5.9 1 0 0 0) # Request [older major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
+test_write_basic_config_version_file(4.5 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5 4.0.0 1 1 0 0) # Request [same major].0.0
+test_write_basic_config_version_file(4.5 4.0.9 1 1 0 0) # Request [same major].0.[newer patch]
+test_write_basic_config_version_file(4.5 4.2.0 1 1 0 0) # Request [same major].[older minor].0
+test_write_basic_config_version_file(4.5 4.2.9 1 1 0 0) # Request [same major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5 4.5.0 1 1 1 0) # Request [same major].[same minor].0
+test_write_basic_config_version_file(4.5 4.5.9 0 0 0 0) # Request [same major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
+test_write_basic_config_version_file(4.5 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5 9.0.0 0 0 0 0) # Request [newer major].0.0
+test_write_basic_config_version_file(4.5 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
+test_write_basic_config_version_file(4.5 9.2.0 0 0 0 0) # Request [newer major].[older minor].0
+test_write_basic_config_version_file(4.5 9.2.9 0 0 0 0) # Request [newer major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5 9.5.0 0 0 0 0) # Request [newer major].[same minor].0
+test_write_basic_config_version_file(4.5 9.5.9 0 0 0 0) # Request [newer major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
+test_write_basic_config_version_file(4.5 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
+
+test_write_basic_config_version_file(4.5 0.0.0.0 1 0 0 0) # Request 0.0.0.0
+test_write_basic_config_version_file(4.5 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
+test_write_basic_config_version_file(4.5 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
+test_write_basic_config_version_file(4.5 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 0.2.0.0 1 0 0 0) # Request 0.[older minor].0.0
+test_write_basic_config_version_file(4.5 0.2.0.9 1 0 0 0) # Request 0.[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 0.2.9.0 1 0 0 0) # Request 0.[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5 0.2.9.9 1 0 0 0) # Request 0.[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 0.5.0.0 1 0 0 0) # Request 0.[same minor].0.0
+test_write_basic_config_version_file(4.5 0.5.0.9 1 0 0 0) # Request 0.[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 0.5.9.0 1 0 0 0) # Request 0.[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5 0.5.9.9 1 0 0 0) # Request 0.[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
+test_write_basic_config_version_file(4.5 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
+test_write_basic_config_version_file(4.5 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
+test_write_basic_config_version_file(4.5 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 2.2.0.0 1 0 0 0) # Request [older major].[older minor].0.0
+test_write_basic_config_version_file(4.5 2.2.0.9 1 0 0 0) # Request [older major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 2.2.9.0 1 0 0 0) # Request [older major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5 2.2.9.9 1 0 0 0) # Request [older major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 2.5.0.0 1 0 0 0) # Request [older major].[same minor].0.0
+test_write_basic_config_version_file(4.5 2.5.0.9 1 0 0 0) # Request [older major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 2.5.9.0 1 0 0 0) # Request [older major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5 2.5.9.9 1 0 0 0) # Request [older major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
+test_write_basic_config_version_file(4.5 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
+test_write_basic_config_version_file(4.5 4.0.0.9 1 1 0 0) # Request [same major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5 4.0.9.0 1 1 0 0) # Request [same major].0.[newer patch].0
+test_write_basic_config_version_file(4.5 4.0.9.9 1 1 0 0) # Request [same major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 4.2.0.0 1 1 0 0) # Request [same major].[older minor].0.0
+test_write_basic_config_version_file(4.5 4.2.0.9 1 1 0 0) # Request [same major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 4.2.9.0 1 1 0 0) # Request [same major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5 4.2.9.9 1 1 0 0) # Request [same major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 4.5.0.0 1 1 1 0) # Request [same major].[same minor].0.0
+test_write_basic_config_version_file(4.5 4.5.0.9 0 0 0 0) # Request [same major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 4.5.9.0 0 0 0 0) # Request [same major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5 4.5.9.9 0 0 0 0) # Request [same major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
+test_write_basic_config_version_file(4.5 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
+test_write_basic_config_version_file(4.5 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
+test_write_basic_config_version_file(4.5 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 9.2.0.0 0 0 0 0) # Request [newer major].[older minor].0.0
+test_write_basic_config_version_file(4.5 9.2.0.9 0 0 0 0) # Request [newer major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 9.2.9.0 0 0 0 0) # Request [newer major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5 9.2.9.9 0 0 0 0) # Request [newer major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 9.5.0.0 0 0 0 0) # Request [newer major].[same minor].0.0
+test_write_basic_config_version_file(4.5 9.5.0.9 0 0 0 0) # Request [newer major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 9.5.9.0 0 0 0 0) # Request [newer major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5 9.5.9.9 0 0 0 0) # Request [newer major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
+test_write_basic_config_version_file(4.5 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
+
+
+test_write_basic_config_version_file(4.5.6 0 1 0 0 0) # Request 0
+test_write_basic_config_version_file(4.5.6 2 1 0 0 0) # Request [older major]
+test_write_basic_config_version_file(4.5.6 4 1 1 0 0) # Request [same major]
+test_write_basic_config_version_file(4.5.6 9 0 0 0 0) # Request [newer major]
+
+test_write_basic_config_version_file(4.5.6 0.0 1 0 0 0) # Request 0.0
+test_write_basic_config_version_file(4.5.6 0.2 1 0 0 0) # Request 0.[older minor]
+test_write_basic_config_version_file(4.5.6 0.5 1 0 0 0) # Request 0.[same minor]
+test_write_basic_config_version_file(4.5.6 0.9 1 0 0 0) # Request 0.[newer minor]
+test_write_basic_config_version_file(4.5.6 2.0 1 0 0 0) # Request [older major].0
+test_write_basic_config_version_file(4.5.6 2.2 1 0 0 0) # Request [older major].[older minor]
+test_write_basic_config_version_file(4.5.6 2.5 1 0 0 0) # Request [older major].[same minor]
+test_write_basic_config_version_file(4.5.6 2.9 1 0 0 0) # Request [older major].[newer minor]
+test_write_basic_config_version_file(4.5.6 4.0 1 1 0 0) # Request [same major].0
+test_write_basic_config_version_file(4.5.6 4.2 1 1 0 0) # Request [same major].[older minor]
+test_write_basic_config_version_file(4.5.6 4.5 1 1 1 0) # Request [same major].[same minor]
+test_write_basic_config_version_file(4.5.6 4.9 0 0 0 0) # Request [same major].[newer minor]
+test_write_basic_config_version_file(4.5.6 9.0 0 0 0 0) # Request [newer major].0
+test_write_basic_config_version_file(4.5.6 9.1 0 0 0 0) # Request [newer major].[older minor]
+test_write_basic_config_version_file(4.5.6 9.5 0 0 0 0) # Request [newer major].[same minor]
+test_write_basic_config_version_file(4.5.6 9.9 0 0 0 0) # Request [newer major].[newer minor]
+
+test_write_basic_config_version_file(4.5.6 0.0.0 1 0 0 0) # Request 0.0.0
+test_write_basic_config_version_file(4.5.6 0.0.2 1 0 0 0) # Request 0.0.[older patch]
+test_write_basic_config_version_file(4.5.6 0.0.6 1 0 0 0) # Request 0.0.[same patch]
+test_write_basic_config_version_file(4.5.6 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
+test_write_basic_config_version_file(4.5.6 0.2.0 1 0 0 0) # Request 0.[older minor].0
+test_write_basic_config_version_file(4.5.6 0.2.2 1 0 0 0) # Request 0.[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6 0.2.6 1 0 0 0) # Request 0.[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6 0.2.9 1 0 0 0) # Request 0.[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 0.5.0 1 0 0 0) # Request 0.[same minor].0
+test_write_basic_config_version_file(4.5.6 0.5.2 1 0 0 0) # Request 0.[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6 0.5.6 1 0 0 0) # Request 0.[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6 0.5.9 1 0 0 0) # Request 0.[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 0.9.0 1 0 0 0) # Request 0.[newer minor].0
+test_write_basic_config_version_file(4.5.6 0.9.2 1 0 0 0) # Request 0.[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6 0.9.6 1 0 0 0) # Request 0.[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 2.0.0 1 0 0 0) # Request [older major].0.0
+test_write_basic_config_version_file(4.5.6 2.0.2 1 0 0 0) # Request [older major].0.[older patch]
+test_write_basic_config_version_file(4.5.6 2.0.6 1 0 0 0) # Request [older major].0.[same patch]
+test_write_basic_config_version_file(4.5.6 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
+test_write_basic_config_version_file(4.5.6 2.2.0 1 0 0 0) # Request [older major].[older minor].0
+test_write_basic_config_version_file(4.5.6 2.2.2 1 0 0 0) # Request [older major].[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6 2.2.6 1 0 0 0) # Request [older major].[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6 2.2.9 1 0 0 0) # Request [older major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 2.5.0 1 0 0 0) # Request [older major].[same minor].0
+test_write_basic_config_version_file(4.5.6 2.5.2 1 0 0 0) # Request [older major].[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6 2.5.6 1 0 0 0) # Request [older major].[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6 2.5.9 1 0 0 0) # Request [older major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
+test_write_basic_config_version_file(4.5.6 2.9.2 1 0 0 0) # Request [older major].[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6 2.9.6 1 0 0 0) # Request [older major].[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 4.0.0 1 1 0 0) # Request [same major].0.0
+test_write_basic_config_version_file(4.5.6 4.0.2 1 1 0 0) # Request [same major].0.[older patch]
+test_write_basic_config_version_file(4.5.6 4.0.6 1 1 0 0) # Request [same major].0.[same patch]
+test_write_basic_config_version_file(4.5.6 4.0.9 1 1 0 0) # Request [same major].0.[newer patch]
+test_write_basic_config_version_file(4.5.6 4.2.0 1 1 0 0) # Request [same major].[older minor].0
+test_write_basic_config_version_file(4.5.6 4.2.2 1 1 0 0) # Request [same major].[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6 4.2.6 1 1 0 0) # Request [same major].[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6 4.2.9 1 1 0 0) # Request [same major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 4.5.0 1 1 1 0) # Request [same major].[same minor].0
+test_write_basic_config_version_file(4.5.6 4.5.2 1 1 1 0) # Request [same major].[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6 4.5.6 1 1 1 1) # Request [same major].[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6 4.5.9 0 0 0 0) # Request [same major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
+test_write_basic_config_version_file(4.5.6 4.9.2 0 0 0 0) # Request [same major].[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6 4.9.6 0 0 0 0) # Request [same major].[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 9.0.0 0 0 0 0) # Request [newer major].0.0
+test_write_basic_config_version_file(4.5.6 9.0.2 0 0 0 0) # Request [newer major].0.[older patch]
+test_write_basic_config_version_file(4.5.6 9.0.6 0 0 0 0) # Request [newer major].0.[same patch]
+test_write_basic_config_version_file(4.5.6 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
+test_write_basic_config_version_file(4.5.6 9.2.0 0 0 0 0) # Request [newer major].[older minor].0
+test_write_basic_config_version_file(4.5.6 9.2.2 0 0 0 0) # Request [newer major].[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6 9.2.6 0 0 0 0) # Request [newer major].[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6 9.2.9 0 0 0 0) # Request [newer major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 9.5.0 0 0 0 0) # Request [newer major].[same minor].0
+test_write_basic_config_version_file(4.5.6 9.5.2 0 0 0 0) # Request [newer major].[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6 9.5.6 0 0 0 0) # Request [newer major].[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6 9.5.9 0 0 0 0) # Request [newer major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
+test_write_basic_config_version_file(4.5.6 9.9.2 0 0 0 0) # Request [newer major].[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6 9.9.6 0 0 0 0) # Request [newer major].[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
+
+test_write_basic_config_version_file(4.5.6 0.0.0.0 1 0 0 0) # Request 0.0.0.0
+test_write_basic_config_version_file(4.5.6 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.0.2.0 1 0 0 0) # Request 0.0.[older patch].0
+test_write_basic_config_version_file(4.5.6 0.0.2.9 1 0 0 0) # Request 0.0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.0.6.0 1 0 0 0) # Request 0.0.[same patch].0
+test_write_basic_config_version_file(4.5.6 0.0.6.9 1 0 0 0) # Request 0.0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
+test_write_basic_config_version_file(4.5.6 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.2.0.0 1 0 0 0) # Request 0.[older minor].0.0
+test_write_basic_config_version_file(4.5.6 0.2.0.9 1 0 0 0) # Request 0.[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.2.2.0 1 0 0 0) # Request 0.[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 0.2.2.9 1 0 0 0) # Request 0.[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.2.6.0 1 0 0 0) # Request 0.[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 0.2.6.9 1 0 0 0) # Request 0.[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.2.9.0 1 0 0 0) # Request 0.[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 0.2.9.9 1 0 0 0) # Request 0.[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.5.0.0 1 0 0 0) # Request 0.[same minor].0.0
+test_write_basic_config_version_file(4.5.6 0.5.0.9 1 0 0 0) # Request 0.[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.5.2.0 1 0 0 0) # Request 0.[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 0.5.2.9 1 0 0 0) # Request 0.[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.5.6.0 1 0 0 0) # Request 0.[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 0.5.6.9 1 0 0 0) # Request 0.[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.5.9.0 1 0 0 0) # Request 0.[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 0.5.9.9 1 0 0 0) # Request 0.[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
+test_write_basic_config_version_file(4.5.6 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.9.2.0 1 0 0 0) # Request 0.[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 0.9.2.9 1 0 0 0) # Request 0.[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.9.6.0 1 0 0 0) # Request 0.[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 0.9.6.9 1 0 0 0) # Request 0.[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
+test_write_basic_config_version_file(4.5.6 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.0.2.0 1 0 0 0) # Request [older major].0.[older patch].0
+test_write_basic_config_version_file(4.5.6 2.0.2.9 1 0 0 0) # Request [older major].0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.0.6.0 1 0 0 0) # Request [older major].0.[same patch].0
+test_write_basic_config_version_file(4.5.6 2.0.6.9 1 0 0 0) # Request [older major].0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
+test_write_basic_config_version_file(4.5.6 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.2.0.0 1 0 0 0) # Request [older major].[older minor].0.0
+test_write_basic_config_version_file(4.5.6 2.2.0.9 1 0 0 0) # Request [older major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.2.2.0 1 0 0 0) # Request [older major].[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 2.2.2.9 1 0 0 0) # Request [older major].[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.2.6.0 1 0 0 0) # Request [older major].[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 2.2.6.9 1 0 0 0) # Request [older major].[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.2.9.0 1 0 0 0) # Request [older major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 2.2.9.9 1 0 0 0) # Request [older major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.5.0.0 1 0 0 0) # Request [older major].[same minor].0.0
+test_write_basic_config_version_file(4.5.6 2.5.0.9 1 0 0 0) # Request [older major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.5.2.0 1 0 0 0) # Request [older major].[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 2.5.2.9 1 0 0 0) # Request [older major].[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.5.6.0 1 0 0 0) # Request [older major].[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 2.5.6.9 1 0 0 0) # Request [older major].[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.5.9.0 1 0 0 0) # Request [older major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 2.5.9.9 1 0 0 0) # Request [older major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
+test_write_basic_config_version_file(4.5.6 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.9.2.0 1 0 0 0) # Request [older major].[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 2.9.2.9 1 0 0 0) # Request [older major].[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.9.6.0 1 0 0 0) # Request [older major].[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 2.9.6.9 1 0 0 0) # Request [older major].[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
+test_write_basic_config_version_file(4.5.6 4.0.0.9 1 1 0 0) # Request [same major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.0.2.0 1 1 0 0) # Request [same major].0.[older patch].0
+test_write_basic_config_version_file(4.5.6 4.0.2.9 1 1 0 0) # Request [same major].0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.0.6.0 1 1 0 0) # Request [same major].0.[same patch].0
+test_write_basic_config_version_file(4.5.6 4.0.6.9 1 1 0 0) # Request [same major].0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.0.9.0 1 1 0 0) # Request [same major].0.[newer patch].0
+test_write_basic_config_version_file(4.5.6 4.0.9.9 1 1 0 0) # Request [same major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.2.0.0 1 1 0 0) # Request [same major].[older minor].0.0
+test_write_basic_config_version_file(4.5.6 4.2.0.9 1 1 0 0) # Request [same major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.2.2.0 1 1 0 0) # Request [same major].[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 4.2.2.9 1 1 0 0) # Request [same major].[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.2.6.0 1 1 0 0) # Request [same major].[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 4.2.6.9 1 1 0 0) # Request [same major].[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.2.9.0 1 1 0 0) # Request [same major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 4.2.9.9 1 1 0 0) # Request [same major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.5.0.0 1 1 1 0) # Request [same major].[same minor].0.0
+test_write_basic_config_version_file(4.5.6 4.5.0.9 1 1 1 0) # Request [same major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.5.2.0 1 1 1 0) # Request [same major].[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 4.5.2.9 1 1 1 0) # Request [same major].[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.5.6.0 1 1 1 1) # Request [same major].[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 4.5.6.9 0 0 0 1) # Request [same major].[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.5.9.0 0 0 0 0) # Request [same major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 4.5.9.9 0 0 0 0) # Request [same major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
+test_write_basic_config_version_file(4.5.6 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.9.2.0 0 0 0 0) # Request [same major].[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 4.9.2.9 0 0 0 0) # Request [same major].[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.9.6.0 0 0 0 0) # Request [same major].[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 4.9.6.9 0 0 0 0) # Request [same major].[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
+test_write_basic_config_version_file(4.5.6 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.0.2.0 0 0 0 0) # Request [newer major].0.[older patch].0
+test_write_basic_config_version_file(4.5.6 9.0.2.9 0 0 0 0) # Request [newer major].0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.0.6.0 0 0 0 0) # Request [newer major].0.[same patch].0
+test_write_basic_config_version_file(4.5.6 9.0.6.9 0 0 0 0) # Request [newer major].0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
+test_write_basic_config_version_file(4.5.6 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.2.0.0 0 0 0 0) # Request [newer major].[older minor].0.0
+test_write_basic_config_version_file(4.5.6 9.2.0.9 0 0 0 0) # Request [newer major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.2.2.0 0 0 0 0) # Request [newer major].[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 9.2.2.9 0 0 0 0) # Request [newer major].[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.2.6.0 0 0 0 0) # Request [newer major].[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 9.2.6.9 0 0 0 0) # Request [newer major].[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.2.9.0 0 0 0 0) # Request [newer major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 9.2.9.9 0 0 0 0) # Request [newer major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.5.0.0 0 0 0 0) # Request [newer major].[same minor].0.0
+test_write_basic_config_version_file(4.5.6 9.5.0.9 0 0 0 0) # Request [newer major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.5.2.0 0 0 0 0) # Request [newer major].[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 9.5.2.9 0 0 0 0) # Request [newer major].[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.5.6.0 0 0 0 0) # Request [newer major].[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 9.5.6.9 0 0 0 0) # Request [newer major].[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.5.9.0 0 0 0 0) # Request [newer major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 9.5.9.9 0 0 0 0) # Request [newer major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
+test_write_basic_config_version_file(4.5.6 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.9.2.0 0 0 0 0) # Request [newer major].[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6 9.9.2.9 0 0 0 0) # Request [newer major].[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.9.6.0 0 0 0 0) # Request [newer major].[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6 9.9.6.9 0 0 0 0) # Request [newer major].[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
+
+
+test_write_basic_config_version_file(4.5.6.7 0 1 0 0 0) # Request 0
+test_write_basic_config_version_file(4.5.6.7 2 1 0 0 0) # Request [older major]
+test_write_basic_config_version_file(4.5.6.7 4 1 1 0 0) # Request [same major]
+test_write_basic_config_version_file(4.5.6.7 9 0 0 0 0) # Request [newer major]
+
+test_write_basic_config_version_file(4.5.6.7 0.0 1 0 0 0) # Request 0.0
+test_write_basic_config_version_file(4.5.6.7 0.2 1 0 0 0) # Request 0.[older minor]
+test_write_basic_config_version_file(4.5.6.7 0.5 1 0 0 0) # Request 0.[same minor]
+test_write_basic_config_version_file(4.5.6.7 0.9 1 0 0 0) # Request 0.[newer minor]
+test_write_basic_config_version_file(4.5.6.7 2.0 1 0 0 0) # Request [older major].0
+test_write_basic_config_version_file(4.5.6.7 2.2 1 0 0 0) # Request [older major].[older minor]
+test_write_basic_config_version_file(4.5.6.7 2.5 1 0 0 0) # Request [older major].[same minor]
+test_write_basic_config_version_file(4.5.6.7 2.9 1 0 0 0) # Request [older major].[newer minor]
+test_write_basic_config_version_file(4.5.6.7 4.0 1 1 0 0) # Request [same major].0
+test_write_basic_config_version_file(4.5.6.7 4.2 1 1 0 0) # Request [same major].[older minor]
+test_write_basic_config_version_file(4.5.6.7 4.5 1 1 1 0) # Request [same major].[same minor]
+test_write_basic_config_version_file(4.5.6.7 4.9 0 0 0 0) # Request [same major].[newer minor]
+test_write_basic_config_version_file(4.5.6.7 9.0 0 0 0 0) # Request [newer major].0
+test_write_basic_config_version_file(4.5.6.7 9.1 0 0 0 0) # Request [newer major].[older minor]
+test_write_basic_config_version_file(4.5.6.7 9.5 0 0 0 0) # Request [newer major].[same minor]
+test_write_basic_config_version_file(4.5.6.7 9.9 0 0 0 0) # Request [newer major].[newer minor]
+
+test_write_basic_config_version_file(4.5.6.7 0.0.0 1 0 0 0) # Request 0.0.0
+test_write_basic_config_version_file(4.5.6.7 0.0.2 1 0 0 0) # Request 0.0.[older patch]
+test_write_basic_config_version_file(4.5.6.7 0.0.6 1 0 0 0) # Request 0.0.[same patch]
+test_write_basic_config_version_file(4.5.6.7 0.0.9 1 0 0 0) # Request 0.0.[newer patch]
+test_write_basic_config_version_file(4.5.6.7 0.2.0 1 0 0 0) # Request 0.[older minor].0
+test_write_basic_config_version_file(4.5.6.7 0.2.2 1 0 0 0) # Request 0.[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 0.2.6 1 0 0 0) # Request 0.[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 0.2.9 1 0 0 0) # Request 0.[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 0.5.0 1 0 0 0) # Request 0.[same minor].0
+test_write_basic_config_version_file(4.5.6.7 0.5.2 1 0 0 0) # Request 0.[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 0.5.6 1 0 0 0) # Request 0.[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 0.5.9 1 0 0 0) # Request 0.[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 0.9.0 1 0 0 0) # Request 0.[newer minor].0
+test_write_basic_config_version_file(4.5.6.7 0.9.2 1 0 0 0) # Request 0.[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 0.9.6 1 0 0 0) # Request 0.[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 0.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 2.0.0 1 0 0 0) # Request [older major].0.0
+test_write_basic_config_version_file(4.5.6.7 2.0.2 1 0 0 0) # Request [older major].0.[older patch]
+test_write_basic_config_version_file(4.5.6.7 2.0.6 1 0 0 0) # Request [older major].0.[same patch]
+test_write_basic_config_version_file(4.5.6.7 2.0.9 1 0 0 0) # Request [older major].0.[newer patch]
+test_write_basic_config_version_file(4.5.6.7 2.2.0 1 0 0 0) # Request [older major].[older minor].0
+test_write_basic_config_version_file(4.5.6.7 2.2.2 1 0 0 0) # Request [older major].[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 2.2.6 1 0 0 0) # Request [older major].[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 2.2.9 1 0 0 0) # Request [older major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 2.5.0 1 0 0 0) # Request [older major].[same minor].0
+test_write_basic_config_version_file(4.5.6.7 2.5.2 1 0 0 0) # Request [older major].[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 2.5.6 1 0 0 0) # Request [older major].[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 2.5.9 1 0 0 0) # Request [older major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 2.9.0 1 0 0 0) # Request [older major].[newer minor].0
+test_write_basic_config_version_file(4.5.6.7 2.9.2 1 0 0 0) # Request [older major].[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 2.9.6 1 0 0 0) # Request [older major].[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 2.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 4.0.0 1 1 0 0) # Request [same major].0.0
+test_write_basic_config_version_file(4.5.6.7 4.0.2 1 1 0 0) # Request [same major].0.[older patch]
+test_write_basic_config_version_file(4.5.6.7 4.0.6 1 1 0 0) # Request [same major].0.[same patch]
+test_write_basic_config_version_file(4.5.6.7 4.0.9 1 1 0 0) # Request [same major].0.[newer patch]
+test_write_basic_config_version_file(4.5.6.7 4.2.0 1 1 0 0) # Request [same major].[older minor].0
+test_write_basic_config_version_file(4.5.6.7 4.2.2 1 1 0 0) # Request [same major].[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 4.2.6 1 1 0 0) # Request [same major].[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 4.2.9 1 1 0 0) # Request [same major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 4.5.0 1 1 1 0) # Request [same major].[same minor].0
+test_write_basic_config_version_file(4.5.6.7 4.5.2 1 1 1 0) # Request [same major].[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 4.5.6 1 1 1 1) # Request [same major].[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 4.5.9 0 0 0 0) # Request [same major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 4.9.0 0 0 0 0) # Request [same major].[newer minor].0
+test_write_basic_config_version_file(4.5.6.7 4.9.2 0 0 0 0) # Request [same major].[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 4.9.6 0 0 0 0) # Request [same major].[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 4.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 9.0.0 0 0 0 0) # Request [newer major].0.0
+test_write_basic_config_version_file(4.5.6.7 9.0.2 0 0 0 0) # Request [newer major].0.[older patch]
+test_write_basic_config_version_file(4.5.6.7 9.0.6 0 0 0 0) # Request [newer major].0.[same patch]
+test_write_basic_config_version_file(4.5.6.7 9.0.9 0 0 0 0) # Request [newer major].0.[newer patch]
+test_write_basic_config_version_file(4.5.6.7 9.2.0 0 0 0 0) # Request [newer major].[older minor].0
+test_write_basic_config_version_file(4.5.6.7 9.2.2 0 0 0 0) # Request [newer major].[older minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 9.2.6 0 0 0 0) # Request [newer major].[older minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 9.2.9 0 0 0 0) # Request [newer major].[older minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 9.5.0 0 0 0 0) # Request [newer major].[same minor].0
+test_write_basic_config_version_file(4.5.6.7 9.5.2 0 0 0 0) # Request [newer major].[same minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 9.5.6 0 0 0 0) # Request [newer major].[same minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 9.5.9 0 0 0 0) # Request [newer major].[same minor].[newer patch]
+test_write_basic_config_version_file(4.5.6.7 9.9.0 0 0 0 0) # Request [newer major].[newer minor].0
+test_write_basic_config_version_file(4.5.6.7 9.9.2 0 0 0 0) # Request [newer major].[newer minor].[older patch]
+test_write_basic_config_version_file(4.5.6.7 9.9.6 0 0 0 0) # Request [newer major].[newer minor].[same patch]
+test_write_basic_config_version_file(4.5.6.7 9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch]
+
+test_write_basic_config_version_file(4.5.6.7 0.0.0.0 1 0 0 0) # Request 0.0.0.0
+test_write_basic_config_version_file(4.5.6.7 0.0.0.2 1 0 0 0) # Request 0.0.0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.0.7 1 0 0 0) # Request 0.0.0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.0.9 1 0 0 0) # Request 0.0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.2.0 1 0 0 0) # Request 0.0.[older patch].0
+test_write_basic_config_version_file(4.5.6.7 0.0.2.2 1 0 0 0) # Request 0.0.[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.2.7 1 0 0 0) # Request 0.0.[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.2.9 1 0 0 0) # Request 0.0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.6.0 1 0 0 0) # Request 0.0.[same patch].0
+test_write_basic_config_version_file(4.5.6.7 0.0.6.2 1 0 0 0) # Request 0.0.[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.6.7 1 0 0 0) # Request 0.0.[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.6.9 1 0 0 0) # Request 0.0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.9.0 1 0 0 0) # Request 0.0.[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 0.0.9.2 1 0 0 0) # Request 0.0.[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.9.7 1 0 0 0) # Request 0.0.[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.0.9.9 1 0 0 0) # Request 0.0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.0.0 1 0 0 0) # Request 0.[older minor].0.0
+test_write_basic_config_version_file(4.5.6.7 0.2.0.2 1 0 0 0) # Request 0.[older minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.0.7 1 0 0 0) # Request 0.[older minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.0.9 1 0 0 0) # Request 0.[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.2.0 1 0 0 0) # Request 0.[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 0.2.2.2 1 0 0 0) # Request 0.[older minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.2.7 1 0 0 0) # Request 0.[older minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.2.9 1 0 0 0) # Request 0.[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.6.0 1 0 0 0) # Request 0.[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 0.2.6.2 1 0 0 0) # Request 0.[older minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.6.7 1 0 0 0) # Request 0.[older minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.6.9 1 0 0 0) # Request 0.[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.9.0 1 0 0 0) # Request 0.[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 0.2.9.2 1 0 0 0) # Request 0.[older minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.9.7 1 0 0 0) # Request 0.[older minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.2.9.9 1 0 0 0) # Request 0.[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.0.0 1 0 0 0) # Request 0.[same minor].0.0
+test_write_basic_config_version_file(4.5.6.7 0.5.0.2 1 0 0 0) # Request 0.[same minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.0.7 1 0 0 0) # Request 0.[same minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.0.9 1 0 0 0) # Request 0.[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.2.0 1 0 0 0) # Request 0.[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 0.5.2.2 1 0 0 0) # Request 0.[same minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.2.7 1 0 0 0) # Request 0.[same minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.2.9 1 0 0 0) # Request 0.[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.6.0 1 0 0 0) # Request 0.[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 0.5.6.2 1 0 0 0) # Request 0.[same minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.6.7 1 0 0 0) # Request 0.[same minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.6.9 1 0 0 0) # Request 0.[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.9.0 1 0 0 0) # Request 0.[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 0.5.9.2 1 0 0 0) # Request 0.[same minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.9.7 1 0 0 0) # Request 0.[same minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.5.9.9 1 0 0 0) # Request 0.[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.0.0 1 0 0 0) # Request 0.[newer minor].0.0
+test_write_basic_config_version_file(4.5.6.7 0.9.0.2 1 0 0 0) # Request 0.[newer minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.0.7 1 0 0 0) # Request 0.[newer minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.0.9 1 0 0 0) # Request 0.[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.2.0 1 0 0 0) # Request 0.[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 0.9.2.2 1 0 0 0) # Request 0.[newer minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.2.7 1 0 0 0) # Request 0.[newer minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.2.9 1 0 0 0) # Request 0.[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.6.0 1 0 0 0) # Request 0.[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 0.9.6.2 1 0 0 0) # Request 0.[newer minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.6.7 1 0 0 0) # Request 0.[newer minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.6.9 1 0 0 0) # Request 0.[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.9.0 1 0 0 0) # Request 0.[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 0.9.9.2 1 0 0 0) # Request 0.[newer minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.9.7 1 0 0 0) # Request 0.[newer minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 0.9.9.9 1 0 0 0) # Request 0.[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.0.0 1 0 0 0) # Request [older major].0.0.0
+test_write_basic_config_version_file(4.5.6.7 2.0.0.2 1 0 0 0) # Request [older major].0.0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.0.7 1 0 0 0) # Request [older major].0.0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.0.9 1 0 0 0) # Request [older major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.2.0 1 0 0 0) # Request [older major].0.[older patch].0
+test_write_basic_config_version_file(4.5.6.7 2.0.2.2 1 0 0 0) # Request [older major].0.[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.2.7 1 0 0 0) # Request [older major].0.[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.2.9 1 0 0 0) # Request [older major].0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.6.0 1 0 0 0) # Request [older major].0.[same patch].0
+test_write_basic_config_version_file(4.5.6.7 2.0.6.2 1 0 0 0) # Request [older major].0.[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.6.7 1 0 0 0) # Request [older major].0.[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.6.9 1 0 0 0) # Request [older major].0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.9.0 1 0 0 0) # Request [older major].0.[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 2.0.9.2 1 0 0 0) # Request [older major].0.[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.9.7 1 0 0 0) # Request [older major].0.[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.0.9.9 1 0 0 0) # Request [older major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.0.0 1 0 0 0) # Request [older major].[older minor].0.0
+test_write_basic_config_version_file(4.5.6.7 2.2.0.2 1 0 0 0) # Request [older major].[older minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.0.7 1 0 0 0) # Request [older major].[older minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.0.9 1 0 0 0) # Request [older major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.2.0 1 0 0 0) # Request [older major].[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 2.2.2.2 1 0 0 0) # Request [older major].[older minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.2.7 1 0 0 0) # Request [older major].[older minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.2.9 1 0 0 0) # Request [older major].[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.6.0 1 0 0 0) # Request [older major].[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 2.2.6.2 1 0 0 0) # Request [older major].[older minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.6.7 1 0 0 0) # Request [older major].[older minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.6.9 1 0 0 0) # Request [older major].[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.9.0 1 0 0 0) # Request [older major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 2.2.9.2 1 0 0 0) # Request [older major].[older minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.9.7 1 0 0 0) # Request [older major].[older minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.2.9.9 1 0 0 0) # Request [older major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.0.0 1 0 0 0) # Request [older major].[same minor].0.0
+test_write_basic_config_version_file(4.5.6.7 2.5.0.2 1 0 0 0) # Request [older major].[same minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.0.7 1 0 0 0) # Request [older major].[same minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.0.9 1 0 0 0) # Request [older major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.2.0 1 0 0 0) # Request [older major].[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 2.5.2.2 1 0 0 0) # Request [older major].[same minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.2.7 1 0 0 0) # Request [older major].[same minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.2.9 1 0 0 0) # Request [older major].[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.6.0 1 0 0 0) # Request [older major].[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 2.5.6.2 1 0 0 0) # Request [older major].[same minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.6.7 1 0 0 0) # Request [older major].[same minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.6.9 1 0 0 0) # Request [older major].[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.9.0 1 0 0 0) # Request [older major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 2.5.9.2 1 0 0 0) # Request [older major].[same minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.9.7 1 0 0 0) # Request [older major].[same minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.5.9.9 1 0 0 0) # Request [older major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.0.0 1 0 0 0) # Request [older major].[newer minor].0.0
+test_write_basic_config_version_file(4.5.6.7 2.9.0.2 1 0 0 0) # Request [older major].[newer minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.0.7 1 0 0 0) # Request [older major].[newer minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.0.9 1 0 0 0) # Request [older major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.2.0 1 0 0 0) # Request [older major].[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 2.9.2.2 1 0 0 0) # Request [older major].[newer minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.2.7 1 0 0 0) # Request [older major].[newer minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.2.9 1 0 0 0) # Request [older major].[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.6.0 1 0 0 0) # Request [older major].[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 2.9.6.2 1 0 0 0) # Request [older major].[newer minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.6.7 1 0 0 0) # Request [older major].[newer minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.6.9 1 0 0 0) # Request [older major].[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.9.0 1 0 0 0) # Request [older major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 2.9.9.2 1 0 0 0) # Request [older major].[newer minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.9.7 1 0 0 0) # Request [older major].[newer minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 2.9.9.9 1 0 0 0) # Request [older major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.0.0 1 1 0 0) # Request [same major].0.0.0
+test_write_basic_config_version_file(4.5.6.7 4.0.0.2 1 1 0 0) # Request [same major].0.0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.0.7 1 1 0 0) # Request [same major].0.0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.0.9 1 1 0 0) # Request [same major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.2.0 1 1 0 0) # Request [same major].0.[older patch].0
+test_write_basic_config_version_file(4.5.6.7 4.0.2.2 1 1 0 0) # Request [same major].0.[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.2.7 1 1 0 0) # Request [same major].0.[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.2.9 1 1 0 0) # Request [same major].0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.6.0 1 1 0 0) # Request [same major].0.[same patch].0
+test_write_basic_config_version_file(4.5.6.7 4.0.6.2 1 1 0 0) # Request [same major].0.[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.6.7 1 1 0 0) # Request [same major].0.[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.6.9 1 1 0 0) # Request [same major].0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.9.0 1 1 0 0) # Request [same major].0.[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 4.0.9.2 1 1 0 0) # Request [same major].0.[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.9.7 1 1 0 0) # Request [same major].0.[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.0.9.9 1 1 0 0) # Request [same major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.0.0 1 1 0 0) # Request [same major].[older minor].0.0
+test_write_basic_config_version_file(4.5.6.7 4.2.0.2 1 1 0 0) # Request [same major].[older minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.0.7 1 1 0 0) # Request [same major].[older minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.0.9 1 1 0 0) # Request [same major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.2.0 1 1 0 0) # Request [same major].[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 4.2.2.2 1 1 0 0) # Request [same major].[older minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.2.7 1 1 0 0) # Request [same major].[older minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.2.9 1 1 0 0) # Request [same major].[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.6.0 1 1 0 0) # Request [same major].[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 4.2.6.2 1 1 0 0) # Request [same major].[older minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.6.7 1 1 0 0) # Request [same major].[older minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.6.9 1 1 0 0) # Request [same major].[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.9.0 1 1 0 0) # Request [same major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 4.2.9.2 1 1 0 0) # Request [same major].[older minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.9.7 1 1 0 0) # Request [same major].[older minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.2.9.9 1 1 0 0) # Request [same major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.0.0 1 1 1 0) # Request [same major].[same minor].0.0
+test_write_basic_config_version_file(4.5.6.7 4.5.0.2 1 1 1 0) # Request [same major].[same minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.0.7 1 1 1 0) # Request [same major].[same minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.0.9 1 1 1 0) # Request [same major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.2.0 1 1 1 0) # Request [same major].[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 4.5.2.2 1 1 1 0) # Request [same major].[same minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.2.7 1 1 1 0) # Request [same major].[same minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.2.9 1 1 1 0) # Request [same major].[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.6.0 1 1 1 1) # Request [same major].[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 4.5.6.2 1 1 1 1) # Request [same major].[same minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.6.7 1 1 1 1) # Request [same major].[same minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.6.9 0 0 0 1) # Request [same major].[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.9.0 0 0 0 0) # Request [same major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 4.5.9.2 0 0 0 0) # Request [same major].[same minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.9.7 0 0 0 0) # Request [same major].[same minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.5.9.9 0 0 0 0) # Request [same major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.0.0 0 0 0 0) # Request [same major].[newer minor].0.0
+test_write_basic_config_version_file(4.5.6.7 4.9.0.2 0 0 0 0) # Request [same major].[newer minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.0.7 0 0 0 0) # Request [same major].[newer minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.0.9 0 0 0 0) # Request [same major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.2.0 0 0 0 0) # Request [same major].[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 4.9.2.2 0 0 0 0) # Request [same major].[newer minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.2.7 0 0 0 0) # Request [same major].[newer minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.2.9 0 0 0 0) # Request [same major].[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.6.0 0 0 0 0) # Request [same major].[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 4.9.6.2 0 0 0 0) # Request [same major].[newer minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.6.7 0 0 0 0) # Request [same major].[newer minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.6.9 0 0 0 0) # Request [same major].[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.9.0 0 0 0 0) # Request [same major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 4.9.9.2 0 0 0 0) # Request [same major].[newer minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.9.7 0 0 0 0) # Request [same major].[newer minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 4.9.9.9 0 0 0 0) # Request [same major].[newer minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.0.0 0 0 0 0) # Request [newer major].0.0.0
+test_write_basic_config_version_file(4.5.6.7 9.0.0.2 0 0 0 0) # Request [newer major].0.0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.0.7 0 0 0 0) # Request [newer major].0.0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.0.9 0 0 0 0) # Request [newer major].0.0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.2.0 0 0 0 0) # Request [newer major].0.[older patch].0
+test_write_basic_config_version_file(4.5.6.7 9.0.2.2 0 0 0 0) # Request [newer major].0.[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.2.7 0 0 0 0) # Request [newer major].0.[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.2.9 0 0 0 0) # Request [newer major].0.[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.6.0 0 0 0 0) # Request [newer major].0.[same patch].0
+test_write_basic_config_version_file(4.5.6.7 9.0.6.2 0 0 0 0) # Request [newer major].0.[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.6.7 0 0 0 0) # Request [newer major].0.[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.6.9 0 0 0 0) # Request [newer major].0.[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.9.0 0 0 0 0) # Request [newer major].0.[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 9.0.9.2 0 0 0 0) # Request [newer major].0.[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.9.7 0 0 0 0) # Request [newer major].0.[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.0.9.9 0 0 0 0) # Request [newer major].0.[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.0.0 0 0 0 0) # Request [newer major].[older minor].0.0
+test_write_basic_config_version_file(4.5.6.7 9.2.0.2 0 0 0 0) # Request [newer major].[older minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.0.7 0 0 0 0) # Request [newer major].[older minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.0.9 0 0 0 0) # Request [newer major].[older minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.2.0 0 0 0 0) # Request [newer major].[older minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 9.2.2.2 0 0 0 0) # Request [newer major].[older minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.2.7 0 0 0 0) # Request [newer major].[older minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.2.9 0 0 0 0) # Request [newer major].[older minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.6.0 0 0 0 0) # Request [newer major].[older minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 9.2.6.2 0 0 0 0) # Request [newer major].[older minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.6.7 0 0 0 0) # Request [newer major].[older minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.6.9 0 0 0 0) # Request [newer major].[older minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.9.0 0 0 0 0) # Request [newer major].[older minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 9.2.9.2 0 0 0 0) # Request [newer major].[older minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.9.7 0 0 0 0) # Request [newer major].[older minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.2.9.9 0 0 0 0) # Request [newer major].[older minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.0.0 0 0 0 0) # Request [newer major].[same minor].0.0
+test_write_basic_config_version_file(4.5.6.7 9.5.0.2 0 0 0 0) # Request [newer major].[same minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.0.7 0 0 0 0) # Request [newer major].[same minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.0.9 0 0 0 0) # Request [newer major].[same minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.2.0 0 0 0 0) # Request [newer major].[same minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 9.5.2.2 0 0 0 0) # Request [newer major].[same minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.2.7 0 0 0 0) # Request [newer major].[same minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.2.9 0 0 0 0) # Request [newer major].[same minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.6.0 0 0 0 0) # Request [newer major].[same minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 9.5.6.2 0 0 0 0) # Request [newer major].[same minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.6.7 0 0 0 0) # Request [newer major].[same minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.6.9 0 0 0 0) # Request [newer major].[same minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.9.0 0 0 0 0) # Request [newer major].[same minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 9.5.9.2 0 0 0 0) # Request [newer major].[same minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.9.7 0 0 0 0) # Request [newer major].[same minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.5.9.9 0 0 0 0) # Request [newer major].[same minor].[newer patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.0.0 0 0 0 0) # Request [newer major].[newer minor].0.0
+test_write_basic_config_version_file(4.5.6.7 9.9.0.2 0 0 0 0) # Request [newer major].[newer minor].0.[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.0.7 0 0 0 0) # Request [newer major].[newer minor].0.[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.0.9 0 0 0 0) # Request [newer major].[newer minor].0.[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.2.0 0 0 0 0) # Request [newer major].[newer minor].[older patch].0
+test_write_basic_config_version_file(4.5.6.7 9.9.2.2 0 0 0 0) # Request [newer major].[newer minor].[older patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.2.7 0 0 0 0) # Request [newer major].[newer minor].[older patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.2.9 0 0 0 0) # Request [newer major].[newer minor].[older patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.6.0 0 0 0 0) # Request [newer major].[newer minor].[same patch].0
+test_write_basic_config_version_file(4.5.6.7 9.9.6.2 0 0 0 0) # Request [newer major].[newer minor].[same patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.6.7 0 0 0 0) # Request [newer major].[newer minor].[same patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.6.9 0 0 0 0) # Request [newer major].[newer minor].[same patch].[newer tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.9.0 0 0 0 0) # Request [newer major].[newer minor].[newer patch].0
+test_write_basic_config_version_file(4.5.6.7 9.9.9.2 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[older tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.9.7 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[same tweak]
+test_write_basic_config_version_file(4.5.6.7 9.9.9.9 0 0 0 0) # Request [newer major].[newer minor].[newer patch].[newer tweak]
diff --git a/Tests/RunCMake/WriteBasicConfigVersionFile/ArchIndependent.cmake b/Tests/RunCMake/WriteBasicConfigVersionFile/ArchIndependent.cmake
new file mode 100644
index 000000000..13ec5d1dd
--- /dev/null
+++ b/Tests/RunCMake/WriteBasicConfigVersionFile/ArchIndependent.cmake
@@ -0,0 +1,63 @@
+# Hard-code architecture for test without a real compiler.
+set(CMAKE_SIZEOF_VOID_P 4)
+
+include(WriteBasicConfigVersionFile)
+
+set(_dummy_version 1.0.0)
+
+set(_compatibilities AnyNewerVersion
+ SameMajorVersion
+ SameMinorVersion
+ ExactVersion)
+
+function(test_write_basic_config_version_file_arch_prepare filename_out compat arch_independent arch)
+ if(arch_independent)
+ set(arch_arg ARCH_INDEPENDENT)
+ else()
+ set(arch_arg )
+ endif()
+
+ set(filename "${CMAKE_CURRENT_BINARY_DIR}/${compat}Arch${arch_arg}ConfigVersion.cmake")
+
+ set(CMAKE_SIZEOF_VOID_P "${arch}")
+
+ write_basic_config_version_file("${filename}"
+ VERSION "${_dummy_version}"
+ COMPATIBILITY "${compat}"
+ ${arch_arg})
+
+ set("${filename_out}" "${filename}" PARENT_SCOPE)
+endfunction()
+
+function(test_write_basic_config_version_file_arch_check unsuitable_out filename arch)
+ set(CMAKE_SIZEOF_VOID_P "${arch}")
+ set(PACKAGE_FIND_VERSION "${_dummy_version}")
+
+ include("${filename}")
+
+ set("${unsuitable_out}" "${PACKAGE_VERSION_UNSUITABLE}" PARENT_SCOPE)
+endfunction()
+
+function(test_write_basic_config_version_file_arch_test expected_unsuitable compat arch_independent source_arch user_arch)
+ test_write_basic_config_version_file_arch_prepare(filename "${compat}" "${arch_independent}" "${source_arch}")
+ test_write_basic_config_version_file_arch_check(unsuitable "${filename}" "${user_arch}")
+ if(unsuitable AND NOT expected_unsuitable)
+ message(SEND_ERROR "Architecture was checked when it shouldn't have been. Compatibility: ${compat} ARCH_INDEPENDENT: ${arch_independent}.")
+ elseif(expected_unsuitable AND NOT unsuitable)
+ message(SEND_ERROR "Requested architecture check not performed. Compatibility: ${compat} ARCH_INDEPENDENT: ${arch_independent}.")
+ endif()
+endfunction()
+
+set(_unsuitable TRUE)
+set(_suitable FALSE)
+
+foreach(compat ${_compatibilities})
+ test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 4 4)
+ test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" FALSE 4 4)
+ test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 4 8)
+ test_write_basic_config_version_file_arch_test("${_unsuitable}" "${compat}" FALSE 4 8)
+ test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 8 4)
+ test_write_basic_config_version_file_arch_test("${_unsuitable}" "${compat}" FALSE 8 4)
+ test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" TRUE 8 8)
+ test_write_basic_config_version_file_arch_test("${_suitable}" "${compat}" FALSE 8 8)
+endforeach()
diff --git a/Tests/RunCMake/WriteBasicConfigVersionFile/CMakeLists.txt b/Tests/RunCMake/WriteBasicConfigVersionFile/CMakeLists.txt
new file mode 100644
index 000000000..44025d3bd
--- /dev/null
+++ b/Tests/RunCMake/WriteBasicConfigVersionFile/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake b/Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake
new file mode 100644
index 000000000..5db33f7f2
--- /dev/null
+++ b/Tests/RunCMake/WriteBasicConfigVersionFile/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(All)
+run_cmake(ArchIndependent)
diff --git a/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake b/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
index 6281352e7..288735e87 100644
--- a/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
+++ b/Tests/RunCMake/XcodeProject/DeploymentTarget.cmake
@@ -3,28 +3,21 @@ project(DeploymentTarget C)
# using Xcode 7.1 SDK versions for deployment targets
-if(SDK MATCHES iphone)
- set(CMAKE_OSX_SYSROOT ${SDK})
- set(CMAKE_OSX_ARCHITECTURES "armv7;x86_64")
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "9.1")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
-elseif(SDK MATCHES watch)
- set(CMAKE_OSX_SYSROOT ${SDK})
- set(CMAKE_OSX_ARCHITECTURES "armv7k;i386")
+elseif(CMAKE_SYSTEM_NAME STREQUAL "watchOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "2.0")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
-elseif(SDK MATCHES appletv)
- set(CMAKE_OSX_SYSROOT ${SDK})
+elseif(CMAKE_SYSTEM_NAME STREQUAL "tvOS")
set(CMAKE_OSX_DEPLOYMENT_TARGET "9.0")
- set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
else()
- set(CMAKE_OSX_SYSROOT ${SDK})
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
endif()
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index fb0400560..4918f7ca4 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -1,9 +1,5 @@
include(RunCMake)
-if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
- set(IOS_DEPLOYMENT_TARGET "-DCMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET=10")
-endif()
-
run_cmake(ExplicitCMakeLists)
run_cmake(XcodeFileType)
@@ -25,14 +21,48 @@ run_cmake(PerConfigPerSourceOptions)
run_cmake(PerConfigPerSourceDefinitions)
run_cmake(PerConfigPerSourceIncludeDirs)
+function(XcodeSchemaGeneration)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON")
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeSchemaGeneration)
+ run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build)
+endfunction()
+
+if(NOT XCODE_VERSION VERSION_LESS 7)
+ XcodeSchemaGeneration()
+ run_cmake(XcodeSchemaProperty)
+endif()
+
+function(XcodeDependOnZeroCheck)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeDependOnZeroCheck-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(XcodeDependOnZeroCheck)
+ run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target parentdirlib)
+ run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target subdirlib)
+endfunction()
+
+XcodeDependOnZeroCheck()
+
+# Isolate device tests from host architecture selection.
+unset(ENV{CMAKE_OSX_ARCHITECTURES})
+
# Use a single build tree for a few tests without cleaning.
if(NOT XCODE_VERSION VERSION_LESS 5)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeInstallIOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_BINARY_DIR}/ios_install"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_SYSTEM_NAME=iOS"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_BINARY_DIR}/ios_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -47,7 +77,7 @@ if(NOT XCODE_VERSION VERSION_LESS 5)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesOSX-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_IOS=OFF"
+ "-DCMAKE_SYSTEM_NAME=Darwin"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
@@ -64,9 +94,8 @@ if(NOT XCODE_VERSION VERSION_LESS 5)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesIOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_IOS=ON"
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_SYSTEM_NAME=iOS"
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -84,7 +113,7 @@ if(NOT XCODE_VERSION VERSION_LESS 7)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesWatchOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_WATCHOS=ON"
+ "-DCMAKE_SYSTEM_NAME=watchOS"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
@@ -103,7 +132,7 @@ if(NOT XCODE_VERSION VERSION_LESS 7.1)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeBundlesTvOS-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DTEST_TVOS=ON"
+ "-DCMAKE_SYSTEM_NAME=tvOS"
"-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
@@ -129,9 +158,9 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombined-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
+ "-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -148,9 +177,9 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedPrune-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
+ "-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -167,9 +196,9 @@ if(NOT XCODE_VERSION VERSION_LESS 6)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeIOSInstallCombinedSingleArch-build)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS
- "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install"
+ "-DCMAKE_SYSTEM_NAME=iOS"
"-DCMAKE_IOS_INSTALL_COMBINED=YES"
- "${IOS_DEPLOYMENT_TARGET}")
+ "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/_install")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -205,28 +234,11 @@ if(NOT XCODE_VERSION VERSION_LESS 5)
unset(RunCMake_TEST_OPTIONS)
endif()
-function(XcodeSchemaGeneration)
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build)
- set(RunCMake_TEST_NO_CLEAN 1)
- set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON")
-
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
-
- run_cmake(XcodeSchemaGeneration)
- run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build)
-endfunction()
-
-if(NOT XCODE_VERSION VERSION_LESS 7)
- XcodeSchemaGeneration()
- run_cmake(XcodeSchemaProperty)
-endif()
-
if(XCODE_VERSION VERSION_GREATER_EQUAL 8)
- function(deploymeny_target_test SDK)
+ function(deployment_target_test SystemName SDK)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DeploymentTarget-${SDK}-build)
set(RunCMake_TEST_NO_CLEAN 1)
- set(RunCMake_TEST_OPTIONS "-DSDK=${SDK}")
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=${SystemName}" "-DCMAKE_OSX_SYSROOT=${SDK}")
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -235,21 +247,13 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8)
run_cmake_command(DeploymentTarget-${SDK} ${CMAKE_COMMAND} --build .)
endfunction()
- foreach(SDK macosx iphoneos iphonesimulator appletvos appletvsimulator watchos watchsimulator)
- deploymeny_target_test(${SDK})
- endforeach()
+ deployment_target_test(Darwin macosx)
+ deployment_target_test(iOS iphoneos)
+ deployment_target_test(iOS iphonesimulator)
+ deployment_target_test(tvOS appletvos)
+ deployment_target_test(tvOS appletvsimulator)
+ deployment_target_test(watchOS watchos)
+ deployment_target_test(watchOS watchsimulator)
endif()
-function(XcodeDependOnZeroCheck)
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeDependOnZeroCheck-build)
- set(RunCMake_TEST_NO_CLEAN 1)
-
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
-
- run_cmake(XcodeDependOnZeroCheck)
- run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target parentdirlib)
- run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target subdirlib)
-endfunction()
-
-XcodeDependOnZeroCheck()
+# Please add macOS-only tests above before the device-specific tests.
diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
index 5d19ee818..ef772ea65 100644
--- a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
@@ -3,27 +3,12 @@
cmake_minimum_required(VERSION 3.3)
enable_language(C)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
-
-if(TEST_IOS)
- set(CMAKE_OSX_SYSROOT iphoneos)
- set(CMAKE_OSX_ARCHITECTURES "armv7")
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
-endif(TEST_IOS)
-
-if(TEST_WATCHOS)
- set(CMAKE_OSX_SYSROOT watchos)
- set(CMAKE_OSX_ARCHITECTURES "armv7k")
- set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
- set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
- set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
endif()
-if(TEST_TVOS)
- set(CMAKE_OSX_SYSROOT appletvos)
- set(CMAKE_OSX_ARCHITECTURES "arm64")
+if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
@@ -41,7 +26,7 @@ add_dependencies(AppBundleTest AppBundle)
# with custom extension
-if (NOT TEST_IOS AND NOT TEST_WATCHOS AND NOT TEST_TVOS)
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
add_executable(AppBundleExt MACOSX_BUNDLE main.m)
set_target_properties(AppBundleExt PROPERTIES BUNDLE_EXTENSION "foo")
install(TARGETS AppBundleExt BUNDLE DESTINATION FooExtension)
@@ -55,7 +40,7 @@ endif()
# Shared Framework (not supported for iOS on Xcode < 6)
-if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS" OR NOT XCODE_VERSION VERSION_LESS 6)
add_library(SharedFramework SHARED main.c)
set_target_properties(SharedFramework PROPERTIES FRAMEWORK TRUE)
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
index d7f392021..f6c00b165 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
@@ -2,10 +2,14 @@ cmake_minimum_required(VERSION 3.3)
project(IOSInstallCombined CXX)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
+if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
+endif()
+
+if(NOT IOS)
+ message(FATAL_ERROR "IOS variable is not set")
+endif()
-set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
index 28ab883d7..ec11dbbd4 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.3)
project(XcodeIOSInstallCombinedPrune CXX)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
+if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
+endif()
-set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
index 5e7961a77..58e96b4f3 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
@@ -2,10 +2,10 @@ cmake_minimum_required(VERSION 3.3)
project(XcodeIOSInstallCombinedSingleArch CXX)
-# due to lack of toolchain file it might point to running macOS version
-unset(CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
+if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10)
+endif()
-set(CMAKE_OSX_SYSROOT iphoneos)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
diff --git a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
index a79741069..ab31387cd 100644
--- a/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeInstallIOS.cmake
@@ -2,11 +2,8 @@ cmake_minimum_required(VERSION 2.8.5)
project(XcodeInstallIOS)
-set(CMAKE_OSX_SYSROOT iphoneos)
set(XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
-set(CMAKE_OSX_ARCHITECTURES "armv7;i386")
-
add_library(foo STATIC foo.cpp)
install(TARGETS foo ARCHIVE DESTINATION lib)
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt
new file mode 100644
index 000000000..1bd7f495b
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt
@@ -0,0 +1 @@
+install(CODE "message(STATUS \"exclude\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt
new file mode 100644
index 000000000..7d76ed959
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt
@@ -0,0 +1,4 @@
+^-- Install configuration: "[^\n]*"
+-- Install component: "Unspecified"
+-- sub
+-- top$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt
new file mode 100644
index 000000000..35b0bb5e1
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt
@@ -0,0 +1,3 @@
+^-- Install configuration: "[^\n]*"
+-- sub
+-- top$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake
new file mode 100644
index 000000000..56c1b81f7
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake
@@ -0,0 +1,3 @@
+add_subdirectory(CMP0082)
+add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
+install(CODE "message(STATUS \"top\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt
new file mode 100644
index 000000000..8f26c248e
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(sub)
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt
new file mode 100644
index 000000000..91a8936dc
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt
@@ -0,0 +1 @@
+install(CODE "message(STATUS \"sub\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt
new file mode 100644
index 000000000..52a066504
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_subdirectory(sub)
+install(CODE "message(STATUS \"top\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt
new file mode 100644
index 000000000..91a8936dc
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt
@@ -0,0 +1 @@
+install(CODE "message(STATUS \"sub\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt
new file mode 100644
index 000000000..4b39789f7
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt
@@ -0,0 +1,4 @@
+^-- Install configuration: "[^\n]*"
+-- Install component: "Unspecified"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt
new file mode 100644
index 000000000..8f3a5f71d
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt
@@ -0,0 +1,3 @@
+^-- Install configuration: "[^\n]*"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake
new file mode 100644
index 000000000..56c1b81f7
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake
@@ -0,0 +1,3 @@
+add_subdirectory(CMP0082)
+add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
+install(CODE "message(STATUS \"top\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt
new file mode 100644
index 000000000..4b39789f7
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt
@@ -0,0 +1,4 @@
+^-- Install configuration: "[^\n]*"
+-- Install component: "Unspecified"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt
new file mode 100644
index 000000000..8f3a5f71d
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt
@@ -0,0 +1,3 @@
+^-- Install configuration: "[^\n]*"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt
new file mode 100644
index 000000000..3624c43a4
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt
@@ -0,0 +1,7 @@
+CMake Warning \(dev\) in CMakeLists\.txt:
+ Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are
+ interleaved with those in caller\. Run "cmake --help-policy CMP0082" for
+ policy details\. Use the cmake_policy command to set the policy and
+ suppress this warning\.
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake
new file mode 100644
index 000000000..df5688af3
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake
@@ -0,0 +1,2 @@
+add_subdirectory(CMP0082-Nested)
+install(CODE "message(STATUS \"top\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt
new file mode 100644
index 000000000..4b39789f7
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt
@@ -0,0 +1,4 @@
+^-- Install configuration: "[^\n]*"
+-- Install component: "Unspecified"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt
new file mode 100644
index 000000000..8f3a5f71d
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt
@@ -0,0 +1,3 @@
+^-- Install configuration: "[^\n]*"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt
new file mode 100644
index 000000000..93629053b
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt
@@ -0,0 +1,7 @@
+CMake Warning \(dev\) in CMP0082-NestedSub/CMakeLists\.txt:
+ Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are
+ interleaved with those in caller\. Run "cmake --help-policy CMP0082" for
+ policy details\. Use the cmake_policy command to set the policy and
+ suppress this warning\.
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake
new file mode 100644
index 000000000..88a0856a6
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake
@@ -0,0 +1 @@
+add_subdirectory(CMP0082-NestedSub)
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt
new file mode 100644
index 000000000..f7a331df2
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt
@@ -0,0 +1,3 @@
+^-- Install configuration: "[^\n]*"
+-- Install component: "Unspecified"
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt
new file mode 100644
index 000000000..6f22ae24d
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt
@@ -0,0 +1,2 @@
+^-- Install configuration: "[^\n]*"
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake
new file mode 100644
index 000000000..70bc9edf1
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake
@@ -0,0 +1 @@
+add_subdirectory(CMP0082)
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt
new file mode 100644
index 000000000..157ab37e2
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt
@@ -0,0 +1,3 @@
+^-- Install configuration: "[^\n]*"
+-- Install component: "Unspecified"
+-- top$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt
new file mode 100644
index 000000000..9e15872bd
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt
@@ -0,0 +1,2 @@
+^-- Install configuration: "[^\n]*"
+-- top$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake
new file mode 100644
index 000000000..670f89b04
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake
@@ -0,0 +1,2 @@
+add_subdirectory(CMP0082-None)
+install(CODE "message(STATUS \"top\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt
new file mode 100644
index 000000000..4b39789f7
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt
@@ -0,0 +1,4 @@
+^-- Install configuration: "[^\n]*"
+-- Install component: "Unspecified"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt
new file mode 100644
index 000000000..8f3a5f71d
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt
@@ -0,0 +1,3 @@
+^-- Install configuration: "[^\n]*"
+-- top
+-- sub$
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt
new file mode 100644
index 000000000..3624c43a4
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt
@@ -0,0 +1,7 @@
+CMake Warning \(dev\) in CMakeLists\.txt:
+ Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are
+ interleaved with those in caller\. Run "cmake --help-policy CMP0082" for
+ policy details\. Use the cmake_policy command to set the policy and
+ suppress this warning\.
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake
new file mode 100644
index 000000000..56c1b81f7
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake
@@ -0,0 +1,3 @@
+add_subdirectory(CMP0082)
+add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
+install(CODE "message(STATUS \"top\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt
new file mode 100644
index 000000000..91a8936dc
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt
@@ -0,0 +1 @@
+install(CODE "message(STATUS \"sub\")")
diff --git a/Tests/RunCMake/add_subdirectory/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMakeLists.txt
index 18dfd2686..47d249cce 100644
--- a/Tests/RunCMake/add_subdirectory/CMakeLists.txt
+++ b/Tests/RunCMake/add_subdirectory/CMakeLists.txt
@@ -1,3 +1,10 @@
cmake_minimum_required(VERSION 3.2)
+
+# Have to set policy here due to policy scope
+if(DEFINED CMP0082_VALUE)
+ cmake_policy(SET CMP0082 "${CMP0082_VALUE}")
+endif()
+set(CMAKE_POLICY_WARNING_CMP0082 ON)
+
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt
index 369a956e6..013058111 100644
--- a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt
+++ b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt
@@ -2,4 +2,4 @@
add_subdirectory given source "DoesNotExist" which is not an existing
directory.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
index b1df6b04f..9e6462bf4 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
@@ -1,4 +1,20 @@
add_library(bar STATIC bar.cpp)
add_library(foo STATIC foo.cpp)
+
+add_library(baz STATIC foo.cpp)
+set_target_properties(baz PROPERTIES EXCLUDE_FROM_ALL OFF)
+
+file(GENERATE
+ OUTPUT "${CMAKE_BINARY_DIR}/main.txt"
+ CONTENT "$<TARGET_FILE_NAME:main>")
+
+file(GENERATE
+ OUTPUT "${CMAKE_BINARY_DIR}/bar.txt"
+ CONTENT "$<TARGET_FILE_NAME:bar>")
+
+file(GENERATE
+ OUTPUT "${CMAKE_BINARY_DIR}/baz.txt"
+ CONTENT "$<TARGET_FILE_NAME:baz>")
+
target_include_directories(foo PUBLIC .)
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
new file mode 100644
index 000000000..14ec4827f
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
@@ -0,0 +1,44 @@
+# Use globbing to check if exes / libs were built because determining
+# exactly where these files will live inside a CMake -P script is
+# pretty challenging.
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/main.txt" main_exe)
+file(READ "${RunCMake_TEST_BINARY_DIR}/bar.txt" bar_lib)
+file(READ "${RunCMake_TEST_BINARY_DIR}/baz.txt" baz_lib)
+
+set(found_main FALSE)
+file(GLOB_RECURSE files
+ LIST_DIRECTORIES FALSE
+ RELATIVE "${RunCMake_TEST_BINARY_DIR}"
+ "${RunCMake_TEST_BINARY_DIR}/*")
+foreach (file IN LISTS files)
+ if (file MATCHES "${main_exe}")
+ set(found_main TRUE)
+ endif()
+endforeach()
+if (NOT found_main)
+ set(RunCMake_TEST_FAILED "'main' missing from ${RunCMake_TEST_BINARY_DIR}")
+endif()
+
+set(found_bar FALSE)
+set(found_baz FALSE)
+file(GLOB_RECURSE files
+ LIST_DIRECTORIES FALSE
+ RELATIVE "${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll"
+ "${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll/*")
+foreach (file IN LISTS files)
+ if (file MATCHES "${bar_lib}")
+ set(found_bar TRUE)
+ endif()
+ if (file MATCHES "${baz_lib}")
+ set(found_baz TRUE)
+ endif()
+endforeach()
+if (found_bar)
+ set(RunCMake_TEST_FAILED
+ "'bar' was not excluded from ${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll")
+endif()
+if (NOT found_baz)
+ set(RunCMake_TEST_FAILED
+ "'baz' missing from ${RunCMake_TEST_BINARY_DIR}/ExcludeFromAll")
+endif()
diff --git a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt
index aba06755a..dd831406e 100644
--- a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt
+++ b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt
@@ -5,4 +5,4 @@
does not contain a CMakeLists.txt file.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
index 88b928308..781e48371 100644
--- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake
@@ -4,6 +4,28 @@ run_cmake(DoesNotExist)
run_cmake(Missing)
run_cmake(Function)
+macro(run_cmake_install case)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS ${ARGN})
+
+ run_cmake(${case})
+ run_cmake_command(${case}-install ${CMAKE_COMMAND} -P cmake_install.cmake)
+ run_cmake_command(${case}-install-component ${CMAKE_COMMAND} -DCOMPONENT=Unspecified -P cmake_install.cmake)
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_OPTIONS)
+endmacro()
+
+run_cmake_install(CMP0082-WARN)
+run_cmake_install(CMP0082-WARN-Nested)
+run_cmake_install(CMP0082-WARN-NestedSub)
+run_cmake_install(CMP0082-WARN-None)
+run_cmake_install(CMP0082-WARN-NoTopInstall)
+run_cmake_install(CMP0082-OLD -DCMP0082_VALUE=OLD)
+run_cmake_install(CMP0082-NEW -DCMP0082_VALUE=NEW)
+
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ExcludeFromAll-build)
set(RunCMake_TEST_NO_CLEAN 1)
@@ -11,6 +33,7 @@ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
run_cmake(ExcludeFromAll)
+set(RunCMake-check-file ExcludeFromAll/check.cmake)
run_cmake_command(ExcludeFromAll-build ${CMAKE_COMMAND} --build .)
unset(RunCMake_TEST_BINARY_DIR)
diff --git a/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt b/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt
index 2e59d99ec..cc9085fee 100644
--- a/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt
+++ b/Tests/RunCMake/ctest_build/BuildQuiet-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_build/BuildQuiet
Build directory: .*/Tests/RunCMake/ctest_build/BuildQuiet-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_build/BuildQuiet/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use Experimental tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_build/CTestConfig.cmake.in b/Tests/RunCMake/ctest_build/CTestConfig.cmake.in
deleted file mode 100644
index 097f82c17..000000000
--- a/Tests/RunCMake/ctest_build/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestBuild@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_cmake_error/CTestConfig.cmake.in b/Tests/RunCMake/ctest_cmake_error/CTestConfig.cmake.in
deleted file mode 100644
index 1f679d5d0..000000000
--- a/Tests/RunCMake/ctest_cmake_error/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestCoverage@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_configure/CTestConfig.cmake.in b/Tests/RunCMake/ctest_configure/CTestConfig.cmake.in
deleted file mode 100644
index 7e30ab933..000000000
--- a/Tests/RunCMake/ctest_configure/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestConfigure@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt b/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt
index 015644d81..98f5a4cd4 100644
--- a/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt
+++ b/Tests/RunCMake/ctest_configure/ConfigureQuiet-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_configure/ConfigureQuiet
Build directory: .*/Tests/RunCMake/ctest_configure/ConfigureQuiet-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_configure/ConfigureQuiet/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use Experimental tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_coverage/CTestConfig.cmake.in b/Tests/RunCMake/ctest_coverage/CTestConfig.cmake.in
deleted file mode 100644
index 1f679d5d0..000000000
--- a/Tests/RunCMake/ctest_coverage/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestCoverage@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in
deleted file mode 100644
index c0d7e425f..000000000
--- a/Tests/RunCMake/ctest_disabled_test/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_fixtures/CTestConfig.cmake.in b/Tests/RunCMake/ctest_fixtures/CTestConfig.cmake.in
deleted file mode 100644
index 982356266..000000000
--- a/Tests/RunCMake/ctest_fixtures/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestTestFixtures.@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in
index 1e1905b1b..5d8353068 100644
--- a/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestConfig.cmake.in
@@ -1,2 +1 @@
-set(CTEST_PROJECT_NAME "CTestLabelsForSubprojects@CASE_NAME@")
@CTEST_EXTRA_CONFIG@
diff --git a/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in b/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in
index 6d4a718d0..53bdd20c8 100644
--- a/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in
+++ b/Tests/RunCMake/ctest_memcheck/CTestConfig.cmake.in
@@ -1,9 +1,6 @@
-set (CTEST_PROJECT_NAME "CTestTestMemcheck@CASE_NAME@")
set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
-set (CTEST_DART_SERVER_VERSION "2")
set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=PublicDashboard")
-set(CTEST_DROP_SITE_CDASH TRUE)
@CTEST_EXTRA_CONFIG@
diff --git a/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in
deleted file mode 100644
index c0d7e425f..000000000
--- a/Tests/RunCMake/ctest_skipped_test/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt
index bc9a4c89e..78f36a1a5 100644
--- a/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendDifferentModel-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/AppendDifferentModel
Build directory: .*/Tests/RunCMake/ctest_start/AppendDifferentModel-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendDifferentModel/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use existing tag: 19551112-2204 - ContinuousTrack
diff --git a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt
index ab1c1f79d..25085ef26 100644
--- a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt
@@ -2,7 +2,6 @@ Run dashboard with to-be-determined model
Source directory: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack
Build directory: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack-build
Track: ExperimentalDifferent
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use existing tag: 19551112-2204 - ExperimentalDifferent
diff --git a/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt b/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt
index 55f2d8e72..578062959 100644
--- a/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Continuous
Source directory: .*/Tests/RunCMake/ctest_start/AppendNoMatchingTrack
Build directory: .*/Tests/RunCMake/ctest_start/AppendNoMatchingTrack-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendNoMatchingTrack/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use existing tag: 19551112-2204 - SomeWeirdTrackName
diff --git a/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt
index f909a4446..bcd01256b 100644
--- a/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendNoModel-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with to-be-determined model
Source directory: .*/Tests/RunCMake/ctest_start/AppendNoModel
Build directory: .*/Tests/RunCMake/ctest_start/AppendNoModel-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendNoModel/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use existing tag: 19551112-2204 - ContinuousTrack
diff --git a/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt b/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt
index 0660f5def..e58cd9c66 100644
--- a/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendOldContinuous-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Continuous
Source directory: .*/Tests/RunCMake/ctest_start/AppendOldContinuous
Build directory: .*/Tests/RunCMake/ctest_start/AppendOldContinuous-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendOldContinuous/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use existing tag: 19551112-2204 - ContinuousTrack
diff --git a/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt
index 0bdf9e417..47331e637 100644
--- a/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendOldNoModel-stdout.txt
@@ -1,6 +1,5 @@
Run dashboard with to-be-determined model
Source directory: .*/Tests/RunCMake/ctest_start/AppendOldNoModel
Build directory: .*/Tests/RunCMake/ctest_start/AppendOldNoModel-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendOldNoModel/CTestConfig.cmake
Site: test-site
Build name: test-build-name
diff --git a/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt b/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt
index 4f43626aa..3abd51e0f 100644
--- a/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendSameModel-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Continuous
Source directory: .*/Tests/RunCMake/ctest_start/AppendSameModel
Build directory: .*/Tests/RunCMake/ctest_start/AppendSameModel-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/AppendSameModel/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use existing tag: 19551112-2204 - ContinuousTrack
diff --git a/Tests/RunCMake/ctest_start/CTestConfig.cmake.in b/Tests/RunCMake/ctest_start/CTestConfig.cmake.in
deleted file mode 100644
index e75d14fc2..000000000
--- a/Tests/RunCMake/ctest_start/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestStart@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt b/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt
index 7e94b8a12..f4a0ba37a 100644
--- a/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt
+++ b/Tests/RunCMake/ctest_start/ConfigInBuild-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/ConfigInBuild
Build directory: .*/Tests/RunCMake/ctest_start/ConfigInBuild-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/ConfigInBuild-build/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use Experimental tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt b/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt
index c3903726a..5f98b4e31 100644
--- a/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt
+++ b/Tests/RunCMake/ctest_start/ConfigInSource-stdout.txt
@@ -1,7 +1,6 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/ConfigInSource
Build directory: .*/Tests/RunCMake/ctest_start/ConfigInSource-build
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/ConfigInSource/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use Experimental tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
index 4a6f1e989..20a29beb9 100644
--- a/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
+++ b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
@@ -2,7 +2,6 @@ Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack
Build directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-build
Track: ExperimentalDifferent
- Reading ctest configuration file: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack/CTestConfig.cmake
Site: test-site
Build name: test-build-name
Use ExperimentalDifferent tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
index 9b57b1be6..905ad0003 100644
--- a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
@@ -48,8 +48,6 @@ function(run_ConfigInBuild)
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
- configure_file(${RunCMake_SOURCE_DIR}/CTestConfig.cmake.in
- ${RunCMake_BINARY_DIR}/ConfigInBuild-build/CTestConfig.cmake @ONLY)
run_ctest_start(ConfigInBuild Experimental)
endfunction()
run_ConfigInBuild()
diff --git a/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in b/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in
index 378a85a0c..140e4be35 100644
--- a/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in
+++ b/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in
@@ -1,4 +1,3 @@
-set(CTEST_PROJECT_NAME "CTestSubmit@CASE_NAME@")
# Intentionally leave out other upload-related CTestConfig.cmake settings
# so that any ctest_submit calls fail with an error message.
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt
deleted file mode 100644
index 00a60ac91..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-cp-stderr.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Missing arguments for submit via cp:
-.*
- Problems when submitting via CP
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt
deleted file mode 100644
index fa6e0042c..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-cp-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-Submit files \(using cp\)
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt
deleted file mode 100644
index b9d9394fb..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stderr.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*)
- Problems when submitting via FTP
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt
deleted file mode 100644
index 345bb62b1..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-ftp-stdout.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Submit files \(using ftp\)
- Using FTP submit method
- Drop site: ftp://
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-http-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-http-stdout.txt
index c7f35c5ff..c9111b0cf 100644
--- a/Tests/RunCMake/ctest_submit/FailDrop-http-stdout.txt
+++ b/Tests/RunCMake/ctest_submit/FailDrop-http-stdout.txt
@@ -1,3 +1,2 @@
-Submit files \(using http\)
- Using HTTP submit method
- Drop site:http://
+Submit files
+ SubmitURL: http://-no-site-
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-https-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-https-stdout.txt
index 19f82347b..2c67eb9db 100644
--- a/Tests/RunCMake/ctest_submit/FailDrop-https-stdout.txt
+++ b/Tests/RunCMake/ctest_submit/FailDrop-https-stdout.txt
@@ -1,3 +1,2 @@
-Submit files \(using https\)
- Using HTTP submit method
- Drop site:https://
+Submit files
+ SubmitURL: https://-no-site-
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt
deleted file mode 100644
index ef671499e..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
- Problems when submitting via SCP
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt
deleted file mode 100644
index ec2ce92be..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-scp-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-Submit files \(using scp\)
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt
deleted file mode 100644
index c0f718e76..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
- (Problems when submitting via XML-RPC|Submission method "xmlrpc" not compiled into CTest!)
diff --git a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt b/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt
deleted file mode 100644
index ed2acb53c..000000000
--- a/Tests/RunCMake/ctest_submit/FailDrop-xmlrpc-stdout.txt
+++ /dev/null
@@ -1 +0,0 @@
-Submit files \(using xmlrpc\)
diff --git a/Tests/RunCMake/ctest_submit/PARTSDone-result.txt b/Tests/RunCMake/ctest_submit/PARTSDone-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_submit/PARTSDone-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt b/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt
new file mode 100644
index 000000000..0020a0fe3
--- /dev/null
+++ b/Tests/RunCMake/ctest_submit/PARTSDone-stderr.txt
@@ -0,0 +1,3 @@
+ *Error when uploading file: .*/Done.xml
+ *Error message was: ([Cc]ould *n.t resolve host:? '?-no-site-'?.*|The requested URL returned error:.*)
+ *Problems when submitting via HTTP
diff --git a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
index 952368d83..4d7d29bad 100644
--- a/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_submit/RunCMakeTest.cmake
@@ -24,6 +24,7 @@ run_ctest_submit(BadFILES FILES bad-file)
run_ctest_submit(RepeatRETURN_VALUE RETURN_VALUE res RETURN_VALUE res)
run_ctest_submit(PARTSCDashUpload PARTS Configure CDASH_UPLOAD)
run_ctest_submit(PARTSCDashUploadType PARTS Configure CDASH_UPLOAD_TYPE)
+run_ctest_submit(PARTSDone PARTS Done)
run_ctest_submit(CDashUploadPARTS CDASH_UPLOAD bad-upload PARTS)
run_ctest_submit(CDashUploadFILES CDASH_UPLOAD bad-upload FILES)
run_ctest_submit(CDashUploadNone CDASH_UPLOAD)
@@ -48,9 +49,5 @@ function(run_ctest_submit_FailDrop CASE_DROP_METHOD)
run_ctest(FailDrop-${CASE_DROP_METHOD})
endfunction()
-run_ctest_submit_FailDrop(cp)
-run_ctest_submit_FailDrop(ftp)
run_ctest_submit_FailDrop(http)
run_ctest_submit_FailDrop(https)
-run_ctest_submit_FailDrop(scp)
-run_ctest_submit_FailDrop(xmlrpc)
diff --git a/Tests/RunCMake/ctest_test/CTestConfig.cmake.in b/Tests/RunCMake/ctest_test/CTestConfig.cmake.in
deleted file mode 100644
index 90044198e..000000000
--- a/Tests/RunCMake/ctest_test/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestTest@CASE_NAME@")
diff --git a/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in b/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in
deleted file mode 100644
index 52665a8b8..000000000
--- a/Tests/RunCMake/ctest_upload/CTestConfig.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-set(CTEST_PROJECT_NAME "CTestUpload@CASE_NAME@")
diff --git a/Tests/RunCMake/file/CREATE_LINK-COPY_ON_ERROR.cmake b/Tests/RunCMake/file/CREATE_LINK-COPY_ON_ERROR.cmake
new file mode 100644
index 000000000..777ef4e6c
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-COPY_ON_ERROR.cmake
@@ -0,0 +1,11 @@
+# Use COPY_ON_ERROR to handle the case where the source and destination
+# directory are on different devices. Cross-device links are not permitted
+# and the following command falls back to copying the file if link fails.
+file(CREATE_LINK
+ ${CMAKE_CURRENT_LIST_FILE} TestCreateLink.cmake
+ RESULT result
+ COPY_ON_ERROR
+ )
+if(NOT result STREQUAL "0")
+ message(SEND_ERROR "COPY_ON_ERROR failed: '${result}'")
+endif()
diff --git a/Tests/RunCMake/file/CREATE_LINK-SYMBOLIC-noexist.cmake b/Tests/RunCMake/file/CREATE_LINK-SYMBOLIC-noexist.cmake
new file mode 100644
index 000000000..61aaf388f
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-SYMBOLIC-noexist.cmake
@@ -0,0 +1,4 @@
+file(CREATE_LINK does_not_exist.txt TestSymLink.txt RESULT sym_result SYMBOLIC)
+if(NOT sym_result STREQUAL "0")
+ message("Symlink fail: ${sym_result}")
+endif()
diff --git a/Tests/RunCMake/file/CREATE_LINK-SYMBOLIC.cmake b/Tests/RunCMake/file/CREATE_LINK-SYMBOLIC.cmake
new file mode 100644
index 000000000..77b899cff
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-SYMBOLIC.cmake
@@ -0,0 +1,4 @@
+file(CREATE_LINK ${CMAKE_CURRENT_LIST_FILE} TestSymLink.cmake RESULT sym_result SYMBOLIC)
+if(NOT sym_result STREQUAL "0")
+ message(SEND_ERROR "Symlink result='${sym_result}'")
+endif()
diff --git a/Tests/RunCMake/file/CREATE_LINK-noarg-result.txt b/Tests/RunCMake/file/CREATE_LINK-noarg-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-noarg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/CREATE_LINK-noarg-stderr.txt b/Tests/RunCMake/file/CREATE_LINK-noarg-stderr.txt
new file mode 100644
index 000000000..12494f845
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-noarg-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CREATE_LINK-noarg\.cmake:[0-9]+ \(file\):
+ file CREATE_LINK must be called with at least two additional arguments
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/file/CREATE_LINK-noarg.cmake b/Tests/RunCMake/file/CREATE_LINK-noarg.cmake
new file mode 100644
index 000000000..65002fa77
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-noarg.cmake
@@ -0,0 +1 @@
+file(CREATE_LINK ${CMAKE_CURRENT_LIST_FILE})
diff --git a/Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt b/Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt
new file mode 100644
index 000000000..97eee4fef
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-noexist-stderr.txt
@@ -0,0 +1 @@
+Hard link error: Cannot hard link 'does_not_exist.txt' as it does not exist.
diff --git a/Tests/RunCMake/file/CREATE_LINK-noexist.cmake b/Tests/RunCMake/file/CREATE_LINK-noexist.cmake
new file mode 100644
index 000000000..5ee258017
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK-noexist.cmake
@@ -0,0 +1,4 @@
+file(CREATE_LINK does_not_exist.txt TestLink.txt RESULT result)
+if(NOT result STREQUAL "0")
+ message("Hard link error: ${result}")
+endif()
diff --git a/Tests/RunCMake/file/CREATE_LINK.cmake b/Tests/RunCMake/file/CREATE_LINK.cmake
new file mode 100644
index 000000000..ca616468a
--- /dev/null
+++ b/Tests/RunCMake/file/CREATE_LINK.cmake
@@ -0,0 +1,11 @@
+# start with a file in the same directory to avoid cross-device links
+set(test_file ${CMAKE_CURRENT_BINARY_DIR}/CreateLinkTest.txt)
+file(TOUCH ${test_file})
+
+file(CREATE_LINK
+ ${test_file} ${CMAKE_CURRENT_BINARY_DIR}/TestCreateLink.txt
+ RESULT result
+ )
+if(NOT result STREQUAL "0")
+ message(SEND_ERROR "Hard link result='${result}'")
+endif()
diff --git a/Tests/RunCMake/file/FileOpenFailRead-stderr.txt b/Tests/RunCMake/file/FileOpenFailRead-stderr.txt
index 23d4337f4..9f8cee26a 100644
--- a/Tests/RunCMake/file/FileOpenFailRead-stderr.txt
+++ b/Tests/RunCMake/file/FileOpenFailRead-stderr.txt
@@ -3,4 +3,4 @@ CMake Error at FileOpenFailRead.cmake:[0-9]+ \(file\):
.*/Tests/RunCMake/file/does_not_exist/file.txt
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt
index 557b817bb..bb7e4d2cc 100644
--- a/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt
+++ b/Tests/RunCMake/file/INSTALL-MESSAGE-bad-stderr.txt
@@ -2,31 +2,31 @@ CMake Error at INSTALL-MESSAGE-bad.cmake:1 \(file\):
file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are
mutually exclusive.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
CMake Error at INSTALL-MESSAGE-bad.cmake:2 \(file\):
file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are
mutually exclusive.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
CMake Error at INSTALL-MESSAGE-bad.cmake:3 \(file\):
file INSTALL options MESSAGE_ALWAYS, MESSAGE_LAZY, and MESSAGE_NEVER are
mutually exclusive.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
CMake Error at INSTALL-MESSAGE-bad.cmake:4 \(file\):
file option MESSAGE_ALWAYS may not appear after PATTERN or REGEX.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
CMake Error at INSTALL-MESSAGE-bad.cmake:5 \(file\):
file option MESSAGE_LAZY may not appear after PATTERN or REGEX.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
CMake Error at INSTALL-MESSAGE-bad.cmake:6 \(file\):
file option MESSAGE_NEVER may not appear after PATTERN or REGEX.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt b/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/READ_SYMLINK-noexist-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt b/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt
new file mode 100644
index 000000000..32b3e8525
--- /dev/null
+++ b/Tests/RunCMake/file/READ_SYMLINK-noexist-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at READ_SYMLINK-noexist\.cmake:[0-9]+ \(file\):
+ file READ_SYMLINK requested of path that is not a symlink:
+
+ .*/Tests/RunCMake/file/READ_SYMLINK-noexist-build/rel\.sym
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake b/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake
new file mode 100644
index 000000000..9e57e4ba4
--- /dev/null
+++ b/Tests/RunCMake/file/READ_SYMLINK-noexist.cmake
@@ -0,0 +1 @@
+file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result)
diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt
new file mode 100644
index 000000000..63e32ed67
--- /dev/null
+++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at READ_SYMLINK-notsymlink\.cmake:[0-9]+ \(file\):
+ file READ_SYMLINK requested of path that is not a symlink:
+
+ .*/Tests/RunCMake/file/READ_SYMLINK-notsymlink-build/rel\.sym
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake b/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake
new file mode 100644
index 000000000..a9798b61e
--- /dev/null
+++ b/Tests/RunCMake/file/READ_SYMLINK-notsymlink.cmake
@@ -0,0 +1,2 @@
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" "")
+file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result)
diff --git a/Tests/RunCMake/file/READ_SYMLINK.cmake b/Tests/RunCMake/file/READ_SYMLINK.cmake
new file mode 100644
index 000000000..865a2e931
--- /dev/null
+++ b/Tests/RunCMake/file/READ_SYMLINK.cmake
@@ -0,0 +1,13 @@
+execute_process(COMMAND
+ ${CMAKE_COMMAND} -E create_symlink "test.txt" "${CMAKE_CURRENT_BINARY_DIR}/rel.sym")
+file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/rel.sym" result)
+if(NOT result STREQUAL "test.txt")
+ message(SEND_ERROR "Relative symlink is \"${result}\", should be \"test.txt\"")
+endif()
+
+execute_process(COMMAND
+ ${CMAKE_COMMAND} -E create_symlink "${CMAKE_CURRENT_BINARY_DIR}/test.txt" "${CMAKE_CURRENT_BINARY_DIR}/abs.sym")
+file(READ_SYMLINK "${CMAKE_CURRENT_BINARY_DIR}/abs.sym" result)
+if(NOT result MATCHES "^.*/Tests/RunCMake/file/READ_SYMLINK-build/test\\.txt$")
+ message(SEND_ERROR "Absolute symlink is \"${result}\", should be \"*/Tests/RunCMake/file/READ_SYMLINK-build/test.txt\"")
+endif()
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index b3832301a..128e8f383 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -1,5 +1,9 @@
include(RunCMake)
+run_cmake(CREATE_LINK)
+run_cmake(CREATE_LINK-COPY_ON_ERROR)
+run_cmake(CREATE_LINK-noarg)
+run_cmake(CREATE_LINK-noexist)
run_cmake(DOWNLOAD-hash-mismatch)
run_cmake(DOWNLOAD-unused-argument)
run_cmake(DOWNLOAD-httpheader-not-set)
@@ -36,6 +40,8 @@ run_cmake(READ_ELF)
run_cmake(GLOB)
run_cmake(GLOB_RECURSE)
run_cmake(GLOB_RECURSE-noexp-FOLLOW_SYMLINKS)
+run_cmake(SIZE)
+run_cmake(SIZE-error-does-not-exist)
# tests are valid both for GLOB and GLOB_RECURSE
run_cmake(GLOB-sort-dedup)
@@ -51,8 +57,13 @@ run_cmake_command(GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE ${CMAKE_COMMAND} -P
${RunCMake_SOURCE_DIR}/GLOB-error-CONFIGURE_DEPENDS-SCRIPT_MODE.cmake)
if(NOT WIN32 OR CYGWIN)
+ run_cmake(CREATE_LINK-SYMBOLIC)
+ run_cmake(CREATE_LINK-SYMBOLIC-noexist)
run_cmake(GLOB_RECURSE-cyclic-recursion)
run_cmake(INSTALL-SYMLINK)
+ run_cmake(READ_SYMLINK)
+ run_cmake(READ_SYMLINK-noexist)
+ run_cmake(READ_SYMLINK-notsymlink)
endif()
if(RunCMake_GENERATOR STREQUAL "Ninja")
diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist-result.txt b/Tests/RunCMake/file/SIZE-error-does-not-exist-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/SIZE-error-does-not-exist-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt b/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt
new file mode 100644
index 000000000..842cf8959
--- /dev/null
+++ b/Tests/RunCMake/file/SIZE-error-does-not-exist-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at SIZE-error-does-not-exist.cmake:[0-9]+ \(file\):
+ file SIZE requested of path that is not readable:
+
+ .*/Tests/RunCMake/file/SIZE-error-does-not-exist-build/does-not-exist
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake b/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake
new file mode 100644
index 000000000..ebac737dc
--- /dev/null
+++ b/Tests/RunCMake/file/SIZE-error-does-not-exist.cmake
@@ -0,0 +1,3 @@
+set(file "${CMAKE_CURRENT_BINARY_DIR}/does-not-exist")
+
+file(SIZE "${file}" CALCULATED_SIZE)
diff --git a/Tests/RunCMake/file/SIZE.cmake b/Tests/RunCMake/file/SIZE.cmake
new file mode 100644
index 000000000..4d9dbd2c9
--- /dev/null
+++ b/Tests/RunCMake/file/SIZE.cmake
@@ -0,0 +1,9 @@
+set(file "${CMAKE_CURRENT_BINARY_DIR}/a-test-file")
+
+file(WRITE "${file}" "test")
+
+file(SIZE "${file}" CALCULATED_SIZE)
+
+if (NOT CALCULATED_SIZE EQUAL 4)
+ message(FATAL_ERROR "Unexpected file size")
+endif()
diff --git a/Tests/RunCMake/find_package/CMP0084-NEW-stderr.txt b/Tests/RunCMake/find_package/CMP0084-NEW-stderr.txt
new file mode 100644
index 000000000..280ff8c30
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0084-NEW-stderr.txt
@@ -0,0 +1,20 @@
+^CMake Warning at CMP0084-NEW\.cmake:[0-9]+ \(find_package\):
+ No "FindQt\.cmake" found in CMAKE_MODULE_PATH\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
++
+CMake Warning \(dev\) at CMP0084-NEW\.cmake:[0-9]+ \(find_package\):
+ FindQt\.cmake must either be part of this project itself, in this case
+ adjust CMAKE_MODULE_PATH so that it points to the correct location inside
+ its source tree\.
+
+ Or it must be installed by a package which has already been found via
+ find_package\(\)\. In this case make sure that package has indeed been found
+ and adjust CMAKE_MODULE_PATH to contain the location where that package has
+ installed FindQt\.cmake\. This must be a location provided by that package\.
+ This error in general means that the buildsystem of this project is relying
+ on a Find-module without ensuring that it is actually available\.
+
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/find_package/CMP0084-NEW.cmake b/Tests/RunCMake/find_package/CMP0084-NEW.cmake
new file mode 100644
index 000000000..68fd6cff6
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0084-NEW.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0084 NEW)
+set(_findqt_testing TRUE)
+find_package(Qt MODULE)
+
+if(_findqt_included)
+ message(FATAL_ERROR "FindQt.cmake erroneously included")
+endif()
diff --git a/Tests/RunCMake/find_package/CMP0084-OLD.cmake b/Tests/RunCMake/find_package/CMP0084-OLD.cmake
new file mode 100644
index 000000000..7bd472653
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0084-OLD.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0084 OLD)
+set(_findqt_testing TRUE)
+find_package(Qt MODULE)
+
+if(NOT _findqt_included)
+ message(FATAL_ERROR "FindQt.cmake not included")
+endif()
diff --git a/Tests/RunCMake/find_package/CMP0084-WARN-stderr.txt b/Tests/RunCMake/find_package/CMP0084-WARN-stderr.txt
new file mode 100644
index 000000000..9ecebd3c7
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0084-WARN-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Warning \(dev\) at CMP0084-WARN\.cmake:[0-9]+ \(find_package\):
+ Policy CMP0084 is not set: The FindQt module does not exist for
+ find_package\(\)\. Run "cmake --help-policy CMP0084" for policy details\. Use
+ the cmake_policy command to set the policy and suppress this warning\.
+
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/find_package/CMP0084-WARN.cmake b/Tests/RunCMake/find_package/CMP0084-WARN.cmake
new file mode 100644
index 000000000..4ea22cb5c
--- /dev/null
+++ b/Tests/RunCMake/find_package/CMP0084-WARN.cmake
@@ -0,0 +1,6 @@
+set(_findqt_testing TRUE)
+find_package(Qt MODULE)
+
+if(NOT _findqt_included)
+ message(FATAL_ERROR "FindQt.cmake not included")
+endif()
diff --git a/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake b/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake
new file mode 100644
index 000000000..4496a051c
--- /dev/null
+++ b/Tests/RunCMake/find_package/PackageRoot/ResolvedConfig.cmake
@@ -0,0 +1 @@
+set(Resolved_DIR "${CMAKE_CURRENT_LIST_DIR}")
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index c06840290..066523ec6 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -23,3 +23,9 @@ run_cmake(PolicyPop)
run_cmake(SetFoundFALSE)
run_cmake(WrongVersion)
run_cmake(WrongVersionConfig)
+run_cmake(CMP0084-OLD)
+run_cmake(CMP0084-WARN)
+run_cmake(CMP0084-NEW)
+if(UNIX)
+ run_cmake(SetFoundResolved)
+endif()
diff --git a/Tests/RunCMake/find_package/SetFoundResolved-stderr.txt b/Tests/RunCMake/find_package/SetFoundResolved-stderr.txt
new file mode 100644
index 000000000..ea94be5a9
--- /dev/null
+++ b/Tests/RunCMake/find_package/SetFoundResolved-stderr.txt
@@ -0,0 +1,10 @@
+CMake Warning at SetFoundResolved.cmake:10 \(message\):
+ .*/Tests/RunCMake/find_package/symlink
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Warning at SetFoundResolved.cmake:15 \(message\):
+ .*/Tests/RunCMake/find_package/PackageRoot
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_package/SetFoundResolved.cmake b/Tests/RunCMake/find_package/SetFoundResolved.cmake
new file mode 100644
index 000000000..8d5651357
--- /dev/null
+++ b/Tests/RunCMake/find_package/SetFoundResolved.cmake
@@ -0,0 +1,17 @@
+# Create ./symlink pointing back here.
+execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+ PackageRoot "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
+
+# Make find_package search through the symlink.
+set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
+
+# Test preservation of symlinks.
+find_package(Resolved)
+message(WARNING "${Resolved_DIR}")
+
+# Test resolving symlinks.
+set(CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS ON)
+find_package(Resolved)
+message(WARNING "${Resolved_DIR}")
+
+file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/symlink")
diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
index ac77ac3de..54b858f92 100644
--- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake
+++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
@@ -11,8 +11,10 @@ set(expect_DIRECTORY "/path/to")
set(expect_NAME "filename.ext.in")
set(expect_EXT ".ext.in")
set(expect_NAME_WE "filename")
+set(expect_LAST_EXT ".in")
+set(expect_NAME_WLE "filename.ext")
set(expect_PATH "/path/to")
-foreach(c DIRECTORY NAME EXT NAME_WE PATH)
+foreach(c DIRECTORY NAME EXT NAME_WE LAST_EXT NAME_WLE PATH)
get_filename_component(actual_${c} "${filename}" ${c})
check("${c}" "${actual_${c}}" "${expect_${c}}")
list(APPEND non_cache_vars actual_${c})
diff --git a/Tests/RunCMake/get_property/BadArgument-stderr.txt b/Tests/RunCMake/get_property/BadArgument-stderr.txt
index 37c44775c..ce5a20923 100644
--- a/Tests/RunCMake/get_property/BadArgument-stderr.txt
+++ b/Tests/RunCMake/get_property/BadArgument-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at BadArgument.cmake:1 \(get_property\):
get_property given invalid argument "FOO".
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/BadDirectory-stderr.txt b/Tests/RunCMake/get_property/BadDirectory-stderr.txt
index 98464f8dc..6afec038a 100644
--- a/Tests/RunCMake/get_property/BadDirectory-stderr.txt
+++ b/Tests/RunCMake/get_property/BadDirectory-stderr.txt
@@ -3,4 +3,4 @@
found. This could be because the directory argument was invalid or, it is
valid but has not been processed yet.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/BadScope-stderr.txt b/Tests/RunCMake/get_property/BadScope-stderr.txt
index 4cc32c87b..3084bb7fd 100644
--- a/Tests/RunCMake/get_property/BadScope-stderr.txt
+++ b/Tests/RunCMake/get_property/BadScope-stderr.txt
@@ -2,4 +2,4 @@
get_property given invalid scope FOO. Valid scopes are GLOBAL, DIRECTORY,
TARGET, SOURCE, TEST, VARIABLE, CACHE, INSTALL.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/BadTarget-stderr.txt b/Tests/RunCMake/get_property/BadTarget-stderr.txt
index 45a0df6c9..e85711721 100644
--- a/Tests/RunCMake/get_property/BadTarget-stderr.txt
+++ b/Tests/RunCMake/get_property/BadTarget-stderr.txt
@@ -2,4 +2,4 @@
get_property could not find TARGET FOO. Perhaps it has not yet been
created.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/BadTest-stderr.txt b/Tests/RunCMake/get_property/BadTest-stderr.txt
index 819c0704a..aec9e9e9c 100644
--- a/Tests/RunCMake/get_property/BadTest-stderr.txt
+++ b/Tests/RunCMake/get_property/BadTest-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at BadTest.cmake:1 \(get_property\):
get_property given TEST name that does not exist: FOO
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/GlobalName-stderr.txt b/Tests/RunCMake/get_property/GlobalName-stderr.txt
index a7d4971c2..4ddceb257 100644
--- a/Tests/RunCMake/get_property/GlobalName-stderr.txt
+++ b/Tests/RunCMake/get_property/GlobalName-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at GlobalName.cmake:1 \(get_property\):
get_property given name for GLOBAL scope.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/MissingArgument-stderr.txt b/Tests/RunCMake/get_property/MissingArgument-stderr.txt
index 87227127a..00d3311af 100644
--- a/Tests/RunCMake/get_property/MissingArgument-stderr.txt
+++ b/Tests/RunCMake/get_property/MissingArgument-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at MissingArgument.cmake:1 \(get_property\):
get_property called with incorrect number of arguments
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/NoCache-stderr.txt b/Tests/RunCMake/get_property/NoCache-stderr.txt
index defafb62d..7348cffdb 100644
--- a/Tests/RunCMake/get_property/NoCache-stderr.txt
+++ b/Tests/RunCMake/get_property/NoCache-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at NoCache.cmake:1 \(get_property\):
get_property not given name for CACHE scope.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/NoProperty-stderr.txt b/Tests/RunCMake/get_property/NoProperty-stderr.txt
index 0ef147fdb..79b8c8702 100644
--- a/Tests/RunCMake/get_property/NoProperty-stderr.txt
+++ b/Tests/RunCMake/get_property/NoProperty-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at NoProperty.cmake:1 \(get_property\):
get_property not given a PROPERTY <name> argument.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/NoSource-stderr.txt b/Tests/RunCMake/get_property/NoSource-stderr.txt
index 59fd0add7..cefff4167 100644
--- a/Tests/RunCMake/get_property/NoSource-stderr.txt
+++ b/Tests/RunCMake/get_property/NoSource-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at NoSource.cmake:1 \(get_property\):
get_property not given name for SOURCE scope.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/NoTarget-stderr.txt b/Tests/RunCMake/get_property/NoTarget-stderr.txt
index a0e1a9440..fb1c8f4e8 100644
--- a/Tests/RunCMake/get_property/NoTarget-stderr.txt
+++ b/Tests/RunCMake/get_property/NoTarget-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at NoTarget.cmake:1 \(get_property\):
get_property not given name for TARGET scope.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/NoTest-stderr.txt b/Tests/RunCMake/get_property/NoTest-stderr.txt
index c90a0ffc2..93c3e9821 100644
--- a/Tests/RunCMake/get_property/NoTest-stderr.txt
+++ b/Tests/RunCMake/get_property/NoTest-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at NoTest.cmake:1 \(get_property\):
get_property not given name for TEST scope.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/get_property/VariableName-stderr.txt b/Tests/RunCMake/get_property/VariableName-stderr.txt
index e9f382759..250d920b4 100644
--- a/Tests/RunCMake/get_property/VariableName-stderr.txt
+++ b/Tests/RunCMake/get_property/VariableName-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at VariableName.cmake:1 \(get_property\):
get_property given name for VARIABLE scope.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake
index e9e9cac72..0a2ba63f5 100644
--- a/Tests/RunCMake/include_external_msproject/check_utils.cmake
+++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake
@@ -100,6 +100,8 @@ function(check_project test name guid type platform imported_release_config_name
set(platform "${RunCMake_GENERATOR_PLATFORM}")
elseif("${RunCMake_GENERATOR}" MATCHES "Win64")
set(platform "x64")
+ elseif(VS_PLATFORM_NAME)
+ set(platform "${VS_PLATFORM_NAME}")
else()
set(platform "Win32")
endif()
diff --git a/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt
index cdd33ac0d..698e89ab0 100644
--- a/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt
+++ b/Tests/RunCMake/include_guard/InvalidArgumentsNumber-stderr.txt
@@ -2,4 +2,4 @@ CMake Error at InvalidArgumentsNumber.cmake:1 \(include_guard\):
include_guard given an invalid number of arguments. The command takes at
most 1 argument.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/include_guard/InvalidScope-stderr.txt b/Tests/RunCMake/include_guard/InvalidScope-stderr.txt
index 456709da7..58f62a362 100644
--- a/Tests/RunCMake/include_guard/InvalidScope-stderr.txt
+++ b/Tests/RunCMake/include_guard/InvalidScope-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at InvalidScope.cmake:1 \(include_guard\):
include_guard given an invalid scope: INVALID
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/install/CMP0087-NEW-check.cmake b/Tests/RunCMake/install/CMP0087-NEW-check.cmake
new file mode 100644
index 000000000..422c53202
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-NEW-check.cmake
@@ -0,0 +1,7 @@
+execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
+ OUTPUT_VARIABLE out ERROR_VARIABLE err)
+if(NOT out MATCHES "-- Install configuration: .*-- codegenexlib")
+ string(REGEX REPLACE "\n" "\n " out " ${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "\"-- codegenexlib\" was not found:\n${out}")
+endif()
diff --git a/Tests/RunCMake/install/CMP0087-NEW.cmake b/Tests/RunCMake/install/CMP0087-NEW.cmake
new file mode 100644
index 000000000..01779609c
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-NEW.cmake
@@ -0,0 +1,3 @@
+# Need a new directory scope, not just a new policy scope
+# to test this correctly
+add_subdirectory(CMP0087-NEW)
diff --git a/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt
new file mode 100644
index 000000000..07b4589cf
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-NEW/CMakeLists.txt
@@ -0,0 +1,7 @@
+# Note that it is the policy settings at the end of the directory
+# scope that will be used when deciding whether or not generator
+# expressions should be evaluated in the installed code.
+cmake_policy(VERSION 3.13)
+cmake_policy(SET CMP0087 NEW)
+add_library( codegenexlib INTERFACE )
+install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")")
diff --git a/Tests/RunCMake/install/CMP0087-OLD-check.cmake b/Tests/RunCMake/install/CMP0087-OLD-check.cmake
new file mode 100644
index 000000000..c5984bca7
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-OLD-check.cmake
@@ -0,0 +1,8 @@
+execute_process(COMMAND ${CMAKE_COMMAND} -P ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake
+ OUTPUT_VARIABLE out ERROR_VARIABLE err)
+
+if(NOT out MATCHES "-- Install configuration: .*-- \\$<TARGET_PROPERTY:codegenexlib,NAME>")
+ string(REGEX REPLACE "\n" "\n " out " ${out}")
+ string(APPEND RunCMake_TEST_FAILED
+ "\"-- $<TARGET_PROPERTY:codegenexlib,NAME>\" was not found:\n${out}")
+endif()
diff --git a/Tests/RunCMake/install/CMP0087-OLD.cmake b/Tests/RunCMake/install/CMP0087-OLD.cmake
new file mode 100644
index 000000000..e7ed4ee98
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-OLD.cmake
@@ -0,0 +1,3 @@
+# Need a new directory scope, not just a new policy scope
+# to test this correctly
+add_subdirectory(CMP0087-OLD)
diff --git a/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt
new file mode 100644
index 000000000..b1d4e2e7d
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-OLD/CMakeLists.txt
@@ -0,0 +1,6 @@
+# Note that it is the policy settings at the end of the directory
+# scope that will be used when deciding whether or not generator
+# expressions should be evaluated in the installed code.
+cmake_policy(VERSION 3.13)
+cmake_policy(SET CMP0087 OLD)
+install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")")
diff --git a/Tests/RunCMake/install/CMP0087-WARN-stderr.txt b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt
new file mode 100644
index 000000000..75fbf2c0c
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-WARN-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning (dev) in CMakeLists.txt:
+ Policy CMP0087 is not set: Install CODE|SCRIPT allow the use of generator
+ expressions. Run "cmake --help-policy CMP0087" for policy details. Use
+ the cmake_policy command to set the policy and suppress this warning.
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/install/CMP0087-WARN.cmake b/Tests/RunCMake/install/CMP0087-WARN.cmake
new file mode 100644
index 000000000..3b8513d64
--- /dev/null
+++ b/Tests/RunCMake/install/CMP0087-WARN.cmake
@@ -0,0 +1,2 @@
+add_library( codegenexlib INTERFACE )
+install(CODE "message( STATUS \"$<TARGET_PROPERTY:codegenexlib,NAME>\")")
diff --git a/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-result.txt b/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-stderr.txt b/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-stderr.txt
new file mode 100644
index 000000000..c847c430f
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at DIRECTORY-DESTINATION-TYPE\.cmake:[0-9]+ \(install\):
+ install DIRECTORY given both TYPE and DESTINATION arguments\. You may only
+ specify one\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE.cmake b/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE.cmake
new file mode 100644
index 000000000..4404d6b76
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-TYPE.cmake
@@ -0,0 +1 @@
+install(DIRECTORY dir TYPE BIN DESTINATION mybin)
diff --git a/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt
index 166ba6f04..c8074e96f 100644
--- a/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt
+++ b/Tests/RunCMake/install/DIRECTORY-PATTERN-MESSAGE_NEVER-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at DIRECTORY-PATTERN-MESSAGE_NEVER.cmake:[0-9]+ \(install\):
install DIRECTORY does not allow "MESSAGE_NEVER" after PATTERN or REGEX.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE-Cache-all-check.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE-Cache-all-check.cmake
new file mode 100644
index 000000000..fb393e396
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-TYPE-Cache-all-check.cmake
@@ -0,0 +1,42 @@
+set(_check_files
+ [[mybin]]
+ [[mybin/dir]]
+ [[mybin/dir/empty\.txt]]
+ [[mycom]]
+ [[mycom/dir]]
+ [[mycom/dir/empty\.txt]]
+ [[mydoc]]
+ [[mydoc/dir]]
+ [[mydoc/dir/empty\.txt]]
+ [[myetc]]
+ [[myetc/dir]]
+ [[myetc/dir/empty\.txt]]
+ [[myinclude]]
+ [[myinclude/dir]]
+ [[myinclude/dir/empty\.txt]]
+ [[myinfo]]
+ [[myinfo/dir]]
+ [[myinfo/dir/empty\.txt]]
+ [[mylib]]
+ [[mylib/dir]]
+ [[mylib/dir/empty\.txt]]
+ [[mylocale]]
+ [[mylocale/dir]]
+ [[mylocale/dir/empty\.txt]]
+ [[myman]]
+ [[myman/dir]]
+ [[myman/dir/empty\.txt]]
+ [[myrun]]
+ [[myrun/dir]]
+ [[myrun/dir/empty\.txt]]
+ [[mysbin]]
+ [[mysbin/dir]]
+ [[mysbin/dir/empty\.txt]]
+ [[myshare]]
+ [[myshare/dir]]
+ [[myshare/dir/empty\.txt]]
+ [[myvar]]
+ [[myvar/dir]]
+ [[myvar/dir/empty\.txt]]
+ )
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE-Cache.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE-Cache.cmake
new file mode 100644
index 000000000..53e95f8ee
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-TYPE-Cache.cmake
@@ -0,0 +1,13 @@
+install(DIRECTORY dir TYPE BIN)
+install(DIRECTORY dir TYPE SBIN)
+install(DIRECTORY dir TYPE LIB)
+install(DIRECTORY dir TYPE INCLUDE)
+install(DIRECTORY dir TYPE SYSCONF)
+install(DIRECTORY dir TYPE SHAREDSTATE)
+install(DIRECTORY dir TYPE LOCALSTATE)
+install(DIRECTORY dir TYPE RUNSTATE)
+install(DIRECTORY dir TYPE DATA)
+install(DIRECTORY dir TYPE INFO)
+install(DIRECTORY dir TYPE LOCALE)
+install(DIRECTORY dir TYPE MAN)
+install(DIRECTORY dir TYPE DOC)
diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent-all-check.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent-all-check.cmake
new file mode 100644
index 000000000..03f7bd657
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent-all-check.cmake
@@ -0,0 +1,24 @@
+set(_check_files
+ [[myshare]]
+ [[myshare/dir]]
+ [[myshare/dir/empty\.txt]]
+ [[myshare/doc]]
+ [[myshare/doc/dir]]
+ [[myshare/doc/dir/empty\.txt]]
+ [[myshare/info]]
+ [[myshare/info/dir]]
+ [[myshare/info/dir/empty\.txt]]
+ [[myshare/locale]]
+ [[myshare/locale/dir]]
+ [[myshare/locale/dir/empty\.txt]]
+ [[myshare/man]]
+ [[myshare/man/dir]]
+ [[myshare/man/dir/empty.txt]]
+ [[myvar]]
+ [[myvar/dir]]
+ [[myvar/dir/empty\.txt]]
+ [[myvar/run]]
+ [[myvar/run/dir]]
+ [[myvar/run/dir/empty\.txt]]
+ )
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent.cmake
new file mode 100644
index 000000000..e797abb91
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-TYPE-CacheDependent.cmake
@@ -0,0 +1,7 @@
+install(DIRECTORY dir TYPE LOCALSTATE)
+install(DIRECTORY dir TYPE RUNSTATE)
+install(DIRECTORY dir TYPE DATA)
+install(DIRECTORY dir TYPE INFO)
+install(DIRECTORY dir TYPE LOCALE)
+install(DIRECTORY dir TYPE MAN)
+install(DIRECTORY dir TYPE DOC)
diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake
new file mode 100644
index 000000000..03fa3c832
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-TYPE-all-check.cmake
@@ -0,0 +1,42 @@
+set(_check_files
+ [[bin]]
+ [[bin/dir]]
+ [[bin/dir/empty\.txt]]
+ [[com]]
+ [[com/dir]]
+ [[com/dir/empty\.txt]]
+ [[etc]]
+ [[etc/dir]]
+ [[etc/dir/empty\.txt]]
+ [[include]]
+ [[include/dir]]
+ [[include/dir/empty\.txt]]
+ [[lib]]
+ [[lib/dir]]
+ [[lib/dir/empty\.txt]]
+ [[sbin]]
+ [[sbin/dir]]
+ [[sbin/dir/empty\.txt]]
+ [[share]]
+ [[share/dir]]
+ [[share/dir/empty\.txt]]
+ [[share/doc]]
+ [[share/doc/dir]]
+ [[share/doc/dir/empty\.txt]]
+ [[share/info]]
+ [[share/info/dir]]
+ [[share/info/dir/empty\.txt]]
+ [[share/locale]]
+ [[share/locale/dir]]
+ [[share/locale/dir/empty\.txt]]
+ [[share/man]]
+ [[share/man/dir]]
+ [[share/man/dir/empty\.txt]]
+ [[var]]
+ [[var/dir]]
+ [[var/dir/empty\.txt]]
+ [[var/run]]
+ [[var/run/dir]]
+ [[var/run/dir/empty\.txt]]
+ )
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/DIRECTORY-TYPE.cmake b/Tests/RunCMake/install/DIRECTORY-TYPE.cmake
new file mode 100644
index 000000000..53e95f8ee
--- /dev/null
+++ b/Tests/RunCMake/install/DIRECTORY-TYPE.cmake
@@ -0,0 +1,13 @@
+install(DIRECTORY dir TYPE BIN)
+install(DIRECTORY dir TYPE SBIN)
+install(DIRECTORY dir TYPE LIB)
+install(DIRECTORY dir TYPE INCLUDE)
+install(DIRECTORY dir TYPE SYSCONF)
+install(DIRECTORY dir TYPE SHAREDSTATE)
+install(DIRECTORY dir TYPE LOCALSTATE)
+install(DIRECTORY dir TYPE RUNSTATE)
+install(DIRECTORY dir TYPE DATA)
+install(DIRECTORY dir TYPE INFO)
+install(DIRECTORY dir TYPE LOCALE)
+install(DIRECTORY dir TYPE MAN)
+install(DIRECTORY dir TYPE DOC)
diff --git a/Tests/RunCMake/install/FILES-DESTINATION-TYPE-result.txt b/Tests/RunCMake/install/FILES-DESTINATION-TYPE-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-DESTINATION-TYPE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/FILES-DESTINATION-TYPE-stderr.txt b/Tests/RunCMake/install/FILES-DESTINATION-TYPE-stderr.txt
new file mode 100644
index 000000000..ce8fc2386
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-DESTINATION-TYPE-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at FILES-DESTINATION-TYPE\.cmake:[0-9]+ \(install\):
+ install FILES given both TYPE and DESTINATION arguments\. You may only
+ specify one\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/FILES-DESTINATION-TYPE.cmake b/Tests/RunCMake/install/FILES-DESTINATION-TYPE.cmake
new file mode 100644
index 000000000..576c98f36
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-DESTINATION-TYPE.cmake
@@ -0,0 +1 @@
+install(FILES main.c TYPE BIN DESTINATION mybin)
diff --git a/Tests/RunCMake/install/FILES-TYPE-Cache-all-check.cmake b/Tests/RunCMake/install/FILES-TYPE-Cache-all-check.cmake
new file mode 100644
index 000000000..dfb90cf02
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-TYPE-Cache-all-check.cmake
@@ -0,0 +1,29 @@
+set(_check_files
+ [[mybin]]
+ [[mybin/main\.c]]
+ [[mycom]]
+ [[mycom/main\.c]]
+ [[mydoc]]
+ [[mydoc/main\.c]]
+ [[myetc]]
+ [[myetc/main\.c]]
+ [[myinclude]]
+ [[myinclude/main\.c]]
+ [[myinfo]]
+ [[myinfo/main\.c]]
+ [[mylib]]
+ [[mylib/main\.c]]
+ [[mylocale]]
+ [[mylocale/main\.c]]
+ [[myman]]
+ [[myman/main\.c]]
+ [[myrun]]
+ [[myrun/main\.c]]
+ [[mysbin]]
+ [[mysbin/main\.c]]
+ [[myshare]]
+ [[myshare/main\.c]]
+ [[myvar]]
+ [[myvar/main\.c]]
+ )
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/FILES-TYPE-Cache.cmake b/Tests/RunCMake/install/FILES-TYPE-Cache.cmake
new file mode 100644
index 000000000..2e2bfc7fa
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-TYPE-Cache.cmake
@@ -0,0 +1,13 @@
+install(FILES main.c TYPE BIN)
+install(FILES main.c TYPE SBIN)
+install(FILES main.c TYPE LIB)
+install(FILES main.c TYPE INCLUDE)
+install(FILES main.c TYPE SYSCONF)
+install(FILES main.c TYPE SHAREDSTATE)
+install(FILES main.c TYPE LOCALSTATE)
+install(FILES main.c TYPE RUNSTATE)
+install(FILES main.c TYPE DATA)
+install(FILES main.c TYPE INFO)
+install(FILES main.c TYPE LOCALE)
+install(FILES main.c TYPE MAN)
+install(FILES main.c TYPE DOC)
diff --git a/Tests/RunCMake/install/FILES-TYPE-CacheDependent-all-check.cmake b/Tests/RunCMake/install/FILES-TYPE-CacheDependent-all-check.cmake
new file mode 100644
index 000000000..e58c80ad3
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-TYPE-CacheDependent-all-check.cmake
@@ -0,0 +1,17 @@
+set(_check_files
+ [[myshare]]
+ [[myshare/doc]]
+ [[myshare/doc/main\.c]]
+ [[myshare/info]]
+ [[myshare/info/main\.c]]
+ [[myshare/locale]]
+ [[myshare/locale/main\.c]]
+ [[myshare/main\.c]]
+ [[myshare/man]]
+ [[myshare/man/main\.c]]
+ [[myvar]]
+ [[myvar/main\.c]]
+ [[myvar/run]]
+ [[myvar/run/main\.c]]
+ )
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/FILES-TYPE-CacheDependent.cmake b/Tests/RunCMake/install/FILES-TYPE-CacheDependent.cmake
new file mode 100644
index 000000000..d7d5aaa11
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-TYPE-CacheDependent.cmake
@@ -0,0 +1,7 @@
+install(FILES main.c TYPE LOCALSTATE)
+install(FILES main.c TYPE RUNSTATE)
+install(FILES main.c TYPE DATA)
+install(FILES main.c TYPE INFO)
+install(FILES main.c TYPE LOCALE)
+install(FILES main.c TYPE MAN)
+install(FILES main.c TYPE DOC)
diff --git a/Tests/RunCMake/install/FILES-TYPE-all-check.cmake b/Tests/RunCMake/install/FILES-TYPE-all-check.cmake
new file mode 100644
index 000000000..c4ec66149
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-TYPE-all-check.cmake
@@ -0,0 +1,29 @@
+set(_check_files
+ [[bin]]
+ [[bin/main\.c]]
+ [[com]]
+ [[com/main\.c]]
+ [[etc]]
+ [[etc/main\.c]]
+ [[include]]
+ [[include/main\.c]]
+ [[lib]]
+ [[lib/main\.c]]
+ [[sbin]]
+ [[sbin/main\.c]]
+ [[share]]
+ [[share/doc]]
+ [[share/doc/main\.c]]
+ [[share/info]]
+ [[share/info/main\.c]]
+ [[share/locale]]
+ [[share/locale/main\.c]]
+ [[share/main\.c]]
+ [[share/man]]
+ [[share/man/main\.c]]
+ [[var]]
+ [[var/main\.c]]
+ [[var/run]]
+ [[var/run/main\.c]]
+ )
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/FILES-TYPE.cmake b/Tests/RunCMake/install/FILES-TYPE.cmake
new file mode 100644
index 000000000..2e2bfc7fa
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-TYPE.cmake
@@ -0,0 +1,13 @@
+install(FILES main.c TYPE BIN)
+install(FILES main.c TYPE SBIN)
+install(FILES main.c TYPE LIB)
+install(FILES main.c TYPE INCLUDE)
+install(FILES main.c TYPE SYSCONF)
+install(FILES main.c TYPE SHAREDSTATE)
+install(FILES main.c TYPE LOCALSTATE)
+install(FILES main.c TYPE RUNSTATE)
+install(FILES main.c TYPE DATA)
+install(FILES main.c TYPE INFO)
+install(FILES main.c TYPE LOCALE)
+install(FILES main.c TYPE MAN)
+install(FILES main.c TYPE DOC)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index ec022caa9..c637db151 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -63,8 +63,18 @@ run_cmake(EXPORT-OldIFace)
run_cmake(CMP0062-OLD)
run_cmake(CMP0062-NEW)
run_cmake(CMP0062-WARN)
+run_cmake(CMP0087-OLD)
+run_cmake(CMP0087-NEW)
+run_cmake(CMP0087-WARN)
+run_cmake(TARGETS-ImportedGlobal)
run_cmake(TARGETS-NAMELINK_COMPONENT-bad-all)
run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc)
+run_cmake(FILES-DESTINATION-TYPE)
+run_cmake(DIRECTORY-DESTINATION-TYPE)
+
+if(APPLE)
+ run_cmake(TARGETS-Apple-Defaults)
+endif()
if(NOT RunCMake_GENERATOR STREQUAL "Xcode" OR NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]")
run_install_test(FILES-TARGET_OBJECTS)
@@ -74,6 +84,46 @@ run_install_test(TARGETS-InstallFromSubDir)
run_install_test(TARGETS-OPTIONAL)
run_install_test(FILES-OPTIONAL)
run_install_test(DIRECTORY-OPTIONAL)
+run_install_test(TARGETS-Defaults)
+
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_BINDIR:PATH=mybin"
+ "-DCMAKE_INSTALL_LIBDIR:PATH=mylib"
+ "-DCMAKE_INSTALL_INCLUDEDIR:PATH=myinclude"
+ )
+run_install_test(TARGETS-Defaults-Cache)
+unset(RunCMake_TEST_OPTIONS)
+
+run_install_test(FILES-TYPE)
+run_install_test(DIRECTORY-TYPE)
+
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_BINDIR:PATH=mybin"
+ "-DCMAKE_INSTALL_SBINDIR:PATH=mysbin"
+ "-DCMAKE_INSTALL_LIBEXECDIR:PATH=mylibexec"
+ "-DCMAKE_INSTALL_LIBDIR:PATH=mylib"
+ "-DCMAKE_INSTALL_INCLUDEDIR:PATH=myinclude"
+ "-DCMAKE_INSTALL_SYSCONFDIR:PATH=myetc"
+ "-DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=mycom"
+ "-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=myvar"
+ "-DCMAKE_INSTALL_RUNSTATEDIR:PATH=myrun"
+ "-DCMAKE_INSTALL_DATADIR:PATH=myshare"
+ "-DCMAKE_INSTALL_INFODIR:PATH=myinfo"
+ "-DCMAKE_INSTALL_LOCALEDIR:PATH=mylocale"
+ "-DCMAKE_INSTALL_MANDIR:PATH=myman"
+ "-DCMAKE_INSTALL_DOCDIR:PATH=mydoc"
+ )
+run_install_test(FILES-TYPE-Cache)
+run_install_test(DIRECTORY-TYPE-Cache)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_INSTALL_LOCALSTATEDIR:PATH=myvar"
+ "-DCMAKE_INSTALL_DATAROOTDIR:PATH=myshare"
+ )
+run_install_test(FILES-TYPE-CacheDependent)
+run_install_test(DIRECTORY-TYPE-CacheDependent)
+unset(RunCMake_TEST_OPTIONS)
set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE:STRING=Debug")
run_install_test(TARGETS-OUTPUT_NAME)
diff --git a/Tests/RunCMake/install/TARGETS-Apple-Defaults-result.txt b/Tests/RunCMake/install/TARGETS-Apple-Defaults-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Apple-Defaults-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/TARGETS-Apple-Defaults-stderr.txt b/Tests/RunCMake/install/TARGETS-Apple-Defaults-stderr.txt
new file mode 100644
index 000000000..645882f52
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Apple-Defaults-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at TARGETS-Apple-Defaults\.cmake:[0-9]+ \(install\):
+ install TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
+ target "exe"\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Error at TARGETS-Apple-Defaults\.cmake:[0-9]+ \(install\):
+ install TARGETS given no FRAMEWORK DESTINATION for shared library FRAMEWORK
+ target "lib1"\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/TARGETS-Apple-Defaults.cmake b/Tests/RunCMake/install/TARGETS-Apple-Defaults.cmake
new file mode 100644
index 000000000..b60c31894
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Apple-Defaults.cmake
@@ -0,0 +1,8 @@
+enable_language(C)
+
+add_executable(exe MACOSX_BUNDLE main.c)
+add_library(lib1 SHARED obj1.c)
+set_property(TARGET lib1 PROPERTY FRAMEWORK ON)
+
+install(TARGETS exe)
+install(TARGETS lib1)
diff --git a/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake b/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake
new file mode 100644
index 000000000..57ad6e140
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Defaults-Cache-all-check.cmake
@@ -0,0 +1,49 @@
+if(WIN32)
+ set(_check_files
+ [[lib3]]
+ [[lib3/(lib)?lib3\.(dll\.a|lib)]]
+ [[lib4]]
+ [[lib4/(lib)?lib4\.dll]]
+ [[mybin]]
+ [[mybin/exe\.exe]]
+ [[mybin/(lib)?lib1\.dll]]
+ [[myinclude]]
+ [[myinclude/obj4\.h]]
+ [[myinclude/obj5\.h]]
+ [[mylib]]
+ [[mylib/(lib)?lib1\.(dll\.a|lib)]]
+ [[mylib/(lib)?lib2\.(a|lib)]]
+ )
+elseif(CYGWIN)
+ set(_check_files
+ [[lib3]]
+ [[lib3/liblib3\.dll\.a]]
+ [[lib4]]
+ [[lib4/cyglib4\.dll]]
+ [[mybin]]
+ [[mybin/cyglib1\.dll]]
+ [[mybin/exe\.exe]]
+ [[myinclude]]
+ [[myinclude/obj4\.h]]
+ [[myinclude/obj5\.h]]
+ [[mylib]]
+ [[mylib/liblib1\.dll\.a]]
+ [[mylib/liblib2\.a]]
+ )
+else()
+ set(_check_files
+ [[lib3]]
+ [[lib3/liblib3\.(dylib|so)]]
+ [[lib4]]
+ [[lib4/liblib4\.(dylib|so)]]
+ [[mybin]]
+ [[mybin/exe]]
+ [[myinclude]]
+ [[myinclude/obj4\.h]]
+ [[myinclude/obj5\.h]]
+ [[mylib]]
+ [[mylib/liblib1\.(dylib|so)]]
+ [[mylib/liblib2\.a]]
+ )
+endif()
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/TARGETS-Defaults-Cache.cmake b/Tests/RunCMake/install/TARGETS-Defaults-Cache.cmake
new file mode 100644
index 000000000..bfd8c2c61
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Defaults-Cache.cmake
@@ -0,0 +1,19 @@
+enable_language(C)
+
+add_executable(exe main.c)
+add_library(lib1 SHARED obj1.c)
+add_library(lib2 STATIC obj3.c)
+add_library(lib3 SHARED obj4.c)
+set_property(TARGET lib3 PROPERTY PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj4.h)
+add_library(lib4 SHARED obj5.c)
+set_property(TARGET lib4 PROPERTY PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj5.h)
+
+install(TARGETS exe lib1 lib2)
+install(TARGETS lib3
+ LIBRARY DESTINATION lib3
+ ARCHIVE DESTINATION lib3
+ )
+install(TARGETS lib4
+ LIBRARY DESTINATION lib4
+ RUNTIME DESTINATION lib4
+ )
diff --git a/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
new file mode 100644
index 000000000..c41cb2a75
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Defaults-all-check.cmake
@@ -0,0 +1,49 @@
+if(WIN32)
+ set(_check_files
+ [[bin]]
+ [[bin/exe\.exe]]
+ [[bin/(lib)?lib1\.dll]]
+ [[include]]
+ [[include/obj4\.h]]
+ [[include/obj5\.h]]
+ [[lib]]
+ [[lib/(lib)?lib1\.(dll\.a|lib)]]
+ [[lib/(lib)?lib2\.(a|lib)]]
+ [[lib3]]
+ [[lib3/(lib)?lib3\.(dll\.a|lib)]]
+ [[lib4]]
+ [[lib4/(lib)?lib4\.dll]]
+ )
+elseif(CYGWIN)
+ set(_check_files
+ [[bin]]
+ [[bin/cyglib1\.dll]]
+ [[bin/exe\.exe]]
+ [[include]]
+ [[include/obj4\.h]]
+ [[include/obj5\.h]]
+ [[lib]]
+ [[lib/liblib1\.dll\.a]]
+ [[lib/liblib2\.a]]
+ [[lib3]]
+ [[lib3/liblib3\.dll\.a]]
+ [[lib4]]
+ [[lib4/cyglib4\.dll]]
+ )
+else()
+ set(_check_files
+ [[bin]]
+ [[bin/exe]]
+ [[include]]
+ [[include/obj4\.h]]
+ [[include/obj5\.h]]
+ [[lib]]
+ [[lib/liblib1\.(dylib|so)]]
+ [[lib/liblib2\.a]]
+ [[lib3]]
+ [[lib3/liblib3\.(dylib|so)]]
+ [[lib4]]
+ [[lib4/liblib4\.(dylib|so)]]
+ )
+endif()
+check_installed("^${_check_files}$")
diff --git a/Tests/RunCMake/install/TARGETS-Defaults.cmake b/Tests/RunCMake/install/TARGETS-Defaults.cmake
new file mode 100644
index 000000000..bfd8c2c61
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-Defaults.cmake
@@ -0,0 +1,19 @@
+enable_language(C)
+
+add_executable(exe main.c)
+add_library(lib1 SHARED obj1.c)
+add_library(lib2 STATIC obj3.c)
+add_library(lib3 SHARED obj4.c)
+set_property(TARGET lib3 PROPERTY PRIVATE_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj4.h)
+add_library(lib4 SHARED obj5.c)
+set_property(TARGET lib4 PROPERTY PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/obj5.h)
+
+install(TARGETS exe lib1 lib2)
+install(TARGETS lib3
+ LIBRARY DESTINATION lib3
+ ARCHIVE DESTINATION lib3
+ )
+install(TARGETS lib4
+ LIBRARY DESTINATION lib4
+ RUNTIME DESTINATION lib4
+ )
diff --git a/Tests/RunCMake/install/TARGETS-ImportedGlobal-result.txt b/Tests/RunCMake/install/TARGETS-ImportedGlobal-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-ImportedGlobal-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/TARGETS-ImportedGlobal-stderr.txt b/Tests/RunCMake/install/TARGETS-ImportedGlobal-stderr.txt
new file mode 100644
index 000000000..d67802bb5
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-ImportedGlobal-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at TARGETS-ImportedGlobal.cmake:[0-9]+ \(install\):
+ install TARGETS given target "imported_global" which does not exist.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/TARGETS-ImportedGlobal.cmake b/Tests/RunCMake/install/TARGETS-ImportedGlobal.cmake
new file mode 100644
index 000000000..08c20bd4e
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-ImportedGlobal.cmake
@@ -0,0 +1,3 @@
+add_library(imported_global STATIC IMPORTED GLOBAL)
+set_property(TARGET imported_global PROPERTY IMPORTED_LOCATION /does_not_exist)
+install(TARGETS imported_global DESTINATION bin)
diff --git a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt
index 187a8261d..fe65fd300 100644
--- a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt
+++ b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-all-stderr.txt
@@ -2,4 +2,4 @@
install TARGETS given NAMELINK_COMPONENT option not in LIBRARY group\. The
NAMELINK_COMPONENT option may be specified only following LIBRARY\.
Call Stack \(most recent call first\):
- CMakeLists\.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt
index d1002bac8..60f52c488 100644
--- a/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt
+++ b/Tests/RunCMake/install/TARGETS-NAMELINK_COMPONENT-bad-exc-stderr.txt
@@ -2,4 +2,4 @@
install TARGETS given NAMELINK_COMPONENT option not in LIBRARY group\. The
NAMELINK_COMPONENT option may be specified only following LIBRARY\.
Call Stack \(most recent call first\):
- CMakeLists\.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt b/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt
deleted file mode 100644
index 86e3ec076..000000000
--- a/Tests/RunCMake/install/TARGETS-OPTIONAL-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^WARNING: Target "notall" has EXCLUDE_FROM_ALL set and will not be built by default but an install rule has been provided for it\. CMake does not define behavior for this case\.$
diff --git a/Tests/RunCMake/install/obj3.c b/Tests/RunCMake/install/obj3.c
new file mode 100644
index 000000000..991fed369
--- /dev/null
+++ b/Tests/RunCMake/install/obj3.c
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ int obj3(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/install/obj3.h b/Tests/RunCMake/install/obj3.h
new file mode 100644
index 000000000..9e8bb760a
--- /dev/null
+++ b/Tests/RunCMake/install/obj3.h
@@ -0,0 +1,6 @@
+#ifndef OBJ3_H
+#define OBJ3_H
+
+int obj3(void);
+
+#endif /* OBJ3_H */
diff --git a/Tests/RunCMake/install/obj4.c b/Tests/RunCMake/install/obj4.c
new file mode 100644
index 000000000..edd61725d
--- /dev/null
+++ b/Tests/RunCMake/install/obj4.c
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ int obj4(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/install/obj4.h b/Tests/RunCMake/install/obj4.h
new file mode 100644
index 000000000..6195aa77e
--- /dev/null
+++ b/Tests/RunCMake/install/obj4.h
@@ -0,0 +1,6 @@
+#ifndef OBJ4_H
+#define OBJ4_H
+
+int obj4(void);
+
+#endif /* OBJ4_H */
diff --git a/Tests/RunCMake/install/obj5.c b/Tests/RunCMake/install/obj5.c
new file mode 100644
index 000000000..df3e9973e
--- /dev/null
+++ b/Tests/RunCMake/install/obj5.c
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ int obj5(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/install/obj5.h b/Tests/RunCMake/install/obj5.h
new file mode 100644
index 000000000..a16a1b0c4
--- /dev/null
+++ b/Tests/RunCMake/install/obj5.h
@@ -0,0 +1,6 @@
+#ifndef OBJ5_H
+#define OBJ5_H
+
+int obj5(void);
+
+#endif /* OBJ5_H */
diff --git a/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt b/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt
index b24a0ed0b..9368e880b 100644
--- a/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt
+++ b/Tests/RunCMake/list/EmptyRemoveAt0-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at EmptyRemoveAt0.cmake:2 \(list\):
- list REMOVE_AT given empty list
+ list index: mylist, 0 out of range \(0, 0\)
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-NotList-stderr.txt b/Tests/RunCMake/list/FILTER-NotList-stderr.txt
deleted file mode 100644
index 159c28dd4..000000000
--- a/Tests/RunCMake/list/FILTER-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at FILTER-NotList.cmake:2 \(list\):
- list sub-command FILTER requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/FILTER-NotList.cmake b/Tests/RunCMake/list/FILTER-NotList.cmake
index 1e15635b9..bf09ec74f 100644
--- a/Tests/RunCMake/list/FILTER-NotList.cmake
+++ b/Tests/RunCMake/list/FILTER-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(FILTER nosuchlist EXCLUDE REGEX "^FILTER_THIS_.+")
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(FILTER) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt b/Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/list/REMOVE_AT-EmptyList-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt b/Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt
new file mode 100644
index 000000000..582b74b04
--- /dev/null
+++ b/Tests/RunCMake/list/REMOVE_AT-EmptyList-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at REMOVE_AT-EmptyList.cmake:2 \(list\):
+ list index: nosuchlist, 0 out of range \(0, 0\)
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake b/Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake
new file mode 100644
index 000000000..ff0dde84f
--- /dev/null
+++ b/Tests/RunCMake/list/REMOVE_AT-EmptyList.cmake
@@ -0,0 +1,6 @@
+set(nosuchlist "")
+list(REMOVE_AT nosuchlist 0)
+if (NOT DEFINED nosuchlist OR NOT nosuchlist STREQUAL "")
+ message(FATAL_ERROR
+ "list(REMOVE_AT) modified our list")
+endif ()
diff --git a/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt
index d6e8d85f5..563d865ea 100644
--- a/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt
+++ b/Tests/RunCMake/list/REMOVE_AT-NotList-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at REMOVE_AT-NotList.cmake:2 \(list\):
- list sub-command REMOVE_AT requires list to be present.
+ list index: nosuchlist, 0 out of range \(0, 0\)
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REMOVE_AT-NotList.cmake b/Tests/RunCMake/list/REMOVE_AT-NotList.cmake
index 5266c7fe9..090df4933 100644
--- a/Tests/RunCMake/list/REMOVE_AT-NotList.cmake
+++ b/Tests/RunCMake/list/REMOVE_AT-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(REMOVE_AT nosuchlist 0)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(REMOVE_AT) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt
deleted file mode 100644
index 96f3446ff..000000000
--- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at REMOVE_DUPLICATES-NotList.cmake:2 \(list\):
- list sub-command REMOVE_DUPLICATES requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake
index 218f2272c..b9f399943 100644
--- a/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake
+++ b/Tests/RunCMake/list/REMOVE_DUPLICATES-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(REMOVE_DUPLICATES nosuchlist)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(REMOVE_DUPLICATES) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt b/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt
deleted file mode 100644
index c32a4c055..000000000
--- a/Tests/RunCMake/list/REMOVE_ITEM-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at REMOVE_ITEM-NotList.cmake:2 \(list\):
- list sub-command REMOVE_ITEM requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake b/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake
index 079e7fbce..0c66837c5 100644
--- a/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake
+++ b/Tests/RunCMake/list/REMOVE_ITEM-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(REMOVE_ITEM nosuchlist alpha)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(REMOVE_ITEM) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/REVERSE-NotList-stderr.txt b/Tests/RunCMake/list/REVERSE-NotList-stderr.txt
deleted file mode 100644
index e9dcc06b3..000000000
--- a/Tests/RunCMake/list/REVERSE-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at REVERSE-NotList.cmake:2 \(list\):
- list sub-command REVERSE requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/REVERSE-NotList.cmake b/Tests/RunCMake/list/REVERSE-NotList.cmake
index 977e2ccac..71383294c 100644
--- a/Tests/RunCMake/list/REVERSE-NotList.cmake
+++ b/Tests/RunCMake/list/REVERSE-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(REVERSE nosuchlist)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(REVERSE) created our list")
+endif ()
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
index a8a0b5717..bf3d22db4 100644
--- a/Tests/RunCMake/list/RunCMakeTest.cmake
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -22,6 +22,8 @@ run_cmake(REMOVE_DUPLICATES-TooManyArguments)
run_cmake(REVERSE-TooManyArguments)
run_cmake(SUBLIST-TooManyArguments)
+run_cmake(REMOVE_AT-EmptyList)
+
run_cmake(FILTER-NotList)
run_cmake(REMOVE_AT-NotList)
run_cmake(REMOVE_DUPLICATES-NotList)
diff --git a/Tests/RunCMake/list/SORT-NotList-stderr.txt b/Tests/RunCMake/list/SORT-NotList-stderr.txt
deleted file mode 100644
index 396c5b57d..000000000
--- a/Tests/RunCMake/list/SORT-NotList-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-^CMake Error at SORT-NotList.cmake:2 \(list\):
- list sub-command SORT requires list to be present.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/list/SORT-NotList.cmake b/Tests/RunCMake/list/SORT-NotList.cmake
index 8f48e1043..6314f1493 100644
--- a/Tests/RunCMake/list/SORT-NotList.cmake
+++ b/Tests/RunCMake/list/SORT-NotList.cmake
@@ -1,2 +1,6 @@
unset(nosuchlist)
list(SORT nosuchlist)
+if (DEFINED nosuchlist)
+ message(FATAL_ERROR
+ "list(SORT) created our list")
+endif ()
diff --git a/Tests/RunCMake/pseudo_cppcheck.c b/Tests/RunCMake/pseudo_cppcheck.c
index 75f3cec18..5b1531bb4 100644
--- a/Tests/RunCMake/pseudo_cppcheck.c
+++ b/Tests/RunCMake/pseudo_cppcheck.c
@@ -5,13 +5,16 @@
int main(int argc, char* argv[])
{
int i;
+ int result = 0;
for (i = 1; i < argc; ++i) {
- if (strcmp(argv[i], "-bad") == 0)
- if (strcmp(argv[i], "-bad") == 0) {
- fprintf(stdout, "stdout from bad command line arg '-bad'\n");
- fprintf(stderr, "stderr from bad command line arg '-bad'\n");
- return 1;
- }
+ if (strcmp(argv[i], "-bad") == 0) {
+ fprintf(stdout, "stdout from bad command line arg '-bad'\n");
+ fprintf(stderr, "stderr from bad command line arg '-bad'\n");
+ return 1;
+ } else if (strcmp(argv[i], "-error") == 0) {
+ // The real cppcheck allows to set the exitcode with --error-exitcode
+ result = 5;
+ }
}
fprintf(stderr,
"[/foo/bar.c:2]: (error) Array 'abc[10]' accessed at index 12,"
@@ -31,6 +34,6 @@ int main(int argc, char* argv[])
fprintf(stderr,
"[/foo/bar.c:2]: (information) cannot find all the include "
"files (use --check-config for details)\n");
- // we allow this to return 1 as we ignore it
- return 1;
+
+ return result;
}
diff --git a/Tests/RunCMake/set/ExtraEnvValue-stderr.txt b/Tests/RunCMake/set/ExtraEnvValue-stderr.txt
new file mode 100644
index 000000000..f61f9d287
--- /dev/null
+++ b/Tests/RunCMake/set/ExtraEnvValue-stderr.txt
@@ -0,0 +1,6 @@
+CMake Warning \(dev\) at ExtraEnvValue.cmake:1 \(set\):
+ Only the first value argument is used when setting an environment variable.
+ Argument 'value_2' and later are unused.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/set/ExtraEnvValue.cmake b/Tests/RunCMake/set/ExtraEnvValue.cmake
new file mode 100644
index 000000000..768a6eac2
--- /dev/null
+++ b/Tests/RunCMake/set/ExtraEnvValue.cmake
@@ -0,0 +1 @@
+set (ENV{sample_key} value_1 value_2)
diff --git a/Tests/RunCMake/set/RunCMakeTest.cmake b/Tests/RunCMake/set/RunCMakeTest.cmake
index b8e8cf1f9..b3bd0a480 100644
--- a/Tests/RunCMake/set/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set/RunCMakeTest.cmake
@@ -3,3 +3,5 @@ include(RunCMake)
run_cmake(ParentScope)
run_cmake(ParentPulling)
run_cmake(ParentPullingRecursive)
+run_cmake(UnknownCacheType)
+run_cmake(ExtraEnvValue)
diff --git a/Tests/RunCMake/set/UnknownCacheType-stderr.txt b/Tests/RunCMake/set/UnknownCacheType-stderr.txt
new file mode 100644
index 000000000..6e1c8114a
--- /dev/null
+++ b/Tests/RunCMake/set/UnknownCacheType-stderr.txt
@@ -0,0 +1,5 @@
+CMake Warning \(dev\) at UnknownCacheType.cmake:1 \(set\):
+ implicitly converting 'unknown_type_sample' to 'STRING' type.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/set/UnknownCacheType.cmake b/Tests/RunCMake/set/UnknownCacheType.cmake
new file mode 100644
index 000000000..f2b5d051d
--- /dev/null
+++ b/Tests/RunCMake/set/UnknownCacheType.cmake
@@ -0,0 +1 @@
+set (sample_key sample_value CACHE unknown_type_sample "sample doc")
diff --git a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
index f21b1dee9..e45fc64b1 100644
--- a/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
+++ b/Tests/RunCMake/set_property/IMPORTED_GLOBAL-stderr.txt
@@ -3,7 +3,7 @@
\(\"ImportedGlobalTarget\"\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
CMake Error at IMPORTED_GLOBAL.cmake:16 \(set_property\):
@@ -11,7 +11,7 @@ CMake Error at IMPORTED_GLOBAL.cmake:16 \(set_property\):
\(\"ImportedGlobalTarget\"\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
CMake Error at IMPORTED_GLOBAL.cmake:26 \(set_property\):
@@ -19,7 +19,7 @@ CMake Error at IMPORTED_GLOBAL.cmake:26 \(set_property\):
\(\"ImportedLocalTarget\"\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
CMake Error at IMPORTED_GLOBAL.cmake:32 \(set_property\):
@@ -27,10 +27,10 @@ CMake Error at IMPORTED_GLOBAL.cmake:32 \(set_property\):
\(\"NonImportedTarget\"\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
-CMake Error at IMPORTED_GLOBAL/CMakeLists.txt:8 \(set_property\):
+CMake Error at IMPORTED_GLOBAL/CMakeLists\.txt:[0-9]+ \(set_property\):
Attempt to promote imported target \"ImportedLocalTarget2\" to global scope
\(by setting IMPORTED_GLOBAL\) which is not built in this directory.
@@ -45,7 +45,7 @@ CMake Error at IMPORTED_GLOBAL.cmake:50 \(set_property\):
Attempt to promote imported target \"ImportedSubdirTarget1\" to global scope
\(by setting IMPORTED_GLOBAL\) which is not built in this directory.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
CMake Error in IMPORTED_GLOBAL/CMakeLists.txt:
@@ -58,4 +58,4 @@ CMake Error at IMPORTED_GLOBAL.cmake:52 \(set_property\):
Attempt to promote imported target \"ImportedSubdirTarget2\" to global scope
\(by setting IMPORTED_GLOBAL\) which is not built in this directory.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/string/AppendNoArgs-stderr.txt b/Tests/RunCMake/string/AppendNoArgs-stderr.txt
index 75ad427fd..9b7e9facd 100644
--- a/Tests/RunCMake/string/AppendNoArgs-stderr.txt
+++ b/Tests/RunCMake/string/AppendNoArgs-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at AppendNoArgs.cmake:1 \(string\):
string sub-command APPEND requires at least one argument.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/ConcatNoArgs-stderr.txt b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt
index efea5f1d8..22b608dd7 100644
--- a/Tests/RunCMake/string/ConcatNoArgs-stderr.txt
+++ b/Tests/RunCMake/string/ConcatNoArgs-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at ConcatNoArgs.cmake:1 \(string\):
string sub-command CONCAT requires at least one argument.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/JoinNoArgs-stderr.txt b/Tests/RunCMake/string/JoinNoArgs-stderr.txt
index d9dcec3eb..7fcd3524d 100644
--- a/Tests/RunCMake/string/JoinNoArgs-stderr.txt
+++ b/Tests/RunCMake/string/JoinNoArgs-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at JoinNoArgs.cmake:1 \(string\):
string sub-command JOIN requires at least two arguments.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/JoinNoVar-stderr.txt b/Tests/RunCMake/string/JoinNoVar-stderr.txt
index 90701a96f..b4a09c31c 100644
--- a/Tests/RunCMake/string/JoinNoVar-stderr.txt
+++ b/Tests/RunCMake/string/JoinNoVar-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at JoinNoVar.cmake:1 \(string\):
string sub-command JOIN requires at least two arguments.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/PrependNoArgs-stderr.txt b/Tests/RunCMake/string/PrependNoArgs-stderr.txt
index 8d433f93a..c8acba8f0 100644
--- a/Tests/RunCMake/string/PrependNoArgs-stderr.txt
+++ b/Tests/RunCMake/string/PrependNoArgs-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at PrependNoArgs.cmake:1 \(string\):
string sub-command PREPEND requires at least one argument.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/UuidBadNamespace-stderr.txt b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt
index cb12903e1..340189b9f 100644
--- a/Tests/RunCMake/string/UuidBadNamespace-stderr.txt
+++ b/Tests/RunCMake/string/UuidBadNamespace-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at UuidBadNamespace.cmake:3 \(string\):
string UUID sub-command, malformed NAMESPACE UUID.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/UuidBadType-stderr.txt b/Tests/RunCMake/string/UuidBadType-stderr.txt
index 1993c044a..2734d86a6 100644
--- a/Tests/RunCMake/string/UuidBadType-stderr.txt
+++ b/Tests/RunCMake/string/UuidBadType-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at UuidBadType.cmake:3 \(string\):
string UUID sub-command, unknown TYPE 'FOO'.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt
index 0b7cde463..79819a97d 100644
--- a/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt
+++ b/Tests/RunCMake/string/UuidMissingNameValue-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at UuidMissingNameValue.cmake:3 \(string\):
string UUID sub-command, NAME requires a value.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt
index dfcfe42b2..1ffc53fe0 100644
--- a/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt
+++ b/Tests/RunCMake/string/UuidMissingNamespace-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at UuidMissingNamespace.cmake:3 \(string\):
string UUID sub-command, malformed NAMESPACE UUID.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt
index 86585ad40..2a73d3f0c 100644
--- a/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt
+++ b/Tests/RunCMake/string/UuidMissingNamespaceValue-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at UuidMissingNamespaceValue.cmake:3 \(string\):
string UUID sub-command, NAMESPACE requires a value.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt
index 70252f8cd..44bd479cd 100644
--- a/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt
+++ b/Tests/RunCMake/string/UuidMissingTypeValue-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at UuidMissingTypeValue.cmake:3 \(string\):
string UUID sub-command, TYPE requires a value.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_definitions/CMakeLists.txt b/Tests/RunCMake/target_compile_definitions/CMakeLists.txt
new file mode 100644
index 000000000..14ef56e8e
--- /dev/null
+++ b/Tests/RunCMake/target_compile_definitions/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.11)
+
+project(${RunCMake_TEST} LANGUAGES NONE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
new file mode 100644
index 000000000..b67c5983e
--- /dev/null
+++ b/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_compile_definitions/empty_keyword_args.cmake b/Tests/RunCMake/target_compile_definitions/empty_keyword_args.cmake
new file mode 100644
index 000000000..cb94e87be
--- /dev/null
+++ b/Tests/RunCMake/target_compile_definitions/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_compile_definitions(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_compile_definitions(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
index 1f67f11a0..f8b08094b 100644
--- a/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
@@ -12,3 +12,4 @@ run_cmake(no_matching_cxx_feature)
run_cmake(not_a_c_feature)
run_cmake(no_matching_c_feature)
run_cmake(cxx_not_enabled)
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
index 5ebe170c3..1658f58df 100644
--- a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at alias_target.cmake:[0-9]+ \(target_compile_features\):
target_compile_features can not be used on an ALIAS target.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt b/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt
index 4f707c7b9..5b4761c60 100644
--- a/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/cxx_not_enabled-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at cxx_not_enabled.cmake:[0-9]+ \(target_compile_features\):
target_compile_features cannot use features from non-enabled language CXX
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/target_compile_features/empty_keyword_args.cmake b/Tests/RunCMake/target_compile_features/empty_keyword_args.cmake
new file mode 100644
index 000000000..8d57c1cac
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_compile_features(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_compile_features(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
index afad5374b..f2a1aba9c 100644
--- a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
@@ -2,4 +2,4 @@
target_compile_features may only set INTERFACE properties on INTERFACE
targets
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
index 9917be77a..ee57b5484 100644
--- a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at invalid_args.cmake:[0-9]+ \(target_compile_features\):
target_compile_features called with invalid arguments
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
index 23a8eebac..d6564f4c0 100644
--- a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
@@ -2,4 +2,4 @@ CMake Error at invalid_args_on_interface.cmake:[0-9]+ \(target_compile_features\
target_compile_features may only set INTERFACE properties on INTERFACE
targets
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt
index 1875d1209..07ddd6a55 100644
--- a/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/no_matching_c_feature-stderr.txt
@@ -5,4 +5,4 @@ CMake Error at no_matching_c_feature.cmake:[0-9]+ \((target_compile_features|mes
version 4.8.1.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
index 90d41c957..9392f4b25 100644
--- a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
@@ -5,4 +5,4 @@ CMake Error at no_matching_cxx_feature.cmake:[0-9]+ \((target_compile_features|m
version *[.0-9]+\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/no_target-stderr.txt b/Tests/RunCMake/target_compile_features/no_target-stderr.txt
index 65974b4d6..7b62c947e 100644
--- a/Tests/RunCMake/target_compile_features/no_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/no_target-stderr.txt
@@ -2,4 +2,4 @@ CMake Error at no_target.cmake:[0-9]+ \(target_compile_features\):
Cannot specify compile features for target "main" which is not built by
this project.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt
index 493c5826c..8a4055d07 100644
--- a/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/not_a_c_feature-stderr.txt
@@ -2,4 +2,4 @@ CMake Error at not_a_c_feature.cmake:[0-9]+ \(target_compile_features\):
target_compile_features specified unknown feature "c_not_a_feature" for
target "main".
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
index 3dbf0e654..bd7f2c6b4 100644
--- a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
@@ -2,4 +2,4 @@ CMake Error at not_a_cxx_feature.cmake:[0-9]+ \(target_compile_features\):
target_compile_features specified unknown feature "cxx_not_a_feature" for
target "main".
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
index c0c2efac4..34f1ce222 100644
--- a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at not_enough_args.cmake:[0-9]+ \(target_compile_features\):
target_compile_features called with incorrect number of arguments
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
index ff03310d1..0c01377fa 100644
--- a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
+++ b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at utility_target.cmake:[0-9]+ \(target_compile_features\):
target_compile_features called with non-compilable target type
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_compile_options/CMakeLists.txt b/Tests/RunCMake/target_compile_options/CMakeLists.txt
new file mode 100644
index 000000000..14ef56e8e
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.11)
+
+project(${RunCMake_TEST} LANGUAGES NONE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
new file mode 100644
index 000000000..b67c5983e
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_compile_options/empty_keyword_args.cmake b/Tests/RunCMake/target_compile_options/empty_keyword_args.cmake
new file mode 100644
index 000000000..8b92fcf16
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_compile_options(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_compile_options(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/target_include_directories/CMakeLists.txt b/Tests/RunCMake/target_include_directories/CMakeLists.txt
new file mode 100644
index 000000000..14ef56e8e
--- /dev/null
+++ b/Tests/RunCMake/target_include_directories/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.11)
+
+project(${RunCMake_TEST} LANGUAGES NONE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_include_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_include_directories/RunCMakeTest.cmake
new file mode 100644
index 000000000..b67c5983e
--- /dev/null
+++ b/Tests/RunCMake/target_include_directories/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_include_directories/empty_keyword_args.cmake b/Tests/RunCMake/target_include_directories/empty_keyword_args.cmake
new file mode 100644
index 000000000..08eaf9157
--- /dev/null
+++ b/Tests/RunCMake/target_include_directories/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_include_directories(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_include_directories(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/target_link_directories/CMakeLists.txt b/Tests/RunCMake/target_link_directories/CMakeLists.txt
new file mode 100644
index 000000000..14ef56e8e
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.11)
+
+project(${RunCMake_TEST} LANGUAGES NONE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
new file mode 100644
index 000000000..b67c5983e
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_link_directories/empty_keyword_args.cmake b/Tests/RunCMake/target_link_directories/empty_keyword_args.cmake
new file mode 100644
index 000000000..aadf80a04
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_link_directories(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_link_directories(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt
index 8e3f3153b..12c00fb01 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-2-stderr.txt
@@ -8,4 +8,4 @@ CMake Error at CMP0023-NEW-2.cmake:11 \(target_link_libraries\):
\* CMP0023-NEW-2.cmake:10 \(target_link_libraries\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt
index 2ef229034..117c80614 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-NEW-stderr.txt
@@ -8,4 +8,4 @@ CMake Error at CMP0023-NEW.cmake:11 \(target_link_libraries\):
\* CMP0023-NEW.cmake:10 \(target_link_libraries\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt
index 514786154..7e49d525e 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-2-stderr.txt
@@ -13,4 +13,4 @@ CMake Warning \(dev\) at CMP0023-WARN-2.cmake:9 \(target_link_libraries\):
\* CMP0023-WARN-2.cmake:8 \(target_link_libraries\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt
index a7474fac9..df1288e35 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0023-WARN-stderr.txt
@@ -13,4 +13,4 @@ CMake Warning \(dev\) at CMP0023-WARN.cmake:9 \(target_link_libraries\):
\* CMP0023-WARN.cmake:8 \(target_link_libraries\)
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
index b9fe3f694..8ef35c1dc 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
@@ -3,4 +3,4 @@
found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
an ALIAS target is missing\?
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt
index c6237f461..5b0caf757 100644
--- a/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/MixedSignature-stderr.txt
@@ -2,4 +2,4 @@ CMake Error at MixedSignature.cmake:6 \(target_link_libraries\):
The INTERFACE, PUBLIC or PRIVATE option must appear as the second argument,
just after the target name.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index a041d6d4e..0152d4c67 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -19,3 +19,4 @@ run_cmake(SharedDepNotTarget)
run_cmake(StaticPrivateDepNotExported)
run_cmake(StaticPrivateDepNotTarget)
run_cmake(UNKNOWN-IMPORTED-GLOBAL)
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_link_libraries/empty_keyword_args.cmake b/Tests/RunCMake/target_link_libraries/empty_keyword_args.cmake
new file mode 100644
index 000000000..440fa06b8
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/empty_keyword_args.cmake
@@ -0,0 +1,4 @@
+add_library(iface INTERFACE)
+target_link_libraries(iface PUBLIC PRIVATE INTERFACE)
+add_library(imported UNKNOWN IMPORTED)
+target_link_libraries(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
index 1eaa5d2ff..1d9ef8b4f 100644
--- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
@@ -39,3 +39,5 @@ if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
run_cmake_target(LINKER_expansion LINKER linker)
run_cmake_target(LINKER_expansion LINKER_SHELL linker_shell)
endif()
+
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_link_options/empty_keyword_args.cmake b/Tests/RunCMake/target_link_options/empty_keyword_args.cmake
new file mode 100644
index 000000000..a1a297ef4
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_link_options(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_link_options(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/target_sources/CMakeLists.txt b/Tests/RunCMake/target_sources/CMakeLists.txt
new file mode 100644
index 000000000..14ef56e8e
--- /dev/null
+++ b/Tests/RunCMake/target_sources/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.11)
+
+project(${RunCMake_TEST} LANGUAGES NONE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake
new file mode 100644
index 000000000..b67c5983e
--- /dev/null
+++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(empty_keyword_args)
diff --git a/Tests/RunCMake/target_sources/empty_keyword_args.cmake b/Tests/RunCMake/target_sources/empty_keyword_args.cmake
new file mode 100644
index 000000000..5cee451fd
--- /dev/null
+++ b/Tests/RunCMake/target_sources/empty_keyword_args.cmake
@@ -0,0 +1,5 @@
+add_library(iface INTERFACE)
+target_sources(iface PUBLIC PRIVATE INTERFACE)
+# Cannot be called with non-compilable targets.
+#add_library(imported UNKNOWN IMPORTED)
+#target_sources(imported PUBLIC PRIVATE INTERFACE)
diff --git a/Tests/RunCMake/try_compile/LinkOptions.cmake b/Tests/RunCMake/try_compile/LinkOptions.cmake
new file mode 100644
index 000000000..9b246c400
--- /dev/null
+++ b/Tests/RunCMake/try_compile/LinkOptions.cmake
@@ -0,0 +1,38 @@
+
+enable_language(C)
+
+cmake_policy(SET CMP0054 NEW)
+
+set (lib_name "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lib${CMAKE_STATIC_LIBRARY_SUFFIX}")
+if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ if (RunCMake_C_COMPILER_ID STREQUAL "MSVC")
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set (undef_flag /INCLUDE:_func)
+ else()
+ set (undef_flag /INCLUDE:func)
+ endif()
+ else()
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set (undef_flag -u _func)
+ else()
+ set (undef_flag -u func)
+ endif()
+ endif()
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ set (undef_flag -u _func)
+else()
+ set (undef_flag -u func)
+endif()
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib.c
+ COPY_FILE "${lib_name}")
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/main.c
+ OUTPUT_VARIABLE out
+ LINK_OPTIONS ${undef_flag} "${lib_name}")
+
+if(NOT result)
+ message(FATAL_ERROR "try_compile(... LINK_OPTIONS ...) failed:\n${out}")
+endif()
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 6a1bc64c0..77fb7a0f3 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -25,6 +25,13 @@ run_cmake(TargetTypeExe)
run_cmake(TargetTypeInvalid)
run_cmake(TargetTypeStatic)
+if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$" AND
+ CMAKE_C_COMPILER_ID MATCHES "^(MSVC|GNU|Clang|AppleClang)$")
+ set (RunCMake_TEST_OPTIONS -DRunCMake_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
+ run_cmake(LinkOptions)
+ unset (RunCMake_TEST_OPTIONS)
+endif()
+
if(CMAKE_C_STANDARD_DEFAULT)
run_cmake(CStandard)
elseif(DEFINED CMAKE_C_STANDARD_DEFAULT)
diff --git a/Tests/RunCMake/try_compile/lib.c b/Tests/RunCMake/try_compile/lib.c
new file mode 100644
index 000000000..b00c576c7
--- /dev/null
+++ b/Tests/RunCMake/try_compile/lib.c
@@ -0,0 +1,4 @@
+
+void func()
+{
+}
diff --git a/Tests/RunCMake/try_compile/main.c b/Tests/RunCMake/try_compile/main.c
new file mode 100644
index 000000000..2128ead9d
--- /dev/null
+++ b/Tests/RunCMake/try_compile/main.c
@@ -0,0 +1,8 @@
+extern void func();
+
+int main(void)
+{
+ func();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/try_run/LinkOptions.cmake b/Tests/RunCMake/try_run/LinkOptions.cmake
new file mode 100644
index 000000000..17af2f7d9
--- /dev/null
+++ b/Tests/RunCMake/try_run/LinkOptions.cmake
@@ -0,0 +1,42 @@
+
+enable_language(C)
+
+cmake_policy(SET CMP0054 NEW)
+
+set (lib_name "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lib${CMAKE_STATIC_LIBRARY_SUFFIX}")
+if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ if (RunCMake_C_COMPILER_ID STREQUAL "MSVC")
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set (undef_flag /INCLUDE:_func)
+ else()
+ set (undef_flag /INCLUDE:func)
+ endif()
+ else()
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set (undef_flag -u _func)
+ else()
+ set (undef_flag -u func)
+ endif()
+ endif()
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ set (undef_flag -u _func)
+else()
+ set (undef_flag -u func)
+endif()
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib.c
+ COPY_FILE "${lib_name}")
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
+try_run(run_result compile_result ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/main.c
+ COMPILE_OUTPUT_VARIABLE compile_out
+ RUN_OUTPUT_VARIABLE run_out
+ LINK_OPTIONS ${undef_flag} "${lib_name}")
+
+if(NOT compile_result)
+ message(FATAL_ERROR "try_run(... LINK_OPTIONS ...) compilation failed:\n${compile_out}")
+endif()
+if(run_result STREQUAL "FAILED_TO_RUN")
+ message(FATAL_ERROR "try_run(... LINK_OPTIONS ...) execution failed:\n${run_out}")
+endif()
diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake b/Tests/RunCMake/try_run/RunCMakeTest.cmake
index 1ec9a55aa..368956295 100644
--- a/Tests/RunCMake/try_run/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake
@@ -1,3 +1,10 @@
include(RunCMake)
run_cmake(BadLinkLibraries)
+
+if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$" AND
+ CMAKE_C_COMPILER_ID MATCHES "^(MSVC|GNU|Clang|AppleClang)$")
+ set (RunCMake_TEST_OPTIONS -DRunCMake_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
+ run_cmake(LinkOptions)
+ unset (RunCMake_TEST_OPTIONS)
+endif()
diff --git a/Tests/RunCMake/try_run/lib.c b/Tests/RunCMake/try_run/lib.c
new file mode 100644
index 000000000..b00c576c7
--- /dev/null
+++ b/Tests/RunCMake/try_run/lib.c
@@ -0,0 +1,4 @@
+
+void func()
+{
+}
diff --git a/Tests/RunCMake/try_run/main.c b/Tests/RunCMake/try_run/main.c
new file mode 100644
index 000000000..2128ead9d
--- /dev/null
+++ b/Tests/RunCMake/try_run/main.c
@@ -0,0 +1,8 @@
+extern void func();
+
+int main(void)
+{
+ func();
+
+ return 0;
+}
diff --git a/Tests/Server/cmakelib.py b/Tests/Server/cmakelib.py
index edb5af676..546ae4cc5 100644
--- a/Tests/Server/cmakelib.py
+++ b/Tests/Server/cmakelib.py
@@ -276,6 +276,10 @@ def validateGlobalSettings(cmakeCommand, cmakeCommandPath, data):
index = cmakeoutput.index('\nGenerators\n\n')
cmakeGenerators = []
for line in cmakeoutput[index + 12:].splitlines():
+ if not line:
+ continue
+ if line[0] == '*': # default generator marker
+ line = ' ' + line[1:]
if not line.startswith(' '):
continue
if line.startswith(' '):
diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt
index 40c265e5f..0d45db85c 100644
--- a/Tests/SubDirSpaces/CMakeLists.txt
+++ b/Tests/SubDirSpaces/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6)
project(SUBDIR)
# Some systems do not seem to support rpath with spaces.
-if(CMAKE_SYSTEM_NAME MATCHES "IRIX|QNX")
+if(CMAKE_SYSTEM_NAME MATCHES "QNX")
set(CMAKE_SKIP_BUILD_RPATH 1)
endif()
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index cf4463ccf..e5f858803 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.3)
project(SwiftOnly Swift)
-if(NOT XCODE_VERSION VERSION_LESS 8.0)
+if(NOT XCODE_VERSION VERSION_LESS 10.2)
+ set(CMAKE_Swift_LANGUAGE_VERSION 5.0)
+elseif(NOT XCODE_VERSION VERSION_LESS 8.0)
set(CMAKE_Swift_LANGUAGE_VERSION 3.0)
endif()
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 184a7be5c..54e96a208 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -165,6 +165,35 @@ try_compile(TEST_INNER
OUTPUT_VARIABLE output)
TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}")
+try_compile(COMPILE_DEFINITIONS_LIST_EXPANDED
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/check_a_b.c
+ OUTPUT_VARIABLE output
+ COMPILE_DEFINITIONS "-DDEF_A;-DDEF_B"
+ )
+if(COMPILE_DEFINITIONS_LIST_EXPANDED)
+ message(STATUS "COMPILE_DEFINITIONS list expanded correctly")
+else()
+ string(REPLACE "\n" "\n " output " ${output}")
+ message(SEND_ERROR "COMPILE_DEFINITIONS list did not expand correctly\n${output}")
+endif()
+
+try_compile(SHOULD_FAIL_DUE_TO_BAD_SOURCE
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/pass.c
+ OUTPUT_VARIABLE output
+ COMPILE_DEFINITIONS "bad#source.c"
+ )
+if(SHOULD_FAIL_DUE_TO_BAD_SOURCE AND NOT CMAKE_GENERATOR MATCHES "Watcom WMake|NMake Makefiles")
+ string(REPLACE "\n" "\n " output " ${output}")
+ message(SEND_ERROR "try_compile with bad#source.c did not fail:\n${output}")
+elseif(NOT output MATCHES [[(bad#source\.c|bad\\)]])
+ string(REPLACE "\n" "\n " output " ${output}")
+ message(SEND_ERROR "try_compile with bad#source.c failed without mentioning bad source:\n${output}")
+else()
+ message(STATUS "try_compile with bad#source.c correctly failed")
+endif()
+
add_executable(TryCompile pass.c)
######################################
diff --git a/Tests/TryCompile/check_a_b.c b/Tests/TryCompile/check_a_b.c
new file mode 100644
index 000000000..05fba0f82
--- /dev/null
+++ b/Tests/TryCompile/check_a_b.c
@@ -0,0 +1,10 @@
+#ifndef DEF_A
+# error DEF_A not defined
+#endif
+#ifndef DEF_B
+# error DEF_B not defined
+#endif
+int main()
+{
+ return 0;
+}
diff --git a/Tests/Tutorial/Complete/CMakeLists.txt b/Tests/Tutorial/Complete/CMakeLists.txt
new file mode 100644
index 000000000..9658e6536
--- /dev/null
+++ b/Tests/Tutorial/Complete/CMakeLists.txt
@@ -0,0 +1,116 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+if(APPLE)
+ set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
+elseif(UNIX)
+ set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
+endif()
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
+
+# install the configuration targets
+install(EXPORT MathFunctionsTargets
+ FILE MathFunctionsTargets.cmake
+ DESTINATION lib/cmake/MathFunctions
+)
+
+include(CMakePackageConfigHelpers)
+# generate the config file that is includes the exports
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+# generate the version file for the config file
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
+ VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
+ COMPATIBILITY AnyNewerVersion
+)
+
+# install the configuration file
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+# generate the export targets for the build tree
+# needs to be after the install(TARGETS ) command
+export(EXPORT MathFunctionsTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
+)
diff --git a/Tests/Tutorial/Complete/Config.cmake.in b/Tests/Tutorial/Complete/Config.cmake.in
new file mode 100644
index 000000000..17cbabd99
--- /dev/null
+++ b/Tests/Tutorial/Complete/Config.cmake.in
@@ -0,0 +1,4 @@
+
+@PACKAGE_INIT@
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
diff --git a/Tests/Tutorial/Step6/License.txt b/Tests/Tutorial/Complete/License.txt
index 673d72453..c62d00b9e 100644
--- a/Tests/Tutorial/Step6/License.txt
+++ b/Tests/Tutorial/Complete/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tests/Tutorial/Step6...
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt
new file mode 100644
index 000000000..161ad6449
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt
@@ -0,0 +1,68 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
+
+# define the symbol stating we are using the declspec(dllexport) when
+# building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+# setup the version numbering
+set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
+set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
+
+install(TARGETS MathFunctions
+ DESTINATION lib
+ EXPORT MathFunctionsTargets)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx
new file mode 100644
index 000000000..ee585568c
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx
new file mode 100644
index 000000000..5351184be
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h
new file mode 100644
index 000000000..3fb547b4a
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx
new file mode 100644
index 000000000..96d94212d
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.h b/Tests/Tutorial/Complete/MathFunctions/mysqrt.h
new file mode 100644
index 000000000..e1c42ef0c
--- /dev/null
+++ b/Tests/Tutorial/Complete/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Complete/TutorialConfig.h.in b/Tests/Tutorial/Complete/TutorialConfig.h.in
new file mode 100644
index 000000000..8cd2fc9c6
--- /dev/null
+++ b/Tests/Tutorial/Complete/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Complete/tutorial.cxx b/Tests/Tutorial/Complete/tutorial.cxx
new file mode 100644
index 000000000..443d19555
--- /dev/null
+++ b/Tests/Tutorial/Complete/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Consumer/CMakeLists.txt b/Tests/Tutorial/Consumer/CMakeLists.txt
new file mode 100644
index 000000000..4033b4da8
--- /dev/null
+++ b/Tests/Tutorial/Consumer/CMakeLists.txt
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.3)
+
+if(NOT DEFINED CMAKE_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
+endif()
+
+
+function(find_external_dependency name)
+ set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
+ mark_as_advanced(${name}_DIR)
+ find_package(${name} PATHS ${${name}_ROOT} REQUIRED)
+endfunction()
+
+
+project(Consumer)
+
+find_external_dependency(MathFunctions)
+
+add_library(consumer consumer.cxx)
+target_link_libraries(consumer PUBLIC MathFunctions)
+
+# install the consumer library
+install(TARGETS consumer DESTINATION bin EXPORT ConsumerTargets)
+
+# install the configuration targets
+install(EXPORT ConsumerTargets
+ FILE ConsumerTargets.cmake
+ DESTINATION lib/cmake/Consumer
+)
+
+include(CMakePackageConfigHelpers)
+# generate the config file that is includes the exports
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+
+# install the configuration file
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake
+ DESTINATION lib/cmake/Consumer
+ )
+
+# generate the export targets for the build tree
+# needs to be after the install(TARGETS ) command
+export(EXPORT ConsumerTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/ConsumerTargets.cmake"
+)
diff --git a/Tests/Tutorial/Consumer/Config.cmake.in b/Tests/Tutorial/Consumer/Config.cmake.in
new file mode 100644
index 000000000..0b3f1e4ef
--- /dev/null
+++ b/Tests/Tutorial/Consumer/Config.cmake.in
@@ -0,0 +1,14 @@
+
+@PACKAGE_INIT@
+
+include(CMakeFindDependencyMacro)
+
+function(find_external_dependency name)
+ set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
+ mark_as_advanced(${name}_DIR)
+ find_dependency(${name} PATHS ${${name}_ROOT} REQUIRED)
+endfunction()
+
+find_external_dependency(MathFunctions)
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/ConsumerTargets.cmake" )
diff --git a/Tests/Tutorial/Consumer/consumer.cxx b/Tests/Tutorial/Consumer/consumer.cxx
new file mode 100644
index 000000000..ae7877b5a
--- /dev/null
+++ b/Tests/Tutorial/Consumer/consumer.cxx
@@ -0,0 +1,11 @@
+// A simple function that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+
+double string_square_root(std::string const& value)
+{
+ return mathfunctions::sqrt(std::stod(value));
+}
diff --git a/Tests/Tutorial/Consumer/directions.txt b/Tests/Tutorial/Consumer/directions.txt
new file mode 100644
index 000000000..6a70aab5e
--- /dev/null
+++ b/Tests/Tutorial/Consumer/directions.txt
@@ -0,0 +1,6 @@
+# Import a CMake Project#
+
+This examples shows how a project can find other CMake packages that
+generated Config.cmake files.
+
+It also shows how to state a projects external dependencies when generating a Config.cmake.
diff --git a/Tests/Tutorial/MultiPackage/CMakeLists.txt b/Tests/Tutorial/MultiPackage/CMakeLists.txt
new file mode 100644
index 000000000..067e80729
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/CMakeLists.txt
@@ -0,0 +1,109 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control how we mark up Debug libraries compared to Release libraries
+set(CMAKE_DEBUG_POSTFIX "-d")
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
+
+# install the configuration targets
+install(EXPORT MathFunctionsTargets
+ FILE MathFunctionsTargets.cmake
+ DESTINATION lib/cmake/MathFunctions
+)
+
+include(CMakePackageConfigHelpers)
+# generate the config file that is includes the exports
+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+# generate the version file for the config file
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
+ VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
+ COMPATIBILITY AnyNewerVersion
+)
+
+# install the configuration file
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+# generate the export targets for the build tree
+# needs to be after the install(TARGETS ) command
+export(EXPORT MathFunctionsTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
+)
diff --git a/Tests/Tutorial/MultiPackage/Config.cmake.in b/Tests/Tutorial/MultiPackage/Config.cmake.in
new file mode 100644
index 000000000..17cbabd99
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/Config.cmake.in
@@ -0,0 +1,4 @@
+
+@PACKAGE_INIT@
+
+include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
diff --git a/Tests/Tutorial/MultiPackage/License.txt b/Tests/Tutorial/MultiPackage/License.txt
new file mode 100644
index 000000000..c62d00b9e
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt b/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt
new file mode 100644
index 000000000..161ad6449
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt
@@ -0,0 +1,68 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
+
+# define the symbol stating we are using the declspec(dllexport) when
+# building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+# setup the version numbering
+set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
+set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
+
+install(TARGETS MathFunctions
+ DESTINATION lib
+ EXPORT MathFunctionsTargets)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx
new file mode 100644
index 000000000..ee585568c
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx
new file mode 100644
index 000000000..5351184be
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h
new file mode 100644
index 000000000..3fb547b4a
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx
new file mode 100644
index 000000000..96d94212d
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h
new file mode 100644
index 000000000..e1c42ef0c
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake b/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake
new file mode 100644
index 000000000..403b633e1
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake
@@ -0,0 +1,7 @@
+
+include("release/CPackConfig.cmake")
+
+set(CPACK_INSTALL_CMAKE_PROJECTS
+ "debug;Tutorial;ALL;/"
+ "release;Tutorial;ALL;/"
+ )
diff --git a/Tests/Tutorial/MultiPackage/TutorialConfig.h.in b/Tests/Tutorial/MultiPackage/TutorialConfig.h.in
new file mode 100644
index 000000000..8cd2fc9c6
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/MultiPackage/directions.txt b/Tests/Tutorial/MultiPackage/directions.txt
new file mode 100644
index 000000000..c3102bb10
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/directions.txt
@@ -0,0 +1,34 @@
+# Packaging Debug and Release #
+
+By default CMake is model is that a build directory only contains a single
+configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo.
+
+But it is possible to setup CPack to bundle multiple build directories at the same
+time to build a package that contains multiple configurations of the same project.
+
+First we need to ahead and construct a directory called 'multi_config' this
+will contain all the builds that we want to package together.
+
+Second create a 'debug' and 'release' directory underneath 'multi_config'. At
+the end you should have a layout that looks like:
+
+─ multi_config
+ ├── debug
+ └── release
+
+Now we need to setup debug and release builds, which would roughly entail
+the following:
+
+ cd debug
+ cmake -DCMAKE_BUILD_TYPE=Debug ../../MultiPackage/
+ cmake --build .
+ cd ../release
+ cmake -DCMAKE_BUILD_TYPE=Release ../../MultiPackage/
+ cmake --build .
+ cd ..
+
+
+Now that both the debug and release builds are complete we can now use
+the custom MultiCPackConfig to package both builds into a single release.
+
+ cpack --config ../../MultiPackage/MultiCPackConfig.cmake
diff --git a/Tests/Tutorial/MultiPackage/tutorial.cxx b/Tests/Tutorial/MultiPackage/tutorial.cxx
new file mode 100644
index 000000000..443d19555
--- /dev/null
+++ b/Tests/Tutorial/MultiPackage/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Readme.txt b/Tests/Tutorial/Readme.txt
new file mode 100644
index 000000000..74eb01ae5
--- /dev/null
+++ b/Tests/Tutorial/Readme.txt
@@ -0,0 +1,16 @@
+
+Step 0: A Starting Point
+Step 1: Configure a File and C++11 Controls
+Step 2: Adding a Library
+Step 3: Usage Requirements for Library
+Step 4: Installing and Testing
+Step 5: System Introspection
+Step 6: Custom Command and Generated File
+Step 7: Building an Installer
+Step 8: CDash submission
+Step 9: Mixing Static and Shared
+Step 10: Generator Expressions
+Step 11: Adding Export Configuration
+Complete: End result of Step 11
+Consumer: Example of Import Packages
+MultiPackage: How to package Debug and Release versions
diff --git a/Tests/Tutorial/Step1/CMakeLists.txt b/Tests/Tutorial/Step1/CMakeLists.txt
index e461d3c8b..141f0c27a 100644
--- a/Tests/Tutorial/Step1/CMakeLists.txt
+++ b/Tests/Tutorial/Step1/CMakeLists.txt
@@ -1,20 +1,3 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file (
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories("${PROJECT_BINARY_DIR}")
-
-# add the executable
add_executable(Tutorial tutorial.cxx)
diff --git a/Tests/Tutorial/Step1/directions.txt b/Tests/Tutorial/Step1/directions.txt
new file mode 100644
index 000000000..827d7754d
--- /dev/null
+++ b/Tests/Tutorial/Step1/directions.txt
@@ -0,0 +1,95 @@
+# Adding a Version Number and Configured Header File #
+
+The first feature we will add is to provide our executable and project with a
+version number. While we could do this exclusively in the source code, using
+CMakeLists provides more flexibility.
+
+To add a version number we modify the CMakeLists file as follows:
+
+ cmake_minimum_required(VERSION 3.3)
+ project(Tutorial)
+
+ # the version number.
+ set(Tutorial_VERSION_MAJOR 1)
+ set(Tutorial_VERSION_MINOR 0)
+
+ # configure a header file to pass some of the CMake settings
+ # to the source code
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+ # add the executable
+ add_executable(Tutorial tutorial.cxx)
+
+ # add the binary tree to the search path for include files
+ # so that we will find TutorialConfig.h
+ target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+
+We then create a TutorialConfig.h.in file in the source tree with the
+following contents:
+
+ // the configured options and settings for Tutorial
+ #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+ #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+
+When CMake configures this header file the values for @Tutorial_VERSION_MAJOR@
+and @Tutorial_VERSION_MINOR@ will be replaced by the values from the CMakeLists
+file. Next we modify tutorial.cxx to include the configured header file and to
+make use of the version numbers. The resulting source code is listed below.
+
+ // A simple program that computes the square root of a number
+ #include <cmath>
+ #include <iostream>
+ #include <string>
+ #include <sstream>
+
+ #include "TutorialConfig.h"
+
+ int main (int argc, char *argv[])
+ {
+ if (argc < 2) {
+ std::cout << argv[0] << " Version "
+ << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR
+ << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = atof(argv[1]);
+
+ double outputValue = sqrt(inputValue);
+ std::cout << "The square root of "
+ << inputValue << " is " << outputValue << std::endl;
+ return 0;
+ }
+
+# Adding C++11 support #
+
+Let's add some C++11 features to our project. We will need to explicitly state
+in the CMake code that it should use the correct flags. The easiest way to
+enable C++11 support for CMake is by using the CMAKE_CXX_STANDARD
+and CMAKE_CXX_STANDARD_REQUIRED variables.
+
+First, replace `atof` with `std::stod` in tutorial.cxx.
+
+Then, add the CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED variables to
+the CMakeLists file. The STANADARD value should be set to 11, and REQUIRED
+should be set to True.
+
+
+# Build and Test #
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool
+
+cd to the directory where Tutorial was built (likely the make directory or
+a Debug or Release build configuration subdirectory) and run these commands:
+
+ Tutorial 4294967296
+ Tutorial 10
+ Tutorial
diff --git a/Tests/Tutorial/Step1/tutorial.cxx b/Tests/Tutorial/Step1/tutorial.cxx
index 7a13376cb..f8dd0c6c8 100644
--- a/Tests/Tutorial/Step1/tutorial.cxx
+++ b/Tests/Tutorial/Step1/tutorial.cxx
@@ -1,19 +1,20 @@
// A simple program that computes the square root of a number
-#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cmath>
+#include <cstdlib>
+#include <iostream>
+#include <string>
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
+
double inputValue = atof(argv[1]);
+
double outputValue = sqrt(inputValue);
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step10/CMakeLists.txt b/Tests/Tutorial/Step10/CMakeLists.txt
new file mode 100644
index 000000000..b1d46c4b9
--- /dev/null
+++ b/Tests/Tutorial/Step10/CMakeLists.txt
@@ -0,0 +1,77 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step10/License.txt b/Tests/Tutorial/Step10/License.txt
new file mode 100644
index 000000000..c62d00b9e
--- /dev/null
+++ b/Tests/Tutorial/Step10/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt
new file mode 100644
index 000000000..7a2350572
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt
@@ -0,0 +1,61 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ # state that SqrtLibrary need PIC when the default is shared libraries
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
+ if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(SqrtLibrary
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+ endif()
+
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+# define the symbol stating we are using the declspec(dllexport) when
+# building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx
new file mode 100644
index 000000000..ee585568c
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx
new file mode 100644
index 000000000..5351184be
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h
new file mode 100644
index 000000000..3fb547b4a
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx
new file mode 100644
index 000000000..96d94212d
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.h b/Tests/Tutorial/Step10/MathFunctions/mysqrt.h
new file mode 100644
index 000000000..e1c42ef0c
--- /dev/null
+++ b/Tests/Tutorial/Step10/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Step10/TutorialConfig.h.in b/Tests/Tutorial/Step10/TutorialConfig.h.in
new file mode 100644
index 000000000..8cd2fc9c6
--- /dev/null
+++ b/Tests/Tutorial/Step10/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step10/directions.txt b/Tests/Tutorial/Step10/directions.txt
new file mode 100644
index 000000000..5317b5430
--- /dev/null
+++ b/Tests/Tutorial/Step10/directions.txt
@@ -0,0 +1,38 @@
+# Adding Generator Expressions #
+
+Generator expressions are evaluated during build system generation to produce
+information specific to each build configuration.
+
+Generator expressions are allowed in the context of many target properties, such
+as LINK_LIBRARIES, INCLUDE_DIRECTORIES, COMPILE_DEFINITIONS and others. They may
+also be used when using commands to populate those properties, such as
+target_link_libraries(), target_include_directories(),
+target_compile_definitions() and others.
+
+Generator expressions may to used to enable conditional linking, conditional
+definitions used when compiling, and conditional include directories and more.
+The conditions may be based on the build configuration, target properties,
+platform information or any other queryable information.
+
+There are different types of generator expressions including Logical,
+Informational, and Output expressions.
+
+Logical expressions are used to create conditional output. The basic expressions
+are the 0 and 1 expressions. A "$<0:...>" results in the empty string, and
+"$<1:...>" results in the content of "...". They can also be nested.
+For example:
+
+ if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(SqrtLibrary
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+ endif()
+
+Can be rewritten with generator expressions:
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+
+Note that "${HAVE_LOG}" is evaluated at CMake configure time while
+"$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>" is evaluated at build system generation time.
diff --git a/Tests/Tutorial/Step10/tutorial.cxx b/Tests/Tutorial/Step10/tutorial.cxx
new file mode 100644
index 000000000..443d19555
--- /dev/null
+++ b/Tests/Tutorial/Step10/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Step11/CMakeLists.txt b/Tests/Tutorial/Step11/CMakeLists.txt
new file mode 100644
index 000000000..b1d46c4b9
--- /dev/null
+++ b/Tests/Tutorial/Step11/CMakeLists.txt
@@ -0,0 +1,77 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+# control where the static and shared libraries are built so that on windows
+# we don't need to tinker with the path to run the executable
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library
+add_subdirectory(MathFunctions)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial MathFunctions)
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step11/License.txt b/Tests/Tutorial/Step11/License.txt
new file mode 100644
index 000000000..c62d00b9e
--- /dev/null
+++ b/Tests/Tutorial/Step11/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt
new file mode 100644
index 000000000..760d6a57c
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt
@@ -0,0 +1,60 @@
+
+# add the library that runs
+add_library(MathFunctions MathFunctions.cxx)
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ set_target_properties(SqrtLibrary PROPERTIES
+ POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
+ )
+
+ target_compile_definitions(SqrtLibrary PRIVATE
+ "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
+ "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
+ )
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+endif()
+
+target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
+
+# define the symbol stating we are using the declspec(dllexport) when
+#building on windows
+target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx
new file mode 100644
index 000000000..ee585568c
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx
new file mode 100644
index 000000000..5351184be
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h
new file mode 100644
index 000000000..3fb547b4a
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h
@@ -0,0 +1,14 @@
+
+#if defined(_WIN32)
+# if defined(EXPORTING_MYMATH)
+# define DECLSPEC __declspec(dllexport)
+# else
+# define DECLSPEC __declspec(dllimport)
+# endif
+#else // non windows
+# define DECLSPEC
+#endif
+
+namespace mathfunctions {
+double DECLSPEC sqrt(double x);
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx
new file mode 100644
index 000000000..96d94212d
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx
@@ -0,0 +1,45 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+namespace mathfunctions {
+namespace detail {
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
+}
+}
diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.h b/Tests/Tutorial/Step11/MathFunctions/mysqrt.h
new file mode 100644
index 000000000..e1c42ef0c
--- /dev/null
+++ b/Tests/Tutorial/Step11/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Step11/TutorialConfig.h.in b/Tests/Tutorial/Step11/TutorialConfig.h.in
new file mode 100644
index 000000000..8cd2fc9c6
--- /dev/null
+++ b/Tests/Tutorial/Step11/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step11/directions.txt b/Tests/Tutorial/Step11/directions.txt
new file mode 100644
index 000000000..ebb5defff
--- /dev/null
+++ b/Tests/Tutorial/Step11/directions.txt
@@ -0,0 +1,104 @@
+# Adding Export Configuration #
+
+During Step 4 of the tutorial we added the ability for CMake to install the
+library and headers of the project. During Step 7 we added the ability
+to package up this information so it could be distributed to other people.
+
+The next step is to add the necessary information so that other CMake projects
+can use our project, be it from a build directory, a local install or when
+packaged.
+
+The first step is to update our install(TARGETS) commands to not only specify
+a DESTINATION but also an EXPORT. The EXPORT keyword generates and installs a
+CMake file containing code to import all targets listed in the install command
+from the installation tree. So let's go ahead and explicitly EXPORT the
+MathFunctions library by updating the install command in
+MathFunctions/CMakeLists.txt to look like:
+
+ install(TARGETS MathFunctions DESTINATION lib EXPORT MathFunctionsTargets)
+
+Now that we have MathFunctions being exported, we also need to explicitly install
+the generated MathFunctionsTargets.cmake file. This is done by adding
+the following to the bottom of the top-level CMakeLists.txt:
+
+ # install the configuration targets
+ install(EXPORT MathFunctionsTargets
+ FILE MathFunctionsTargets.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+At this point you should try and run CMake. If everything is setup properly
+you will see that CMake will generate an error that looks like:
+
+ Target "MathFunctions" INTERFACE_INCLUDE_DIRECTORIES property contains
+ path:
+
+ "/Users/robert/Documents/CMakeClass/Tutorial/Step11/MathFunctions"
+
+ which is prefixed in the source directory.
+
+What CMake is trying to say is that during generating the export information
+it will export a path that is intrinsically tied to the current machine and
+will not be valid on other machines. The solution to this is to update the
+MathFunctions target_include_directories to understand that it needs different
+INTERFACE locations when being used from within the build directory and from an
+install / package. This means converting the target_include_directories
+call for MathFunctions to look like:
+
+ target_include_directories(MathFunctions
+ INTERFACE
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+ )
+
+Once this has been updated, we can re-run CMake and see verify that it doesn't
+warn anymore.
+
+At this point, we have CMake properly packaging the target information that is
+required but we will still need to generate a MathFunctionsConfig.cmake, so
+that the CMake find_package command can find our project. So let's go ahead and
+add a new file to the top-level of the project called Config.cmake.in with the
+following contents:
+
+ @PACKAGE_INIT@
+
+ include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
+
+Then, to properly configure and install that file, add the following to the
+bottom of the top-level CMakeLists:
+
+ include(CMakePackageConfigHelpers)
+ # generate the config file that is includes the exports
+ configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
+ INSTALL_DESTINATION "lib/cmake/example"
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
+ # generate the version file for the config file
+ write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
+ VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
+ COMPATIBILITY AnyNewerVersion
+ )
+
+ # install the configuration file
+ install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
+ DESTINATION lib/cmake/MathFunctions
+ )
+
+At this point, we have generated a relocatable CMake Configuration for our project
+that can be used after the project has been installed or packaged. If we want
+our project to also be used from a build directory we only have to add
+the following to the bottom of the top level CMakeLists:
+
+ # generate the export targets for the build tree
+ # needs to be after the install(TARGETS ) command
+ export(EXPORT MathFunctionsTargets
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
+ )
+
+With this export call we now generate a Targets.cmake, allowing the configured
+MathFunctionsConfig.cmake in the build directory to be used by other projects,
+without needing it to be installed.
diff --git a/Tests/Tutorial/Step11/tutorial.cxx b/Tests/Tutorial/Step11/tutorial.cxx
new file mode 100644
index 000000000..376885526
--- /dev/null
+++ b/Tests/Tutorial/Step11/tutorial.cxx
@@ -0,0 +1,25 @@
+// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+ const double outputValue = mathfunctions::sqrt(inputValue);
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Tests/Tutorial/Step2/CMakeLists.txt
index cf1d30ee2..48afaa327 100644
--- a/Tests/Tutorial/Step2/CMakeLists.txt
+++ b/Tests/Tutorial/Step2/CMakeLists.txt
@@ -1,31 +1,25 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+
# add the binary tree to the search path for include files
# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
-# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
-
-# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
diff --git a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
index 2710f9220..7d9379e43 100644
--- a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
@@ -1,5 +1,5 @@
#include "MathFunctions.h"
-#include <stdio.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -8,19 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
- double delta;
- result = x;
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
return result;
}
diff --git a/Tests/Tutorial/Step2/TutorialConfig.h.in b/Tests/Tutorial/Step2/TutorialConfig.h.in
index 25a06020a..5395a0671 100644
--- a/Tests/Tutorial/Step2/TutorialConfig.h.in
+++ b/Tests/Tutorial/Step2/TutorialConfig.h.in
@@ -1,5 +1,4 @@
// the configured options and settings for Tutorial
#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
diff --git a/Tests/Tutorial/Step2/directions.txt b/Tests/Tutorial/Step2/directions.txt
new file mode 100644
index 000000000..bb6662c7e
--- /dev/null
+++ b/Tests/Tutorial/Step2/directions.txt
@@ -0,0 +1,102 @@
+# Adding a Library #
+
+Now we will add a library to our project. This library will contain our own
+implementation for computing the square root of a number. The executable can
+then use this library instead of the standard square root function provided by
+the compiler.
+
+For this tutorial we will put the library into a subdirectory
+called MathFunctions. It will have the following one line CMakeLists file:
+
+ add_library(MathFunctions mysqrt.cxx)
+
+The source file mysqrt.cxx has one function called mysqrt that provides similar
+functionality to the compiler’s sqrt function. To make use of the new library
+we add an add_subdirectory call in the top-level CMakeLists file so that the
+library will get built. We add the new library to the executable, and add the
+MathFunctions as an include directory so that mqsqrt.h header file can be
+found. The last few lines of the top-level CMakeLists file now look like:
+
+
+ add_subdirectory(MathFunctions)
+
+ #add the executable
+ add_executable(Tutorial tutorial.cxx)
+
+ target_link_libraries(Tutorial ${EXTRA_LIBS})
+
+
+Now let us make the MathFunctions library optional. While for the tutorial
+there really isn’t any need to do so, but with larger projects this is a common
+occurrence. The first step is to add an option to the top-level CMakeLists file.
+
+ option (USE_MYMATH
+ "Use tutorial provided math implementation" ON)
+
+This will show up in CMake GUI and ccmake with a default value of ON that can
+be changed by the user. This setting will be stored so that the user does not
+need to set the value each time they run CMake on this build directory.
+
+The next change is to make building and linking the MathFunctions library
+conditional. To do this we change the top-level CMakeLists file to look like
+the following:
+
+ cmake_minimum_required(VERSION 3.3)
+ project(Tutorial)
+
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+ # the version number.
+ set(Tutorial_VERSION_MAJOR 1)
+ set(Tutorial_VERSION_MINOR 0)
+
+ # configure a header file to pass some of the CMake settings
+ # to the source code
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+ # should we use our own math functions
+ option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+ # add the MathFunctions library?
+ if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+ list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
+ endif(USE_MYMATH)
+
+ # add the executable
+ add_executable(Tutorial tutorial.cxx)
+
+ target_link_libraries(Tutorial ${EXTRA_LIBS})
+
+ # add the binary tree to the search path for include files
+ # so that we will find TutorialConfig.h
+ target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ ${EXTRA_INCLUDES}
+ )
+
+Note the use of the variables EXTRA_LIBS, and EXTRA_INCLUDES to collect
+up any optional libraries to later be linked into the executable. This is a
+classic approach when dealing with many optional components, we will cover the
+modern approach in the next step. For now the corresponding changes to the
+source code are fairly straightforward and leave us with:
+
+ #ifdef USE_MYMATH
+ double outputValue = mysqrt(inputValue);
+ #else
+ double outputValue = sqrt(inputValue);
+ #endif
+
+Since the source code now requires USE_MYMATH we can add it to the
+TutorialConfig.h.in. Simply add the following line:
+ #cmakedefine USE_MYMATH
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool and then run the built Tutorial executable.
+
+Which function gives better results, Step1’s sqrt or Step2’s mysqrt?
diff --git a/Tests/Tutorial/Step2/tutorial.cxx b/Tests/Tutorial/Step2/tutorial.cxx
index 37f6ac456..75b7d67b0 100644
--- a/Tests/Tutorial/Step2/tutorial.cxx
+++ b/Tests/Tutorial/Step2/tutorial.cxx
@@ -1,33 +1,23 @@
// A simple program that computes the square root of a number
-#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cmath>
+#include <iostream>
+#include <string>
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
+#include "TutorialConfig.h"
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
-
- if (inputValue >= 0) {
-#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
-#else
- outputValue = sqrt(inputValue);
-#endif
- }
+ double inputValue = std::stod(argv[1]);
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ double outputValue = sqrt(inputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt
index 762302bc5..f904ea748 100644
--- a/Tests/Tutorial/Step3/CMakeLists.txt
+++ b/Tests/Tutorial/Step3/CMakeLists.txt
@@ -1,68 +1,38 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+ list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
+endif(USE_MYMATH)
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
-
-# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
-
-
-# enable testing
-enable_testing ()
-
-# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_executable(Tutorial tutorial.cxx)
-# does it sqrt of 25
-add_test (TutorialComp25 Tutorial 25)
-set_tests_properties (TutorialComp25
- PROPERTIES PASS_REGULAR_EXPRESSION "25 is 5"
- )
-
-# does it handle negative numbers
-add_test (TutorialNegative Tutorial -25)
-set_tests_properties (TutorialNegative
- PROPERTIES PASS_REGULAR_EXPRESSION "-25 is 0"
- )
-
-# does it handle small numbers
-add_test (TutorialSmall Tutorial 0.0001)
-set_tests_properties (TutorialSmall
- PROPERTIES PASS_REGULAR_EXPRESSION "0.0001 is 0.01"
- )
+target_link_libraries(Tutorial ${EXTRA_LIBS})
-# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ ${EXTRA_INCLUDES}
+ )
diff --git a/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
index f386036c3..8b443a659 100644
--- a/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
@@ -1,4 +1 @@
add_library(MathFunctions mysqrt.cxx)
-
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
index 2710f9220..7d9379e43 100644
--- a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
@@ -1,5 +1,5 @@
#include "MathFunctions.h"
-#include <stdio.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -8,19 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
- double delta;
- result = x;
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
return result;
}
diff --git a/Tests/Tutorial/Step3/directions.txt b/Tests/Tutorial/Step3/directions.txt
new file mode 100644
index 000000000..54d031806
--- /dev/null
+++ b/Tests/Tutorial/Step3/directions.txt
@@ -0,0 +1,26 @@
+# Adding Usage Requirements for Library #
+
+Usage requirements allow for far better control over a library / executable's
+link and include line. While also giving more control over the transitive
+property of targets inside CMake. The primary commands that leverage usage
+requirements are:
+
+ - target_compile_definitions
+ - target_compile_options
+ - target_include_directories
+ - target_link_libraries
+
+First up is MathFunctions. We first state that anybody linking to MathFunctions
+needs to include the current source directory, while MathFunctions itself
+doesn't. So this can become an INTERFACE usage requirement.
+
+Remember INTERFACE means things that consumers require but the producer doesn't.
+
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
+
+Now that we've specified usage requirements for MathFunctions we can safely remove
+our uses of the EXTRA_INCLUDES variable.
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool.
diff --git a/Tests/Tutorial/Step3/tutorial.cxx b/Tests/Tutorial/Step3/tutorial.cxx
index 37f6ac456..1d5742d2d 100644
--- a/Tests/Tutorial/Step3/tutorial.cxx
+++ b/Tests/Tutorial/Step3/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt
index 6994aa1ce..34eab5558 100644
--- a/Tests/Tutorial/Step4/CMakeLists.txt
+++ b/Tests/Tutorial/Step4/CMakeLists.txt
@@ -1,68 +1,36 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif(USE_MYMATH)
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
-
-# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
-
-# enable testing
-enable_testing ()
+add_executable(Tutorial tutorial.cxx)
-# does the application run
-add_test (TutorialRuns Tutorial 25)
-
-# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endmacro ()
-
-# do a bunch of result based tests
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
diff --git a/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
index f386036c3..0515852a0 100644
--- a/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
@@ -1,4 +1,7 @@
add_library(MathFunctions mysqrt.cxx)
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
diff --git a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
index 6ca264f76..7d9379e43 100644
--- a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
@@ -1,8 +1,5 @@
#include "MathFunctions.h"
-#include "TutorialConfig.h"
-#include <stdio.h>
-
-#include <math.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -11,26 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
-
-// if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- result = exp(log(x) * 0.5);
- fprintf(stdout, "Computing sqrt of %g to be %g using log\n", x, result);
-#else
- double delta;
- result = x;
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-#endif
return result;
}
diff --git a/Tests/Tutorial/Step4/TutorialConfig.h.in b/Tests/Tutorial/Step4/TutorialConfig.h.in
index a0912656a..25a06020a 100644
--- a/Tests/Tutorial/Step4/TutorialConfig.h.in
+++ b/Tests/Tutorial/Step4/TutorialConfig.h.in
@@ -3,7 +3,3 @@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
#cmakedefine USE_MYMATH
-// does the platform provide exp and log functions?
-#cmakedefine HAVE_LOG
-#cmakedefine HAVE_EXP
-
diff --git a/Tests/Tutorial/Step4/directions.txt b/Tests/Tutorial/Step4/directions.txt
new file mode 100644
index 000000000..91e4043da
--- /dev/null
+++ b/Tests/Tutorial/Step4/directions.txt
@@ -0,0 +1,72 @@
+# Installing and Testing #
+
+Now we can start adding testing support and install rules to our project.
+
+The install rules are fairly simple; for MathFunctions we install the library
+and header file, for the application we install the executable and configured
+header.
+
+So to MathFunctions/CMakeLists.txt we add:
+
+ install (TARGETS MathFunctions DESTINATION bin)
+ install (FILES MathFunctions.h DESTINATION include)
+
+And the to top-level CMakeLists.txt we add:
+
+ install(TARGETS Tutorial DESTINATION bin)
+ install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+That is all that is needed to create a basic local install of the tutorial.
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool. Then build the “install” target by typing 'make install'
+from the command line or build the INSTALL target from an IDE. This will
+install the appropriate header files, libraries, and executables.
+
+Verify that the installed Tutorial runs. Note: The CMake variable
+CMAKE_INSTALL_PREFIX is used to determine the root of where the files will
+be installed.
+
+Next let's test our application. Adding testing is an easy process. At the
+end of the top-level CMakeLists file we can add a number of basic tests to
+verify that the application is working correctly.
+
+ # enable testing
+ enable_testing()
+
+ # does the application run
+ add_test(NAME Runs COMMAND Tutorial 25)
+
+ # does the usage message work?
+ add_test(NAME Usage COMMAND Tutorial)
+ set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+ # define a function to simplify adding tests
+ function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+ endfunction(do_test)
+
+ # do a bunch of result based tests
+ do_test(Tutorial 25 "25 is 5")
+ do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+ do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+The first test simply verifies that the application runs, does not segfault or
+otherwise crash, and has a zero return value. This is the basic form of a CTest
+test.
+
+The Usage test uses a regular expression to verify that the usage message
+is printed when an incorrect number of arguments are provided.
+
+Lastly, we have a function called do_test that simplifies running the
+application and verifying that the computed square root is correct for given
+input.
+
+To run tests, cd to the binary directory and run “ctest -N” and “ctest -VV”.
diff --git a/Tests/Tutorial/Step4/tutorial.cxx b/Tests/Tutorial/Step4/tutorial.cxx
index 37f6ac456..1d5742d2d 100644
--- a/Tests/Tutorial/Step4/tutorial.cxx
+++ b/Tests/Tutorial/Step4/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt
index e40b676b4..63e541056 100644
--- a/Tests/Tutorial/Step5/CMakeLists.txt
+++ b/Tests/Tutorial/Step5/CMakeLists.txt
@@ -1,72 +1,70 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif()
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
# enable testing
-enable_testing ()
+enable_testing()
# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_test(NAME Runs COMMAND Tutorial 25)
# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
)
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
PROPERTIES PASS_REGULAR_EXPRESSION ${result}
)
-endmacro ()
+endfunction(do_test)
# do a bunch of result based tests
-do_test (4 "4 is 2")
-do_test (9 "9 is 3")
-do_test (5 "5 is 2.236")
-do_test (7 "7 is 2.645")
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
-
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
index 453a46332..11cf4127b 100644
--- a/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
@@ -1,17 +1,10 @@
-# first we add the executable that generates the table
-# add the binary tree directory to the search path for include files
-include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
+add_library(MathFunctions mysqrt.cxx)
-add_executable(MakeTable MakeTable.cxx )
-# add the command to generate the source code
-add_custom_command (
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
-# add the main library
-add_library(MathFunctions mysqrt.cxx ${CMAKE_CURRENT_BINARY_DIR}/Table.h )
-
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
index cebd50fcc..ee585568c 100644
--- a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
@@ -1,32 +1,25 @@
// A simple program that builds a sqrt table
-#include <math.h>
-#include <stdio.h>
+#include <cmath>
+#include <fstream>
+#include <iostream>
int main(int argc, char* argv[])
{
- int i;
- double result;
-
// make sure we have enough arguments
if (argc < 2) {
return 1;
}
- // open the output file
- FILE* fout = fopen(argv[1], "w");
- if (!fout) {
- return 1;
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
}
-
- // create a source file with a table of square roots
- fprintf(fout, "double sqrtTable[] = {\n");
- for (i = 0; i < 10; ++i) {
- result = sqrt(static_cast<double>(i));
- fprintf(fout, "%g,\n", result);
- }
-
- // close the table with a zero
- fprintf(fout, "0};\n");
- fclose(fout);
- return 0;
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
}
diff --git a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
index 458ed63a1..7d9379e43 100644
--- a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
@@ -1,11 +1,5 @@
#include "MathFunctions.h"
-#include "TutorialConfig.h"
-#include <stdio.h>
-
-// include the generated table
-#include "Table.h"
-
-#include <math.h>
+#include <iostream>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -14,27 +8,16 @@ double mysqrt(double x)
return 0;
}
- double result;
-
- // if we have both log and exp then use them
- double delta;
-
- // use the table to help find an initial value
- result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-
return result;
}
diff --git a/Tests/Tutorial/Step5/TutorialConfig.h.in b/Tests/Tutorial/Step5/TutorialConfig.h.in
index a0912656a..25a06020a 100644
--- a/Tests/Tutorial/Step5/TutorialConfig.h.in
+++ b/Tests/Tutorial/Step5/TutorialConfig.h.in
@@ -3,7 +3,3 @@
#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
#cmakedefine USE_MYMATH
-// does the platform provide exp and log functions?
-#cmakedefine HAVE_LOG
-#cmakedefine HAVE_EXP
-
diff --git a/Tests/Tutorial/Step5/directions.txt b/Tests/Tutorial/Step5/directions.txt
new file mode 100644
index 000000000..e6f51975c
--- /dev/null
+++ b/Tests/Tutorial/Step5/directions.txt
@@ -0,0 +1,69 @@
+# Adding System Introspection #
+
+Let us consider adding some code to our project that depends on features the
+target platform may not have. For this example, we will add some code that
+depends on whether or not the target platform has the log and exp functions. Of
+course almost every platform has these functions but for this tutorial assume
+that they are not common.
+
+If the platform has log and exp then we will use them to compute the square
+root in the mysqrt function. We first test for the availability of these
+functions using the CheckSymbolExists.cmake macro in the top-level CMakeLists
+file as follows:
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+Now let's add these defines to TutorialConfig.h.in so that we can use them
+from mysqrt.cxx:
+
+ // does the platform provide exp and log functions?
+ #cmakedefine HAVE_LOG
+ #cmakedefine HAVE_EXP
+
+Modify mysqrt.cxx to include math.h. Next, in the mysqrt function we can
+provide an alternate implementation based on log and exp if they are available
+on the system using the following code:
+
+ // if we have both log and exp then use them
+ #if defined(HAVE_LOG) && defined (HAVE_EXP)
+ double result = exp(log(x)*0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log" << std::endl;
+ #else
+ ...
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool.
+
+You will notice that even though HAVE_LOG and HAVE_EXP are both defined mysqrt
+isn't using them. We should realize quickly that we have forgotten to include
+TutorialConfig.h in mysqrt.cxx. We will also need to update
+MathFunctions/CMakeLists.txt with where it is located.
+
+So let's go ahead and update MathFunctions/CMakeLists.txt to look like:
+
+ add_library(MathFunctions mysqrt.cxx)
+
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ )
+
+ install(TARGETS MathFunctions DESTINATION lib)
+ install(FILES MathFunctions.h DESTINATION include)
+
+Now all we need to do is include TutorialConfig.h in mysqrt.cxx
+
+At this point you should go ahead and build the project again.
+
+Run the built Tutorial executable. Which function gives better results now,
+Step1’s sqrt or Step5’s mysqrt?
+
+Exercise: Why is it important that we configure TutorialConfig.h.in after the
+checks for HAVE_LOG and HAVE_EXP? What would happen if we inverted the two?
+
+Exercise: Is there a better place for us to save the HAVE_LOG and HAVE_EXP
+values other than in TutorialConfig.h?
diff --git a/Tests/Tutorial/Step5/tutorial.cxx b/Tests/Tutorial/Step5/tutorial.cxx
index 37f6ac456..1d5742d2d 100644
--- a/Tests/Tutorial/Step5/tutorial.cxx
+++ b/Tests/Tutorial/Step5/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt
index 0fb7cac5f..503a31290 100644
--- a/Tests/Tutorial/Step6/CMakeLists.txt
+++ b/Tests/Tutorial/Step6/CMakeLists.txt
@@ -1,78 +1,76 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif()
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
# enable testing
-enable_testing ()
+enable_testing()
# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_test(NAME Runs COMMAND Tutorial 25)
# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
)
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
PROPERTIES PASS_REGULAR_EXPRESSION ${result}
)
-endmacro ()
+endfunction(do_test)
# do a bunch of result based tests
-do_test (4 "4 is 2")
-do_test (9 "9 is 3")
-do_test (5 "5 is 2.236")
-do_test (7 "7 is 2.645")
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
-
-# build a CPack driven installer package
-include (InstallRequiredSystemLibraries)
-set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set (CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set (CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include (CPack)
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
index 70a35f662..2946075f1 100644
--- a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
@@ -1,24 +1,14 @@
-# first we add the executable that generates the table
-add_executable(MakeTable MakeTable.cxx)
-
-# add the command to generate the source code
-add_custom_command (
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- COMMAND MakeTable
- ARGS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
-set_source_files_properties (
- mysqrt.cxx PROPERTIES
- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
+add_library(MathFunctions mysqrt.cxx)
-# add the binary tree directory to the search path for include files
-include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
+# TutorialConfig.h include is an implementation detail
-# add the main library
-add_library(MathFunctions mysqrt.cxx)
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ )
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
index cebd50fcc..ee585568c 100644
--- a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
@@ -1,32 +1,25 @@
// A simple program that builds a sqrt table
-#include <math.h>
-#include <stdio.h>
+#include <cmath>
+#include <fstream>
+#include <iostream>
int main(int argc, char* argv[])
{
- int i;
- double result;
-
// make sure we have enough arguments
if (argc < 2) {
return 1;
}
- // open the output file
- FILE* fout = fopen(argv[1], "w");
- if (!fout) {
- return 1;
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
}
-
- // create a source file with a table of square roots
- fprintf(fout, "double sqrtTable[] = {\n");
- for (i = 0; i < 10; ++i) {
- result = sqrt(static_cast<double>(i));
- fprintf(fout, "%g,\n", result);
- }
-
- // close the table with a zero
- fprintf(fout, "0};\n");
- fclose(fout);
- return 0;
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
}
diff --git a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
index 458ed63a1..b9ad20a84 100644
--- a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
@@ -1,11 +1,8 @@
#include "MathFunctions.h"
#include "TutorialConfig.h"
-#include <stdio.h>
+#include <iostream>
-// include the generated table
-#include "Table.h"
-
-#include <math.h>
+#include <cmath>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -14,27 +11,23 @@ double mysqrt(double x)
return 0;
}
- double result;
-
// if we have both log and exp then use them
- double delta;
-
- // use the table to help find an initial value
- result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ double result = x;
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
-
+#endif
return result;
}
diff --git a/Tests/Tutorial/Step6/directions.txt b/Tests/Tutorial/Step6/directions.txt
new file mode 100644
index 000000000..42b9f06df
--- /dev/null
+++ b/Tests/Tutorial/Step6/directions.txt
@@ -0,0 +1,104 @@
+# Adding a Custom Command and Generated File #
+
+In this section we will show how you can add a generated source file into the
+build process of an application. For this example, we will create a table of
+precomputed square roots as part of the build process, and then compile that
+table into our application.
+
+To accomplish this, we first need a program that will generate the table. In the
+MathFunctions subdirectory a new source file named MakeTable.cxx will do just that.
+
+ // A simple program that builds a sqrt table
+ #include <iostream>
+ #include <fstream>
+ #include <cmath>
+
+ int main (int argc, char *argv[])
+ {
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1],std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if(fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+ }
+
+Note that the table is produced as valid C++ code and that the output filename
+is passed in as an argument.
+
+The next step is to add the appropriate commands to MathFunctions’ CMakeLists
+file to build the MakeTable executable and then run it as part of the build
+process. A few commands are needed to accomplish this, as shown below:
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # add the main library
+ add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PUBLIC ${Tutorial_BINARY_DIR}
+ # add the binary tree directory to the search path for include files
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ install(TARGETS MathFunctions DESTINATION lib)
+ install(FILES MathFunctions.h DESTINATION include)
+
+First, the executable for MakeTable is added as any other executable would be
+added. Then we add a custom command that specifies how to produce Table.h by
+running MakeTable. Next we have to let CMake know that mysqrt.cxx depends on
+the generated file Table.h. This is done by adding the generated Table.h to the
+list of sources for the library MathFunctions. We also have to add the current
+binary directory to the list of include directories so that Table.h can be
+found and included by mysqrt.cxx.
+
+Now let's use the generated table. First, modify mysqrt.cxx to include Table.h.
+Next, we can rewrite the mysqrt function to use the table:
+
+ if (x <= 0) {
+ return 0;
+ }
+
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result*result);
+ result = result + 0.5*delta/result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+
+Run cmake or cmake-gui to configure the project and then build it with your
+chosen build tool. When this project is built it will first build the MakeTable
+executable. It will then run MakeTable to produce Table.h. Finally, it will
+compile mysqrt.cxx which includes Table.h to produce the MathFunctions library.
diff --git a/Tests/Tutorial/Step6/tutorial.cxx b/Tests/Tutorial/Step6/tutorial.cxx
index 37f6ac456..1d5742d2d 100644
--- a/Tests/Tutorial/Step6/tutorial.cxx
+++ b/Tests/Tutorial/Step6/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt
index d9a92fbef..f2d3839b7 100644
--- a/Tests/Tutorial/Step7/CMakeLists.txt
+++ b/Tests/Tutorial/Step7/CMakeLists.txt
@@ -1,82 +1,76 @@
-cmake_minimum_required (VERSION 2.6)
-project (Tutorial)
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
-# The version number.
-set (Tutorial_VERSION_MAJOR 1)
-set (Tutorial_VERSION_MINOR 0)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
# does this system provide the log and exp functions?
-include (${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
-check_function_exists (log HAVE_LOG)
-check_function_exists (exp HAVE_EXP)
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
# should we use our own math functions
option(USE_MYMATH "Use tutorial provided math implementation" ON)
# configure a header file to pass some of the CMake settings
# to the source code
-configure_file (
+configure_file(
"${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
"${PROJECT_BINARY_DIR}/TutorialConfig.h"
)
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-include_directories ("${PROJECT_BINARY_DIR}")
-
# add the MathFunctions library?
-if (USE_MYMATH)
- include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions")
- add_subdirectory (MathFunctions)
- set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions)
-endif ()
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif(USE_MYMATH)
# add the executable
-add_executable (Tutorial tutorial.cxx)
-target_link_libraries (Tutorial ${EXTRA_LIBS})
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
# add the install targets
-install (TARGETS Tutorial DESTINATION bin)
-install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include)
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
# enable testing
-enable_testing ()
+enable_testing()
# does the application run
-add_test (TutorialRuns Tutorial 25)
+add_test(NAME Runs COMMAND Tutorial 25)
# does the usage message work?
-add_test (TutorialUsage Tutorial)
-set_tests_properties (TutorialUsage
- PROPERTIES
- PASS_REGULAR_EXPRESSION "Usage:.*number"
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
)
-#define a macro to simplify adding tests
-macro (do_test arg result)
- add_test (TutorialComp${arg} Tutorial ${arg})
- set_tests_properties (TutorialComp${arg}
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
PROPERTIES PASS_REGULAR_EXPRESSION ${result}
)
-endmacro ()
+endfunction(do_test)
# do a bunch of result based tests
-do_test (4 "4 is 2")
-do_test (9 "9 is 3")
-do_test (5 "5 is 2.236")
-do_test (7 "7 is 2.645")
-do_test (25 "25 is 5")
-do_test (-25 "-25 is 0")
-do_test (0.0001 "0.0001 is 0.01")
-
-# build a CPack driven installer package
-include (InstallRequiredSystemLibraries)
-set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set (CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set (CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-set (CPACK_PACKAGE_CONTACT "foo@bar.org")
-include (CPack)
-
-# enable dashboard scripting
-include (CTest)
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step7/CTestConfig.cmake b/Tests/Tutorial/Step7/CTestConfig.cmake
deleted file mode 100644
index d8f5c4491..000000000
--- a/Tests/Tutorial/Step7/CTestConfig.cmake
+++ /dev/null
@@ -1 +0,0 @@
-set (CTEST_PROJECT_NAME "Tutorial")
diff --git a/Tests/Tutorial/Step7/License.txt b/Tests/Tutorial/Step7/License.txt
index 673d72453..c62d00b9e 100644
--- a/Tests/Tutorial/Step7/License.txt
+++ b/Tests/Tutorial/Step7/License.txt
@@ -1,2 +1,2 @@
This is the open source License.txt file introduced in
-CMake/Tests/Tutorial/Step6...
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
index 70a35f662..dc3eb9822 100644
--- a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
+++ b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
@@ -2,23 +2,28 @@
add_executable(MakeTable MakeTable.cxx)
# add the command to generate the source code
-add_custom_command (
+add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
DEPENDS MakeTable
- COMMAND MakeTable
- ARGS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
)
-set_source_files_properties (
- mysqrt.cxx PROPERTIES
- OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
-# add the binary tree directory to the search path for include files
-include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
-
# add the main library
-add_library(MathFunctions mysqrt.cxx)
+add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
+# TutorialConfig.h include is an implementation detail
+# state that we depend on our binary dir to find Table.h
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
-install (TARGETS MathFunctions DESTINATION bin)
-install (FILES MathFunctions.h DESTINATION include)
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
index cebd50fcc..ee585568c 100644
--- a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
+++ b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
@@ -1,32 +1,25 @@
// A simple program that builds a sqrt table
-#include <math.h>
-#include <stdio.h>
+#include <cmath>
+#include <fstream>
+#include <iostream>
int main(int argc, char* argv[])
{
- int i;
- double result;
-
// make sure we have enough arguments
if (argc < 2) {
return 1;
}
- // open the output file
- FILE* fout = fopen(argv[1], "w");
- if (!fout) {
- return 1;
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
}
-
- // create a source file with a table of square roots
- fprintf(fout, "double sqrtTable[] = {\n");
- for (i = 0; i < 10; ++i) {
- result = sqrt(static_cast<double>(i));
- fprintf(fout, "%g,\n", result);
- }
-
- // close the table with a zero
- fprintf(fout, "0};\n");
- fclose(fout);
- return 0;
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
}
diff --git a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
index 458ed63a1..5272f56f2 100644
--- a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
+++ b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
@@ -1,11 +1,11 @@
#include "MathFunctions.h"
#include "TutorialConfig.h"
-#include <stdio.h>
+#include <iostream>
// include the generated table
#include "Table.h"
-#include <math.h>
+#include <cmath>
// a hack square root calculation using simple operations
double mysqrt(double x)
@@ -14,26 +14,20 @@ double mysqrt(double x)
return 0;
}
- double result;
-
- // if we have both log and exp then use them
- double delta;
-
// use the table to help find an initial value
- result = x;
+ double result = x;
if (x >= 1 && x < 10) {
result = sqrtTable[static_cast<int>(x)];
}
// do ten iterations
- int i;
- for (i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; ++i) {
if (result <= 0) {
result = 0.1;
}
- delta = x - (result * result);
+ double delta = x - (result * result);
result = result + 0.5 * delta / result;
- fprintf(stdout, "Computing sqrt of %g to be %g\n", x, result);
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
}
return result;
diff --git a/Tests/Tutorial/Step7/directions.txt b/Tests/Tutorial/Step7/directions.txt
new file mode 100644
index 000000000..7d7c2eacd
--- /dev/null
+++ b/Tests/Tutorial/Step7/directions.txt
@@ -0,0 +1,40 @@
+# Building an Installer #
+
+Next suppose that we want to distribute our project to other people so that they
+can use it. We want to provide both binary and source distributions on a variety
+of platforms. This is a little different from the install we did previously in
+the Installing and Testing section (Step 4), where we were installing the
+binaries that we had built from the source code. In this example we will be
+building installation packages that support binary installations and package
+management features. To accomplish this we will use CPack to create platform
+specific installers. Specifically we need to add a few lines to the bottom of
+our top-level CMakeLists.txt file.
+
+ include(InstallRequiredSystemLibraries)
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+ set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+ set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+ include(CPack)
+
+That is all there is to it. We start by including InstallRequiredSystemLibraries.
+This module will include any runtime libraries that are needed by the project
+for the current platform. Next we set some CPack variables to where we have
+stored the license and version information for this project. The version
+information makes use of the variables we set earlier in this tutorial. Finally
+we include the CPack module which will use these variables and some other
+properties of the system you are on to setup an installer.
+
+The next step is to build the project in the usual manner and then run CPack
+on it. To build a binary distribution you would run:
+
+ cpack
+
+To create a source distribution you would type:
+
+ cpack -C CPackSourceConfig.cmake
+
+Alternatively, run “make package” or right click the Package target and
+“Build Project” from an IDE.
+
+Run the installer executable found in the binary directory. Then run the
+installed executable and verify that it works.
diff --git a/Tests/Tutorial/Step7/tutorial.cxx b/Tests/Tutorial/Step7/tutorial.cxx
index 37f6ac456..1d5742d2d 100644
--- a/Tests/Tutorial/Step7/tutorial.cxx
+++ b/Tests/Tutorial/Step7/tutorial.cxx
@@ -1,8 +1,9 @@
// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
#include "TutorialConfig.h"
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
#ifdef USE_MYMATH
# include "MathFunctions.h"
@@ -11,23 +12,21 @@
int main(int argc, char* argv[])
{
if (argc < 2) {
- fprintf(stdout, "%s Version %d.%d\n", argv[0], Tutorial_VERSION_MAJOR,
- Tutorial_VERSION_MINOR);
- fprintf(stdout, "Usage: %s number\n", argv[0]);
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
return 1;
}
- double inputValue = atof(argv[1]);
- double outputValue = 0;
+ double inputValue = std::stod(argv[1]);
- if (inputValue >= 0) {
#ifdef USE_MYMATH
- outputValue = mysqrt(inputValue);
+ double outputValue = mysqrt(inputValue);
#else
- outputValue = sqrt(inputValue);
+ double outputValue = sqrt(inputValue);
#endif
- }
- fprintf(stdout, "The square root of %g is %g\n", inputValue, outputValue);
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
return 0;
}
diff --git a/Tests/Tutorial/Step8/CMakeLists.txt b/Tests/Tutorial/Step8/CMakeLists.txt
new file mode 100644
index 000000000..c66bf96e3
--- /dev/null
+++ b/Tests/Tutorial/Step8/CMakeLists.txt
@@ -0,0 +1,82 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# does this system provide the log and exp functions?
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+# configure a header file to pass some of the CMake settings
+# to the source code
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library?
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif(USE_MYMATH)
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+enable_testing()
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step8/License.txt b/Tests/Tutorial/Step8/License.txt
new file mode 100644
index 000000000..c62d00b9e
--- /dev/null
+++ b/Tests/Tutorial/Step8/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt
new file mode 100644
index 000000000..dc3eb9822
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt
@@ -0,0 +1,29 @@
+# first we add the executable that generates the table
+add_executable(MakeTable MakeTable.cxx)
+
+# add the command to generate the source code
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+# add the main library
+add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
+# TutorialConfig.h include is an implementation detail
+# state that we depend on our binary dir to find Table.h
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${Tutorial_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx
new file mode 100644
index 000000000..ee585568c
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h
new file mode 100644
index 000000000..cd36bccff
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h
@@ -0,0 +1 @@
+double mysqrt(double x);
diff --git a/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx
new file mode 100644
index 000000000..5b862fbd5
--- /dev/null
+++ b/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx
@@ -0,0 +1,42 @@
+#include "MathFunctions.h"
+#include "TutorialConfig.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
diff --git a/Tests/Tutorial/Step8/TutorialConfig.h.in b/Tests/Tutorial/Step8/TutorialConfig.h.in
new file mode 100644
index 000000000..e97ce24ea
--- /dev/null
+++ b/Tests/Tutorial/Step8/TutorialConfig.h.in
@@ -0,0 +1,8 @@
+// the configured options and settings for Tutorial
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
+#cmakedefine USE_MYMATH
+
+// does the platform provide exp and log functions?
+#cmakedefine HAVE_LOG
+#cmakedefine HAVE_EXP
diff --git a/Tests/Tutorial/Step8/directions.txt b/Tests/Tutorial/Step8/directions.txt
new file mode 100644
index 000000000..588d9c679
--- /dev/null
+++ b/Tests/Tutorial/Step8/directions.txt
@@ -0,0 +1,38 @@
+# Adding Support for a Dashboard #
+
+Adding support for submitting our test results to a dashboard is very easy. We
+already defined a number of tests for our project in the earlier steps of this
+tutorial. We just have to run those tests and submit them to a dashboard. To
+include support for dashboards we include the CTest module in our top-level
+CMakeLists.txt.
+
+Replace:
+ # enable testing
+ enable_testing()
+
+With:
+ # enable dashboard scripting
+ include(CTest)
+
+The CTest module will automatically call enable_testing(), so
+we can remove it from our CMake files.
+
+We will also need to create a CTestConfig.cmake file where we can specify the
+name of the project and where to submit the dashboard.
+
+ set(CTEST_PROJECT_NAME "CMakeTutorial")
+ set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+
+ set(CTEST_DROP_METHOD "http")
+ set(CTEST_DROP_SITE "my.cdash.org/")
+ set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
+ set(CTEST_DROP_SITE_CDASH TRUE)
+
+CTest will read in this file when it runs. To create a simple dashboard you can
+run cmake or cmake-gui to configure the project, but do not build it yet.
+Instead, change directory to the binary tree, and then run:
+ 'ctest [-VV] –D Experimental'. On Windows, build the EXPERIMENTAL target.
+
+Ctest will build and test the project and submit results to the Kitware public
+dashboard. The results of your dashboard will be uploaded to Kitware's public
+dashboard here: https://my.cdash.org/index.php?project=CMakeTutorial.
diff --git a/Tests/Tutorial/Step8/tutorial.cxx b/Tests/Tutorial/Step8/tutorial.cxx
new file mode 100644
index 000000000..1d5742d2d
--- /dev/null
+++ b/Tests/Tutorial/Step8/tutorial.cxx
@@ -0,0 +1,32 @@
+// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <string>
+
+#include "TutorialConfig.h"
+
+#ifdef USE_MYMATH
+# include "MathFunctions.h"
+#endif
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+#ifdef USE_MYMATH
+ double outputValue = mysqrt(inputValue);
+#else
+ double outputValue = sqrt(inputValue);
+#endif
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Tutorial/Step9/CMakeLists.txt b/Tests/Tutorial/Step9/CMakeLists.txt
new file mode 100644
index 000000000..309d513ff
--- /dev/null
+++ b/Tests/Tutorial/Step9/CMakeLists.txt
@@ -0,0 +1,81 @@
+cmake_minimum_required(VERSION 3.3)
+project(Tutorial)
+
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+# the version number.
+set(Tutorial_VERSION_MAJOR 1)
+set(Tutorial_VERSION_MINOR 0)
+
+# does this system provide the log and exp functions?
+include(CheckSymbolExists)
+set(CMAKE_REQUIRED_LIBRARIES "m")
+check_symbol_exists(log "math.h" HAVE_LOG)
+check_symbol_exists(exp "math.h" HAVE_EXP)
+
+# should we use our own math functions
+option(USE_MYMATH "Use tutorial provided math implementation" ON)
+
+# configure a header file to pass the version number only
+configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+# add the MathFunctions library?
+if(USE_MYMATH)
+ add_subdirectory(MathFunctions)
+ list(APPEND EXTRA_LIBS MathFunctions)
+endif()
+
+# add the executable
+add_executable(Tutorial tutorial.cxx)
+target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
+
+# add the binary tree to the search path for include files
+# so that we will find TutorialConfig.h
+target_include_directories(Tutorial PUBLIC
+ "${PROJECT_BINARY_DIR}"
+ )
+
+# add the install targets
+install(TARGETS Tutorial DESTINATION bin)
+install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ DESTINATION include
+ )
+
+# enable testing
+include(CTest)
+
+# does the application run
+add_test(NAME Runs COMMAND Tutorial 25)
+
+# does the usage message work?
+add_test(NAME Usage COMMAND Tutorial)
+set_tests_properties(Usage
+ PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
+ )
+
+# define a function to simplify adding tests
+function(do_test target arg result)
+ add_test(NAME Comp${arg} COMMAND ${target} ${arg})
+ set_tests_properties(Comp${arg}
+ PROPERTIES PASS_REGULAR_EXPRESSION ${result}
+ )
+endfunction(do_test)
+
+# do a bunch of result based tests
+do_test(Tutorial 4 "4 is 2")
+do_test(Tutorial 9 "9 is 3")
+do_test(Tutorial 5 "5 is 2.236")
+do_test(Tutorial 7 "7 is 2.645")
+do_test(Tutorial 25 "25 is 5")
+do_test(Tutorial -25 "-25 is [-nan|nan|0]")
+do_test(Tutorial 0.0001 "0.0001 is 0.01")
+
+include(InstallRequiredSystemLibraries)
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
+set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
+set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
+include(CPack)
diff --git a/Tests/Tutorial/Step9/CTestConfig.cmake b/Tests/Tutorial/Step9/CTestConfig.cmake
new file mode 100644
index 000000000..7a927ac94
--- /dev/null
+++ b/Tests/Tutorial/Step9/CTestConfig.cmake
@@ -0,0 +1,15 @@
+## This file should be placed in the root directory of your project.
+## Then modify the CMakeLists.txt file in the root directory of your
+## project to incorporate the testing dashboard.
+##
+## # The following are required to submit to the CDash dashboard:
+## ENABLE_TESTING()
+## INCLUDE(CTest)
+
+set(CTEST_PROJECT_NAME "CMakeTutorial")
+set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/Tutorial/Step9/License.txt b/Tests/Tutorial/Step9/License.txt
new file mode 100644
index 000000000..c62d00b9e
--- /dev/null
+++ b/Tests/Tutorial/Step9/License.txt
@@ -0,0 +1,2 @@
+This is the open source License.txt file introduced in
+CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt
new file mode 100644
index 000000000..e651a5748
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt
@@ -0,0 +1,35 @@
+# first we add the executable that generates the table
+add_executable(MakeTable MakeTable.cxx)
+
+# add the command to generate the source code
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+# add the main library
+add_library(MathFunctions
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+# state that anybody linking to us needs to include the current source dir
+# to find MathFunctions.h, while we don't.
+# state that we depend on our binary dir to find Table.h
+target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+# use compile definitions to state if we have enabled USE_MYMATH
+# and that anything that links to use will get this define
+target_compile_definitions(MathFunctions INTERFACE "USE_MYMATH")
+
+if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(MathFunctions
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+endif()
+
+install(TARGETS MathFunctions DESTINATION lib)
+install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx
new file mode 100644
index 000000000..ee585568c
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx
@@ -0,0 +1,25 @@
+// A simple program that builds a sqrt table
+#include <cmath>
+#include <fstream>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+ // make sure we have enough arguments
+ if (argc < 2) {
+ return 1;
+ }
+
+ std::ofstream fout(argv[1], std::ios_base::out);
+ const bool fileOpen = fout.is_open();
+ if (fileOpen) {
+ fout << "double sqrtTable[] = {" << std::endl;
+ for (int i = 0; i < 10; ++i) {
+ fout << sqrt(static_cast<double>(i)) << "," << std::endl;
+ }
+ // close the table with a zero
+ fout << "0};" << std::endl;
+ fout.close();
+ }
+ return fileOpen ? 0 : 1; // return 0 if wrote the file
+}
diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx
new file mode 100644
index 000000000..5351184be
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx
@@ -0,0 +1,18 @@
+
+#include "MathFunctions.h"
+#include <cmath>
+
+#ifdef USE_MYMATH
+# include "mysqrt.h"
+#endif
+
+namespace mathfunctions {
+double sqrt(double x)
+{
+#ifdef USE_MYMATH
+ return detail::mysqrt(x);
+#else
+ return std::sqrt(x);
+#endif
+}
+}
diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h
new file mode 100644
index 000000000..cd36bccff
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h
@@ -0,0 +1 @@
+double mysqrt(double x);
diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx
new file mode 100644
index 000000000..8b8214151
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx
@@ -0,0 +1,41 @@
+#include "MathFunctions.h"
+#include <iostream>
+
+// include the generated table
+#include "Table.h"
+
+#include <cmath>
+
+// a hack square root calculation using simple operations
+double mysqrt(double x)
+{
+ if (x <= 0) {
+ return 0;
+ }
+
+ // if we have both log and exp then use them
+#if defined(HAVE_LOG) && defined(HAVE_EXP)
+ double result = exp(log(x) * 0.5);
+ std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
+ << std::endl;
+#else
+ // use the table to help find an initial value
+ double result = x;
+ if (x >= 1 && x < 10) {
+ result = sqrtTable[static_cast<int>(x)];
+ }
+
+ // if we have both log and exp then use them
+
+ // do ten iterations
+ for (int i = 0; i < 10; ++i) {
+ if (result <= 0) {
+ result = 0.1;
+ }
+ double delta = x - (result * result);
+ result = result + 0.5 * delta / result;
+ std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
+ }
+#endif
+ return result;
+}
diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.h b/Tests/Tutorial/Step9/MathFunctions/mysqrt.h
new file mode 100644
index 000000000..e1c42ef0c
--- /dev/null
+++ b/Tests/Tutorial/Step9/MathFunctions/mysqrt.h
@@ -0,0 +1,6 @@
+
+namespace mathfunctions {
+namespace detail {
+double mysqrt(double x);
+}
+}
diff --git a/Tests/Tutorial/Step9/TutorialConfig.h.in b/Tests/Tutorial/Step9/TutorialConfig.h.in
new file mode 100644
index 000000000..8cd2fc9c6
--- /dev/null
+++ b/Tests/Tutorial/Step9/TutorialConfig.h.in
@@ -0,0 +1,3 @@
+// the configured version number
+#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
+#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step9/directions.txt b/Tests/Tutorial/Step9/directions.txt
new file mode 100644
index 000000000..8771637d2
--- /dev/null
+++ b/Tests/Tutorial/Step9/directions.txt
@@ -0,0 +1,166 @@
+# Mixing Static and Shared #
+
+In this section we will show how by using the BUILD_SHARED_LIBS variable we can
+control the default behavior of add_library, and allow control over how
+libraries without an explicit type ( STATIC/SHARED/MODULE/OBJECT ) are built.
+
+To accomplish this we need to add BUILD_SHARED_LIBS to the top level
+CMakeLists.txt. We use the option command as it allows users to optionally
+select if the value should be On or Off.
+
+Next we are going to refactor MathFunctions to become a real library that
+encapsulates using mysqrt or sqrt, instead of requiring the calling code
+to do this logic. This will also mean that USE_MYMATH will not control building
+MathFuctions, but instead will control the behavior of this library.
+
+The first step is to update the starting section of the top level CMakeLists.txt
+to look like:
+
+ cmake_minimum_required(VERSION 3.3)
+ project(Tutorial)
+
+ # control where the static and shared libraries are built so that on windows
+ # we don't need to tinker with the path to run the executable
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
+
+ set(CMAKE_CXX_STANDARD 11)
+ set(CMAKE_CXX_STANDARD_REQUIRED True)
+
+ option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+ # the version number.
+ set(Tutorial_VERSION_MAJOR 1)
+ set(Tutorial_VERSION_MINOR 0)
+
+ # configure a header file to pass the version number only
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
+ "${PROJECT_BINARY_DIR}/TutorialConfig.h"
+ )
+
+ # add the MathFunctions library
+ add_subdirectory(MathFunctions)
+
+ # add the executable
+ add_executable(Tutorial tutorial.cxx)
+ target_link_libraries(Tutorial PUBLIC MathFunctions)
+
+Now that we have made MathFunctions always be used, we will need to update
+the logic of that library. So, in MathFunctions/CMakeLists.txt we need to
+create a SqrtLibrary that will conditionally be built when USE_MYMATH is
+enabled. Now, since this is a tutorial, we are going to explicitly require
+that SqrtLibrary is built statically.
+
+The end result is that MathFunctions/CMakeLists.txt should look like:
+
+ # add the library that runs
+ add_library(MathFunctions MathFunctions.cxx)
+
+ # state that anybody linking to us needs to include the current source dir
+ # to find MathFunctions.h, while we don't.
+ target_include_directories(MathFunctions
+ INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
+ )
+
+ # should we use our own math functions
+ option(USE_MYMATH "Use tutorial provided math implementation" ON)
+ if(USE_MYMATH)
+
+ # does this system provide the log and exp functions?
+ include(CheckSymbolExists)
+ set(CMAKE_REQUIRED_LIBRARIES "m")
+ check_symbol_exists(log "math.h" HAVE_LOG)
+ check_symbol_exists(exp "math.h" HAVE_EXP)
+
+ # first we add the executable that generates the table
+ add_executable(MakeTable MakeTable.cxx)
+
+ # add the command to generate the source code
+ add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ DEPENDS MakeTable
+ )
+
+ # library that just does sqrt
+ add_library(SqrtLibrary STATIC
+ mysqrt.cxx
+ ${CMAKE_CURRENT_BINARY_DIR}/Table.h
+ )
+
+ # state that we depend on our binary dir to find Table.h
+ target_include_directories(SqrtLibrary PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
+ target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
+ if(HAVE_LOG AND HAVE_EXP)
+ target_compile_definitions(SqrtLibrary
+ PRIVATE "HAVE_LOG" "HAVE_EXP")
+ endif()
+
+ target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
+ endif()
+
+ # define the symbol stating we are using the declspec(dllexport) when
+ # building on windows
+ target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
+
+ install(TARGETS MathFunctions DESTINATION lib)
+ install(FILES MathFunctions.h DESTINATION include)
+
+Next, update MathFunctions/mysqrt.cxx to use the mathfunctions and detail namespaces:
+
+ #include <iostream>
+ #include "MathFunctions.h"
+
+ // include the generated table
+ #include "Table.h"
+
+ #include <cmath>
+
+ namespace mathfunctions {
+ namespace detail {
+ // a hack square root calculation using simple operations
+ double mysqrt(double x)
+ {
+ ...
+
+ return result;
+ }
+ }
+ }
+
+We also need to make some changes in tutorial.cxx, so that it no longer uses USE_MYMATH:
+1. Always include MathFunctions.h
+2. Always use mathfunctions::sqrt
+
+Finally, update MathFunctions/MathFunctions.h to use dll export defines:
+
+ #if defined(_WIN32)
+ #if defined(EXPORTING_MYMATH)
+ #define DECLSPEC __declspec(dllexport)
+ #else
+ #define DECLSPEC __declspec(dllimport)
+ #endif
+ #else //non windows
+ #define DECLSPEC
+ #endif
+
+ namespace mathfunctions
+ {
+ double DECLSPEC sqrt(double x);
+ }
+
+At this point, if you build everything, you will notice that linking fails
+as we are combining a static library without position enabled code with a
+library that has position enabled code. This solution to this is to explicitly
+set the POSITION_INDEPENDENT_CODE target property of SqrtLibrary to be True no
+matter the build type.
+
+Exercise: We modified MathFunctions.h to use dll export defines. Using CMake
+documentation can you find a helper module to simplify this?
+
+Exercise: Determine what command is enabling PIC for SqrtLibrary.
+What happens if we remove said command?
diff --git a/Tests/Tutorial/Step9/tutorial.cxx b/Tests/Tutorial/Step9/tutorial.cxx
new file mode 100644
index 000000000..73e67a9c0
--- /dev/null
+++ b/Tests/Tutorial/Step9/tutorial.cxx
@@ -0,0 +1,33 @@
+// A simple program that computes the square root of a number
+#include <cmath>
+#include <iostream>
+#include <sstream>
+#include <string>
+
+#include "TutorialConfig.h"
+
+#ifdef USE_MYMATH
+# include "MathFunctions.h"
+#endif
+
+int main(int argc, char* argv[])
+{
+ if (argc < 2) {
+ std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
+ << Tutorial_VERSION_MAJOR << std::endl;
+ std::cout << "Usage: " << argv[0] << " number" << std::endl;
+ return 1;
+ }
+
+ double inputValue = std::stod(argv[1]);
+
+#ifdef USE_MYMATH
+ double outputValue = mysqrt(inputValue);
+#else
+ double outputValue = sqrt(inputValue);
+#endif
+
+ std::cout << "The square root of " << inputValue << " is " << outputValue
+ << std::endl;
+ return 0;
+}
diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt
index 07aa68e7a..a40367bbe 100644
--- a/Tests/Unset/CMakeLists.txt
+++ b/Tests/Unset/CMakeLists.txt
@@ -21,17 +21,26 @@ set(x 43)
if(NOT x EQUAL 43)
message(FATAL_ERROR "x!=43")
endif()
+if(DEFINED CACHE{x})
+ message(FATAL_ERROR "x shouldn't be found in the cache")
+endif()
+
set(x)
if(DEFINED x)
message(FATAL_ERROR "x should be undefined now!")
endif()
+
# Cache variable
set(BAR "test" CACHE STRING "documentation")
if(NOT DEFINED BAR)
message(FATAL_ERROR "BAR not defined")
endif()
+if(NOT DEFINED CACHE{BAR})
+ message(FATAL_ERROR "BAR could not be found by CACHE{BAR}")
+endif()
+
# Test interaction of cache entries with variables.
set(BAR "test-var")
if(NOT "$CACHE{BAR}" STREQUAL "test")
diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt
index 4c3d901a9..434895e1b 100644
--- a/Tests/UseSWIG/CMakeLists.txt
+++ b/Tests/UseSWIG/CMakeLists.txt
@@ -96,6 +96,30 @@ add_test(NAME UseSWIG.UseTargetINCLUDE_DIRECTORIES COMMAND
"${CMake_SOURCE_DIR}/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES"
"${CMake_BINARY_DIR}/Tests/UseSWIG/UseTargetINCLUDE_DIRECTORIES"
${build_generator_args}
- --build-project TestModuleVersion2
+ --build-project TestUseTargetINCLUDE_DIRECTORIES
--build-options ${build_options}
)
+
+
+add_test(NAME UseSWIG.ModuleName COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/UseSWIG/ModuleName"
+ "${CMake_BINARY_DIR}/Tests/UseSWIG/ModuleName"
+ ${build_generator_args}
+ --build-project TestModuleName
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+
+add_test(NAME UseSWIG.SwigSrcFileExtension COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/UseSWIG/SwigSrcFileExtension"
+ "${CMake_BINARY_DIR}/Tests/UseSWIG/SwigSrcFileExtension"
+ ${build_generator_args}
+ --build-project SwigSrcFileExtension
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/UseSWIG/ModuleName/CMakeLists.txt b/Tests/UseSWIG/ModuleName/CMakeLists.txt
new file mode 100644
index 000000000..de6388335
--- /dev/null
+++ b/Tests/UseSWIG/ModuleName/CMakeLists.txt
@@ -0,0 +1,42 @@
+cmake_minimum_required(VERSION 3.1...3.14)
+
+project(TestModuleName CXX)
+
+include(CTest)
+
+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()
+
+unset(CMAKE_SWIG_FLAGS)
+
+set_property(SOURCE "example.i" PROPERTY CPLUSPLUS ON)
+set_property(SOURCE "example.i" PROPERTY COMPILE_OPTIONS -includeall)
+set_property(SOURCE "example.i" PROPERTY SWIG_MODULE_NAME new_example)
+
+swig_add_library(example1
+ LANGUAGE python
+ OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/example1"
+ SOURCES example.i ../example.cxx)
+set_target_properties (example1 PROPERTIES
+ INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/.."
+ SWIG_USE_TARGET_INCLUDE_DIRECTORIES TRUE
+ OUTPUT_NAME new_example
+ 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::Python)
+
+
+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")
diff --git a/Tests/UseSWIG/ModuleName/example.i b/Tests/UseSWIG/ModuleName/example.i
new file mode 100644
index 000000000..fbdf7249f
--- /dev/null
+++ b/Tests/UseSWIG/ModuleName/example.i
@@ -0,0 +1,9 @@
+/* File : example.i */
+%module example
+
+%{
+#include "example.h"
+%}
+
+/* Let's just grab the original header file here */
+%include "example.h"
diff --git a/Tests/UseSWIG/ModuleName/runme.py b/Tests/UseSWIG/ModuleName/runme.py
new file mode 100644
index 000000000..c37e4a736
--- /dev/null
+++ b/Tests/UseSWIG/ModuleName/runme.py
@@ -0,0 +1,52 @@
+# file: runme.py
+
+# This file illustrates the shadow-class C++ interface generated
+# by SWIG.
+
+from __future__ import print_function
+
+import new_example
+
+# ----- Object creation -----
+
+print ("Creating some objects:")
+c = new_example.Circle(10)
+print (" Created circle", c)
+s = new_example.Square(10)
+print (" Created square", s)
+
+# ----- Access a static member -----
+
+print ("\nA total of", new_example.cvar.Shape_nshapes,"shapes were created")
+
+# ----- Member data access -----
+
+# Set the location of the object
+
+c.x = 20
+c.y = 30
+
+s.x = -10
+s.y = 5
+
+print ("\nHere is their current position:")
+print (" Circle = (%f, %f)" % (c.x,c.y))
+print (" Square = (%f, %f)" % (s.x,s.y))
+
+# ----- Call some methods -----
+
+print ("\nHere are some properties of the shapes:")
+for o in [c,s]:
+ print (" ", o)
+ print (" area = ", o.area())
+ print (" perimeter = ", o.perimeter())
+
+print ("\nGuess I'll clean up now")
+
+# Note: this invokes the virtual destructor
+del c
+del s
+
+s = 3
+print (new_example.cvar.Shape_nshapes,"shapes remain")
+print ("Goodbye")
diff --git a/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt b/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt
new file mode 100644
index 000000000..7eb73d42b
--- /dev/null
+++ b/Tests/UseSWIG/SwigSrcFileExtension/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.1...3.14)
+
+project(SwigSrcFileExtension C)
+
+include(CTest)
+find_package(SWIG REQUIRED)
+find_package(Python COMPONENTS Interpreter Development REQUIRED)
+
+include(${SWIG_USE_FILE})
+
+# Use the newer target name preference
+set(UseSWIG_TARGET_NAME_PREFERENCE "STANDARD")
+
+# Set the custom source file extension to both .i and .swg
+set(SWIG_SOURCE_FILE_EXTENSIONS ".i" ".swg")
+
+# Generate a Python module out of `.i`
+swig_add_library(my_add LANGUAGE python SOURCES my_add.i)
+target_link_libraries(my_add Python::Python)
+
+# Generate a Python module out of `.swg`
+swig_add_library(my_sub LANGUAGE python SOURCES my_sub.swg)
+target_link_libraries(my_sub Python::Python)
+
+# Add a test
+add_test(NAME SwigSrcFileExtension
+ COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}"
+ "${Python_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/runme.py")
diff --git a/Tests/UseSWIG/SwigSrcFileExtension/my_add.i b/Tests/UseSWIG/SwigSrcFileExtension/my_add.i
new file mode 100644
index 000000000..d087ab5e2
--- /dev/null
+++ b/Tests/UseSWIG/SwigSrcFileExtension/my_add.i
@@ -0,0 +1,9 @@
+%module my_add
+
+%{
+int add(int a, int b) {
+ return a + b;
+}
+%}
+
+int add(int a, int b);
diff --git a/Tests/UseSWIG/SwigSrcFileExtension/my_sub.swg b/Tests/UseSWIG/SwigSrcFileExtension/my_sub.swg
new file mode 100644
index 000000000..df34b441a
--- /dev/null
+++ b/Tests/UseSWIG/SwigSrcFileExtension/my_sub.swg
@@ -0,0 +1,9 @@
+%module my_sub
+
+%{
+int sub(int a, int b) {
+ return a - b;
+}
+%}
+
+int sub(int a, int b);
diff --git a/Tests/UseSWIG/SwigSrcFileExtension/runme.py b/Tests/UseSWIG/SwigSrcFileExtension/runme.py
new file mode 100755
index 000000000..290175b08
--- /dev/null
+++ b/Tests/UseSWIG/SwigSrcFileExtension/runme.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+import random
+
+import my_add
+import my_sub
+
+
+# These can be changed, but make sure not to overflow `int`
+a = random.randint(1, 1024)
+b = random.randint(1, 1024)
+
+if my_add.add(a, b) == a + b:
+ print ("Test 1 Passed for SWIG custom source file extension")
+else:
+ print ("Test 1 FAILED for SWIG custom source file extension")
+ exit(1)
+
+if my_sub.sub(a, b) == a - b:
+ print ("Test 2 Passed for SWIG custom source file extension")
+else:
+ print ("Test 2 FAILED for SWIG custom source file extension")
+ exit(1)
diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt
index 7465243bd..8ca725249 100644
--- a/Tests/VSExternalInclude/CMakeLists.txt
+++ b/Tests/VSExternalInclude/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required (VERSION 2.6)
project(VSExternalInclude)
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01245]")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012456]")
set(PROJECT_EXT vcxproj)
else()
set(PROJECT_EXT vcproj)
@@ -55,7 +55,7 @@ add_dependencies(VSExternalInclude lib2)
# and the sln file can no longer be the only source
# of that depend. So, for VS 10 make the executable
# depend on lib1 and lib2
-if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01245]")
+if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[012456]")
add_dependencies(VSExternalInclude lib1)
endif()
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index acda11735..efc77601d 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -8,6 +8,8 @@ elseif(MSVC_VERSION GREATER 1600)
set(COMPILER_VERSION "11")
endif()
+add_subdirectory(WinRT)
+
set (APP_MANIFEST_NAME Package.appxmanifest)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
set(PLATFORM WP)
@@ -139,11 +141,14 @@ if("${SHORT_VERSION}" STREQUAL "10.0")
message(STATUS "Targeting Windows 10. Setting Extensions to version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
set_property(TARGET ${EXE_NAME} PROPERTY VS_DESKTOP_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
set_property(TARGET ${EXE_NAME} PROPERTY VS_MOBILE_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
- set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+
+ # The last IOT reference is on 10.0.17134.0, so only add it if supported
+ if("${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" VERSION_LESS "10.0.17135.0")
+ set_property(TARGET ${EXE_NAME} PROPERTY VS_IOT_EXTENSIONS_VERSION "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
+ endif()
# Add a reference to an SDK
set_property(TARGET ${EXE_NAME} PROPERTY VS_SDK_REFERENCES "Microsoft.UniversalCRT.Debug, Version=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
endif()
-
-target_link_libraries(${EXE_NAME} d3d11)
+target_link_libraries(${EXE_NAME} d3d11 JusticeLeagueWinRT)
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png
index 7d95d4e08..c715e1bc7 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/ApplicationIcon.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png
index e26771cb3..65f91ac0f 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Logo.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png
index 1eb0d9d52..460c0222d 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
index 28810b7c0..c2374581a 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SmallLogo44x44.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png
index c951e031b..834256580 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/SplashScreen.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png
index dcb672712..508c8a809 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/StoreLogo.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png
index e0c59ac01..fcdbaf4ac 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileLarge.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png
index e93b89d60..06425c4b1 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileMedium.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png
index 550b1b5e8..4cef0eb30 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/FlipCycleTileSmall.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png
index 686e6b53f..253503f04 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileMediumLarge.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png
index d4b5ede1b..2ef050fb3 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Assets/Tiles/IconicTileSmall.png
Binary files differ
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
index 1c969cd2f..3ba35fa43 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
+++ b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
@@ -6,11 +6,15 @@ using namespace DirectX;
using namespace Microsoft::WRL;
using namespace Windows::Foundation;
using namespace Windows::UI::Core;
+using namespace JusticeLeagueWinRT;
CubeRenderer::CubeRenderer()
: m_loadingComplete(false)
, m_indexCount(0)
{
+ // Create a new WinRT object to validate that we can link properly
+ Batman ^ hero = ref new Batman();
+ hero->savePeople();
}
void CubeRenderer::CreateDeviceResources()
diff --git a/Tests/VSWinStorePhone/WinRT/Batman.cpp b/Tests/VSWinStorePhone/WinRT/Batman.cpp
new file mode 100644
index 000000000..e09225898
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/Batman.cpp
@@ -0,0 +1,14 @@
+#include "Batman.h"
+
+using namespace JusticeLeagueWinRT;
+using namespace Platform;
+
+Batman::Batman()
+{
+}
+
+void Batman::savePeople()
+{
+ int i = 0;
+ i++;
+}
diff --git a/Tests/VSWinStorePhone/WinRT/Batman.h b/Tests/VSWinStorePhone/WinRT/Batman.h
new file mode 100644
index 000000000..e2dcabc46
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/Batman.h
@@ -0,0 +1,12 @@
+#pragma once
+
+namespace JusticeLeagueWinRT {
+public
+ref class Batman sealed
+{
+public:
+ Batman();
+
+ void savePeople();
+};
+}
diff --git a/Tests/VSWinStorePhone/WinRT/CMakeLists.txt b/Tests/VSWinStorePhone/WinRT/CMakeLists.txt
new file mode 100644
index 000000000..bb9333360
--- /dev/null
+++ b/Tests/VSWinStorePhone/WinRT/CMakeLists.txt
@@ -0,0 +1,13 @@
+project(JusticeLeagueWinRT CXX)
+
+# create project
+add_library(JusticeLeagueWinRT SHARED
+ "${CMAKE_CURRENT_SOURCE_DIR}/Batman.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/Batman.h"
+)
+
+set_target_properties(JusticeLeagueWinRT PROPERTIES
+ VS_WINRT_COMPONENT TRUE
+ VS_GLOBAL_ROOTNAMESPACE "JusticeLeagueWinRT"
+ OUTPUT_NAME "JusticeLeagueWinRT"
+)
diff --git a/Tests/VSXaml/Assets/Logo.scale-100.png b/Tests/VSXaml/Assets/Logo.scale-100.png
index e26771cb3..65f91ac0f 100644
--- a/Tests/VSXaml/Assets/Logo.scale-100.png
+++ b/Tests/VSXaml/Assets/Logo.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/SmallLogo.scale-100.png b/Tests/VSXaml/Assets/SmallLogo.scale-100.png
index 1eb0d9d52..460c0222d 100644
--- a/Tests/VSXaml/Assets/SmallLogo.scale-100.png
+++ b/Tests/VSXaml/Assets/SmallLogo.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/SplashScreen.scale-100.png b/Tests/VSXaml/Assets/SplashScreen.scale-100.png
index c951e031b..834256580 100644
--- a/Tests/VSXaml/Assets/SplashScreen.scale-100.png
+++ b/Tests/VSXaml/Assets/SplashScreen.scale-100.png
Binary files differ
diff --git a/Tests/VSXaml/Assets/StoreLogo.scale-100.png b/Tests/VSXaml/Assets/StoreLogo.scale-100.png
index dcb672712..508c8a809 100644
--- a/Tests/VSXaml/Assets/StoreLogo.scale-100.png
+++ b/Tests/VSXaml/Assets/StoreLogo.scale-100.png
Binary files differ
diff --git a/Utilities/Doxygen/CMakeLists.txt b/Utilities/Doxygen/CMakeLists.txt
index 6a90c8474..2cdd7672d 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.1 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.1...3.12 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/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index 5af8b85dd..482a08dd8 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/Utilities/IWYU/mapping.imp
@@ -55,6 +55,9 @@
# HACK: iwyu wrongly thinks that <system_error> is needed for std::hash
{ symbol: [ "std::hash", private, "<functional>", public ] },
+ # HACK: iwyu thinks we use a libstdc++ private type
+ { symbol: [ "__gnu_cxx::size_t", private, "<cstddef>", public ] },
+
# __decay_and_strip is used internally in the C++11 standard library.
# IWYU does not classify it as internal and suggests to add <type_traits>.
# To ignore it, we simply map it to a file that is included anyway.
@@ -94,12 +97,9 @@
{ include: [ "<json/writer.h>", private, "\"cm_jsoncpp_writer.h\"", public ] },
{ include: [ "<rhash.h>", private, "\"cm_rhash.h\"", public ] },
{ include: [ "<uv.h>", private, "\"cm_uv.h\"", public ] },
- { include: [ "@<uv-.+\\.h>", private, "\"cm_uv.h\"", public ] },
+ { include: [ "@<uv[/-].+\\.h>", private, "\"cm_uv.h\"", public ] },
{ include: [ "<kwiml/abi.h>", private, "\"cm_kwiml.h\"", public ] },
{ include: [ "<kwiml/int.h>", private, "\"cm_kwiml.h\"", public ] },
- { include: [ "<xmlrpc.h>", private, "\"cm_xmlrpc.h\"", public ] },
- { include: [ "<xmlrpc_client.h>", private, "\"cm_xmlrpc.h\"", public ] },
- { include: [ "@<xmlrpc-c/.+\\.h>", private, "\"cm_xmlrpc.h\"", public ] },
{ include: [ "<zconf.h>", private, "\"cm_zlib.h\"", public ] },
{ include: [ "<zlib.h>", private, "\"cm_zlib.h\"", public ] },
@@ -114,7 +114,7 @@
{ include: [ "\"cmjsoncpp/include/json/writer.h\"", private, "\"cm_jsoncpp_writer.h\"", public ] },
{ include: [ "\"cmlibrhash/librhash/rhash.h\"", private, "\"cm_rhash.h\"", public ] },
{ include: [ "\"cmlibuv/include/uv.h\"", private, "\"cm_uv.h\"", public ] },
- { include: [ "@\"cmlibuv/include/uv-.+\\.h\"", private, "\"cm_uv.h\"", public ] },
+ { include: [ "@\"cmlibuv/include/uv/.+\\.h\"", private, "\"cm_uv.h\"", public ] },
{ include: [ "\"KWIML/include/kwiml/abi.h\"", private, "\"cm_kwiml.h\"", public ] },
{ include: [ "\"KWIML/include/kwiml/int.h\"", private, "\"cm_kwiml.h\"", public ] },
{ include: [ "\"cmzlib/cm_zlib_mangle.h\"", private, "\"cm_zlib.h\"", public ] },
@@ -126,6 +126,8 @@
{ symbol: [ "SIGINT", private, "\"cm_uv.h\"", public ] },
{ symbol: [ "ssize_t", private, "\"cm_uv.h\"", public ] },
+ { symbol: [ "Json::ArrayIndex", private, "\"cm_jsoncpp_value.h\"", public ] },
+
{ symbol: [ "std::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
{ symbol: [ "std::ofstream", private, "\"cmsys/FStream.hxx\"", public ] },
{ symbol: [ "cmsys::ifstream", private, "\"cmsys/FStream.hxx\"", public ] },
diff --git a/Utilities/Release/linux64_release.cmake b/Utilities/Release/linux64_release.cmake
index dc3412020..fa585d74b 100644
--- a/Utilities/Release/linux64_release.cmake
+++ b/Utilities/Release/linux64_release.cmake
@@ -29,9 +29,9 @@ CURSES_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libncurses.a
CURSES_INCLUDE_PATH:PATH=/home/kitware/ncurses-5.9/include
FORM_LIBRARY:FILEPATH=/home/kitware/ncurses-5.9/lib/libform.a
CMAKE_USE_OPENSSL:BOOL=ON
-OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.0h/lib/libcrypto.a;-pthread
-OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.0h/include
-OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.0h/lib/libssl.a
+OPENSSL_CRYPTO_LIBRARY:STRING=/home/kitware/openssl-1.1.1/lib/libcrypto.a;-pthread
+OPENSSL_INCLUDE_DIR:PATH=/home/kitware/openssl-1.1.1/include
+OPENSSL_SSL_LIBRARY:FILEPATH=/home/kitware/openssl-1.1.1/lib/libssl.a
PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
CPACK_SYSTEM_NAME:STRING=Linux-x86_64
BUILD_CursesDialog:BOOL=ON
diff --git a/Utilities/Release/upload_release.cmake b/Utilities/Release/upload_release.cmake
index bbc74379d..3613ae7a7 100644
--- a/Utilities/Release/upload_release.cmake
+++ b/Utilities/Release/upload_release.cmake
@@ -1,6 +1,6 @@
set(CTEST_RUN_CURRENT_SCRIPT 0)
if(NOT VERSION)
- set(VERSION 3.13)
+ set(VERSION 3.14)
endif()
if(NOT DEFINED PROJECT_PREFIX)
set(PROJECT_PREFIX cmake-${VERSION})
diff --git a/Utilities/Release/win32_release.cmake b/Utilities/Release/win32_release.cmake
index 2e817d925..c03c66550 100644
--- a/Utilities/Release/win32_release.cmake
+++ b/Utilities/Release/win32_release.cmake
@@ -25,13 +25,13 @@ BUILD_QtDialog:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
CMAKE_C_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG
-CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x86 -subsystem:console,5.01
+CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x86 -subsystem:console,6.01
CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES:STRING=${qt_win_libs}
CMAKE_PREFIX_PATH:STRING=${qt_prefix}
CMake_TEST_Qt4:BOOL=OFF
CMake_TEST_Qt5:BOOL=OFF
")
-set(ppflags "-D_WIN32_WINNT=0x501 -DNTDDI_VERSION=0x05010000 -D_USING_V110_SDK71_")
+set(ppflags "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000 -D_USING_V110_SDK71_")
set(CFLAGS "${ppflags}")
set(CXXFLAGS "${ppflags}")
set(ENV ". ~/rel/env32")
diff --git a/Utilities/Release/win64_release.cmake b/Utilities/Release/win64_release.cmake
index 33af830c4..84172067d 100644
--- a/Utilities/Release/win64_release.cmake
+++ b/Utilities/Release/win64_release.cmake
@@ -25,13 +25,13 @@ BUILD_QtDialog:BOOL=TRUE
CMake_GUI_DISTRIBUTE_WITH_Qt_LGPL:STRING=3
CMAKE_C_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-MT -O2 -Ob2 -DNDEBUG
-CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x64 -subsystem:console,5.02
+CMAKE_EXE_LINKER_FLAGS:STRING=-machine:x64 -subsystem:console,6.01
CMake_QT_STATIC_QWindowsIntegrationPlugin_LIBRARIES:STRING=${qt_win_libs}
CMAKE_PREFIX_PATH:STRING=${qt_prefix}
CMake_TEST_Qt4:BOOL=OFF
CMake_TEST_Qt5:BOOL=OFF
")
-set(ppflags "-D_WIN32_WINNT=0x502 -DNTDDI_VERSION=0x05020000 -D_USING_V110_SDK71_")
+set(ppflags "-D_WIN32_WINNT=0x601 -DNTDDI_VERSION=0x06010000 -D_USING_V110_SDK71_")
set(CFLAGS "${ppflags}")
set(CXXFLAGS "${ppflags}")
set(ENV ". ~/rel/env64")
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index 1cbc46371..15204d63f 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.1 FATAL_ERROR)
+ cmake_minimum_required(VERSION 3.1...3.12 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/cmake.py b/Utilities/Sphinx/cmake.py
index ebf44da45..d903dbe39 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -4,14 +4,58 @@
import os
import re
-# Monkey patch for pygments reporting an error when generator expressions are
-# used.
-# https://bitbucket.org/birkenfeld/pygments-main/issue/942/cmake-generator-expressions-not-handled
+# Override much of pygments' CMakeLexer.
+# We need to parse CMake syntax definitions, not CMake code.
+
+# For hard test cases that use much of the syntax below, see
+# - module/FindPkgConfig.html (with "glib-2.0>=2.10 gtk+-2.0" and similar)
+# - module/ExternalProject.html (with http:// https:// git@; also has command options -E --build)
+# - manual/cmake-buildsystem.7.html (with nested $<..>; relative and absolute paths, "::")
+
from pygments.lexers import CMakeLexer
-from pygments.token import Name, Operator
+from pygments.token import Name, Operator, Punctuation, String, Text, Comment, Generic, Whitespace, Number
from pygments.lexer import bygroups
-CMakeLexer.tokens["args"].append(('(\\$<)(.+?)(>)',
- bygroups(Operator, Name.Variable, Operator)))
+
+# Notes on regular expressions below:
+# - [\.\+-] are needed for string constants like gtk+-2.0
+# - Unix paths are recognized by '/'; support for Windows paths may be added if needed
+# - (\\.) allows for \-escapes (used in manual/cmake-language.7)
+# - $<..$<..$>..> nested occurence in cmake-buildsystem
+# - Nested variable evaluations are only supported in a limited capacity. Only
+# one level of nesting is supported and at most one nested variable can be present.
+
+CMakeLexer.tokens["root"] = [
+ (r'\b(\w+)([ \t]*)(\()', bygroups(Name.Function, Text, Name.Function), '#push'), # fctn(
+ (r'\(', Name.Function, '#push'),
+ (r'\)', Name.Function, '#pop'),
+ (r'\[', Punctuation, '#push'),
+ (r'\]', Punctuation, '#pop'),
+ (r'[|;,.=*\-]', Punctuation),
+ (r'\\\\', Punctuation), # used in commands/source_group
+ (r'[:]', Operator),
+ (r'[<>]=', Punctuation), # used in FindPkgConfig.cmake
+ (r'\$<', Operator, '#push'), # $<...>
+ (r'<[^<|]+?>(\w*\.\.\.)?', Name.Variable), # <expr>
+ (r'(\$\w*\{)([^\}\$]*)?(?:(\$\w*\{)([^\}]+?)(\}))?([^\}]*?)(\})', # ${..} $ENV{..}, possibly nested
+ bygroups(Operator, Name.Tag, Operator, Name.Tag, Operator, Name.Tag, Operator)),
+ (r'([A-Z]+\{)(.+?)(\})', bygroups(Operator, Name.Tag, Operator)), # DATA{ ...}
+ (r'[a-z]+(@|(://))((\\.)|[\w.+-:/\\])+', Name.Attribute), # URL, git@, ...
+ (r'/\w[\w\.\+-/\\]*', Name.Attribute), # absolute path
+ (r'/', Name.Attribute),
+ (r'\w[\w\.\+-]*/[\w.+-/\\]*', Name.Attribute), # relative path
+ (r'[A-Z]((\\.)|[\w.+-])*[a-z]((\\.)|[\w.+-])*', Name.Builtin), # initial A-Z, contains a-z
+ (r'@?[A-Z][A-Z0-9_]*', Name.Constant),
+ (r'[a-z_]((\\;)|(\\ )|[\w.+-])*', Name.Builtin),
+ (r'[0-9][0-9\.]*', Number),
+ (r'(?s)"(\\"|[^"])*"', String), # "string"
+ (r'\.\.\.', Name.Variable),
+ (r'<', Operator, '#push'), # <..|..> is different from <expr>
+ (r'>', Operator, '#pop'),
+ (r'\n', Whitespace),
+ (r'[ \t]+', Whitespace),
+ (r'#.*\n', Comment),
+ # (r'[^<>\])\}\|$"# \t\n]+', Name.Exception), # fallback, for debugging only
+]
# Monkey patch for sphinx generating invalid content for qcollectiongenerator
# https://bitbucket.org/birkenfeld/sphinx/issue/1435/qthelp-builder-should-htmlescape-keywords
diff --git a/Utilities/Sphinx/colors.py b/Utilities/Sphinx/colors.py
new file mode 100644
index 000000000..dae00634e
--- /dev/null
+++ b/Utilities/Sphinx/colors.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+
+from pygments.style import Style
+from pygments.token import Name, Comment, String, Number, Operator, Whitespace
+
+class CMakeTemplateStyle(Style):
+ """
+ for more token names, see pygments/styles.default
+ """
+
+ background_color = "#f8f8f8"
+ default_style = ""
+
+ styles = {
+ Whitespace: "#bbbbbb",
+ Comment: "italic #408080",
+ Operator: "#555555",
+ String: "#217A21",
+ Number: "#105030",
+ Name.Builtin: "#333333", # anything lowercase
+ Name.Function: "#007020", # function
+ Name.Variable: "#1080B0", # <..>
+ Name.Tag: "#bb60d5", # ${..}
+ Name.Constant: "#4070a0", # uppercase only
+ Name.Entity: "italic #70A020", # @..@
+ Name.Attribute: "#906060", # paths, URLs
+ Name.Label: "#A0A000", # anything left over
+ Name.Exception: "bold #FF0000", # for debugging only
+ }
diff --git a/Utilities/Sphinx/conf.py.in b/Utilities/Sphinx/conf.py.in
index f52ccd188..70ba08032 100644
--- a/Utilities/Sphinx/conf.py.in
+++ b/Utilities/Sphinx/conf.py.in
@@ -15,6 +15,7 @@ project = 'CMake'
copyright = '@conf_copyright@'
version = '@conf_version@' # feature version
release = '@conf_release@' # full version string
+pygments_style = 'colors.CMakeTemplateStyle'
primary_domain = 'cmake'
highlight_language = 'none'
diff --git a/Utilities/Sphinx/static/cmake-logo-16.png b/Utilities/Sphinx/static/cmake-logo-16.png
index 9c95b75f3..db9458dc1 100644
--- a/Utilities/Sphinx/static/cmake-logo-16.png
+++ b/Utilities/Sphinx/static/cmake-logo-16.png
Binary files differ
diff --git a/Utilities/cmThirdParty.h.in b/Utilities/cmThirdParty.h.in
index a547f0da7..46e0490c0 100644
--- a/Utilities/cmThirdParty.h.in
+++ b/Utilities/cmThirdParty.h.in
@@ -15,6 +15,5 @@
#cmakedefine CMAKE_USE_SYSTEM_JSONCPP
#cmakedefine CMAKE_USE_SYSTEM_LIBRHASH
#cmakedefine CMAKE_USE_SYSTEM_LIBUV
-#cmakedefine CTEST_USE_XMLRPC
#endif
diff --git a/Utilities/cm_xmlrpc.h b/Utilities/cm_xmlrpc.h
deleted file mode 100644
index 932066aaa..000000000
--- a/Utilities/cm_xmlrpc.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
- file Copyright.txt or https://cmake.org/licensing for details. */
-#ifndef cm_xmlrpc_h
-#define cm_xmlrpc_h
-
-/* Use the xmlrpc library configured for CMake. */
-#include "cmThirdParty.h"
-#ifdef CTEST_USE_XMLRPC
-# include <xmlrpc.h>
-# include <xmlrpc_client.h>
-#endif
-
-#endif
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 27b7507f6..1c96497cd 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -29,7 +29,7 @@ set(DISABLED_THREADSAFE OFF CACHE INTERNAL "Curl can use thread-safe functions")
set(ENABLE_ARES OFF CACHE INTERNAL "No curl c-ares support")
set(ENABLE_CURLDEBUG OFF CACHE INTERNAL "No curl TrackMemory features")
set(ENABLE_DEBUG OFF CACHE INTERNAL "No curl debug features")
-set(ENABLE_IPV6 OFF CACHE INTERNAL "No curl IPv6 support")
+set(ENABLE_IPV6 ON CACHE INTERNAL "Enable curl IPv6 support detection")
set(ENABLE_MANUAL OFF CACHE INTERNAL "No curl built-in manual")
set(ENABLE_THREADED_RESOLVER OFF CACHE INTERNAL "No curl POSIX threaded DNS lookup")
set(ENABLE_UNIX_SOCKETS OFF CACHE INTERNAL "No curl Unix domain sockets support")
@@ -123,7 +123,6 @@ endif()
# To check:
# (From Daniel Stenberg) The cmake build selected to run gcc with -fPIC on my box while the plain configure script did not.
# (From Daniel Stenberg) The gcc command line use neither -g nor any -O options. As a developer, I also treasure our configure scripts's --enable-debug option that sets a long range of "picky" compiler options.
-cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
include(Utilities)
include(Macros)
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
index 0249cc9f1..6eeba0e65 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
@@ -1581,7 +1581,7 @@ bool OurReader::decodeNumber(Token& token, Value& decoded) {
++current;
// TODO: Help the compiler do the div and mod at compile time or get rid of them.
Value::LargestUInt maxIntegerValue =
- isNegative ? Value::LargestUInt(-Value::minLargestInt)
+ isNegative ? Value::LargestUInt(Value::minLargestInt)
: Value::maxLargestUInt;
Value::LargestUInt threshold = maxIntegerValue / 10;
Value::LargestUInt value = 0;
diff --git a/Utilities/cmliblzma/liblzma/simple/x86.c b/Utilities/cmliblzma/liblzma/simple/x86.c
index 23d0c4293..b38cebfd5 100644
--- a/Utilities/cmliblzma/liblzma/simple/x86.c
+++ b/Utilities/cmliblzma/liblzma/simple/x86.c
@@ -97,7 +97,7 @@ x86_code(void *simple_ptr, uint32_t now_pos, bool is_encoder,
if (!Test86MSByte(b))
break;
- src = dest ^ ((1u << (32 - i * 8)) - 1);
+ src = dest ^ ((1ull << (32 - i * 8)) - 1);
}
buffer[buffer_pos + 4]
diff --git a/Utilities/cmlibuv/CMakeLists.txt b/Utilities/cmlibuv/CMakeLists.txt
index a503041be..a62c516ef 100644
--- a/Utilities/cmlibuv/CMakeLists.txt
+++ b/Utilities/cmlibuv/CMakeLists.txt
@@ -14,16 +14,21 @@ set(uv_libraries ${CMAKE_THREAD_LIBS_INIT})
set(uv_includes include src)
set(uv_headers
include/uv.h
- include/uv-errno.h
- include/uv-threadpool.h
- include/uv-version.h
+ include/uv/errno.h
+ include/uv/threadpool.h
+ include/uv/version.h
)
set(uv_sources
src/fs-poll.c
src/heap-inl.h
+ src/idna.c
+ src/idna.h
src/inet.c
src/queue.h
+ src/strscpy.c
+ src/strscpy.h
src/threadpool.c
+ src/timer.c
src/uv-common.c
src/uv-common.h
src/uv-data-getter-setters.c
@@ -45,7 +50,7 @@ if(WIN32)
_WIN32_WINNT=0x0600
)
list(APPEND uv_headers
- include/uv-win.h
+ include/uv/win.h
include/tree.h
)
list(APPEND uv_sources
@@ -67,7 +72,6 @@ if(WIN32)
src/win/poll.c
src/win/process-stdio.c
src/win/process.c
- src/win/req.c
src/win/req-inl.h
src/win/signal.c
src/win/snprintf.c
@@ -75,7 +79,6 @@ if(WIN32)
src/win/stream-inl.h
src/win/tcp.c
src/win/thread.c
- src/win/timer.c
src/win/tty.c
src/win/udp.c
src/win/util.c
@@ -89,7 +92,7 @@ else()
src/unix
)
list(APPEND uv_headers
- include/uv-unix.h
+ include/uv/unix.h
)
list(APPEND uv_sources
src/unix/async.c
@@ -110,7 +113,6 @@ else()
src/unix/stream.c
src/unix/tcp.c
src/unix/thread.c
- src/unix/timer.c
src/unix/tty.c
src/unix/udp.c
)
@@ -121,7 +123,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
perfstat
)
list(APPEND uv_headers
- include/uv-aix.h
+ include/uv/aix.h
)
list(APPEND uv_defines
_ALL_SOURCE
@@ -139,7 +141,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "CYGWIN")
list(APPEND uv_libraries
)
list(APPEND uv_headers
- include/uv-posix.h
+ include/uv/posix.h
)
list(APPEND uv_defines
)
@@ -158,8 +160,7 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND uv_headers
- include/uv-darwin.h
- include/pthread-barrier.h
+ include/uv/darwin.h
)
list(APPEND uv_defines
_DARWIN_USE_64_BIT_INODE=1
@@ -178,7 +179,7 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND uv_libraries dl rt)
list(APPEND uv_headers
- include/uv-linux.h
+ include/uv/linux.h
)
list(APPEND uv_defines _GNU_SOURCE)
list(APPEND uv_sources
@@ -198,10 +199,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
kvm
)
list(APPEND uv_headers
- include/uv-bsd.h
+ include/uv/bsd.h
)
list(APPEND uv_sources
src/unix/bsd-ifaddrs.c
+ src/unix/bsd-proctitle.c
src/unix/freebsd.c
src/unix/kqueue.c
src/unix/posix-hrtime.c
@@ -214,10 +216,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "kFreeBSD")
kvm
)
list(APPEND uv_headers
- include/uv-bsd.h
+ include/uv/bsd.h
)
list(APPEND uv_sources
src/unix/bsd-ifaddrs.c
+ src/unix/bsd-proctitle.c
src/unix/freebsd.c
src/unix/kqueue.c
src/unix/posix-hrtime.c
@@ -229,10 +232,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
kvm
)
list(APPEND uv_headers
- include/uv-bsd.h
+ include/uv/bsd.h
)
list(APPEND uv_sources
src/unix/bsd-ifaddrs.c
+ src/unix/bsd-proctitle.c
src/unix/netbsd.c
src/unix/kqueue.c
src/unix/posix-hrtime.c
@@ -244,10 +248,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
kvm
)
list(APPEND uv_headers
- include/uv-bsd.h
+ include/uv/bsd.h
)
list(APPEND uv_sources
src/unix/bsd-ifaddrs.c
+ src/unix/bsd-proctitle.c
src/unix/openbsd.c
src/unix/kqueue.c
src/unix/posix-hrtime.c
@@ -263,7 +268,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
rt
)
list(APPEND uv_headers
- include/uv-sunos.h
+ include/uv/sunos.h
)
list(APPEND uv_defines
__EXTENSIONS__
diff --git a/Utilities/cmlibuv/include/pthread-barrier.h b/Utilities/cmlibuv/include/pthread-barrier.h
deleted file mode 100644
index 07db9b8a6..000000000
--- a/Utilities/cmlibuv/include/pthread-barrier.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
-Copyright (c) 2016, Kari Tristan Helgason <kthelgason@gmail.com>
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-*/
-
-#ifndef _UV_PTHREAD_BARRIER_
-#define _UV_PTHREAD_BARRIER_
-#include <errno.h>
-#include <pthread.h>
-#if !defined(__MVS__)
-#include <semaphore.h> /* sem_t */
-#endif
-
-#define PTHREAD_BARRIER_SERIAL_THREAD 0x12345
-#define UV__PTHREAD_BARRIER_FALLBACK 1
-
-/*
- * To maintain ABI compatibility with
- * libuv v1.x struct is padded according
- * to target platform
- */
-#if defined(__ANDROID__)
-# define UV_BARRIER_STRUCT_PADDING \
- sizeof(pthread_mutex_t) + \
- sizeof(pthread_cond_t) + \
- sizeof(unsigned int) - \
- sizeof(void *)
-#elif defined(__APPLE__)
-# define UV_BARRIER_STRUCT_PADDING \
- sizeof(pthread_mutex_t) + \
- 2 * sizeof(sem_t) + \
- 2 * sizeof(unsigned int) - \
- sizeof(void *)
-#else
-# define UV_BARRIER_STRUCT_PADDING 0
-#endif
-
-typedef struct {
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- unsigned threshold;
- unsigned in;
- unsigned out;
-} _uv_barrier;
-
-typedef struct {
- _uv_barrier* b;
- char _pad[UV_BARRIER_STRUCT_PADDING];
-} pthread_barrier_t;
-
-int pthread_barrier_init(pthread_barrier_t* barrier,
- const void* barrier_attr,
- unsigned count);
-
-int pthread_barrier_wait(pthread_barrier_t* barrier);
-int pthread_barrier_destroy(pthread_barrier_t *barrier);
-
-#endif /* _UV_PTHREAD_BARRIER_ */
diff --git a/Utilities/cmlibuv/include/uv.h b/Utilities/cmlibuv/include/uv.h
index 74fa00dfc..e6dc7368a 100644
--- a/Utilities/cmlibuv/include/uv.h
+++ b/Utilities/cmlibuv/include/uv.h
@@ -49,21 +49,21 @@ extern "C" {
# define UV_EXTERN /* nothing */
#endif
-#include "uv-errno.h"
-#include "uv-version.h"
+#include "uv/errno.h"
+#include "uv/version.h"
#include <stddef.h>
#include <stdio.h>
#if defined(_MSC_VER) && _MSC_VER < 1600
-# include "stdint-msvc2008.h"
+# include "uv/stdint-msvc2008.h"
#else
# include <stdint.h>
#endif
#if defined(_WIN32)
-# include "uv-win.h"
+# include "uv/win.h"
#else
-# include "uv-unix.h"
+# include "uv/unix.h"
#endif
/* Expand this list if necessary. */
@@ -146,6 +146,7 @@ extern "C" {
XX(EHOSTDOWN, "host is down") \
XX(EREMOTEIO, "remote I/O error") \
XX(ENOTTY, "inappropriate ioctl for device") \
+ XX(EFTYPE, "inappropriate file type or format") \
#define UV_HANDLE_TYPE_MAP(XX) \
XX(ASYNC, async) \
@@ -237,6 +238,7 @@ typedef struct uv_cpu_info_s uv_cpu_info_t;
typedef struct uv_interface_address_s uv_interface_address_t;
typedef struct uv_dirent_s uv_dirent_t;
typedef struct uv_passwd_s uv_passwd_t;
+typedef struct uv_utsname_s uv_utsname_t;
typedef enum {
UV_LOOP_BLOCK_SIGNAL
@@ -373,7 +375,10 @@ typedef enum {
UV_EXTERN int uv_translate_sys_error(int sys_errno);
UV_EXTERN const char* uv_strerror(int err);
+UV_EXTERN char* uv_strerror_r(int err, char* buf, size_t buflen);
+
UV_EXTERN const char* uv_err_name(int err);
+UV_EXTERN char* uv_err_name_r(int err, char* buf, size_t buflen);
#define UV_REQ_FIELDS \
@@ -507,7 +512,7 @@ UV_EXTERN int uv_try_write(uv_stream_t* handle,
struct uv_write_s {
UV_REQ_FIELDS
uv_write_cb cb;
- uv_stream_t* send_handle;
+ uv_stream_t* send_handle; /* TODO: make private and unix-only in v2.x. */
uv_stream_t* handle;
UV_WRITE_PRIVATE_FIELDS
};
@@ -869,7 +874,13 @@ typedef enum {
* flags may be specified to create a duplex data stream.
*/
UV_READABLE_PIPE = 0x10,
- UV_WRITABLE_PIPE = 0x20
+ UV_WRITABLE_PIPE = 0x20,
+
+ /*
+ * Open the child pipe handle in overlapped mode on Windows.
+ * On Unix it is silently ignored.
+ */
+ UV_OVERLAPPED_PIPE = 0x40
} uv_stdio_flags;
typedef struct uv_stdio_container_s {
@@ -970,11 +981,22 @@ enum uv_process_flags {
*/
UV_PROCESS_DETACHED = (1 << 3),
/*
+ * Hide the subprocess window that would normally be created. This option is
+ * only meaningful on Windows systems. On Unix it is silently ignored.
+ */
+ UV_PROCESS_WINDOWS_HIDE = (1 << 4),
+ /*
* Hide the subprocess console window that would normally be created. This
* option is only meaningful on Windows systems. On Unix it is silently
* ignored.
*/
- UV_PROCESS_WINDOWS_HIDE = (1 << 4)
+ UV_PROCESS_WINDOWS_HIDE_CONSOLE = (1 << 5),
+ /*
+ * Hide the subprocess GUI window that would normally be created. This
+ * option is only meaningful on Windows systems. On Unix it is silently
+ * ignored.
+ */
+ UV_PROCESS_WINDOWS_HIDE_GUI = (1 << 6)
};
/*
@@ -1014,16 +1036,18 @@ UV_EXTERN int uv_queue_work(uv_loop_t* loop,
UV_EXTERN int uv_cancel(uv_req_t* req);
+struct uv_cpu_times_s {
+ uint64_t user;
+ uint64_t nice;
+ uint64_t sys;
+ uint64_t idle;
+ uint64_t irq;
+};
+
struct uv_cpu_info_s {
char* model;
int speed;
- struct uv_cpu_times_s {
- uint64_t user;
- uint64_t nice;
- uint64_t sys;
- uint64_t idle;
- uint64_t irq;
- } cpu_times;
+ struct uv_cpu_times_s cpu_times;
};
struct uv_interface_address_s {
@@ -1048,6 +1072,16 @@ struct uv_passwd_s {
char* homedir;
};
+struct uv_utsname_s {
+ char sysname[256];
+ char release[256];
+ char version[256];
+ char machine[256];
+ /* This struct does not contain the nodename and domainname fields present in
+ the utsname type. domainname is a GNU extension. Both fields are referred
+ to as meaningless in the docs. */
+};
+
typedef enum {
UV_DIRENT_UNKNOWN,
UV_DIRENT_FILE,
@@ -1070,6 +1104,7 @@ UV_EXTERN int uv_set_process_title(const char* title);
UV_EXTERN int uv_resident_set_memory(size_t* rss);
UV_EXTERN int uv_uptime(double* uptime);
UV_EXTERN uv_os_fd_t uv_get_osfhandle(int fd);
+UV_EXTERN int uv_open_osfhandle(uv_os_fd_t os_fd);
typedef struct {
long tv_sec;
@@ -1104,6 +1139,16 @@ UV_EXTERN void uv_os_free_passwd(uv_passwd_t* pwd);
UV_EXTERN uv_pid_t uv_os_getpid(void);
UV_EXTERN uv_pid_t uv_os_getppid(void);
+#define UV_PRIORITY_LOW 19
+#define UV_PRIORITY_BELOW_NORMAL 10
+#define UV_PRIORITY_NORMAL 0
+#define UV_PRIORITY_ABOVE_NORMAL -7
+#define UV_PRIORITY_HIGH -14
+#define UV_PRIORITY_HIGHEST -20
+
+UV_EXTERN int uv_os_getpriority(uv_pid_t pid, int* priority);
+UV_EXTERN int uv_os_setpriority(uv_pid_t pid, int priority);
+
UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count);
UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count);
UV_EXTERN int uv_cpumask_size(void);
@@ -1119,6 +1164,8 @@ UV_EXTERN int uv_os_unsetenv(const char* name);
UV_EXTERN int uv_os_gethostname(char* buffer, size_t* size);
+UV_EXTERN int uv_os_uname(uv_utsname_t* buffer);
+
typedef enum {
UV_FS_UNKNOWN = -1,
@@ -1151,7 +1198,8 @@ typedef enum {
UV_FS_CHOWN,
UV_FS_FCHOWN,
UV_FS_REALPATH,
- UV_FS_COPYFILE
+ UV_FS_COPYFILE,
+ UV_FS_LCHOWN
} uv_fs_type;
/* uv_fs_t is a subclass of uv_req_t. */
@@ -1354,6 +1402,12 @@ UV_EXTERN int uv_fs_fchown(uv_loop_t* loop,
uv_uid_t uid,
uv_gid_t gid,
uv_fs_cb cb);
+UV_EXTERN int uv_fs_lchown(uv_loop_t* loop,
+ uv_fs_t* req,
+ const char* path,
+ uv_uid_t uid,
+ uv_gid_t gid,
+ uv_fs_cb cb);
enum uv_fs_event {
diff --git a/Utilities/cmlibuv/include/uv-aix.h b/Utilities/cmlibuv/include/uv/aix.h
index 7dc992fa6..7dc992fa6 100644
--- a/Utilities/cmlibuv/include/uv-aix.h
+++ b/Utilities/cmlibuv/include/uv/aix.h
diff --git a/Utilities/cmlibuv/include/android-ifaddrs.h b/Utilities/cmlibuv/include/uv/android-ifaddrs.h
index 9cd19fec1..9cd19fec1 100644
--- a/Utilities/cmlibuv/include/android-ifaddrs.h
+++ b/Utilities/cmlibuv/include/uv/android-ifaddrs.h
diff --git a/Utilities/cmlibuv/include/uv-bsd.h b/Utilities/cmlibuv/include/uv/bsd.h
index 2d72b3d77..2d72b3d77 100644
--- a/Utilities/cmlibuv/include/uv-bsd.h
+++ b/Utilities/cmlibuv/include/uv/bsd.h
diff --git a/Utilities/cmlibuv/include/uv-darwin.h b/Utilities/cmlibuv/include/uv/darwin.h
index d22641582..d22641582 100644
--- a/Utilities/cmlibuv/include/uv-darwin.h
+++ b/Utilities/cmlibuv/include/uv/darwin.h
diff --git a/Utilities/cmlibuv/include/uv-errno.h b/Utilities/cmlibuv/include/uv/errno.h
index aa4d4509f..8eeb95de3 100644
--- a/Utilities/cmlibuv/include/uv-errno.h
+++ b/Utilities/cmlibuv/include/uv/errno.h
@@ -433,5 +433,11 @@
# define UV__ENOTTY (-4029)
#endif
+#if defined(EFTYPE) && !defined(_WIN32)
+# define UV__EFTYPE UV__ERR(EFTYPE)
+#else
+# define UV__EFTYPE (-4028)
+#endif
+
#endif /* UV_ERRNO_H_ */
diff --git a/Utilities/cmlibuv/include/uv-linux.h b/Utilities/cmlibuv/include/uv/linux.h
index 9b38405a1..9b38405a1 100644
--- a/Utilities/cmlibuv/include/uv-linux.h
+++ b/Utilities/cmlibuv/include/uv/linux.h
diff --git a/Utilities/cmlibuv/include/uv-os390.h b/Utilities/cmlibuv/include/uv/os390.h
index 0267d74cb..0267d74cb 100644
--- a/Utilities/cmlibuv/include/uv-os390.h
+++ b/Utilities/cmlibuv/include/uv/os390.h
diff --git a/Utilities/cmlibuv/include/uv-posix.h b/Utilities/cmlibuv/include/uv/posix.h
index 9a96634db..9a96634db 100644
--- a/Utilities/cmlibuv/include/uv-posix.h
+++ b/Utilities/cmlibuv/include/uv/posix.h
diff --git a/Utilities/cmlibuv/include/stdint-msvc2008.h b/Utilities/cmlibuv/include/uv/stdint-msvc2008.h
index d02608a59..d02608a59 100644
--- a/Utilities/cmlibuv/include/stdint-msvc2008.h
+++ b/Utilities/cmlibuv/include/uv/stdint-msvc2008.h
diff --git a/Utilities/cmlibuv/include/uv-sunos.h b/Utilities/cmlibuv/include/uv/sunos.h
index 042166424..042166424 100644
--- a/Utilities/cmlibuv/include/uv-sunos.h
+++ b/Utilities/cmlibuv/include/uv/sunos.h
diff --git a/Utilities/cmlibuv/include/uv-threadpool.h b/Utilities/cmlibuv/include/uv/threadpool.h
index 9708ebdd5..9708ebdd5 100644
--- a/Utilities/cmlibuv/include/uv-threadpool.h
+++ b/Utilities/cmlibuv/include/uv/threadpool.h
diff --git a/Utilities/cmlibuv/include/tree.h b/Utilities/cmlibuv/include/uv/tree.h
index f936416e3..f936416e3 100644
--- a/Utilities/cmlibuv/include/tree.h
+++ b/Utilities/cmlibuv/include/uv/tree.h
diff --git a/Utilities/cmlibuv/include/uv-unix.h b/Utilities/cmlibuv/include/uv/unix.h
index 455674d1a..3c1b36369 100644
--- a/Utilities/cmlibuv/include/uv-unix.h
+++ b/Utilities/cmlibuv/include/uv/unix.h
@@ -42,34 +42,32 @@
#include <pthread.h>
#include <signal.h>
-#include "uv-threadpool.h"
+#include "threadpool.h"
#ifdef CMAKE_BOOTSTRAP
-# include "uv-posix.h"
+# include "posix.h"
#elif defined(__linux__)
-# include "uv-linux.h"
+# include "linux.h"
#elif defined (__MVS__)
-# include "uv-os390.h"
+# include "os390.h"
#elif defined(__PASE__)
-# include "uv-posix.h"
+# include "posix.h"
#elif defined(_AIX)
-# include "uv-aix.h"
+# include "aix.h"
#elif defined(__sun)
-# include "uv-sunos.h"
+# include "sunos.h"
#elif defined(__APPLE__)
-# include "uv-darwin.h"
+# include "darwin.h"
#elif defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__)
-# include "uv-bsd.h"
+# include "bsd.h"
#elif defined(__CYGWIN__) || defined(__MSYS__)
-# include "uv-posix.h"
-#endif
-
-#ifndef PTHREAD_BARRIER_SERIAL_THREAD
-# include "pthread-barrier.h"
+# include "posix.h"
+#elif defined(__GNU__)
+# include "posix.h"
#endif
#ifndef NI_MAXHOST
@@ -149,9 +147,30 @@ typedef pthread_rwlock_t uv_rwlock_t;
typedef UV_PLATFORM_SEM_T uv_sem_t;
typedef pthread_cond_t uv_cond_t;
typedef pthread_key_t uv_key_t;
+
+/* Note: guard clauses should match uv_barrier_init's in src/unix/thread.c. */
+#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
+/* TODO(bnoordhuis) Merge into uv_barrier_t in v2. */
+struct _uv_barrier {
+ uv_mutex_t mutex;
+ uv_cond_t cond;
+ unsigned threshold;
+ unsigned in;
+ unsigned out;
+};
+
+typedef struct {
+ struct _uv_barrier* b;
+# if defined(PTHREAD_BARRIER_SERIAL_THREAD)
+ /* TODO(bnoordhuis) Remove padding in v2. */
+ char pad[sizeof(pthread_barrier_t) - sizeof(struct _uv_barrier*)];
+# endif
+} uv_barrier_t;
+#else
typedef pthread_barrier_t uv_barrier_t;
#endif
+#endif
/* Platform-specific definitions for uv_spawn support. */
typedef gid_t uv_gid_t;
diff --git a/Utilities/cmlibuv/include/uv-version.h b/Utilities/cmlibuv/include/uv/version.h
index 06c6711c6..abc140a3b 100644
--- a/Utilities/cmlibuv/include/uv-version.h
+++ b/Utilities/cmlibuv/include/uv/version.h
@@ -31,8 +31,8 @@
*/
#define UV_VERSION_MAJOR 1
-#define UV_VERSION_MINOR 20
-#define UV_VERSION_PATCH 3
+#define UV_VERSION_MINOR 24
+#define UV_VERSION_PATCH 2
#define UV_VERSION_IS_RELEASE 0
#define UV_VERSION_SUFFIX "dev"
diff --git a/Utilities/cmlibuv/include/uv-win.h b/Utilities/cmlibuv/include/uv/win.h
index 6486aabb3..f3d3809f3 100644
--- a/Utilities/cmlibuv/include/uv-win.h
+++ b/Utilities/cmlibuv/include/uv/win.h
@@ -25,6 +25,7 @@
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
typedef intptr_t ssize_t;
+# define SSIZE_MAX INTPTR_MAX
# define _SSIZE_T_
# define _SSIZE_T_DEFINED
#endif
@@ -59,7 +60,7 @@ typedef struct pollfd {
#endif
#include "tree.h"
-#include "uv-threadpool.h"
+#include "threadpool.h"
#define MAX_PIPENAME_LEN 256
@@ -86,8 +87,16 @@ typedef struct pollfd {
#define SIGKILL 9
#define SIGWINCH 28
-/* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many */
-/* unix-like platforms. However MinGW doesn't define it, so we do. */
+/* Redefine NSIG to take SIGWINCH into consideration */
+#if defined(NSIG) && NSIG <= SIGWINCH
+# undef NSIG
+#endif
+#ifndef NSIG
+# define NSIG SIGWINCH + 1
+#endif
+
+/* The CRT defines SIGABRT_COMPAT as 6, which equals SIGABRT on many unix-like
+ * platforms. However MinGW doesn't define it, so we do. */
#ifndef SIGABRT_COMPAT
# define SIGABRT_COMPAT 6
#endif
@@ -255,7 +264,7 @@ typedef union {
CRITICAL_SECTION waiters_count_lock;
HANDLE signal_event;
HANDLE broadcast_event;
- } fallback;
+ } unused_; /* TODO: retained for ABI compatibility; remove me in v2.x. */
} uv_cond_t;
typedef union {
@@ -319,8 +328,6 @@ typedef struct {
char* errmsg;
} uv_lib_t;
-RB_HEAD(uv_timer_tree_s, uv_timer_s);
-
#define UV_LOOP_PRIVATE_FIELDS \
/* The loop's I/O completion port */ \
HANDLE iocp; \
@@ -332,8 +339,8 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
uv_req_t* pending_reqs_tail; \
/* Head of a single-linked list of closed handles */ \
uv_handle_t* endgame_handles; \
- /* The head of the timers tree */ \
- struct uv_timer_tree_s timers; \
+ /* TODO(bnoordhuis) Stop heap-allocating |timer_heap| in libuv v2.x. */ \
+ void* timer_heap; \
/* Lists of active loop (prepare / check / idle) watchers */ \
uv_prepare_t* prepare_handles; \
uv_check_t* check_handles; \
@@ -379,10 +386,10 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
} u; \
struct uv_req_s* next_req;
-#define UV_WRITE_PRIVATE_FIELDS \
- int ipc_header; \
- uv_buf_t write_buffer; \
- HANDLE event_handle; \
+#define UV_WRITE_PRIVATE_FIELDS \
+ int coalesced; \
+ uv_buf_t write_buffer; \
+ HANDLE event_handle; \
HANDLE wait_handle;
#define UV_CONNECT_PRIVATE_FIELDS \
@@ -470,16 +477,17 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
#define uv_pipe_connection_fields \
uv_timer_t* eof_timer; \
- uv_write_t ipc_header_write_req; \
- int ipc_pid; \
- uint64_t remaining_ipc_rawdata_bytes; \
- struct { \
- void* queue[2]; \
- int queue_len; \
- } pending_ipc_info; \
+ uv_write_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \
+ DWORD ipc_remote_pid; \
+ union { \
+ uint32_t payload_remaining; \
+ uint64_t dummy; /* TODO: retained for ABI compat; remove this in v2.x. */ \
+ } ipc_data_frame; \
+ void* ipc_xfer_queue[2]; \
+ int ipc_xfer_queue_length; \
uv_write_t* non_overlapped_writes_tail; \
- uv_mutex_t readfile_mutex; \
- volatile HANDLE readfile_thread;
+ CRITICAL_SECTION readfile_thread_lock; \
+ volatile HANDLE readfile_thread_handle;
#define UV_PIPE_PRIVATE_FIELDS \
HANDLE handle; \
@@ -489,8 +497,8 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
struct { uv_pipe_connection_fields } conn; \
} pipe;
-/* TODO: put the parser states in an union - TTY handles are always */
-/* half-duplex so read-state can safely overlap write-state. */
+/* TODO: put the parser states in an union - TTY handles are always half-duplex
+ * so read-state can safely overlap write-state. */
#define UV_TTY_PRIVATE_FIELDS \
HANDLE handle; \
union { \
@@ -539,8 +547,9 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
unsigned char events;
#define UV_TIMER_PRIVATE_FIELDS \
- RB_ENTRY(uv_timer_s) tree_entry; \
- uint64_t due; \
+ void* heap_node[3]; \
+ int unused; \
+ uint64_t timeout; \
uint64_t repeat; \
uint64_t start_id; \
uv_timer_cb timer_cb;
diff --git a/Utilities/cmlibuv/src/fs-poll.c b/Utilities/cmlibuv/src/fs-poll.c
index ee73d5a2e..6c82dfc1d 100644
--- a/Utilities/cmlibuv/src/fs-poll.c
+++ b/Utilities/cmlibuv/src/fs-poll.c
@@ -83,7 +83,7 @@ int uv_fs_poll_start(uv_fs_poll_t* handle,
if (err < 0)
goto error;
- ctx->timer_handle.flags |= UV__HANDLE_INTERNAL;
+ ctx->timer_handle.flags |= UV_HANDLE_INTERNAL;
uv__handle_unref(&ctx->timer_handle);
err = uv_fs_stat(loop, &ctx->fs_req, ctx->path, poll_cb);
@@ -248,7 +248,7 @@ static int statbuf_eq(const uv_stat_t* a, const uv_stat_t* b) {
#include "win/handle-inl.h"
void uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle) {
- assert(handle->flags & UV__HANDLE_CLOSING);
+ assert(handle->flags & UV_HANDLE_CLOSING);
assert(!(handle->flags & UV_HANDLE_CLOSED));
uv__handle_close(handle);
}
diff --git a/Utilities/cmlibuv/src/idna.c b/Utilities/cmlibuv/src/idna.c
new file mode 100644
index 000000000..13ffac6be
--- /dev/null
+++ b/Utilities/cmlibuv/src/idna.c
@@ -0,0 +1,291 @@
+/* Copyright (c) 2011, 2018 Ben Noordhuis <info@bnoordhuis.nl>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/* Derived from https://github.com/bnoordhuis/punycode
+ * but updated to support IDNA 2008.
+ */
+
+#include "uv.h"
+#include "idna.h"
+#include <string.h>
+
+static unsigned uv__utf8_decode1_slow(const char** p,
+ const char* pe,
+ unsigned a) {
+ unsigned b;
+ unsigned c;
+ unsigned d;
+ unsigned min;
+
+ if (a > 0xF7)
+ return -1;
+
+ switch (*p - pe) {
+ default:
+ if (a > 0xEF) {
+ min = 0x10000;
+ a = a & 7;
+ b = (unsigned char) *(*p)++;
+ c = (unsigned char) *(*p)++;
+ d = (unsigned char) *(*p)++;
+ break;
+ }
+ /* Fall through. */
+ case 2:
+ if (a > 0xDF) {
+ min = 0x800;
+ b = 0x80 | (a & 15);
+ c = (unsigned char) *(*p)++;
+ d = (unsigned char) *(*p)++;
+ a = 0;
+ break;
+ }
+ /* Fall through. */
+ case 1:
+ if (a > 0xBF) {
+ min = 0x80;
+ b = 0x80;
+ c = 0x80 | (a & 31);
+ d = (unsigned char) *(*p)++;
+ a = 0;
+ break;
+ }
+ return -1; /* Invalid continuation byte. */
+ }
+
+ if (0x80 != (0xC0 & (b ^ c ^ d)))
+ return -1; /* Invalid sequence. */
+
+ b &= 63;
+ c &= 63;
+ d &= 63;
+ a = (a << 18) | (b << 12) | (c << 6) | d;
+
+ if (a < min)
+ return -1; /* Overlong sequence. */
+
+ if (a > 0x10FFFF)
+ return -1; /* Four-byte sequence > U+10FFFF. */
+
+ if (a >= 0xD800 && a <= 0xDFFF)
+ return -1; /* Surrogate pair. */
+
+ return a;
+}
+
+unsigned uv__utf8_decode1(const char** p, const char* pe) {
+ unsigned a;
+
+ a = (unsigned char) *(*p)++;
+
+ if (a < 128)
+ return a; /* ASCII, common case. */
+
+ return uv__utf8_decode1_slow(p, pe, a);
+}
+
+#define foreach_codepoint(c, p, pe) \
+ for (; (void) (*p <= pe && (c = uv__utf8_decode1(p, pe))), *p <= pe;)
+
+static int uv__idna_toascii_label(const char* s, const char* se,
+ char** d, char* de) {
+ static const char alphabet[] = "abcdefghijklmnopqrstuvwxyz0123456789";
+ const char* ss;
+ unsigned c;
+ unsigned h;
+ unsigned k;
+ unsigned n;
+ unsigned m;
+ unsigned q;
+ unsigned t;
+ unsigned x;
+ unsigned y;
+ unsigned bias;
+ unsigned delta;
+ unsigned todo;
+ int first;
+
+ h = 0;
+ ss = s;
+ todo = 0;
+
+ foreach_codepoint(c, &s, se) {
+ if (c < 128)
+ h++;
+ else if (c == (unsigned) -1)
+ return UV_EINVAL;
+ else
+ todo++;
+ }
+
+ if (todo > 0) {
+ if (*d < de) *(*d)++ = 'x';
+ if (*d < de) *(*d)++ = 'n';
+ if (*d < de) *(*d)++ = '-';
+ if (*d < de) *(*d)++ = '-';
+ }
+
+ x = 0;
+ s = ss;
+ foreach_codepoint(c, &s, se) {
+ if (c > 127)
+ continue;
+
+ if (*d < de)
+ *(*d)++ = c;
+
+ if (++x == h)
+ break; /* Visited all ASCII characters. */
+ }
+
+ if (todo == 0)
+ return h;
+
+ /* Only write separator when we've written ASCII characters first. */
+ if (h > 0)
+ if (*d < de)
+ *(*d)++ = '-';
+
+ n = 128;
+ bias = 72;
+ delta = 0;
+ first = 1;
+
+ while (todo > 0) {
+ m = -1;
+ s = ss;
+ foreach_codepoint(c, &s, se)
+ if (c >= n)
+ if (c < m)
+ m = c;
+
+ x = m - n;
+ y = h + 1;
+
+ if (x > ~delta / y)
+ return UV_E2BIG; /* Overflow. */
+
+ delta += x * y;
+ n = m;
+
+ s = ss;
+ foreach_codepoint(c, &s, se) {
+ if (c < n)
+ if (++delta == 0)
+ return UV_E2BIG; /* Overflow. */
+
+ if (c != n)
+ continue;
+
+ for (k = 36, q = delta; /* empty */; k += 36) {
+ t = 1;
+
+ if (k > bias)
+ t = k - bias;
+
+ if (t > 26)
+ t = 26;
+
+ if (q < t)
+ break;
+
+ /* TODO(bnoordhuis) Since 1 <= t <= 26 and therefore
+ * 10 <= y <= 35, we can optimize the long division
+ * into a table-based reciprocal multiplication.
+ */
+ x = q - t;
+ y = 36 - t; /* 10 <= y <= 35 since 1 <= t <= 26. */
+ q = x / y;
+ t = t + x % y; /* 1 <= t <= 35 because of y. */
+
+ if (*d < de)
+ *(*d)++ = alphabet[t];
+ }
+
+ if (*d < de)
+ *(*d)++ = alphabet[q];
+
+ delta /= 2;
+
+ if (first) {
+ delta /= 350;
+ first = 0;
+ }
+
+ /* No overflow check is needed because |delta| was just
+ * divided by 2 and |delta+delta >= delta + delta/h|.
+ */
+ h++;
+ delta += delta / h;
+
+ for (bias = 0; delta > 35 * 26 / 2; bias += 36)
+ delta /= 35;
+
+ bias += 36 * delta / (delta + 38);
+ delta = 0;
+ todo--;
+ }
+
+ delta++;
+ n++;
+ }
+
+ return 0;
+}
+
+#undef foreach_codepoint
+
+long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
+ const char* si;
+ const char* st;
+ unsigned c;
+ char* ds;
+ int rc;
+
+ ds = d;
+
+ for (si = s; si < se; /* empty */) {
+ st = si;
+ c = uv__utf8_decode1(&si, se);
+
+ if (c != '.')
+ if (c != 0x3002) /* 。 */
+ if (c != 0xFF0E) /* . */
+ if (c != 0xFF61) /* 。 */
+ continue;
+
+ rc = uv__idna_toascii_label(s, st, &d, de);
+
+ if (rc < 0)
+ return rc;
+
+ if (d < de)
+ *d++ = '.';
+
+ s = si;
+ }
+
+ if (s < se) {
+ rc = uv__idna_toascii_label(s, se, &d, de);
+
+ if (rc < 0)
+ return rc;
+ }
+
+ if (d < de)
+ *d++ = '\0';
+
+ return d - ds; /* Number of bytes written. */
+}
diff --git a/Utilities/cmlibuv/src/idna.h b/Utilities/cmlibuv/src/idna.h
new file mode 100644
index 000000000..8e0c592fe
--- /dev/null
+++ b/Utilities/cmlibuv/src/idna.h
@@ -0,0 +1,31 @@
+/* Copyright (c) 2011, 2018 Ben Noordhuis <info@bnoordhuis.nl>
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef UV_SRC_IDNA_H_
+#define UV_SRC_IDNA_H_
+
+/* Decode a single codepoint. Returns the codepoint or UINT32_MAX on error.
+ * |p| is updated on success _and_ error, i.e., bad multi-byte sequences are
+ * skipped in their entirety, not just the first bad byte.
+ */
+unsigned uv__utf8_decode1(const char** p, const char* pe);
+
+/* Convert a UTF-8 domain name to IDNA 2008 / Punycode. A return value >= 0
+ * is the number of bytes written to |d|, including the trailing nul byte.
+ * A return value < 0 is a libuv error code. |s| and |d| can not overlap.
+ */
+long uv__idna_toascii(const char* s, const char* se, char* d, char* de);
+
+#endif /* UV_SRC_IDNA_H_ */
diff --git a/Utilities/cmlibuv/src/inet.c b/Utilities/cmlibuv/src/inet.c
index 7c75e4373..58238dcbb 100644
--- a/Utilities/cmlibuv/src/inet.c
+++ b/Utilities/cmlibuv/src/inet.c
@@ -22,7 +22,7 @@
#include <string.h>
#if defined(_MSC_VER) && _MSC_VER < 1600
-# include "stdint-msvc2008.h"
+# include "uv/stdint-msvc2008.h"
#else
# include <stdint.h>
#endif
@@ -59,8 +59,7 @@ static int inet_ntop4(const unsigned char *src, char *dst, size_t size) {
if (l <= 0 || (size_t) l >= size) {
return UV_ENOSPC;
}
- strncpy(dst, tmp, size);
- dst[size - 1] = '\0';
+ uv__strscpy(dst, tmp, size);
return 0;
}
@@ -142,14 +141,8 @@ static int inet_ntop6(const unsigned char *src, char *dst, size_t size) {
if (best.base != -1 && (best.base + best.len) == ARRAY_SIZE(words))
*tp++ = ':';
*tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((size_t)(tp - tmp) > size) {
+ if (UV_E2BIG == uv__strscpy(dst, tmp, size))
return UV_ENOSPC;
- }
- strcpy(dst, tmp);
return 0;
}
diff --git a/Utilities/cmlibuv/src/strscpy.c b/Utilities/cmlibuv/src/strscpy.c
new file mode 100644
index 000000000..2a2bdce74
--- /dev/null
+++ b/Utilities/cmlibuv/src/strscpy.c
@@ -0,0 +1,17 @@
+#include "strscpy.h"
+#include <limits.h> /* SSIZE_MAX */
+
+ssize_t uv__strscpy(char* d, const char* s, size_t n) {
+ size_t i;
+
+ for (i = 0; i < n; i++)
+ if ('\0' == (d[i] = s[i]))
+ return i > SSIZE_MAX ? UV_E2BIG : (ssize_t) i;
+
+ if (i == 0)
+ return 0;
+
+ d[--i] = '\0';
+
+ return UV_E2BIG;
+}
diff --git a/Utilities/cmlibuv/src/strscpy.h b/Utilities/cmlibuv/src/strscpy.h
new file mode 100644
index 000000000..fbe0a393f
--- /dev/null
+++ b/Utilities/cmlibuv/src/strscpy.h
@@ -0,0 +1,18 @@
+#ifndef UV_STRSCPY_H_
+#define UV_STRSCPY_H_
+
+/* Include uv.h for its definitions of size_t and ssize_t.
+ * size_t can be obtained directly from <stddef.h> but ssize_t requires
+ * some hoop jumping on Windows that I didn't want to duplicate here.
+ */
+#include "uv.h"
+
+/* Copies up to |n-1| bytes from |d| to |s| and always zero-terminates
+ * the result, except when |n==0|. Returns the number of bytes copied
+ * or UV_E2BIG if |d| is too small.
+ *
+ * See https://www.kernel.org/doc/htmldocs/kernel-api/API-strscpy.html
+ */
+ssize_t uv__strscpy(char* d, const char* s, size_t n);
+
+#endif /* UV_STRSCPY_H_ */
diff --git a/Utilities/cmlibuv/src/threadpool.c b/Utilities/cmlibuv/src/threadpool.c
index 413d1c204..4258933c7 100644
--- a/Utilities/cmlibuv/src/threadpool.c
+++ b/Utilities/cmlibuv/src/threadpool.c
@@ -33,12 +33,18 @@ static uv_once_t once = UV_ONCE_INIT;
static uv_cond_t cond;
static uv_mutex_t mutex;
static unsigned int idle_threads;
+static unsigned int slow_io_work_running;
static unsigned int nthreads;
static uv_thread_t* threads;
static uv_thread_t default_threads[4];
static QUEUE exit_message;
static QUEUE wq;
+static QUEUE run_slow_work_message;
+static QUEUE slow_io_pending_wq;
+static unsigned int slow_work_thread_threshold(void) {
+ return (nthreads + 1) / 2;
+}
static void uv__cancelled(struct uv__work* w) {
abort();
@@ -51,34 +57,67 @@ static void uv__cancelled(struct uv__work* w) {
static void worker(void* arg) {
struct uv__work* w;
QUEUE* q;
+ int is_slow_work;
uv_sem_post((uv_sem_t*) arg);
arg = NULL;
+ uv_mutex_lock(&mutex);
for (;;) {
- uv_mutex_lock(&mutex);
-
- while (QUEUE_EMPTY(&wq)) {
+ /* `mutex` should always be locked at this point. */
+
+ /* Keep waiting while either no work is present or only slow I/O
+ and we're at the threshold for that. */
+ while (QUEUE_EMPTY(&wq) ||
+ (QUEUE_HEAD(&wq) == &run_slow_work_message &&
+ QUEUE_NEXT(&run_slow_work_message) == &wq &&
+ slow_io_work_running >= slow_work_thread_threshold())) {
idle_threads += 1;
uv_cond_wait(&cond, &mutex);
idle_threads -= 1;
}
q = QUEUE_HEAD(&wq);
-
- if (q == &exit_message)
+ if (q == &exit_message) {
uv_cond_signal(&cond);
- else {
+ uv_mutex_unlock(&mutex);
+ break;
+ }
+
+ QUEUE_REMOVE(q);
+ QUEUE_INIT(q); /* Signal uv_cancel() that the work req is executing. */
+
+ is_slow_work = 0;
+ if (q == &run_slow_work_message) {
+ /* If we're at the slow I/O threshold, re-schedule until after all
+ other work in the queue is done. */
+ if (slow_io_work_running >= slow_work_thread_threshold()) {
+ QUEUE_INSERT_TAIL(&wq, q);
+ continue;
+ }
+
+ /* If we encountered a request to run slow I/O work but there is none
+ to run, that means it's cancelled => Start over. */
+ if (QUEUE_EMPTY(&slow_io_pending_wq))
+ continue;
+
+ is_slow_work = 1;
+ slow_io_work_running++;
+
+ q = QUEUE_HEAD(&slow_io_pending_wq);
QUEUE_REMOVE(q);
- QUEUE_INIT(q); /* Signal uv_cancel() that the work req is
- executing. */
+ QUEUE_INIT(q);
+
+ /* If there is more slow I/O work, schedule it to be run as well. */
+ if (!QUEUE_EMPTY(&slow_io_pending_wq)) {
+ QUEUE_INSERT_TAIL(&wq, &run_slow_work_message);
+ if (idle_threads > 0)
+ uv_cond_signal(&cond);
+ }
}
uv_mutex_unlock(&mutex);
- if (q == &exit_message)
- break;
-
w = QUEUE_DATA(q, struct uv__work, wq);
w->work(w);
@@ -88,12 +127,32 @@ static void worker(void* arg) {
QUEUE_INSERT_TAIL(&w->loop->wq, &w->wq);
uv_async_send(&w->loop->wq_async);
uv_mutex_unlock(&w->loop->wq_mutex);
+
+ /* Lock `mutex` since that is expected at the start of the next
+ * iteration. */
+ uv_mutex_lock(&mutex);
+ if (is_slow_work) {
+ /* `slow_io_work_running` is protected by `mutex`. */
+ slow_io_work_running--;
+ }
}
}
-static void post(QUEUE* q) {
+static void post(QUEUE* q, enum uv__work_kind kind) {
uv_mutex_lock(&mutex);
+ if (kind == UV__WORK_SLOW_IO) {
+ /* Insert into a separate queue. */
+ QUEUE_INSERT_TAIL(&slow_io_pending_wq, q);
+ if (!QUEUE_EMPTY(&run_slow_work_message)) {
+ /* Running slow I/O tasks is already scheduled => Nothing to do here.
+ The worker that runs said other task will schedule this one as well. */
+ uv_mutex_unlock(&mutex);
+ return;
+ }
+ q = &run_slow_work_message;
+ }
+
QUEUE_INSERT_TAIL(&wq, q);
if (idle_threads > 0)
uv_cond_signal(&cond);
@@ -108,7 +167,7 @@ UV_DESTRUCTOR(static void cleanup(void)) {
if (nthreads == 0)
return;
- post(&exit_message);
+ post(&exit_message, UV__WORK_CPU);
for (i = 0; i < nthreads; i++)
if (uv_thread_join(threads + i))
@@ -156,6 +215,8 @@ static void init_threads(void) {
abort();
QUEUE_INIT(&wq);
+ QUEUE_INIT(&slow_io_pending_wq);
+ QUEUE_INIT(&run_slow_work_message);
if (uv_sem_init(&sem, 0))
abort();
@@ -194,13 +255,14 @@ static void init_once(void) {
void uv__work_submit(uv_loop_t* loop,
struct uv__work* w,
+ enum uv__work_kind kind,
void (*work)(struct uv__work* w),
void (*done)(struct uv__work* w, int status)) {
uv_once(&once, init_once);
w->loop = loop;
w->work = work;
w->done = done;
- post(&w->wq);
+ post(&w->wq, kind);
}
@@ -284,7 +346,11 @@ int uv_queue_work(uv_loop_t* loop,
req->loop = loop;
req->work_cb = work_cb;
req->after_work_cb = after_work_cb;
- uv__work_submit(loop, &req->work_req, uv__queue_work, uv__queue_done);
+ uv__work_submit(loop,
+ &req->work_req,
+ UV__WORK_CPU,
+ uv__queue_work,
+ uv__queue_done);
return 0;
}
diff --git a/Utilities/cmlibuv/src/unix/timer.c b/Utilities/cmlibuv/src/timer.c
index 54dabfe7d..dd78bcbad 100644
--- a/Utilities/cmlibuv/src/unix/timer.c
+++ b/Utilities/cmlibuv/src/timer.c
@@ -19,13 +19,22 @@
*/
#include "uv.h"
-#include "internal.h"
+#include "uv-common.h"
#include "heap-inl.h"
#include <assert.h>
#include <limits.h>
+static struct heap *timer_heap(const uv_loop_t* loop) {
+#ifdef _WIN32
+ return (struct heap*) loop->timer_heap;
+#else
+ return (struct heap*) &loop->timer_heap;
+#endif
+}
+
+
static int timer_less_than(const struct heap_node* ha,
const struct heap_node* hb) {
const uv_timer_t* a;
@@ -81,7 +90,7 @@ int uv_timer_start(uv_timer_t* handle,
/* start_id is the second index to be compared in uv__timer_cmp() */
handle->start_id = handle->loop->timer_counter++;
- heap_insert((struct heap*) &handle->loop->timer_heap,
+ heap_insert(timer_heap(handle->loop),
(struct heap_node*) &handle->heap_node,
timer_less_than);
uv__handle_start(handle);
@@ -94,7 +103,7 @@ int uv_timer_stop(uv_timer_t* handle) {
if (!uv__is_active(handle))
return 0;
- heap_remove((struct heap*) &handle->loop->timer_heap,
+ heap_remove(timer_heap(handle->loop),
(struct heap_node*) &handle->heap_node,
timer_less_than);
uv__handle_stop(handle);
@@ -131,7 +140,7 @@ int uv__next_timeout(const uv_loop_t* loop) {
const uv_timer_t* handle;
uint64_t diff;
- heap_node = heap_min((const struct heap*) &loop->timer_heap);
+ heap_node = heap_min(timer_heap(loop));
if (heap_node == NULL)
return -1; /* block indefinitely */
@@ -143,7 +152,7 @@ int uv__next_timeout(const uv_loop_t* loop) {
if (diff > INT_MAX)
diff = INT_MAX;
- return diff;
+ return (int) diff;
}
@@ -152,7 +161,7 @@ void uv__run_timers(uv_loop_t* loop) {
uv_timer_t* handle;
for (;;) {
- heap_node = heap_min((struct heap*) &loop->timer_heap);
+ heap_node = heap_min(timer_heap(loop));
if (heap_node == NULL)
break;
diff --git a/Utilities/cmlibuv/src/unix/aix-common.c b/Utilities/cmlibuv/src/unix/aix-common.c
index 9c11c5dac..e9697e9c2 100644
--- a/Utilities/cmlibuv/src/unix/aix-common.c
+++ b/Utilities/cmlibuv/src/unix/aix-common.c
@@ -166,8 +166,7 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
}
-int uv_interface_addresses(uv_interface_address_t** addresses,
- int* count) {
+int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
uv_interface_address_t* address;
int sockfd, inet6, size = 1;
struct ifconf ifc;
@@ -175,6 +174,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
struct sockaddr_dl* sa_addr;
*count = 0;
+ *addresses = NULL;
if (0 > (sockfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP))) {
return UV__ERR(errno);
@@ -217,6 +217,11 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
(*count)++;
}
+ if (*count == 0) {
+ uv__close(sockfd);
+ return 0;
+ }
+
/* Alloc the return interface structs */
*addresses = uv__malloc(*count * sizeof(uv_interface_address_t));
if (!(*addresses)) {
@@ -290,3 +295,4 @@ void uv_free_interface_addresses(uv_interface_address_t* addresses,
uv__free(addresses);
}
+
diff --git a/Utilities/cmlibuv/src/unix/aix.c b/Utilities/cmlibuv/src/unix/aix.c
index 92de81483..337e58e0a 100644
--- a/Utilities/cmlibuv/src/unix/aix.c
+++ b/Utilities/cmlibuv/src/unix/aix.c
@@ -358,19 +358,15 @@ void uv_loadavg(double avg[3]) {
#ifdef HAVE_SYS_AHAFS_EVPRODS_H
-static char *uv__rawname(char *cp) {
- static char rawbuf[FILENAME_MAX+1];
- char *dp = rindex(cp, '/');
+static char* uv__rawname(const char* cp, char (*dst)[FILENAME_MAX+1]) {
+ char* dp;
+ dp = rindex(cp, '/');
if (dp == 0)
return 0;
- *dp = 0;
- strcpy(rawbuf, cp);
- *dp = '/';
- strcat(rawbuf, "/r");
- strcat(rawbuf, dp+1);
- return rawbuf;
+ snprintf(*dst, sizeof(*dst), "%.*s/r%s", (int) (dp - cp), cp, dp + 1);
+ return *dst;
}
@@ -399,6 +395,7 @@ static int uv__path_is_a_directory(char* filename) {
* Returns 0 if AHAFS is mounted, or an error code < 0 on failure
*/
static int uv__is_ahafs_mounted(void){
+ char rawbuf[FILENAME_MAX+1];
int rv, i = 2;
struct vmount *p;
int size_multiplier = 10;
@@ -432,7 +429,7 @@ static int uv__is_ahafs_mounted(void){
obj = vmt2dataptr(vmt, VMT_OBJECT); /* device */
stub = vmt2dataptr(vmt, VMT_STUB); /* mount point */
- if (EQ(obj, dev) || EQ(uv__rawname(obj), dev) || EQ(stub, dev)) {
+ if (EQ(obj, dev) || EQ(uv__rawname(obj, &rawbuf), dev) || EQ(stub, dev)) {
uv__free(p); /* Found a match */
return 0;
}
@@ -453,7 +450,8 @@ static int uv__makedir_p(const char *dir) {
size_t len;
int err;
- snprintf(tmp, sizeof(tmp),"%s",dir);
+ /* TODO(bnoordhuis) Check uv__strscpy() return value. */
+ uv__strscpy(tmp, dir, sizeof(tmp));
len = strlen(tmp);
if (tmp[len - 1] == '/')
tmp[len - 1] = 0;
@@ -557,7 +555,7 @@ static int uv__setup_ahafs(const char* filename, int *fd) {
sprintf(mon_file_write_string, "CHANGED=YES;WAIT_TYPE=WAIT_IN_SELECT;INFO_LVL=1");
rc = write(*fd, mon_file_write_string, strlen(mon_file_write_string)+1);
- if (rc < 0)
+ if (rc < 0 && errno != EBUSY)
return UV__ERR(errno);
return 0;
@@ -702,9 +700,9 @@ static void uv__ahafs_event(uv_loop_t* loop, uv__io_t* event_watch, unsigned int
else
p++;
}
- strncpy(fname, p, sizeof(fname) - 1);
- /* Just in case */
- fname[sizeof(fname) - 1] = '\0';
+
+ /* TODO(bnoordhuis) Check uv__strscpy() return value. */
+ uv__strscpy(fname, p, sizeof(fname));
handle->cb(handle, fname, events, 0);
}
@@ -730,12 +728,19 @@ int uv_fs_event_start(uv_fs_event_t* handle,
char cwd[PATH_MAX];
char absolute_path[PATH_MAX];
char readlink_cwd[PATH_MAX];
+ struct timeval zt;
+ fd_set pollfd;
/* Figure out whether filename is absolute or not */
- if (filename[0] == '/') {
+ if (filename[0] == '\0') {
+ /* Missing a pathname */
+ return UV_ENOENT;
+ }
+ else if (filename[0] == '/') {
/* We have absolute pathname */
- snprintf(absolute_path, sizeof(absolute_path), "%s", filename);
+ /* TODO(bnoordhuis) Check uv__strscpy() return value. */
+ uv__strscpy(absolute_path, filename, sizeof(absolute_path));
} else {
/* We have a relative pathname, compose the absolute pathname */
snprintf(cwd, sizeof(cwd), "/proc/%lu/cwd", (unsigned long) getpid());
@@ -769,6 +774,15 @@ int uv_fs_event_start(uv_fs_event_t* handle,
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
+ /* AHAFS wants someone to poll for it to start mointoring.
+ * so kick-start it so that we don't miss an event in the
+ * eventuality of an event that occurs in the current loop. */
+ do {
+ memset(&zt, 0, sizeof(zt));
+ FD_ZERO(&pollfd);
+ FD_SET(fd, &pollfd);
+ rc = select(fd + 1, &pollfd, NULL, NULL, &zt);
+ } while (rc == -1 && errno == EINTR);
return 0;
#else
return UV_ENOSYS;
@@ -886,16 +900,20 @@ int uv_set_process_title(const char* title) {
int uv_get_process_title(char* buffer, size_t size) {
size_t len;
- len = strlen(process_argv[0]);
if (buffer == NULL || size == 0)
return UV_EINVAL;
- else if (size <= len)
- return UV_ENOBUFS;
uv_once(&process_title_mutex_once, init_process_title_mutex_once);
uv_mutex_lock(&process_title_mutex);
- memcpy(buffer, process_argv[0], len + 1);
+ len = strlen(process_argv[0]);
+ if (size <= len) {
+ uv_mutex_unlock(&process_title_mutex);
+ return UV_ENOBUFS;
+ }
+
+ memcpy(buffer, process_argv[0], len);
+ buffer[len] = '\0';
uv_mutex_unlock(&process_title_mutex);
@@ -982,7 +1000,8 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
return UV_ENOMEM;
}
- strcpy(cpu_id.name, FIRST_CPU);
+ /* TODO(bnoordhuis) Check uv__strscpy() return value. */
+ uv__strscpy(cpu_id.name, FIRST_CPU, sizeof(cpu_id.name));
result = perfstat_cpu(&cpu_id, ps_cpus, sizeof(perfstat_cpu_t), ncpus);
if (result == -1) {
uv__free(ps_cpus);
diff --git a/Utilities/cmlibuv/src/unix/android-ifaddrs.c b/Utilities/cmlibuv/src/unix/android-ifaddrs.c
index bf30b1417..99fb25a43 100644
--- a/Utilities/cmlibuv/src/unix/android-ifaddrs.c
+++ b/Utilities/cmlibuv/src/unix/android-ifaddrs.c
@@ -23,7 +23,7 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "android-ifaddrs.h"
+#include "uv/android-ifaddrs.h"
#include "uv-common.h"
#include <string.h>
diff --git a/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c b/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
index 0d0215448..3c2253f0c 100644
--- a/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
+++ b/Utilities/cmlibuv/src/unix/bsd-ifaddrs.c
@@ -52,13 +52,10 @@ static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
*/
if (ent->ifa_addr->sa_family == AF_LINK)
return 1;
-#elif defined(__NetBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
if (ent->ifa_addr->sa_family != PF_INET &&
ent->ifa_addr->sa_family != PF_INET6)
return 1;
-#elif defined(__OpenBSD__)
- if (ent->ifa_addr->sa_family != PF_INET)
- return 1;
#endif
return 0;
}
@@ -69,11 +66,12 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
uv_interface_address_t* address;
int i;
+ *count = 0;
+ *addresses = NULL;
+
if (getifaddrs(&addrs) != 0)
return UV__ERR(errno);
- *count = 0;
-
/* Count the number of interfaces */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (uv__ifaddr_exclude(ent, UV__EXCLUDE_IFADDR))
@@ -81,6 +79,11 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
(*count)++;
}
+ if (*count == 0) {
+ freeifaddrs(addrs);
+ return 0;
+ }
+
*addresses = uv__malloc(*count * sizeof(**addresses));
if (*addresses == NULL) {
@@ -121,15 +124,17 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
address = *addresses;
for (i = 0; i < *count; i++) {
- if (strcmp(address->name, ent->ifa_name) == 0) {
#if defined(__CYGWIN__) || defined(__MSYS__)
- memset(address->phys_addr, 0, sizeof(address->phys_addr));
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
#else
+ if (strcmp(address->name, ent->ifa_name) == 0) {
struct sockaddr_dl* sa_addr;
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
-#endif
+ } else {
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
}
+#endif
address++;
}
}
diff --git a/Utilities/cmlibuv/src/unix/bsd-proctitle.c b/Utilities/cmlibuv/src/unix/bsd-proctitle.c
new file mode 100644
index 000000000..0ce47c8f6
--- /dev/null
+++ b/Utilities/cmlibuv/src/unix/bsd-proctitle.c
@@ -0,0 +1,93 @@
+/* Copyright libuv project contributors. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#include "uv.h"
+#include "internal.h"
+
+#include <sys/types.h>
+#include <unistd.h>
+
+
+static uv_mutex_t process_title_mutex;
+static uv_once_t process_title_mutex_once = UV_ONCE_INIT;
+static char* process_title;
+
+
+static void init_process_title_mutex_once(void) {
+ if (uv_mutex_init(&process_title_mutex))
+ abort();
+}
+
+
+char** uv_setup_args(int argc, char** argv) {
+ process_title = argc > 0 ? uv__strdup(argv[0]) : NULL;
+ return argv;
+}
+
+
+int uv_set_process_title(const char* title) {
+ char* new_title;
+
+ new_title = uv__strdup(title);
+ if (new_title == NULL)
+ return UV_ENOMEM;
+
+ uv_once(&process_title_mutex_once, init_process_title_mutex_once);
+ uv_mutex_lock(&process_title_mutex);
+
+ uv__free(process_title);
+ process_title = new_title;
+ setproctitle("%s", title);
+
+ uv_mutex_unlock(&process_title_mutex);
+
+ return 0;
+}
+
+
+int uv_get_process_title(char* buffer, size_t size) {
+ size_t len;
+
+ if (buffer == NULL || size == 0)
+ return UV_EINVAL;
+
+ uv_once(&process_title_mutex_once, init_process_title_mutex_once);
+ uv_mutex_lock(&process_title_mutex);
+
+ if (process_title != NULL) {
+ len = strlen(process_title) + 1;
+
+ if (size < len) {
+ uv_mutex_unlock(&process_title_mutex);
+ return UV_ENOBUFS;
+ }
+
+ memcpy(buffer, process_title, len);
+ } else {
+ len = 0;
+ }
+
+ uv_mutex_unlock(&process_title_mutex);
+
+ buffer[len] = '\0';
+
+ return 0;
+}
diff --git a/Utilities/cmlibuv/src/unix/cmake-bootstrap.c b/Utilities/cmlibuv/src/unix/cmake-bootstrap.c
index 4f32d03bc..309ec79ce 100644
--- a/Utilities/cmlibuv/src/unix/cmake-bootstrap.c
+++ b/Utilities/cmlibuv/src/unix/cmake-bootstrap.c
@@ -46,6 +46,7 @@ void uv__async_stop(uv_loop_t* loop) {
}
void uv__work_submit(uv_loop_t* loop, struct uv__work* w,
+ enum uv__work_kind kind,
void (*work)(struct uv__work* w),
void (*done)(struct uv__work* w, int status)) {
abort();
diff --git a/Utilities/cmlibuv/src/unix/core.c b/Utilities/cmlibuv/src/unix/core.c
index a357ef32d..a8d6adb42 100644
--- a/Utilities/cmlibuv/src/unix/core.c
+++ b/Utilities/cmlibuv/src/unix/core.c
@@ -41,6 +41,7 @@
#include <sys/resource.h> /* getrusage */
#include <pwd.h>
#include <sched.h>
+#include <sys/utsname.h>
#ifdef __sun
# include <netdb.h> /* MAXHOSTNAMELEN on Solaris */
@@ -119,7 +120,7 @@ uint64_t uv_hrtime(void) {
void uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
assert(!uv__is_closing(handle));
- handle->flags |= UV_CLOSING;
+ handle->flags |= UV_HANDLE_CLOSING;
handle->close_cb = close_cb;
switch (handle->type) {
@@ -177,8 +178,8 @@ void uv_close(uv_handle_t* handle, uv_close_cb close_cb) {
case UV_SIGNAL:
uv__signal_close((uv_signal_t*) handle);
- /* Signal handles may not be closed immediately. The signal code will */
- /* itself close uv__make_close_pending whenever appropriate. */
+ /* Signal handles may not be closed immediately. The signal code will
+ * itself close uv__make_close_pending whenever appropriate. */
return;
default:
@@ -217,8 +218,8 @@ int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value) {
}
void uv__make_close_pending(uv_handle_t* handle) {
- assert(handle->flags & UV_CLOSING);
- assert(!(handle->flags & UV_CLOSED));
+ assert(handle->flags & UV_HANDLE_CLOSING);
+ assert(!(handle->flags & UV_HANDLE_CLOSED));
handle->next_closing = handle->loop->closing_handles;
handle->loop->closing_handles = handle;
}
@@ -244,15 +245,17 @@ int uv__getiovmax(void) {
static void uv__finish_close(uv_handle_t* handle) {
- /* Note: while the handle is in the UV_CLOSING state now, it's still possible
- * for it to be active in the sense that uv__is_active() returns true.
+ /* Note: while the handle is in the UV_HANDLE_CLOSING state now, it's still
+ * possible for it to be active in the sense that uv__is_active() returns
+ * true.
+ *
* A good example is when the user calls uv_shutdown(), immediately followed
* by uv_close(). The handle is considered active at this point because the
* completion of the shutdown req is still pending.
*/
- assert(handle->flags & UV_CLOSING);
- assert(!(handle->flags & UV_CLOSED));
- handle->flags |= UV_CLOSED;
+ assert(handle->flags & UV_HANDLE_CLOSING);
+ assert(!(handle->flags & UV_HANDLE_CLOSED));
+ handle->flags |= UV_HANDLE_CLOSED;
switch (handle->type) {
case UV_PREPARE:
@@ -637,27 +640,6 @@ int uv__cloexec_fcntl(int fd, int set) {
}
-/* This function is not execve-safe, there is a race window
- * between the call to dup() and fcntl(FD_CLOEXEC).
- */
-int uv__dup(int fd) {
- int err;
-
- fd = dup(fd);
-
- if (fd == -1)
- return UV__ERR(errno);
-
- err = uv__cloexec(fd, 1);
- if (err) {
- uv__close(fd);
- return err;
- }
-
- return fd;
-}
-
-
ssize_t uv__recvmsg(int fd, struct msghdr* msg, int flags) {
struct cmsghdr* cmsg;
ssize_t rc;
@@ -930,6 +912,11 @@ int uv__io_active(const uv__io_t* w, unsigned int events) {
}
+int uv__fd_exists(uv_loop_t* loop, int fd) {
+ return (unsigned) fd < loop->nwatchers && loop->watchers[fd] != NULL;
+}
+
+
int uv_getrusage(uv_rusage_t* rusage) {
struct rusage usage;
@@ -1343,6 +1330,9 @@ uv_os_fd_t uv_get_osfhandle(int fd) {
return fd;
}
+int uv_open_osfhandle(uv_os_fd_t os_fd) {
+ return os_fd;
+}
uv_pid_t uv_os_getpid(void) {
return getpid();
@@ -1352,3 +1342,87 @@ uv_pid_t uv_os_getpid(void) {
uv_pid_t uv_os_getppid(void) {
return getppid();
}
+
+
+int uv_os_getpriority(uv_pid_t pid, int* priority) {
+ int r;
+
+ if (priority == NULL)
+ return UV_EINVAL;
+
+ errno = 0;
+ r = getpriority(PRIO_PROCESS, (int) pid);
+
+ if (r == -1 && errno != 0)
+ return UV__ERR(errno);
+
+ *priority = r;
+ return 0;
+}
+
+
+int uv_os_setpriority(uv_pid_t pid, int priority) {
+ if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW)
+ return UV_EINVAL;
+
+ if (setpriority(PRIO_PROCESS, (int) pid, priority) != 0)
+ return UV__ERR(errno);
+
+ return 0;
+}
+
+
+int uv_os_uname(uv_utsname_t* buffer) {
+ struct utsname buf;
+ int r;
+
+ if (buffer == NULL)
+ return UV_EINVAL;
+
+ if (uname(&buf) == -1) {
+ r = UV__ERR(errno);
+ goto error;
+ }
+
+ r = uv__strscpy(buffer->sysname, buf.sysname, sizeof(buffer->sysname));
+ if (r == UV_E2BIG)
+ goto error;
+
+#ifdef _AIX
+ r = snprintf(buffer->release,
+ sizeof(buffer->release),
+ "%s.%s",
+ buf.version,
+ buf.release);
+ if (r >= sizeof(buffer->release)) {
+ r = UV_E2BIG;
+ goto error;
+ }
+#else
+ r = uv__strscpy(buffer->release, buf.release, sizeof(buffer->release));
+ if (r == UV_E2BIG)
+ goto error;
+#endif
+
+ r = uv__strscpy(buffer->version, buf.version, sizeof(buffer->version));
+ if (r == UV_E2BIG)
+ goto error;
+
+#if defined(_AIX) || defined(__PASE__)
+ r = uv__strscpy(buffer->machine, "ppc64", sizeof(buffer->machine));
+#else
+ r = uv__strscpy(buffer->machine, buf.machine, sizeof(buffer->machine));
+#endif
+
+ if (r == UV_E2BIG)
+ goto error;
+
+ return 0;
+
+error:
+ buffer->sysname[0] = '\0';
+ buffer->release[0] = '\0';
+ buffer->version[0] = '\0';
+ buffer->machine[0] = '\0';
+ return r;
+}
diff --git a/Utilities/cmlibuv/src/unix/cygwin.c b/Utilities/cmlibuv/src/unix/cygwin.c
index 9fe4093ef..9da20e203 100644
--- a/Utilities/cmlibuv/src/unix/cygwin.c
+++ b/Utilities/cmlibuv/src/unix/cygwin.c
@@ -38,7 +38,7 @@ int uv_uptime(double* uptime) {
int uv_resident_set_memory(size_t* rss) {
/* FIXME: read /proc/meminfo? */
*rss = 0;
- return UV_ENOSYS;
+ return 0;
}
int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
diff --git a/Utilities/cmlibuv/src/unix/darwin-proctitle.c b/Utilities/cmlibuv/src/unix/darwin-proctitle.c
index dabde2239..e505bdd23 100644
--- a/Utilities/cmlibuv/src/unix/darwin-proctitle.c
+++ b/Utilities/cmlibuv/src/unix/darwin-proctitle.c
@@ -33,61 +33,56 @@
# include <ApplicationServices/ApplicationServices.h>
#endif
+#define S(s) pCFStringCreateWithCString(NULL, (s), kCFStringEncodingUTF8)
-static int uv__pthread_setname_np(const char* name) {
- int (*dynamic_pthread_setname_np)(const char* name);
- char namebuf[64]; /* MAXTHREADNAMESIZE */
- int err;
-
- /* pthread_setname_np() first appeared in OS X 10.6 and iOS 3.2. */
- *(void **)(&dynamic_pthread_setname_np) =
- dlsym(RTLD_DEFAULT, "pthread_setname_np");
-
- if (dynamic_pthread_setname_np == NULL)
- return UV_ENOSYS;
-
- strncpy(namebuf, name, sizeof(namebuf) - 1);
- namebuf[sizeof(namebuf) - 1] = '\0';
- err = dynamic_pthread_setname_np(namebuf);
- if (err)
- return UV__ERR(err);
+static int (*dynamic_pthread_setname_np)(const char* name);
+#if !TARGET_OS_IPHONE
+static CFStringRef (*pCFStringCreateWithCString)(CFAllocatorRef,
+ const char*,
+ CFStringEncoding);
+static CFBundleRef (*pCFBundleGetBundleWithIdentifier)(CFStringRef);
+static void *(*pCFBundleGetDataPointerForName)(CFBundleRef, CFStringRef);
+static void *(*pCFBundleGetFunctionPointerForName)(CFBundleRef, CFStringRef);
+static CFTypeRef (*pLSGetCurrentApplicationASN)(void);
+static OSStatus (*pLSSetApplicationInformationItem)(int,
+ CFTypeRef,
+ CFStringRef,
+ CFStringRef,
+ CFDictionaryRef*);
+static void* application_services_handle;
+static void* core_foundation_handle;
+static CFBundleRef launch_services_bundle;
+static CFStringRef* display_name_key;
+static CFDictionaryRef (*pCFBundleGetInfoDictionary)(CFBundleRef);
+static CFBundleRef (*pCFBundleGetMainBundle)(void);
+static CFBundleRef hi_services_bundle;
+static OSStatus (*pSetApplicationIsDaemon)(int);
+static CFDictionaryRef (*pLSApplicationCheckIn)(int, CFDictionaryRef);
+static void (*pLSSetApplicationLaunchServicesServerConnectionStatus)(uint64_t,
+ void*);
+
+
+UV_DESTRUCTOR(static void uv__set_process_title_platform_fini(void)) {
+ if (core_foundation_handle != NULL) {
+ dlclose(core_foundation_handle);
+ core_foundation_handle = NULL;
+ }
- return 0;
+ if (application_services_handle != NULL) {
+ dlclose(application_services_handle);
+ application_services_handle = NULL;
+ }
}
+#endif /* !TARGET_OS_IPHONE */
-int uv__set_process_title(const char* title) {
-#if TARGET_OS_IPHONE
- return uv__pthread_setname_np(title);
-#else
- CFStringRef (*pCFStringCreateWithCString)(CFAllocatorRef,
- const char*,
- CFStringEncoding);
- CFBundleRef (*pCFBundleGetBundleWithIdentifier)(CFStringRef);
- void *(*pCFBundleGetDataPointerForName)(CFBundleRef, CFStringRef);
- void *(*pCFBundleGetFunctionPointerForName)(CFBundleRef, CFStringRef);
- CFTypeRef (*pLSGetCurrentApplicationASN)(void);
- OSStatus (*pLSSetApplicationInformationItem)(int,
- CFTypeRef,
- CFStringRef,
- CFStringRef,
- CFDictionaryRef*);
- void* application_services_handle;
- void* core_foundation_handle;
- CFBundleRef launch_services_bundle;
- CFStringRef* display_name_key;
- CFDictionaryRef (*pCFBundleGetInfoDictionary)(CFBundleRef);
- CFBundleRef (*pCFBundleGetMainBundle)(void);
- CFBundleRef hi_services_bundle;
- OSStatus (*pSetApplicationIsDaemon)(int);
- CFDictionaryRef (*pLSApplicationCheckIn)(int, CFDictionaryRef);
- void (*pLSSetApplicationLaunchServicesServerConnectionStatus)(uint64_t,
- void*);
- CFTypeRef asn;
- int err;
-
- err = UV_ENOENT;
+void uv__set_process_title_platform_init(void) {
+ /* pthread_setname_np() first appeared in OS X 10.6 and iOS 3.2. */
+ *(void **)(&dynamic_pthread_setname_np) =
+ dlsym(RTLD_DEFAULT, "pthread_setname_np");
+
+#if !TARGET_OS_IPHONE
application_services_handle = dlopen("/System/Library/Frameworks/"
"ApplicationServices.framework/"
"Versions/A/ApplicationServices",
@@ -116,8 +111,6 @@ int uv__set_process_title(const char* title) {
goto out;
}
-#define S(s) pCFStringCreateWithCString(NULL, (s), kCFStringEncodingUTF8)
-
launch_services_bundle =
pCFBundleGetBundleWithIdentifier(S("com.apple.LaunchServices"));
@@ -148,13 +141,14 @@ int uv__set_process_title(const char* title) {
"CFBundleGetInfoDictionary");
*(void **)(&pCFBundleGetMainBundle) = dlsym(core_foundation_handle,
"CFBundleGetMainBundle");
+
if (pCFBundleGetInfoDictionary == NULL || pCFBundleGetMainBundle == NULL)
goto out;
/* Black 10.9 magic, to remove (Not responding) mark in Activity Monitor */
hi_services_bundle =
pCFBundleGetBundleWithIdentifier(S("com.apple.HIServices"));
- err = UV_ENOENT;
+
if (hi_services_bundle == NULL)
goto out;
@@ -168,42 +162,37 @@ int uv__set_process_title(const char* title) {
pCFBundleGetFunctionPointerForName(
launch_services_bundle,
S("_LSSetApplicationLaunchServicesServerConnectionStatus"));
+
if (pSetApplicationIsDaemon == NULL ||
pLSApplicationCheckIn == NULL ||
pLSSetApplicationLaunchServicesServerConnectionStatus == NULL) {
goto out;
}
- if (pSetApplicationIsDaemon(1) != noErr)
- goto out;
-
- pLSSetApplicationLaunchServicesServerConnectionStatus(0, NULL);
-
- /* Check into process manager?! */
- pLSApplicationCheckIn(-2,
- pCFBundleGetInfoDictionary(pCFBundleGetMainBundle()));
-
- asn = pLSGetCurrentApplicationASN();
-
- err = UV_EINVAL;
- if (pLSSetApplicationInformationItem(-2, /* Magic value. */
- asn,
- *display_name_key,
- S(title),
- NULL) != noErr) {
- goto out;
- }
-
- uv__pthread_setname_np(title); /* Don't care if it fails. */
- err = 0;
+ return;
out:
- if (core_foundation_handle != NULL)
- dlclose(core_foundation_handle);
+ uv__set_process_title_platform_fini();
+#endif /* !TARGET_OS_IPHONE */
+}
- if (application_services_handle != NULL)
- dlclose(application_services_handle);
- return err;
+void uv__set_process_title(const char* title) {
+#if !TARGET_OS_IPHONE
+ if (core_foundation_handle != NULL && pSetApplicationIsDaemon(1) != noErr) {
+ CFTypeRef asn;
+ pLSSetApplicationLaunchServicesServerConnectionStatus(0, NULL);
+ pLSApplicationCheckIn(/* Magic value */ -2,
+ pCFBundleGetInfoDictionary(pCFBundleGetMainBundle()));
+ asn = pLSGetCurrentApplicationASN();
+ pLSSetApplicationInformationItem(/* Magic value */ -2, asn,
+ *display_name_key, S(title), NULL);
+ }
#endif /* !TARGET_OS_IPHONE */
+
+ if (dynamic_pthread_setname_np != NULL) {
+ char namebuf[64]; /* MAXTHREADNAMESIZE */
+ uv__strscpy(namebuf, title, sizeof(namebuf));
+ dynamic_pthread_setname_np(namebuf);
+ }
}
diff --git a/Utilities/cmlibuv/src/unix/freebsd.c b/Utilities/cmlibuv/src/unix/freebsd.c
index 70ccb1304..0f729cfd4 100644
--- a/Utilities/cmlibuv/src/unix/freebsd.c
+++ b/Utilities/cmlibuv/src/unix/freebsd.c
@@ -47,15 +47,6 @@
# define CP_INTR 4
#endif
-static uv_mutex_t process_title_mutex;
-static uv_once_t process_title_mutex_once = UV_ONCE_INIT;
-static char *process_title;
-
-
-static void init_process_title_mutex_once(void) {
- uv_mutex_init(&process_title_mutex);
-}
-
int uv__platform_loop_init(uv_loop_t* loop) {
return uv__kqueue_init(loop);
@@ -159,76 +150,6 @@ void uv_loadavg(double avg[3]) {
}
-char** uv_setup_args(int argc, char** argv) {
- process_title = argc ? uv__strdup(argv[0]) : NULL;
- return argv;
-}
-
-
-int uv_set_process_title(const char* title) {
- int oid[4];
- char* new_title;
-
- new_title = uv__strdup(title);
-
- uv_once(&process_title_mutex_once, init_process_title_mutex_once);
- uv_mutex_lock(&process_title_mutex);
-
- if (process_title == NULL) {
- uv_mutex_unlock(&process_title_mutex);
- return UV_ENOMEM;
- }
-
- uv__free(process_title);
- process_title = new_title;
-
- oid[0] = CTL_KERN;
- oid[1] = KERN_PROC;
- oid[2] = KERN_PROC_ARGS;
- oid[3] = getpid();
-
- sysctl(oid,
- ARRAY_SIZE(oid),
- NULL,
- NULL,
- process_title,
- strlen(process_title) + 1);
-
- uv_mutex_unlock(&process_title_mutex);
-
- return 0;
-}
-
-
-int uv_get_process_title(char* buffer, size_t size) {
- size_t len;
-
- if (buffer == NULL || size == 0)
- return UV_EINVAL;
-
- uv_once(&process_title_mutex_once, init_process_title_mutex_once);
- uv_mutex_lock(&process_title_mutex);
-
- if (process_title) {
- len = strlen(process_title) + 1;
-
- if (size < len) {
- uv_mutex_unlock(&process_title_mutex);
- return UV_ENOBUFS;
- }
-
- memcpy(buffer, process_title, len);
- } else {
- len = 0;
- }
-
- uv_mutex_unlock(&process_title_mutex);
-
- buffer[len] = '\0';
-
- return 0;
-}
-
int uv_resident_set_memory(size_t* rss) {
struct kinfo_proc kinfo;
size_t page_size;
diff --git a/Utilities/cmlibuv/src/unix/fs.c b/Utilities/cmlibuv/src/unix/fs.c
index a6cc6dbd1..bffc956b5 100644
--- a/Utilities/cmlibuv/src/unix/fs.c
+++ b/Utilities/cmlibuv/src/unix/fs.c
@@ -43,7 +43,6 @@
#include <pthread.h>
#include <unistd.h>
#include <fcntl.h>
-#include <utime.h>
#include <poll.h>
#if defined(__DragonFly__) || \
@@ -62,11 +61,20 @@
#if defined(__APPLE__)
# include <copyfile.h>
+# include <sys/sysctl.h>
#elif defined(__linux__) && !defined(FICLONE)
# include <sys/ioctl.h>
# define FICLONE _IOW(0x94, 9, int)
#endif
+#if defined(_AIX) && !defined(_AIX71)
+# include <utime.h>
+#endif
+
+#if defined(_AIX) && _XOPEN_SOURCE <= 600
+extern char *mkdtemp(char *template); /* See issue #740 on AIX < 7 */
+#endif
+
#define INIT(subtype) \
do { \
if (req == NULL) \
@@ -120,7 +128,11 @@
do { \
if (cb != NULL) { \
uv__req_register(loop, req); \
- uv__work_submit(loop, &req->work_req, uv__fs_work, uv__fs_done); \
+ uv__work_submit(loop, \
+ &req->work_req, \
+ UV__WORK_FAST_IO, \
+ uv__fs_work, \
+ uv__fs_done); \
return 0; \
} \
else { \
@@ -143,7 +155,7 @@ static ssize_t uv__fs_fsync(uv_fs_t* req) {
int r;
r = fcntl(req->file, F_FULLFSYNC);
- if (r != 0 && errno == ENOTTY)
+ if (r != 0)
r = fsync(req->file);
return r;
#else
@@ -165,59 +177,17 @@ static ssize_t uv__fs_fdatasync(uv_fs_t* req) {
static ssize_t uv__fs_futime(uv_fs_t* req) {
-#if defined(__linux__)
+#if defined(__linux__) \
+ || defined(_AIX71)
/* utimesat() has nanosecond resolution but we stick to microseconds
* for the sake of consistency with other platforms.
*/
- static int no_utimesat;
struct timespec ts[2];
- struct timeval tv[2];
- char path[sizeof("/proc/self/fd/") + 3 * sizeof(int)];
- int r;
-
- if (no_utimesat)
- goto skip;
-
ts[0].tv_sec = req->atime;
ts[0].tv_nsec = (uint64_t)(req->atime * 1000000) % 1000000 * 1000;
ts[1].tv_sec = req->mtime;
ts[1].tv_nsec = (uint64_t)(req->mtime * 1000000) % 1000000 * 1000;
-
- r = uv__utimesat(req->file, NULL, ts, 0);
- if (r == 0)
- return r;
-
- if (errno != ENOSYS)
- return r;
-
- no_utimesat = 1;
-
-skip:
-
- tv[0].tv_sec = req->atime;
- tv[0].tv_usec = (uint64_t)(req->atime * 1000000) % 1000000;
- tv[1].tv_sec = req->mtime;
- tv[1].tv_usec = (uint64_t)(req->mtime * 1000000) % 1000000;
- snprintf(path, sizeof(path), "/proc/self/fd/%d", (int) req->file);
-
- r = utimes(path, tv);
- if (r == 0)
- return r;
-
- switch (errno) {
- case ENOENT:
- if (fcntl(req->file, F_GETFL) == -1 && errno == EBADF)
- break;
- /* Fall through. */
-
- case EACCES:
- case ENOTDIR:
- errno = ENOSYS;
- break;
- }
-
- return r;
-
+ return futimens(req->file, ts);
#elif defined(__APPLE__) \
|| defined(__DragonFly__) \
|| defined(__FreeBSD__) \
@@ -235,13 +205,6 @@ skip:
# else
return futimes(req->file, tv);
# endif
-#elif defined(_AIX71)
- struct timespec ts[2];
- ts[0].tv_sec = req->atime;
- ts[0].tv_nsec = (uint64_t)(req->atime * 1000000) % 1000000 * 1000;
- ts[1].tv_sec = req->mtime;
- ts[1].tv_nsec = (uint64_t)(req->mtime * 1000000) % 1000000 * 1000;
- return futimens(req->file, ts);
#elif defined(__MVS__)
attrib_t atr;
memset(&atr, 0, sizeof(atr));
@@ -314,17 +277,13 @@ static ssize_t uv__fs_read(uv_fs_t* req) {
#if defined(__linux__)
static int no_preadv;
#endif
+ unsigned int iovmax;
ssize_t result;
-#if defined(_AIX)
- struct stat buf;
- if(fstat(req->file, &buf))
- return -1;
- if(S_ISDIR(buf.st_mode)) {
- errno = EISDIR;
- return -1;
- }
-#endif /* defined(_AIX) */
+ iovmax = uv__getiovmax();
+ if (req->nbufs > iovmax)
+ req->nbufs = iovmax;
+
if (req->off < 0) {
if (req->nbufs == 1)
result = read(req->file, req->bufs[0].base, req->bufs[0].len);
@@ -343,25 +302,7 @@ static ssize_t uv__fs_read(uv_fs_t* req) {
if (no_preadv) retry:
# endif
{
- off_t nread;
- size_t index;
-
- nread = 0;
- index = 0;
- result = 1;
- do {
- if (req->bufs[index].len > 0) {
- result = pread(req->file,
- req->bufs[index].base,
- req->bufs[index].len,
- req->off + nread);
- if (result > 0)
- nread += result;
- }
- index++;
- } while (index < req->nbufs && result > 0);
- if (nread > 0)
- result = nread;
+ result = pread(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
}
# if defined(__linux__)
else {
@@ -379,6 +320,13 @@ static ssize_t uv__fs_read(uv_fs_t* req) {
}
done:
+ /* Early cleanup of bufs allocation, since we're done with it. */
+ if (req->bufs != req->bufsml)
+ uv__free(req->bufs);
+
+ req->bufs = NULL;
+ req->nbufs = 0;
+
return result;
}
@@ -446,8 +394,10 @@ static ssize_t uv__fs_pathmax_size(const char* path) {
}
static ssize_t uv__fs_readlink(uv_fs_t* req) {
+ ssize_t maxlen;
ssize_t len;
char* buf;
+ char* newbuf;
#if defined(UV__FS_PATH_MAX_FALLBACK)
/* We may not have a real PATH_MAX. Read size of link. */
@@ -461,17 +411,17 @@ static ssize_t uv__fs_readlink(uv_fs_t* req) {
return -1;
}
- len = st.st_size;
+ maxlen = st.st_size;
/* According to readlink(2) lstat can report st_size == 0
for some symlinks, such as those in /proc or /sys. */
- if (len == 0)
- len = uv__fs_pathmax_size(req->path);
+ if (maxlen == 0)
+ maxlen = uv__fs_pathmax_size(req->path);
#else
- len = uv__fs_pathmax_size(req->path);
+ maxlen = uv__fs_pathmax_size(req->path);
#endif
- buf = uv__malloc(len + 1);
+ buf = uv__malloc(maxlen);
if (buf == NULL) {
errno = ENOMEM;
@@ -479,17 +429,28 @@ static ssize_t uv__fs_readlink(uv_fs_t* req) {
}
#if defined(__MVS__)
- len = os390_readlink(req->path, buf, len);
+ len = os390_readlink(req->path, buf, maxlen);
#else
- len = readlink(req->path, buf, len);
+ len = readlink(req->path, buf, maxlen);
#endif
-
if (len == -1) {
uv__free(buf);
return -1;
}
+ /* Uncommon case: resize to make room for the trailing nul byte. */
+ if (len == maxlen) {
+ newbuf = uv__realloc(buf, len + 1);
+
+ if (newbuf == NULL) {
+ uv__free(buf);
+ return -1;
+ }
+
+ buf = newbuf;
+ }
+
buf[len] = '\0';
req->ptr = buf;
@@ -739,10 +700,48 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) {
static ssize_t uv__fs_utime(uv_fs_t* req) {
+#if defined(__linux__) \
+ || defined(_AIX71) \
+ || defined(__sun)
+ /* utimesat() has nanosecond resolution but we stick to microseconds
+ * for the sake of consistency with other platforms.
+ */
+ struct timespec ts[2];
+ ts[0].tv_sec = req->atime;
+ ts[0].tv_nsec = (uint64_t)(req->atime * 1000000) % 1000000 * 1000;
+ ts[1].tv_sec = req->mtime;
+ ts[1].tv_nsec = (uint64_t)(req->mtime * 1000000) % 1000000 * 1000;
+ return utimensat(AT_FDCWD, req->path, ts, 0);
+#elif defined(__APPLE__) \
+ || defined(__DragonFly__) \
+ || defined(__FreeBSD__) \
+ || defined(__FreeBSD_kernel__) \
+ || defined(__NetBSD__) \
+ || defined(__OpenBSD__)
+ struct timeval tv[2];
+ tv[0].tv_sec = req->atime;
+ tv[0].tv_usec = (uint64_t)(req->atime * 1000000) % 1000000;
+ tv[1].tv_sec = req->mtime;
+ tv[1].tv_usec = (uint64_t)(req->mtime * 1000000) % 1000000;
+ return utimes(req->path, tv);
+#elif defined(_AIX) \
+ && !defined(_AIX71)
struct utimbuf buf;
buf.actime = req->atime;
buf.modtime = req->mtime;
- return utime(req->path, &buf); /* TODO use utimes() where available */
+ return utime(req->path, &buf);
+#elif defined(__MVS__)
+ attrib_t atr;
+ memset(&atr, 0, sizeof(atr));
+ atr.att_mtimechg = 1;
+ atr.att_atimechg = 1;
+ atr.att_mtime = req->mtime;
+ atr.att_atime = req->atime;
+ return __lchattr((char*) req->path, &atr, sizeof(atr));
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}
@@ -780,25 +779,7 @@ static ssize_t uv__fs_write(uv_fs_t* req) {
if (no_pwritev) retry:
# endif
{
- off_t written;
- size_t index;
-
- written = 0;
- index = 0;
- r = 0;
- do {
- if (req->bufs[index].len > 0) {
- r = pwrite(req->file,
- req->bufs[index].base,
- req->bufs[index].len,
- req->off + written);
- if (r > 0)
- written += r;
- }
- index++;
- } while (index < req->nbufs && r >= 0);
- if (written > 0)
- r = written;
+ r = pwrite(req->file, req->bufs[0].base, req->bufs[0].len, req->off);
}
# if defined(__linux__)
else {
@@ -827,26 +808,41 @@ done:
static ssize_t uv__fs_copyfile(uv_fs_t* req) {
#if defined(__APPLE__) && !TARGET_OS_IPHONE
/* On macOS, use the native copyfile(3). */
+ static int can_clone;
copyfile_flags_t flags;
+ char buf[64];
+ size_t len;
+ int major;
flags = COPYFILE_ALL;
if (req->flags & UV_FS_COPYFILE_EXCL)
flags |= COPYFILE_EXCL;
-#ifdef COPYFILE_CLONE
- if (req->flags & UV_FS_COPYFILE_FICLONE)
- flags |= COPYFILE_CLONE;
-#endif
-
+ /* Check OS version. Cloning is only supported on macOS >= 10.12. */
if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) {
-#ifdef COPYFILE_CLONE_FORCE
- flags |= COPYFILE_CLONE_FORCE;
-#else
- return UV_ENOSYS;
-#endif
+ if (can_clone == 0) {
+ len = sizeof(buf);
+ if (sysctlbyname("kern.osrelease", buf, &len, NULL, 0))
+ return UV__ERR(errno);
+
+ if (1 != sscanf(buf, "%d", &major))
+ abort();
+
+ can_clone = -1 + 2 * (major >= 16); /* macOS >= 10.12 */
+ }
+
+ if (can_clone < 0)
+ return UV_ENOSYS;
}
+ /* copyfile() simply ignores COPYFILE_CLONE if it's not supported. */
+ if (req->flags & UV_FS_COPYFILE_FICLONE)
+ flags |= 1 << 24; /* COPYFILE_CLONE */
+
+ if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE)
+ flags |= 1 << 25; /* COPYFILE_CLONE_FORCE */
+
return copyfile(req->path, req->new_path, NULL, flags);
#else
uv_fs_t fs_req;
@@ -906,9 +902,11 @@ static ssize_t uv__fs_copyfile(uv_fs_t* req) {
/* If an error occurred that the sendfile fallback also won't handle, or
this is a force clone then exit. Otherwise, fall through to try using
sendfile(). */
- if ((errno != ENOTTY && errno != EOPNOTSUPP && errno != EXDEV) ||
- req->flags & UV_FS_COPYFILE_FICLONE_FORCE) {
- err = -errno;
+ if (errno != ENOTTY && errno != EOPNOTSUPP && errno != EXDEV) {
+ err = UV__ERR(errno);
+ goto out;
+ } else if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) {
+ err = UV_ENOTSUP;
goto out;
}
} else {
@@ -968,7 +966,11 @@ out:
}
}
- return result;
+ if (result == 0)
+ return 0;
+
+ errno = UV__ERR(result);
+ return -1;
#endif
}
@@ -1084,9 +1086,21 @@ static int uv__fs_fstat(int fd, uv_stat_t *buf) {
return ret;
}
+static size_t uv__fs_buf_offset(uv_buf_t* bufs, size_t size) {
+ size_t offset;
+ /* Figure out which bufs are done */
+ for (offset = 0; size > 0 && bufs[offset].len <= size; ++offset)
+ size -= bufs[offset].len;
+
+ /* Fix a partial read/write */
+ if (size > 0) {
+ bufs[offset].base += size;
+ bufs[offset].len -= size;
+ }
+ return offset;
+}
-typedef ssize_t (*uv__fs_buf_iter_processor)(uv_fs_t* req);
-static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process) {
+static ssize_t uv__fs_write_all(uv_fs_t* req) {
unsigned int iovmax;
unsigned int nbufs;
uv_buf_t* bufs;
@@ -1103,7 +1117,10 @@ static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process)
if (req->nbufs > iovmax)
req->nbufs = iovmax;
- result = process(req);
+ do
+ result = uv__fs_write(req);
+ while (result < 0 && errno == EINTR);
+
if (result <= 0) {
if (total == 0)
total = result;
@@ -1113,14 +1130,12 @@ static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process)
if (req->off >= 0)
req->off += result;
+ req->nbufs = uv__fs_buf_offset(req->bufs, result);
req->bufs += req->nbufs;
nbufs -= req->nbufs;
total += result;
}
- if (errno == EINTR && total == -1)
- return total;
-
if (bufs != req->bufsml)
uv__free(bufs);
@@ -1137,7 +1152,8 @@ static void uv__fs_work(struct uv__work* w) {
ssize_t r;
req = container_of(w, uv_fs_t, work_req);
- retry_on_eintr = !(req->fs_type == UV_FS_CLOSE);
+ retry_on_eintr = !(req->fs_type == UV_FS_CLOSE ||
+ req->fs_type == UV_FS_READ);
do {
errno = 0;
@@ -1155,6 +1171,7 @@ static void uv__fs_work(struct uv__work* w) {
X(COPYFILE, uv__fs_copyfile(req));
X(FCHMOD, fchmod(req->file, req->mode));
X(FCHOWN, fchown(req->file, req->uid, req->gid));
+ X(LCHOWN, lchown(req->path, req->uid, req->gid));
X(FDATASYNC, uv__fs_fdatasync(req));
X(FSTAT, uv__fs_fstat(req->file, &req->statbuf));
X(FSYNC, uv__fs_fsync(req));
@@ -1165,7 +1182,7 @@ static void uv__fs_work(struct uv__work* w) {
X(MKDIR, mkdir(req->path, req->mode));
X(MKDTEMP, uv__fs_mkdtemp(req));
X(OPEN, uv__fs_open(req));
- X(READ, uv__fs_buf_iter(req, uv__fs_read));
+ X(READ, uv__fs_read(req));
X(SCANDIR, uv__fs_scandir(req));
X(READLINK, uv__fs_readlink(req));
X(REALPATH, uv__fs_realpath(req));
@@ -1176,7 +1193,7 @@ static void uv__fs_work(struct uv__work* w) {
X(SYMLINK, symlink(req->path, req->new_path));
X(UNLINK, unlink(req->path));
X(UTIME, uv__fs_utime(req));
- X(WRITE, uv__fs_buf_iter(req, uv__fs_write));
+ X(WRITE, uv__fs_write_all(req));
default: abort();
}
#undef X
@@ -1281,6 +1298,20 @@ int uv_fs_fchown(uv_loop_t* loop,
}
+int uv_fs_lchown(uv_loop_t* loop,
+ uv_fs_t* req,
+ const char* path,
+ uv_uid_t uid,
+ uv_gid_t gid,
+ uv_fs_cb cb) {
+ INIT(LCHOWN);
+ PATH;
+ req->uid = uid;
+ req->gid = gid;
+ POST;
+}
+
+
int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) {
INIT(FDATASYNC);
req->file = file;
diff --git a/Utilities/cmlibuv/src/unix/fsevents.c b/Utilities/cmlibuv/src/unix/fsevents.c
index 47d8024b6..c430562b3 100644
--- a/Utilities/cmlibuv/src/unix/fsevents.c
+++ b/Utilities/cmlibuv/src/unix/fsevents.c
@@ -255,42 +255,55 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef,
path = paths[i];
len = strlen(path);
+ if (handle->realpath_len == 0)
+ continue; /* This should be unreachable */
+
/* Filter out paths that are outside handle's request */
- if (strncmp(path, handle->realpath, handle->realpath_len) != 0)
+ if (len < handle->realpath_len)
+ continue;
+
+ if (handle->realpath_len != len &&
+ path[handle->realpath_len] != '/')
+ /* Make sure that realpath actually named a directory,
+ * or that we matched the whole string */
continue;
- if (handle->realpath_len > 1 || *handle->realpath != '/') {
+ if (memcmp(path, handle->realpath, handle->realpath_len) != 0)
+ continue;
+
+ if (!(handle->realpath_len == 1 && handle->realpath[0] == '/')) {
+ /* Remove common prefix, unless the watched folder is "/" */
path += handle->realpath_len;
len -= handle->realpath_len;
- /* Skip forward slash */
- if (*path != '\0') {
+ /* Ignore events with path equal to directory itself */
+ if (len <= 1 && (flags & kFSEventStreamEventFlagItemIsDir))
+ continue;
+
+ if (len == 0) {
+ /* Since we're using fsevents to watch the file itself,
+ * realpath == path, and we now need to get the basename of the file back
+ * (for commonality with other codepaths and platforms). */
+ while (len < handle->realpath_len && path[-1] != '/') {
+ path--;
+ len++;
+ }
+ /* Created and Removed seem to be always set, but don't make sense */
+ flags &= ~kFSEventsRenamed;
+ } else {
+ /* Skip forward slash */
path++;
len--;
}
}
-#ifdef MAC_OS_X_VERSION_10_7
- /* Ignore events with path equal to directory itself */
- if (len == 0)
- continue;
-#else
- if (len == 0 && (flags & kFSEventStreamEventFlagItemIsDir))
- continue;
-#endif /* MAC_OS_X_VERSION_10_7 */
-
/* Do not emit events from subdirectories (without option set) */
- if ((handle->cf_flags & UV_FS_EVENT_RECURSIVE) == 0 && *path != 0) {
+ if ((handle->cf_flags & UV_FS_EVENT_RECURSIVE) == 0 && *path != '\0') {
pos = strchr(path + 1, '/');
if (pos != NULL)
continue;
}
-#ifndef MAC_OS_X_VERSION_10_7
- path = "";
- len = 0;
-#endif /* MAC_OS_X_VERSION_10_7 */
-
event = uv__malloc(sizeof(*event) + len);
if (event == NULL)
break;
@@ -299,22 +312,11 @@ static void uv__fsevents_event_cb(ConstFSEventStreamRef streamRef,
memcpy(event->path, path, len + 1);
event->events = UV_RENAME;
-#ifdef MAC_OS_X_VERSION_10_7
- if (0 != (flags & kFSEventsModified) &&
- 0 == (flags & kFSEventsRenamed)) {
- event->events = UV_CHANGE;
- }
-#else
- if (0 != (flags & kFSEventsModified) &&
- 0 != (flags & kFSEventStreamEventFlagItemIsDir) &&
- 0 == (flags & kFSEventStreamEventFlagItemRenamed)) {
- event->events = UV_CHANGE;
- }
- if (0 == (flags & kFSEventStreamEventFlagItemIsDir) &&
- 0 == (flags & kFSEventStreamEventFlagItemRenamed)) {
- event->events = UV_CHANGE;
+ if (0 == (flags & kFSEventsRenamed)) {
+ if (0 != (flags & kFSEventsModified) ||
+ 0 == (flags & kFSEventStreamEventFlagItemIsDir))
+ event->events = UV_CHANGE;
}
-#endif /* MAC_OS_X_VERSION_10_7 */
QUEUE_INSERT_TAIL(&head, &event->member);
}
@@ -836,7 +838,7 @@ int uv__fsevents_init(uv_fs_event_t* handle) {
handle->cf_cb->data = handle;
uv_async_init(handle->loop, handle->cf_cb, uv__fsevents_cb);
- handle->cf_cb->flags |= UV__HANDLE_INTERNAL;
+ handle->cf_cb->flags |= UV_HANDLE_INTERNAL;
uv_unref((uv_handle_t*) handle->cf_cb);
err = uv_mutex_init(&handle->cf_mutex);
diff --git a/Utilities/cmlibuv/src/unix/getaddrinfo.c b/Utilities/cmlibuv/src/unix/getaddrinfo.c
index 10e8afd75..6d23fbe02 100644
--- a/Utilities/cmlibuv/src/unix/getaddrinfo.c
+++ b/Utilities/cmlibuv/src/unix/getaddrinfo.c
@@ -27,6 +27,7 @@
#include "uv.h"
#include "internal.h"
+#include "idna.h"
#include <errno.h>
#include <stddef.h> /* NULL */
@@ -141,15 +142,34 @@ int uv_getaddrinfo(uv_loop_t* loop,
const char* hostname,
const char* service,
const struct addrinfo* hints) {
+ char hostname_ascii[256];
size_t hostname_len;
size_t service_len;
size_t hints_len;
size_t len;
char* buf;
+ long rc;
if (req == NULL || (hostname == NULL && service == NULL))
return UV_EINVAL;
+ /* FIXME(bnoordhuis) IDNA does not seem to work z/OS,
+ * probably because it uses EBCDIC rather than ASCII.
+ */
+#ifdef __MVS__
+ (void) &hostname_ascii;
+#else
+ if (hostname != NULL) {
+ rc = uv__idna_toascii(hostname,
+ hostname + strlen(hostname),
+ hostname_ascii,
+ hostname_ascii + sizeof(hostname_ascii));
+ if (rc < 0)
+ return rc;
+ hostname = hostname_ascii;
+ }
+#endif
+
hostname_len = hostname ? strlen(hostname) + 1 : 0;
service_len = service ? strlen(service) + 1 : 0;
hints_len = hints ? sizeof(*hints) : 0;
@@ -186,6 +206,7 @@ int uv_getaddrinfo(uv_loop_t* loop,
if (cb) {
uv__work_submit(loop,
&req->work_req,
+ UV__WORK_SLOW_IO,
uv__getaddrinfo_work,
uv__getaddrinfo_done);
return 0;
diff --git a/Utilities/cmlibuv/src/unix/getnameinfo.c b/Utilities/cmlibuv/src/unix/getnameinfo.c
index d9e6f79d4..b695081b4 100644
--- a/Utilities/cmlibuv/src/unix/getnameinfo.c
+++ b/Utilities/cmlibuv/src/unix/getnameinfo.c
@@ -109,6 +109,7 @@ int uv_getnameinfo(uv_loop_t* loop,
if (getnameinfo_cb) {
uv__work_submit(loop,
&req->work_req,
+ UV__WORK_SLOW_IO,
uv__getnameinfo_work,
uv__getnameinfo_done);
return 0;
diff --git a/Utilities/cmlibuv/src/unix/ibmi.c b/Utilities/cmlibuv/src/unix/ibmi.c
index 02e90fb1f..13fed6cc0 100644
--- a/Utilities/cmlibuv/src/unix/ibmi.c
+++ b/Utilities/cmlibuv/src/unix/ibmi.c
@@ -72,7 +72,8 @@ void uv_loadavg(double avg[3]) {
int uv_resident_set_memory(size_t* rss) {
- return UV_ENOSYS;
+ *rss = 0;
+ return 0;
}
diff --git a/Utilities/cmlibuv/src/unix/internal.h b/Utilities/cmlibuv/src/unix/internal.h
index 89c6eb13d..48fe6e8b1 100644
--- a/Utilities/cmlibuv/src/unix/internal.h
+++ b/Utilities/cmlibuv/src/unix/internal.h
@@ -137,26 +137,6 @@ int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset);
typedef struct uv__stream_queued_fds_s uv__stream_queued_fds_t;
-/* handle flags */
-enum {
- UV_CLOSING = 0x01, /* uv_close() called but not finished. */
- UV_CLOSED = 0x02, /* close(2) finished. */
- UV_STREAM_READING = 0x04, /* uv_read_start() called. */
- UV_STREAM_SHUTTING = 0x08, /* uv_shutdown() called but not complete. */
- UV_STREAM_SHUT = 0x10, /* Write side closed. */
- UV_STREAM_READABLE = 0x20, /* The stream is readable */
- UV_STREAM_WRITABLE = 0x40, /* The stream is writable */
- UV_STREAM_BLOCKING = 0x80, /* Synchronous writes. */
- UV_STREAM_READ_PARTIAL = 0x100, /* read(2) read less than requested. */
- UV_STREAM_READ_EOF = 0x200, /* read(2) read EOF. */
- UV_TCP_NODELAY = 0x400, /* Disable Nagle. */
- UV_TCP_KEEPALIVE = 0x800, /* Turn on keep-alive. */
- UV_TCP_SINGLE_ACCEPT = 0x1000, /* Only accept() when idle. */
- UV_HANDLE_IPV6 = 0x10000, /* Handle is bound to a IPv6 socket. */
- UV_UDP_PROCESSING = 0x20000, /* Handle is running the send callback queue. */
- UV_HANDLE_BOUND = 0x40000 /* Handle is bound to an address and port */
-};
-
/* loop flags */
enum {
UV_LOOP_BLOCK_SIGPROF = 1
@@ -215,7 +195,6 @@ int uv__nonblock_fcntl(int fd, int set);
int uv__close(int fd); /* preserves errno */
int uv__close_nocheckstdio(int fd);
int uv__socket(int domain, int type, int protocol);
-int uv__dup(int fd);
ssize_t uv__recvmsg(int fd, struct msghdr *msg, int flags);
void uv__make_close_pending(uv_handle_t* handle);
int uv__getiovmax(void);
@@ -229,6 +208,7 @@ int uv__io_active(const uv__io_t* w, unsigned int events);
int uv__io_check_fd(uv_loop_t* loop, int fd);
void uv__io_poll(uv_loop_t* loop, int timeout); /* in milliseconds or -1 */
int uv__io_fork(uv_loop_t* loop);
+int uv__fd_exists(uv_loop_t* loop, int fd);
/* async */
void uv__async_stop(uv_loop_t* loop);
@@ -261,10 +241,6 @@ int uv__tcp_keepalive(int fd, int on, unsigned int delay);
/* pipe */
int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb);
-/* timer */
-void uv__run_timers(uv_loop_t* loop);
-int uv__next_timeout(const uv_loop_t* loop);
-
/* signal */
void uv__signal_close(uv_signal_t* handle);
void uv__signal_global_once_init(void);
@@ -289,7 +265,6 @@ void uv__prepare_close(uv_prepare_t* handle);
void uv__process_close(uv_process_t* handle);
void uv__stream_close(uv_stream_t* handle);
void uv__tcp_close(uv_tcp_t* handle);
-void uv__timer_close(uv_timer_t* handle);
void uv__udp_close(uv_udp_t* handle);
void uv__udp_finish_close(uv_udp_t* handle);
uv_handle_type uv__handle_type(int fd);
@@ -319,24 +294,6 @@ int uv__fsevents_init(uv_fs_event_t* handle);
int uv__fsevents_close(uv_fs_event_t* handle);
void uv__fsevents_loop_delete(uv_loop_t* loop);
-/* OSX < 10.7 has no file events, polyfill them */
-#ifndef MAC_OS_X_VERSION_10_7
-
-static const int kFSEventStreamCreateFlagFileEvents = 0x00000010;
-static const int kFSEventStreamEventFlagItemCreated = 0x00000100;
-static const int kFSEventStreamEventFlagItemRemoved = 0x00000200;
-static const int kFSEventStreamEventFlagItemInodeMetaMod = 0x00000400;
-static const int kFSEventStreamEventFlagItemRenamed = 0x00000800;
-static const int kFSEventStreamEventFlagItemModified = 0x00001000;
-static const int kFSEventStreamEventFlagItemFinderInfoMod = 0x00002000;
-static const int kFSEventStreamEventFlagItemChangeOwner = 0x00004000;
-static const int kFSEventStreamEventFlagItemXattrMod = 0x00008000;
-static const int kFSEventStreamEventFlagItemIsFile = 0x00010000;
-static const int kFSEventStreamEventFlagItemIsDir = 0x00020000;
-static const int kFSEventStreamEventFlagItemIsSymlink = 0x00040000;
-
-#endif /* __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070 */
-
#endif /* defined(__APPLE__) */
UV_UNUSED(static void uv__update_time(uv_loop_t* loop)) {
diff --git a/Utilities/cmlibuv/src/unix/kqueue.c b/Utilities/cmlibuv/src/unix/kqueue.c
index a30fd730f..c24f96e13 100644
--- a/Utilities/cmlibuv/src/unix/kqueue.c
+++ b/Utilities/cmlibuv/src/unix/kqueue.c
@@ -261,8 +261,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
w = loop->watchers[fd];
if (w == NULL) {
- /* File descriptor that we've stopped watching, disarm it. */
- /* TODO batch up */
+ /* File descriptor that we've stopped watching, disarm it.
+ * TODO: batch up. */
struct kevent events[1];
EV_SET(events + 0, fd, ev->filter, EV_DELETE, 0, 0, 0);
@@ -452,49 +452,48 @@ int uv_fs_event_start(uv_fs_event_t* handle,
uv_fs_event_cb cb,
const char* path,
unsigned int flags) {
-#if defined(__APPLE__)
- struct stat statbuf;
-#endif /* defined(__APPLE__) */
int fd;
if (uv__is_active(handle))
return UV_EINVAL;
- /* TODO open asynchronously - but how do we report back errors? */
- fd = open(path, O_RDONLY);
- if (fd == -1)
- return UV__ERR(errno);
-
- uv__handle_start(handle);
- uv__io_init(&handle->event_watcher, uv__fs_event, fd);
- handle->path = uv__strdup(path);
- handle->cb = cb;
-
#if defined(__APPLE__)
- if (uv__has_forked_with_cfrunloop)
- goto fallback;
-
/* Nullify field to perform checks later */
handle->cf_cb = NULL;
handle->realpath = NULL;
handle->realpath_len = 0;
handle->cf_flags = flags;
- if (fstat(fd, &statbuf))
- goto fallback;
- /* FSEvents works only with directories */
- if (!(statbuf.st_mode & S_IFDIR))
- goto fallback;
-
- /* The fallback fd is no longer needed */
- uv__close(fd);
- handle->event_watcher.fd = -1;
-
- return uv__fsevents_init(handle);
-
-fallback:
+ if (!uv__has_forked_with_cfrunloop) {
+ int r;
+ /* The fallback fd is not used */
+ handle->event_watcher.fd = -1;
+ handle->path = uv__strdup(path);
+ if (handle->path == NULL)
+ return UV_ENOMEM;
+ handle->cb = cb;
+ r = uv__fsevents_init(handle);
+ if (r == 0) {
+ uv__handle_start(handle);
+ } else {
+ uv__free(handle->path);
+ handle->path = NULL;
+ }
+ return r;
+ }
#endif /* defined(__APPLE__) */
+ /* TODO open asynchronously - but how do we report back errors? */
+ fd = open(path, O_RDONLY);
+ if (fd == -1)
+ return UV__ERR(errno);
+
+ handle->path = uv__strdup(path);
+ if (handle->path == NULL)
+ return UV_ENOMEM;
+ handle->cb = cb;
+ uv__handle_start(handle);
+ uv__io_init(&handle->event_watcher, uv__fs_event, fd);
uv__io_start(handle->loop, &handle->event_watcher, POLLIN);
return 0;
@@ -502,29 +501,29 @@ fallback:
int uv_fs_event_stop(uv_fs_event_t* handle) {
+ int r;
+ r = 0;
+
if (!uv__is_active(handle))
return 0;
uv__handle_stop(handle);
#if defined(__APPLE__)
- if (uv__has_forked_with_cfrunloop || uv__fsevents_close(handle))
-#endif /* defined(__APPLE__) */
- {
- uv__io_close(handle->loop, &handle->event_watcher);
- }
-
- uv__free(handle->path);
- handle->path = NULL;
+ if (!uv__has_forked_with_cfrunloop)
+ r = uv__fsevents_close(handle);
+#endif
if (handle->event_watcher.fd != -1) {
- /* When FSEvents is used, we don't use the event_watcher's fd under certain
- * confitions. (see uv_fs_event_start) */
+ uv__io_close(handle->loop, &handle->event_watcher);
uv__close(handle->event_watcher.fd);
handle->event_watcher.fd = -1;
}
- return 0;
+ uv__free(handle->path);
+ handle->path = NULL;
+
+ return r;
}
diff --git a/Utilities/cmlibuv/src/unix/linux-core.c b/Utilities/cmlibuv/src/unix/linux-core.c
index b63c25f3c..3341b94e1 100644
--- a/Utilities/cmlibuv/src/unix/linux-core.c
+++ b/Utilities/cmlibuv/src/unix/linux-core.c
@@ -20,7 +20,7 @@
/* We lean on the fact that POLL{IN,OUT,ERR,HUP} correspond with their
* EPOLL* counterparts. We use the POLL* variants in this file because that
- * is what libuv uses elsewhere and it avoids a dependency on <sys/epoll.h>.
+ * is what libuv uses elsewhere.
*/
#include "uv.h"
@@ -34,6 +34,7 @@
#include <errno.h>
#include <net/if.h>
+#include <sys/epoll.h>
#include <sys/param.h>
#include <sys/prctl.h>
#include <sys/sysinfo.h>
@@ -51,7 +52,7 @@
#ifdef HAVE_IFADDRS_H
# if defined(__ANDROID__)
-# include "android-ifaddrs.h"
+# include "uv/android-ifaddrs.h"
# else
# include <ifaddrs.h>
# endif
@@ -84,13 +85,13 @@ static unsigned long read_cpufreq(unsigned int cpunum);
int uv__platform_loop_init(uv_loop_t* loop) {
int fd;
- fd = uv__epoll_create1(UV__EPOLL_CLOEXEC);
+ fd = epoll_create1(EPOLL_CLOEXEC);
/* epoll_create1() can fail either because it's not implemented (old kernel)
* or because it doesn't understand the EPOLL_CLOEXEC flag.
*/
if (fd == -1 && (errno == ENOSYS || errno == EINVAL)) {
- fd = uv__epoll_create(256);
+ fd = epoll_create(256);
if (fd != -1)
uv__cloexec(fd, 1);
@@ -134,20 +135,20 @@ void uv__platform_loop_delete(uv_loop_t* loop) {
void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
- struct uv__epoll_event* events;
- struct uv__epoll_event dummy;
+ struct epoll_event* events;
+ struct epoll_event dummy;
uintptr_t i;
uintptr_t nfds;
assert(loop->watchers != NULL);
- events = (struct uv__epoll_event*) loop->watchers[loop->nwatchers];
+ events = (struct epoll_event*) loop->watchers[loop->nwatchers];
nfds = (uintptr_t) loop->watchers[loop->nwatchers + 1];
if (events != NULL)
/* Invalidate events with same file descriptor */
for (i = 0; i < nfds; i++)
- if ((int) events[i].data == fd)
- events[i].data = -1;
+ if (events[i].data.fd == fd)
+ events[i].data.fd = -1;
/* Remove the file descriptor from the epoll.
* This avoids a problem where the same file description remains open
@@ -160,25 +161,26 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
* has the EPOLLWAKEUP flag set generates spurious audit syslog warnings.
*/
memset(&dummy, 0, sizeof(dummy));
- uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, &dummy);
+ epoll_ctl(loop->backend_fd, EPOLL_CTL_DEL, fd, &dummy);
}
}
int uv__io_check_fd(uv_loop_t* loop, int fd) {
- struct uv__epoll_event e;
+ struct epoll_event e;
int rc;
+ memset(&e, 0, sizeof(e));
e.events = POLLIN;
- e.data = -1;
+ e.data.fd = -1;
rc = 0;
- if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_ADD, fd, &e))
+ if (epoll_ctl(loop->backend_fd, EPOLL_CTL_ADD, fd, &e))
if (errno != EEXIST)
rc = UV__ERR(errno);
if (rc == 0)
- if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, &e))
+ if (epoll_ctl(loop->backend_fd, EPOLL_CTL_DEL, fd, &e))
abort();
return rc;
@@ -195,16 +197,14 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
* that being the largest value I have seen in the wild (and only once.)
*/
static const int max_safe_timeout = 1789569;
- static int no_epoll_pwait;
- static int no_epoll_wait;
- struct uv__epoll_event events[1024];
- struct uv__epoll_event* pe;
- struct uv__epoll_event e;
+ struct epoll_event events[1024];
+ struct epoll_event* pe;
+ struct epoll_event e;
int real_timeout;
QUEUE* q;
uv__io_t* w;
sigset_t sigset;
- uint64_t sigmask;
+ sigset_t* psigset;
uint64_t base;
int have_signals;
int nevents;
@@ -219,6 +219,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
return;
}
+ memset(&e, 0, sizeof(e));
+
while (!QUEUE_EMPTY(&loop->watcher_queue)) {
q = QUEUE_HEAD(&loop->watcher_queue);
QUEUE_REMOVE(q);
@@ -230,35 +232,35 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
assert(w->fd < (int) loop->nwatchers);
e.events = w->pevents;
- e.data = w->fd;
+ e.data.fd = w->fd;
if (w->events == 0)
- op = UV__EPOLL_CTL_ADD;
+ op = EPOLL_CTL_ADD;
else
- op = UV__EPOLL_CTL_MOD;
+ op = EPOLL_CTL_MOD;
/* XXX Future optimization: do EPOLL_CTL_MOD lazily if we stop watching
* events, skip the syscall and squelch the events after epoll_wait().
*/
- if (uv__epoll_ctl(loop->backend_fd, op, w->fd, &e)) {
+ if (epoll_ctl(loop->backend_fd, op, w->fd, &e)) {
if (errno != EEXIST)
abort();
- assert(op == UV__EPOLL_CTL_ADD);
+ assert(op == EPOLL_CTL_ADD);
/* We've reactivated a file descriptor that's been watched before. */
- if (uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_MOD, w->fd, &e))
+ if (epoll_ctl(loop->backend_fd, EPOLL_CTL_MOD, w->fd, &e))
abort();
}
w->events = w->pevents;
}
- sigmask = 0;
+ psigset = NULL;
if (loop->flags & UV_LOOP_BLOCK_SIGPROF) {
sigemptyset(&sigset);
sigaddset(&sigset, SIGPROF);
- sigmask |= 1 << (SIGPROF - 1);
+ psigset = &sigset;
}
assert(timeout >= -1);
@@ -273,30 +275,11 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
if (sizeof(int32_t) == sizeof(long) && timeout >= max_safe_timeout)
timeout = max_safe_timeout;
- if (sigmask != 0 && no_epoll_pwait != 0)
- if (pthread_sigmask(SIG_BLOCK, &sigset, NULL))
- abort();
-
- if (no_epoll_wait != 0 || (sigmask != 0 && no_epoll_pwait == 0)) {
- nfds = uv__epoll_pwait(loop->backend_fd,
- events,
- ARRAY_SIZE(events),
- timeout,
- sigmask);
- if (nfds == -1 && errno == ENOSYS)
- no_epoll_pwait = 1;
- } else {
- nfds = uv__epoll_wait(loop->backend_fd,
- events,
- ARRAY_SIZE(events),
- timeout);
- if (nfds == -1 && errno == ENOSYS)
- no_epoll_wait = 1;
- }
-
- if (sigmask != 0 && no_epoll_pwait != 0)
- if (pthread_sigmask(SIG_UNBLOCK, &sigset, NULL))
- abort();
+ nfds = epoll_pwait(loop->backend_fd,
+ events,
+ ARRAY_SIZE(events),
+ timeout,
+ psigset);
/* Update loop->time unconditionally. It's tempting to skip the update when
* timeout == 0 (i.e. non-blocking poll) but there is no guarantee that the
@@ -317,12 +300,6 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
}
if (nfds == -1) {
- if (errno == ENOSYS) {
- /* epoll_wait() or epoll_pwait() failed, try the other system call. */
- assert(no_epoll_wait == 0 || no_epoll_pwait == 0);
- continue;
- }
-
if (errno != EINTR)
abort();
@@ -344,7 +321,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
loop->watchers[loop->nwatchers + 1] = (void*) (uintptr_t) nfds;
for (i = 0; i < nfds; i++) {
pe = events + i;
- fd = pe->data;
+ fd = pe->data.fd;
/* Skip invalidated events, see uv__platform_invalidate_fd */
if (fd == -1)
@@ -361,7 +338,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
* Ignore all errors because we may be racing with another thread
* when the file descriptor is closed.
*/
- uv__epoll_ctl(loop->backend_fd, UV__EPOLL_CTL_DEL, fd, pe);
+ epoll_ctl(loop->backend_fd, EPOLL_CTL_DEL, fd, pe);
continue;
}
@@ -388,7 +365,8 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
* free when we switch over to edge-triggered I/O.
*/
if (pe->events == POLLERR || pe->events == POLLHUP)
- pe->events |= w->pevents & (POLLIN | POLLOUT | UV__POLLPRI);
+ pe->events |=
+ w->pevents & (POLLIN | POLLOUT | UV__POLLRDHUP | UV__POLLPRI);
if (pe->events != 0) {
/* Run signal watchers last. This also affects child process watchers
@@ -851,9 +829,10 @@ static int uv__ifaddr_exclude(struct ifaddrs *ent, int exclude_type) {
return !exclude_type;
}
-int uv_interface_addresses(uv_interface_address_t** addresses,
- int* count) {
+int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
#ifndef HAVE_IFADDRS_H
+ *count = 0;
+ *addresses = NULL;
return UV_ENOSYS;
#else
struct ifaddrs *addrs, *ent;
@@ -861,12 +840,12 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
int i;
struct sockaddr_ll *sll;
- if (getifaddrs(&addrs))
- return UV__ERR(errno);
-
*count = 0;
*addresses = NULL;
+ if (getifaddrs(&addrs))
+ return UV__ERR(errno);
+
/* Count the number of interfaces */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (uv__ifaddr_exclude(ent, UV__EXCLUDE_IFADDR))
@@ -875,8 +854,10 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
(*count)++;
}
- if (*count == 0)
+ if (*count == 0) {
+ freeifaddrs(addrs);
return 0;
+ }
*addresses = uv__malloc(*count * sizeof(**addresses));
if (!(*addresses)) {
@@ -920,6 +901,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses,
if (strcmp(address->name, ent->ifa_name) == 0) {
sll = (struct sockaddr_ll*)ent->ifa_addr;
memcpy(address->phys_addr, sll->sll_addr, sizeof(address->phys_addr));
+ } else {
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
}
address++;
}
diff --git a/Utilities/cmlibuv/src/unix/linux-inotify.c b/Utilities/cmlibuv/src/unix/linux-inotify.c
index bcad630fa..9b26202fb 100644
--- a/Utilities/cmlibuv/src/unix/linux-inotify.c
+++ b/Utilities/cmlibuv/src/unix/linux-inotify.c
@@ -19,7 +19,7 @@
*/
#include "uv.h"
-#include "tree.h"
+#include "uv/tree.h"
#include "internal.h"
#include <stdint.h>
@@ -278,6 +278,7 @@ int uv_fs_event_start(uv_fs_event_t* handle,
const char* path,
unsigned int flags) {
struct watcher_list* w;
+ size_t len;
int events;
int err;
int wd;
@@ -306,12 +307,13 @@ int uv_fs_event_start(uv_fs_event_t* handle,
if (w)
goto no_insert;
- w = uv__malloc(sizeof(*w) + strlen(path) + 1);
+ len = strlen(path) + 1;
+ w = uv__malloc(sizeof(*w) + len);
if (w == NULL)
return UV_ENOMEM;
w->wd = wd;
- w->path = strcpy((char*)(w + 1), path);
+ w->path = memcpy(w + 1, path, len);
QUEUE_INIT(&w->watchers);
w->iterating = 0;
RB_INSERT(watcher_root, CAST(&handle->loop->inotify_watchers), w);
diff --git a/Utilities/cmlibuv/src/unix/linux-syscalls.c b/Utilities/cmlibuv/src/unix/linux-syscalls.c
index 89998ded2..bfd754487 100644
--- a/Utilities/cmlibuv/src/unix/linux-syscalls.c
+++ b/Utilities/cmlibuv/src/unix/linux-syscalls.c
@@ -77,56 +77,6 @@
# endif
#endif /* __NR_eventfd2 */
-#ifndef __NR_epoll_create
-# if defined(__x86_64__)
-# define __NR_epoll_create 213
-# elif defined(__i386__)
-# define __NR_epoll_create 254
-# elif defined(__arm__)
-# define __NR_epoll_create (UV_SYSCALL_BASE + 250)
-# endif
-#endif /* __NR_epoll_create */
-
-#ifndef __NR_epoll_create1
-# if defined(__x86_64__)
-# define __NR_epoll_create1 291
-# elif defined(__i386__)
-# define __NR_epoll_create1 329
-# elif defined(__arm__)
-# define __NR_epoll_create1 (UV_SYSCALL_BASE + 357)
-# endif
-#endif /* __NR_epoll_create1 */
-
-#ifndef __NR_epoll_ctl
-# if defined(__x86_64__)
-# define __NR_epoll_ctl 233 /* used to be 214 */
-# elif defined(__i386__)
-# define __NR_epoll_ctl 255
-# elif defined(__arm__)
-# define __NR_epoll_ctl (UV_SYSCALL_BASE + 251)
-# endif
-#endif /* __NR_epoll_ctl */
-
-#ifndef __NR_epoll_wait
-# if defined(__x86_64__)
-# define __NR_epoll_wait 232 /* used to be 215 */
-# elif defined(__i386__)
-# define __NR_epoll_wait 256
-# elif defined(__arm__)
-# define __NR_epoll_wait (UV_SYSCALL_BASE + 252)
-# endif
-#endif /* __NR_epoll_wait */
-
-#ifndef __NR_epoll_pwait
-# if defined(__x86_64__)
-# define __NR_epoll_pwait 281
-# elif defined(__i386__)
-# define __NR_epoll_pwait 319
-# elif defined(__arm__)
-# define __NR_epoll_pwait (UV_SYSCALL_BASE + 346)
-# endif
-#endif /* __NR_epoll_pwait */
-
#ifndef __NR_inotify_init
# if defined(__x86_64__)
# define __NR_inotify_init 253
@@ -285,76 +235,6 @@ int uv__eventfd2(unsigned int count, int flags) {
}
-int uv__epoll_create(int size) {
-#if defined(__NR_epoll_create)
- return syscall(__NR_epoll_create, size);
-#else
- return errno = ENOSYS, -1;
-#endif
-}
-
-
-int uv__epoll_create1(int flags) {
-#if defined(__NR_epoll_create1)
- return syscall(__NR_epoll_create1, flags);
-#else
- return errno = ENOSYS, -1;
-#endif
-}
-
-
-int uv__epoll_ctl(int epfd, int op, int fd, struct uv__epoll_event* events) {
-#if defined(__NR_epoll_ctl)
- return syscall(__NR_epoll_ctl, epfd, op, fd, events);
-#else
- return errno = ENOSYS, -1;
-#endif
-}
-
-
-int uv__epoll_wait(int epfd,
- struct uv__epoll_event* events,
- int nevents,
- int timeout) {
-#if defined(__NR_epoll_wait)
- int result;
- result = syscall(__NR_epoll_wait, epfd, events, nevents, timeout);
-#if MSAN_ACTIVE
- if (result > 0)
- __msan_unpoison(events, sizeof(events[0]) * result);
-#endif
- return result;
-#else
- return errno = ENOSYS, -1;
-#endif
-}
-
-
-int uv__epoll_pwait(int epfd,
- struct uv__epoll_event* events,
- int nevents,
- int timeout,
- uint64_t sigmask) {
-#if defined(__NR_epoll_pwait)
- int result;
- result = syscall(__NR_epoll_pwait,
- epfd,
- events,
- nevents,
- timeout,
- &sigmask,
- sizeof(sigmask));
-#if MSAN_ACTIVE
- if (result > 0)
- __msan_unpoison(events, sizeof(events[0]) * result);
-#endif
- return result;
-#else
- return errno = ENOSYS, -1;
-#endif
-}
-
-
int uv__inotify_init(void) {
#if defined(__NR_inotify_init)
return syscall(__NR_inotify_init);
@@ -431,19 +311,6 @@ int uv__recvmmsg(int fd,
}
-int uv__utimesat(int dirfd,
- const char* path,
- const struct timespec times[2],
- int flags)
-{
-#if defined(__NR_utimensat)
- return syscall(__NR_utimensat, dirfd, path, times, flags);
-#else
- return errno = ENOSYS, -1;
-#endif
-}
-
-
ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset) {
#if defined(__NR_preadv)
return syscall(__NR_preadv, fd, iov, iovcnt, (long)offset, (long)(offset >> 32));
diff --git a/Utilities/cmlibuv/src/unix/linux-syscalls.h b/Utilities/cmlibuv/src/unix/linux-syscalls.h
index 4c095e9b5..3dfd329d6 100644
--- a/Utilities/cmlibuv/src/unix/linux-syscalls.h
+++ b/Utilities/cmlibuv/src/unix/linux-syscalls.h
@@ -66,12 +66,6 @@
# define UV__SOCK_NONBLOCK UV__O_NONBLOCK
#endif
-/* epoll flags */
-#define UV__EPOLL_CLOEXEC UV__O_CLOEXEC
-#define UV__EPOLL_CTL_ADD 1
-#define UV__EPOLL_CTL_DEL 2
-#define UV__EPOLL_CTL_MOD 3
-
/* inotify flags */
#define UV__IN_ACCESS 0x001
#define UV__IN_MODIFY 0x002
@@ -86,18 +80,6 @@
#define UV__IN_DELETE_SELF 0x400
#define UV__IN_MOVE_SELF 0x800
-#if defined(__x86_64__)
-struct uv__epoll_event {
- uint32_t events;
- uint64_t data;
-} __attribute__((packed));
-#else
-struct uv__epoll_event {
- uint32_t events;
- uint64_t data;
-};
-#endif
-
struct uv__inotify_event {
int32_t wd;
uint32_t mask;
@@ -113,18 +95,6 @@ struct uv__mmsghdr {
int uv__accept4(int fd, struct sockaddr* addr, socklen_t* addrlen, int flags);
int uv__eventfd(unsigned int count);
-int uv__epoll_create(int size);
-int uv__epoll_create1(int flags);
-int uv__epoll_ctl(int epfd, int op, int fd, struct uv__epoll_event *ev);
-int uv__epoll_wait(int epfd,
- struct uv__epoll_event* events,
- int nevents,
- int timeout);
-int uv__epoll_pwait(int epfd,
- struct uv__epoll_event* events,
- int nevents,
- int timeout,
- uint64_t sigmask);
int uv__eventfd2(unsigned int count, int flags);
int uv__inotify_init(void);
int uv__inotify_init1(int flags);
@@ -140,10 +110,6 @@ int uv__sendmmsg(int fd,
struct uv__mmsghdr* mmsg,
unsigned int vlen,
unsigned int flags);
-int uv__utimesat(int dirfd,
- const char* path,
- const struct timespec times[2],
- int flags);
ssize_t uv__preadv(int fd, const struct iovec *iov, int iovcnt, int64_t offset);
ssize_t uv__pwritev(int fd, const struct iovec *iov, int iovcnt, int64_t offset);
int uv__dup3(int oldfd, int newfd, int flags);
diff --git a/Utilities/cmlibuv/src/unix/loop.c b/Utilities/cmlibuv/src/unix/loop.c
index 99ead6cbc..c2a03d770 100644
--- a/Utilities/cmlibuv/src/unix/loop.c
+++ b/Utilities/cmlibuv/src/unix/loop.c
@@ -20,7 +20,7 @@
*/
#include "uv.h"
-#include "tree.h"
+#include "uv/tree.h"
#include "internal.h"
#include "heap-inl.h"
#include <stdlib.h>
@@ -74,7 +74,7 @@ int uv_loop_init(uv_loop_t* loop) {
goto fail_signal_init;
uv__handle_unref(&loop->child_watcher);
- loop->child_watcher.flags |= UV__HANDLE_INTERNAL;
+ loop->child_watcher.flags |= UV_HANDLE_INTERNAL;
QUEUE_INIT(&loop->process_handles);
err = uv_rwlock_init(&loop->cloexec_lock);
@@ -90,7 +90,7 @@ int uv_loop_init(uv_loop_t* loop) {
goto fail_async_init;
uv__handle_unref(&loop->wq_async);
- loop->wq_async.flags |= UV__HANDLE_INTERNAL;
+ loop->wq_async.flags |= UV_HANDLE_INTERNAL;
return 0;
diff --git a/Utilities/cmlibuv/src/unix/netbsd.c b/Utilities/cmlibuv/src/unix/netbsd.c
index 2605c114b..a2a4e5215 100644
--- a/Utilities/cmlibuv/src/unix/netbsd.c
+++ b/Utilities/cmlibuv/src/unix/netbsd.c
@@ -40,15 +40,6 @@
#include <unistd.h>
#include <time.h>
-static uv_mutex_t process_title_mutex;
-static uv_once_t process_title_mutex_once = UV_ONCE_INIT;
-static char *process_title;
-
-
-static void init_process_title_mutex_once(void) {
- uv_mutex_init(&process_title_mutex);
-}
-
int uv__platform_loop_init(uv_loop_t* loop) {
return uv__kqueue_init(loop);
@@ -96,7 +87,8 @@ int uv_exepath(char* buffer, size_t* size) {
/* Copy string from the intermediate buffer to outer one with appropriate
* length.
*/
- strlcpy(buffer, int_buf, *size);
+ /* TODO(bnoordhuis) Check uv__strscpy() return value. */
+ uv__strscpy(buffer, int_buf, *size);
/* Set new size. */
*size = strlen(buffer);
@@ -134,65 +126,6 @@ uint64_t uv_get_total_memory(void) {
}
-char** uv_setup_args(int argc, char** argv) {
- process_title = argc ? uv__strdup(argv[0]) : NULL;
- return argv;
-}
-
-
-int uv_set_process_title(const char* title) {
- char* new_title;
-
- new_title = uv__strdup(title);
-
- uv_once(&process_title_mutex_once, init_process_title_mutex_once);
- uv_mutex_lock(&process_title_mutex);
-
- if (process_title == NULL) {
- uv_mutex_unlock(&process_title_mutex);
- return UV_ENOMEM;
- }
-
- uv__free(process_title);
- process_title = new_title;
- setproctitle("%s", title);
-
- uv_mutex_unlock(&process_title_mutex);
-
- return 0;
-}
-
-
-int uv_get_process_title(char* buffer, size_t size) {
- size_t len;
-
- if (buffer == NULL || size == 0)
- return UV_EINVAL;
-
- uv_once(&process_title_mutex_once, init_process_title_mutex_once);
- uv_mutex_lock(&process_title_mutex);
-
- if (process_title) {
- len = strlen(process_title) + 1;
-
- if (size < len) {
- uv_mutex_unlock(&process_title_mutex);
- return UV_ENOBUFS;
- }
-
- memcpy(buffer, process_title, len);
- } else {
- len = 0;
- }
-
- uv_mutex_unlock(&process_title_mutex);
-
- buffer[len] = '\0';
-
- return 0;
-}
-
-
int uv_resident_set_memory(size_t* rss) {
kvm_t *kd = NULL;
struct kinfo_proc2 *kinfo = NULL;
diff --git a/Utilities/cmlibuv/src/unix/openbsd.c b/Utilities/cmlibuv/src/unix/openbsd.c
index ce937cd3e..bffb58bcd 100644
--- a/Utilities/cmlibuv/src/unix/openbsd.c
+++ b/Utilities/cmlibuv/src/unix/openbsd.c
@@ -36,16 +36,6 @@
#include <unistd.h>
-static uv_mutex_t process_title_mutex;
-static uv_once_t process_title_mutex_once = UV_ONCE_INIT;
-static char *process_title;
-
-
-static void init_process_title_mutex_once(void) {
- uv_mutex_init(&process_title_mutex);
-}
-
-
int uv__platform_loop_init(uv_loop_t* loop) {
return uv__kqueue_init(loop);
}
@@ -146,65 +136,6 @@ uint64_t uv_get_total_memory(void) {
}
-char** uv_setup_args(int argc, char** argv) {
- process_title = argc ? uv__strdup(argv[0]) : NULL;
- return argv;
-}
-
-
-int uv_set_process_title(const char* title) {
- char* new_title;
-
- new_title = uv__strdup(title);
-
- uv_once(&process_title_mutex_once, init_process_title_mutex_once);
- uv_mutex_lock(&process_title_mutex);
-
- if (process_title == NULL) {
- uv_mutex_unlock(&process_title_mutex);
- return UV_ENOMEM;
- }
-
- uv__free(process_title);
- process_title = new_title;
- setproctitle("%s", title);
-
- uv_mutex_unlock(&process_title_mutex);
-
- return 0;
-}
-
-
-int uv_get_process_title(char* buffer, size_t size) {
- size_t len;
-
- if (buffer == NULL || size == 0)
- return UV_EINVAL;
-
- uv_once(&process_title_mutex_once, init_process_title_mutex_once);
- uv_mutex_lock(&process_title_mutex);
-
- if (process_title) {
- len = strlen(process_title) + 1;
-
- if (size < len) {
- uv_mutex_unlock(&process_title_mutex);
- return UV_ENOBUFS;
- }
-
- memcpy(buffer, process_title, len);
- } else {
- len = 0;
- }
-
- uv_mutex_unlock(&process_title_mutex);
-
- buffer[len] = '\0';
-
- return 0;
-}
-
-
int uv_resident_set_memory(size_t* rss) {
struct kinfo_proc kinfo;
size_t page_size = getpagesize();
diff --git a/Utilities/cmlibuv/src/unix/os390-syscalls.c b/Utilities/cmlibuv/src/unix/os390-syscalls.c
index a5dd34426..1040d6697 100644
--- a/Utilities/cmlibuv/src/unix/os390-syscalls.c
+++ b/Utilities/cmlibuv/src/unix/os390-syscalls.c
@@ -141,7 +141,7 @@ static void init_message_queue(uv__os390_epoll* lst) {
} msg;
/* initialize message queue */
- lst->msg_queue = msgget(IPC_PRIVATE, 0622 | IPC_CREAT);
+ lst->msg_queue = msgget(IPC_PRIVATE, 0600 | IPC_CREAT);
if (lst->msg_queue == -1)
abort();
@@ -255,12 +255,13 @@ int epoll_ctl(uv__os390_epoll* lst,
lst->items[fd].events = event->events;
lst->items[fd].revents = 0;
} else if (op == EPOLL_CTL_MOD) {
- if (fd >= lst->size || lst->items[fd].fd == -1) {
+ if (fd >= lst->size - 1 || lst->items[fd].fd == -1) {
uv_mutex_unlock(&global_epoll_lock);
errno = ENOENT;
return -1;
}
lst->items[fd].events = event->events;
+ lst->items[fd].revents = 0;
} else
abort();
@@ -275,8 +276,9 @@ int epoll_wait(uv__os390_epoll* lst, struct epoll_event* events,
struct pollfd* pfds;
int pollret;
int reventcount;
+ int nevents;
- size = _SET_FDS_MSGS(size, 1, lst->size - 1);
+ _SET_FDS_MSGS(size, 1, lst->size - 1);
pfds = lst->items;
pollret = poll(pfds, size, timeout);
if (pollret <= 0)
@@ -285,19 +287,28 @@ int epoll_wait(uv__os390_epoll* lst, struct epoll_event* events,
pollret = _NFDS(pollret) + _NMSGS(pollret);
reventcount = 0;
+ nevents = 0;
for (int i = 0;
i < lst->size && i < maxevents && reventcount < pollret; ++i) {
struct epoll_event ev;
+ struct pollfd* pfd;
- if (pfds[i].fd == -1 || pfds[i].revents == 0)
+ pfd = &pfds[i];
+ if (pfd->fd == -1 || pfd->revents == 0)
continue;
- ev.fd = pfds[i].fd;
- ev.events = pfds[i].revents;
- events[reventcount++] = ev;
+ ev.fd = pfd->fd;
+ ev.events = pfd->revents;
+ if (pfd->revents & POLLIN && pfd->revents & POLLOUT)
+ reventcount += 2;
+ else if (pfd->revents & (POLLIN | POLLOUT))
+ ++reventcount;
+
+ pfd->revents = 0;
+ events[nevents++] = ev;
}
- return reventcount;
+ return nevents;
}
@@ -493,7 +504,7 @@ ssize_t os390_readlink(const char* path, char* buf, size_t len) {
size_t strnlen(const char* str, size_t maxlen) {
- void* p = memchr(str, 0, maxlen);
+ char* p = memchr(str, 0, maxlen);
if (p == NULL)
return maxlen;
else
diff --git a/Utilities/cmlibuv/src/unix/os390-syscalls.h b/Utilities/cmlibuv/src/unix/os390-syscalls.h
index 6e34a88cb..ea599107b 100644
--- a/Utilities/cmlibuv/src/unix/os390-syscalls.h
+++ b/Utilities/cmlibuv/src/unix/os390-syscalls.h
@@ -36,10 +36,6 @@
#define MAX_ITEMS_PER_EPOLL 1024
#define UV__O_CLOEXEC 0x80000
-#define UV__EPOLL_CLOEXEC UV__O_CLOEXEC
-#define UV__EPOLL_CTL_ADD EPOLL_CTL_ADD
-#define UV__EPOLL_CTL_DEL EPOLL_CTL_DEL
-#define UV__EPOLL_CTL_MOD EPOLL_CTL_MOD
struct epoll_event {
int events;
diff --git a/Utilities/cmlibuv/src/unix/os390.c b/Utilities/cmlibuv/src/unix/os390.c
index f766b3933..dc146e311 100644
--- a/Utilities/cmlibuv/src/unix/os390.c
+++ b/Utilities/cmlibuv/src/unix/os390.c
@@ -229,15 +229,15 @@ static int getexe(const int pid, char* buf, size_t len) {
assert(((Output_buf.Output_data.offsetPath >>24) & 0xFF) == 'A');
/* Get the offset from the lowest 3 bytes */
- Output_path = (char*)(&Output_buf) +
- (Output_buf.Output_data.offsetPath & 0x00FFFFFF);
+ Output_path = (struct Output_path_type*) ((char*) (&Output_buf) +
+ (Output_buf.Output_data.offsetPath & 0x00FFFFFF));
if (Output_path->len >= len) {
errno = ENOBUFS;
return -1;
}
- strncpy(buf, Output_path->path, len);
+ uv__strscpy(buf, Output_path->path, len);
return 0;
}
@@ -357,13 +357,11 @@ uint64_t uv_get_total_memory(void) {
int uv_resident_set_memory(size_t* rss) {
- char* psa;
char* ascb;
char* rax;
size_t nframes;
- psa = PSA_PTR;
- ascb = *(char* __ptr32 *)(psa + PSAAOLD);
+ ascb = *(char* __ptr32 *)(PSA_PTR + PSAAOLD);
rax = *(char* __ptr32 *)(ascb + ASCBRSME);
nframes = *(unsigned int*)(rax + RAXFMCT);
@@ -512,7 +510,7 @@ static int uv__interface_addresses_v6(uv_interface_address_t** addresses,
/* TODO: Retrieve netmask using SIOCGIFNETMASK ioctl */
address->is_internal = flg.__nif6e_flags & _NIF6E_FLAGS_LOOPBACK ? 1 : 0;
-
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
address++;
}
@@ -531,12 +529,14 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
struct ifreq* p;
int count_v6;
+ *count = 0;
+ *addresses = NULL;
+
/* get the ipv6 addresses first */
uv_interface_address_t* addresses_v6;
uv__interface_addresses_v6(&addresses_v6, &count_v6);
/* now get the ipv4 addresses */
- *count = 0;
/* Assume maximum buffer size allowable */
maxsize = 16384;
@@ -578,6 +578,11 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
(*count)++;
}
+ if (*count == 0) {
+ uv__close(sockfd);
+ return 0;
+ }
+
/* Alloc the return interface structs */
*addresses = uv__malloc((*count + count_v6) *
sizeof(uv_interface_address_t));
@@ -624,6 +629,7 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
}
address->is_internal = flg.ifr_flags & IFF_LOOPBACK ? 1 : 0;
+ memset(address->phys_addr, 0, sizeof(address->phys_addr));
address++;
}
@@ -662,7 +668,7 @@ void uv__platform_invalidate_fd(uv_loop_t* loop, int fd) {
/* Remove the file descriptor from the epoll. */
if (loop->ep != NULL)
- epoll_ctl(loop->ep, UV__EPOLL_CTL_DEL, fd, &dummy);
+ epoll_ctl(loop->ep, EPOLL_CTL_DEL, fd, &dummy);
}
@@ -751,7 +757,7 @@ int uv_fs_event_stop(uv_fs_event_t* handle) {
memcpy(reg_struct.__rfis_rftok, handle->rfis_rftok,
sizeof(handle->rfis_rftok));
- /*
+ /*
* This call will take "/" as the path argument in case we
* don't care to supply the correct path. The system will simply
* ignore it.
@@ -838,9 +844,9 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
e.fd = w->fd;
if (w->events == 0)
- op = UV__EPOLL_CTL_ADD;
+ op = EPOLL_CTL_ADD;
else
- op = UV__EPOLL_CTL_MOD;
+ op = EPOLL_CTL_MOD;
/* XXX Future optimization: do EPOLL_CTL_MOD lazily if we stop watching
* events, skip the syscall and squelch the events after epoll_wait().
@@ -849,10 +855,10 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
if (errno != EEXIST)
abort();
- assert(op == UV__EPOLL_CTL_ADD);
+ assert(op == EPOLL_CTL_ADD);
/* We've reactivated a file descriptor that's been watched before. */
- if (epoll_ctl(loop->ep, UV__EPOLL_CTL_MOD, w->fd, &e))
+ if (epoll_ctl(loop->ep, EPOLL_CTL_MOD, w->fd, &e))
abort();
}
@@ -934,7 +940,7 @@ void uv__io_poll(uv_loop_t* loop, int timeout) {
* Ignore all errors because we may be racing with another thread
* when the file descriptor is closed.
*/
- epoll_ctl(loop->ep, UV__EPOLL_CTL_DEL, fd, pe);
+ epoll_ctl(loop->ep, EPOLL_CTL_DEL, fd, pe);
continue;
}
@@ -987,7 +993,7 @@ void uv__set_process_title(const char* title) {
}
int uv__io_fork(uv_loop_t* loop) {
- /*
+ /*
Nullify the msg queue but don't close it because
it is still being used by the parent.
*/
diff --git a/Utilities/cmlibuv/src/unix/pipe.c b/Utilities/cmlibuv/src/unix/pipe.c
index 42846b927..9657bc914 100644
--- a/Utilities/cmlibuv/src/unix/pipe.c
+++ b/Utilities/cmlibuv/src/unix/pipe.c
@@ -64,8 +64,7 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) {
sockfd = err;
memset(&saddr, 0, sizeof saddr);
- strncpy(saddr.sun_path, pipe_fname, sizeof(saddr.sun_path) - 1);
- saddr.sun_path[sizeof(saddr.sun_path) - 1] = '\0';
+ uv__strscpy(saddr.sun_path, pipe_fname, sizeof(saddr.sun_path));
saddr.sun_family = AF_UNIX;
if (bind(sockfd, (struct sockaddr*)&saddr, sizeof saddr)) {
@@ -130,7 +129,20 @@ void uv__pipe_close(uv_pipe_t* handle) {
int uv_pipe_open(uv_pipe_t* handle, uv_file fd) {
+ int flags;
+ int mode;
int err;
+ flags = 0;
+
+ if (uv__fd_exists(handle->loop, fd))
+ return UV_EEXIST;
+
+ do
+ mode = fcntl(fd, F_GETFL);
+ while (mode == -1 && errno == EINTR);
+
+ if (mode == -1)
+ return UV__ERR(errno); /* according to docs, must be EBADF */
err = uv__nonblock(fd, 1);
if (err)
@@ -142,9 +154,13 @@ int uv_pipe_open(uv_pipe_t* handle, uv_file fd) {
return err;
#endif /* defined(__APPLE__) */
- return uv__stream_open((uv_stream_t*)handle,
- fd,
- UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+ mode &= O_ACCMODE;
+ if (mode != O_WRONLY)
+ flags |= UV_HANDLE_READABLE;
+ if (mode != O_RDONLY)
+ flags |= UV_HANDLE_WRITABLE;
+
+ return uv__stream_open((uv_stream_t*)handle, fd, flags);
}
@@ -167,8 +183,7 @@ void uv_pipe_connect(uv_connect_t* req,
}
memset(&saddr, 0, sizeof saddr);
- strncpy(saddr.sun_path, name, sizeof(saddr.sun_path) - 1);
- saddr.sun_path[sizeof(saddr.sun_path) - 1] = '\0';
+ uv__strscpy(saddr.sun_path, name, sizeof(saddr.sun_path));
saddr.sun_family = AF_UNIX;
do {
@@ -194,7 +209,7 @@ void uv_pipe_connect(uv_connect_t* req,
if (new_sock) {
err = uv__stream_open((uv_stream_t*)handle,
uv__stream_fd(handle),
- UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+ UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
}
if (err == 0)
diff --git a/Utilities/cmlibuv/src/unix/poll.c b/Utilities/cmlibuv/src/unix/poll.c
index f3b0bf4e4..3d5022b22 100644
--- a/Utilities/cmlibuv/src/unix/poll.c
+++ b/Utilities/cmlibuv/src/unix/poll.c
@@ -68,6 +68,9 @@ static void uv__poll_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {
int err;
+ if (uv__fd_exists(loop, fd))
+ return UV_EEXIST;
+
err = uv__io_check_fd(loop, fd);
if (err)
return err;
diff --git a/Utilities/cmlibuv/src/unix/process.c b/Utilities/cmlibuv/src/unix/process.c
index 1bded8d38..e9579f5ed 100644
--- a/Utilities/cmlibuv/src/unix/process.c
+++ b/Utilities/cmlibuv/src/unix/process.c
@@ -250,9 +250,9 @@ static int uv__process_open_stream(uv_stdio_container_t* container,
flags = 0;
if (container->flags & UV_WRITABLE_PIPE)
- flags |= UV_STREAM_READABLE;
+ flags |= UV_HANDLE_READABLE;
if (container->flags & UV_READABLE_PIPE)
- flags |= UV_STREAM_WRITABLE;
+ flags |= UV_HANDLE_WRITABLE;
return uv__stream_open(container->data.stream, pipefds[0], flags);
}
@@ -334,7 +334,7 @@ static void uv__process_child_init(const uv_process_options_t* options,
use_fd = open("/dev/null", fd == 0 ? O_RDONLY : O_RDWR);
close_fd = use_fd;
- if (use_fd == -1) {
+ if (use_fd < 0) {
uv__write_int(error_fd, UV__ERR(errno));
_exit(127);
}
diff --git a/Utilities/cmlibuv/src/unix/proctitle.c b/Utilities/cmlibuv/src/unix/proctitle.c
index 1a8c7a709..a5ce2030c 100644
--- a/Utilities/cmlibuv/src/unix/proctitle.c
+++ b/Utilities/cmlibuv/src/unix/proctitle.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
+extern void uv__set_process_title_platform_init(void);
extern void uv__set_process_title(const char* title);
static uv_mutex_t process_title_mutex;
@@ -38,6 +39,9 @@ static struct {
static void init_process_title_mutex_once(void) {
uv_mutex_init(&process_title_mutex);
+#ifdef __APPLE__
+ uv__set_process_title_platform_init();
+#endif
}
diff --git a/Utilities/cmlibuv/src/unix/signal.c b/Utilities/cmlibuv/src/unix/signal.c
index b9d0a5608..01aa55f3f 100644
--- a/Utilities/cmlibuv/src/unix/signal.c
+++ b/Utilities/cmlibuv/src/unix/signal.c
@@ -54,8 +54,7 @@ static void uv__signal_unregister_handler(int signum);
static uv_once_t uv__signal_global_init_guard = UV_ONCE_INIT;
static struct uv__signal_tree_s uv__signal_tree =
RB_INITIALIZER(uv__signal_tree);
-static int uv__signal_lock_pipefd[2];
-
+static int uv__signal_lock_pipefd[2] = { -1, -1 };
RB_GENERATE_STATIC(uv__signal_tree_s,
uv_signal_s, tree_entry,
@@ -64,7 +63,7 @@ RB_GENERATE_STATIC(uv__signal_tree_s,
static void uv__signal_global_reinit(void);
static void uv__signal_global_init(void) {
- if (!uv__signal_lock_pipefd[0])
+ if (uv__signal_lock_pipefd[0] == -1)
/* pthread_atfork can register before and after handlers, one
* for each child. This only registers one for the child. That
* state is both persistent and cumulative, so if we keep doing
@@ -74,15 +73,11 @@ static void uv__signal_global_init(void) {
if (pthread_atfork(NULL, NULL, &uv__signal_global_reinit))
abort();
- if (uv__make_pipe(uv__signal_lock_pipefd, 0))
- abort();
-
- if (uv__signal_unlock())
- abort();
+ uv__signal_global_reinit();
}
-static void uv__signal_global_reinit(void) {
+UV_DESTRUCTOR(static void uv__signal_global_fini(void)) {
/* We can only use signal-safe functions here.
* That includes read/write and close, fortunately.
* We do all of this directly here instead of resetting
@@ -90,11 +85,26 @@ static void uv__signal_global_reinit(void) {
* uv__signal_global_once_init is only called from uv_loop_init
* and this needs to function in existing loops.
*/
- uv__close(uv__signal_lock_pipefd[0]);
- uv__signal_lock_pipefd[0] = -1;
- uv__close(uv__signal_lock_pipefd[1]);
- uv__signal_lock_pipefd[1] = -1;
- uv__signal_global_init();
+ if (uv__signal_lock_pipefd[0] != -1) {
+ uv__close(uv__signal_lock_pipefd[0]);
+ uv__signal_lock_pipefd[0] = -1;
+ }
+
+ if (uv__signal_lock_pipefd[1] != -1) {
+ uv__close(uv__signal_lock_pipefd[1]);
+ uv__signal_lock_pipefd[1] = -1;
+ }
+}
+
+
+static void uv__signal_global_reinit(void) {
+ uv__signal_global_fini();
+
+ if (uv__make_pipe(uv__signal_lock_pipefd, 0))
+ abort();
+
+ if (uv__signal_unlock())
+ abort();
}
@@ -103,7 +113,6 @@ void uv__signal_global_once_init(void) {
}
-
static int uv__signal_lock(void) {
int r;
char data;
@@ -387,7 +396,7 @@ static int uv__signal_start(uv_signal_t* handle,
*/
first_handle = uv__signal_first_handle(signum);
if (first_handle == NULL ||
- (!oneshot && (first_handle->flags & UV__SIGNAL_ONE_SHOT))) {
+ (!oneshot && (first_handle->flags & UV_SIGNAL_ONE_SHOT))) {
err = uv__signal_register_handler(signum, oneshot);
if (err) {
/* Registering the signal handler failed. Must be an invalid signal. */
@@ -398,7 +407,7 @@ static int uv__signal_start(uv_signal_t* handle,
handle->signum = signum;
if (oneshot)
- handle->flags |= UV__SIGNAL_ONE_SHOT;
+ handle->flags |= UV_SIGNAL_ONE_SHOT;
RB_INSERT(uv__signal_tree_s, &uv__signal_tree, handle);
@@ -455,20 +464,20 @@ static void uv__signal_event(uv_loop_t* loop,
handle = msg->handle;
if (msg->signum == handle->signum) {
- assert(!(handle->flags & UV_CLOSING));
+ assert(!(handle->flags & UV_HANDLE_CLOSING));
handle->signal_cb(handle, handle->signum);
}
handle->dispatched_signals++;
- if (handle->flags & UV__SIGNAL_ONE_SHOT)
+ if (handle->flags & UV_SIGNAL_ONE_SHOT)
uv__signal_stop(handle);
/* If uv_close was called while there were caught signals that were not
* yet dispatched, the uv__finish_close was deferred. Make close pending
* now if this has happened.
*/
- if ((handle->flags & UV_CLOSING) &&
+ if ((handle->flags & UV_HANDLE_CLOSING) &&
(handle->caught_signals == handle->dispatched_signals)) {
uv__make_close_pending((uv_handle_t*) handle);
}
@@ -496,11 +505,11 @@ static int uv__signal_compare(uv_signal_t* w1, uv_signal_t* w2) {
if (w1->signum < w2->signum) return -1;
if (w1->signum > w2->signum) return 1;
- /* Handlers without UV__SIGNAL_ONE_SHOT set will come first, so if the first
+ /* Handlers without UV_SIGNAL_ONE_SHOT set will come first, so if the first
* handler returned is a one-shot handler, the rest will be too.
*/
- f1 = w1->flags & UV__SIGNAL_ONE_SHOT;
- f2 = w2->flags & UV__SIGNAL_ONE_SHOT;
+ f1 = w1->flags & UV_SIGNAL_ONE_SHOT;
+ f2 = w2->flags & UV_SIGNAL_ONE_SHOT;
if (f1 < f2) return -1;
if (f1 > f2) return 1;
@@ -549,8 +558,8 @@ static void uv__signal_stop(uv_signal_t* handle) {
if (first_handle == NULL) {
uv__signal_unregister_handler(handle->signum);
} else {
- rem_oneshot = handle->flags & UV__SIGNAL_ONE_SHOT;
- first_oneshot = first_handle->flags & UV__SIGNAL_ONE_SHOT;
+ rem_oneshot = handle->flags & UV_SIGNAL_ONE_SHOT;
+ first_oneshot = first_handle->flags & UV_SIGNAL_ONE_SHOT;
if (first_oneshot && !rem_oneshot) {
ret = uv__signal_register_handler(handle->signum, 1);
assert(ret == 0);
diff --git a/Utilities/cmlibuv/src/unix/stream.c b/Utilities/cmlibuv/src/unix/stream.c
index 9bdd1c507..4b9123f1a 100644
--- a/Utilities/cmlibuv/src/unix/stream.c
+++ b/Utilities/cmlibuv/src/unix/stream.c
@@ -58,11 +58,19 @@ struct uv__stream_select_s {
fd_set* swrite;
size_t swrite_sz;
};
-# define WRITE_RETRY_ON_ERROR(send_handle) \
+
+/* Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
+ * EPROTOTYPE can be returned while trying to write to a socket that is
+ * shutting down. If we retry the write, we should get the expected EPIPE
+ * instead.
+ */
+# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR || errno == EPROTOTYPE)
+# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \
(errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS || \
- (errno == EMSGSIZE && send_handle))
+ (errno == EMSGSIZE && send_handle != NULL))
#else
-# define WRITE_RETRY_ON_ERROR(send_handle) \
+# define RETRY_ON_WRITE_ERROR(errno) (errno == EINTR)
+# define IS_TRANSIENT_WRITE_ERROR(errno, send_handle) \
(errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOBUFS)
#endif /* defined(__APPLE__) */
@@ -220,7 +228,7 @@ static void uv__stream_osx_select(void* arg) {
uv_sem_wait(&s->async_sem);
/* Should be processed at this stage */
- assert((s->events == 0) || (stream->flags & UV_CLOSING));
+ assert((s->events == 0) || (stream->flags & UV_HANDLE_CLOSING));
}
}
}
@@ -248,7 +256,7 @@ static void uv__stream_osx_select_cb(uv_async_t* handle) {
if ((events & POLLOUT) && uv__io_active(&stream->io_watcher, POLLOUT))
uv__stream_io(stream->loop, &stream->io_watcher, POLLOUT);
- if (stream->flags & UV_CLOSING)
+ if (stream->flags & UV_HANDLE_CLOSING)
return;
/* NOTE: It is important to do it here, otherwise `select()` might be called
@@ -342,7 +350,7 @@ int uv__stream_try_select(uv_stream_t* stream, int* fd) {
if (err)
goto failed_async_init;
- s->async.flags |= UV__HANDLE_INTERNAL;
+ s->async.flags |= UV_HANDLE_INTERNAL;
uv__handle_unref(&s->async);
err = uv_sem_init(&s->close_sem, 0);
@@ -407,12 +415,14 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) {
stream->flags |= flags;
if (stream->type == UV_TCP) {
- if ((stream->flags & UV_TCP_NODELAY) && uv__tcp_nodelay(fd, 1))
+ if ((stream->flags & UV_HANDLE_TCP_NODELAY) && uv__tcp_nodelay(fd, 1))
return UV__ERR(errno);
/* TODO Use delay the user passed in. */
- if ((stream->flags & UV_TCP_KEEPALIVE) && uv__tcp_keepalive(fd, 1, 60))
+ if ((stream->flags & UV_HANDLE_TCP_KEEPALIVE) &&
+ uv__tcp_keepalive(fd, 1, 60)) {
return UV__ERR(errno);
+ }
}
#if defined(__APPLE__)
@@ -447,7 +457,7 @@ void uv__stream_flush_write_queue(uv_stream_t* stream, int error) {
void uv__stream_destroy(uv_stream_t* stream) {
assert(!uv__io_active(&stream->io_watcher, POLLIN | POLLOUT));
- assert(stream->flags & UV_CLOSED);
+ assert(stream->flags & UV_HANDLE_CLOSED);
if (stream->connect_req) {
uv__req_unregister(stream->loop, stream->connect_req);
@@ -522,7 +532,7 @@ void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
stream = container_of(w, uv_stream_t, io_watcher);
assert(events & POLLIN);
assert(stream->accepted_fd == -1);
- assert(!(stream->flags & UV_CLOSING));
+ assert(!(stream->flags & UV_HANDLE_CLOSING));
uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
@@ -565,7 +575,8 @@ void uv__server_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
return;
}
- if (stream->type == UV_TCP && (stream->flags & UV_TCP_SINGLE_ACCEPT)) {
+ if (stream->type == UV_TCP &&
+ (stream->flags & UV_HANDLE_TCP_SINGLE_ACCEPT)) {
/* Give other processes a chance to accept connections. */
struct timespec timeout = { 0, 1 };
nanosleep(&timeout, NULL);
@@ -590,7 +601,7 @@ int uv_accept(uv_stream_t* server, uv_stream_t* client) {
case UV_TCP:
err = uv__stream_open(client,
server->accepted_fd,
- UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+ UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
if (err) {
/* TODO handle error */
uv__close(server->accepted_fd);
@@ -674,14 +685,14 @@ static void uv__drain(uv_stream_t* stream) {
uv__stream_osx_interrupt_select(stream);
/* Shutdown? */
- if ((stream->flags & UV_STREAM_SHUTTING) &&
- !(stream->flags & UV_CLOSING) &&
- !(stream->flags & UV_STREAM_SHUT)) {
+ if ((stream->flags & UV_HANDLE_SHUTTING) &&
+ !(stream->flags & UV_HANDLE_CLOSING) &&
+ !(stream->flags & UV_HANDLE_SHUT)) {
assert(stream->shutdown_req);
req = stream->shutdown_req;
stream->shutdown_req = NULL;
- stream->flags &= ~UV_STREAM_SHUTTING;
+ stream->flags &= ~UV_HANDLE_SHUTTING;
uv__req_unregister(stream->loop, req);
err = 0;
@@ -689,7 +700,7 @@ static void uv__drain(uv_stream_t* stream) {
err = UV__ERR(errno);
if (err == 0)
- stream->flags |= UV_STREAM_SHUT;
+ stream->flags |= UV_HANDLE_SHUT;
if (req->cb != NULL)
req->cb(req, err);
@@ -697,6 +708,14 @@ static void uv__drain(uv_stream_t* stream) {
}
+static ssize_t uv__writev(int fd, struct iovec* vec, size_t n) {
+ if (n == 1)
+ return write(fd, vec->iov_base, vec->iov_len);
+ else
+ return writev(fd, vec, n);
+}
+
+
static size_t uv__write_req_size(uv_write_t* req) {
size_t size;
@@ -709,6 +728,37 @@ static size_t uv__write_req_size(uv_write_t* req) {
}
+/* Returns 1 if all write request data has been written, or 0 if there is still
+ * more data to write.
+ *
+ * Note: the return value only says something about the *current* request.
+ * There may still be other write requests sitting in the queue.
+ */
+static int uv__write_req_update(uv_stream_t* stream,
+ uv_write_t* req,
+ size_t n) {
+ uv_buf_t* buf;
+ size_t len;
+
+ assert(n <= stream->write_queue_size);
+ stream->write_queue_size -= n;
+
+ buf = req->bufs + req->write_index;
+
+ while (n > 0) {
+ len = n < buf->len ? n : buf->len;
+ buf->base += len;
+ buf->len -= len;
+ buf += (buf->len == 0); /* Advance to next buffer if this one is empty. */
+ n -= len;
+ }
+
+ req->write_index = buf - req->bufs;
+
+ return req->write_index == req->nbufs;
+}
+
+
static void uv__write_req_finish(uv_write_t* req) {
uv_stream_t* stream = req->handle;
@@ -829,102 +879,32 @@ start:
*pi = fd_to_send;
}
- do {
+ do
n = sendmsg(uv__stream_fd(stream), &msg, 0);
- }
-#if defined(__APPLE__)
- /*
- * Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
- * EPROTOTYPE can be returned while trying to write to a socket that is
- * shutting down. If we retry the write, we should get the expected EPIPE
- * instead.
- */
- while (n == -1 && (errno == EINTR || errno == EPROTOTYPE));
-#else
- while (n == -1 && errno == EINTR);
-#endif
- } else {
- do {
- if (iovcnt == 1) {
- n = write(uv__stream_fd(stream), iov[0].iov_base, iov[0].iov_len);
- } else {
- n = writev(uv__stream_fd(stream), iov, iovcnt);
- }
- }
-#if defined(__APPLE__)
- /*
- * Due to a possible kernel bug at least in OS X 10.10 "Yosemite",
- * EPROTOTYPE can be returned while trying to write to a socket that is
- * shutting down. If we retry the write, we should get the expected EPIPE
- * instead.
- */
- while (n == -1 && (errno == EINTR || errno == EPROTOTYPE));
-#else
- while (n == -1 && errno == EINTR);
-#endif
- }
+ while (n == -1 && RETRY_ON_WRITE_ERROR(errno));
- if (n < 0) {
- if (!WRITE_RETRY_ON_ERROR(req->send_handle)) {
- err = UV__ERR(errno);
- goto error;
- } else if (stream->flags & UV_STREAM_BLOCKING) {
- /* If this is a blocking stream, try again. */
- goto start;
- }
+ /* Ensure the handle isn't sent again in case this is a partial write. */
+ if (n >= 0)
+ req->send_handle = NULL;
} else {
- /* Successful write */
-
- while (n >= 0) {
- uv_buf_t* buf = &(req->bufs[req->write_index]);
- size_t len = buf->len;
-
- assert(req->write_index < req->nbufs);
-
- if ((size_t)n < len) {
- buf->base += n;
- buf->len -= n;
- stream->write_queue_size -= n;
- n = 0;
-
- /* There is more to write. */
- if (stream->flags & UV_STREAM_BLOCKING) {
- /*
- * If we're blocking then we should not be enabling the write
- * watcher - instead we need to try again.
- */
- goto start;
- } else {
- /* Break loop and ensure the watcher is pending. */
- break;
- }
-
- } else {
- /* Finished writing the buf at index req->write_index. */
- req->write_index++;
-
- assert((size_t)n >= len);
- n -= len;
-
- assert(stream->write_queue_size >= len);
- stream->write_queue_size -= len;
+ do
+ n = uv__writev(uv__stream_fd(stream), iov, iovcnt);
+ while (n == -1 && RETRY_ON_WRITE_ERROR(errno));
+ }
- if (req->write_index == req->nbufs) {
- /* Then we're done! */
- assert(n == 0);
- uv__write_req_finish(req);
- /* TODO: start trying to write the next request. */
- return;
- }
- }
- }
+ if (n == -1 && !IS_TRANSIENT_WRITE_ERROR(errno, req->send_handle)) {
+ err = UV__ERR(errno);
+ goto error;
}
- /* Either we've counted n down to zero or we've got EAGAIN. */
- assert(n == 0 || n == -1);
+ if (n > 0 && uv__write_req_update(stream, req, n)) {
+ uv__write_req_finish(req);
+ return; /* TODO(bnoordhuis) Start trying to write the next request. */
+ }
- /* Only non-blocking streams should use the write_watcher. */
- assert(!(stream->flags & UV_STREAM_BLOCKING));
+ /* If this is a blocking stream, try again. */
+ if (stream->flags & UV_HANDLE_BLOCKING_WRITES)
+ goto start;
/* We're not done. */
uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
@@ -947,10 +927,16 @@ error:
static void uv__write_callbacks(uv_stream_t* stream) {
uv_write_t* req;
QUEUE* q;
+ QUEUE pq;
+
+ if (QUEUE_EMPTY(&stream->write_completed_queue))
+ return;
+
+ QUEUE_MOVE(&stream->write_completed_queue, &pq);
- while (!QUEUE_EMPTY(&stream->write_completed_queue)) {
+ while (!QUEUE_EMPTY(&pq)) {
/* Pop a req off write_completed_queue. */
- q = QUEUE_HEAD(&stream->write_completed_queue);
+ q = QUEUE_HEAD(&pq);
req = QUEUE_DATA(q, uv_write_t, queue);
QUEUE_REMOVE(q);
uv__req_unregister(stream->loop, req);
@@ -966,8 +952,6 @@ static void uv__write_callbacks(uv_stream_t* stream) {
if (req->cb)
req->cb(req, req->error);
}
-
- assert(QUEUE_EMPTY(&stream->write_completed_queue));
}
@@ -1015,13 +999,13 @@ uv_handle_type uv__handle_type(int fd) {
static void uv__stream_eof(uv_stream_t* stream, const uv_buf_t* buf) {
- stream->flags |= UV_STREAM_READ_EOF;
+ stream->flags |= UV_HANDLE_READ_EOF;
uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
if (!uv__io_active(&stream->io_watcher, POLLOUT))
uv__handle_stop(stream);
uv__stream_osx_interrupt_select(stream);
stream->read_cb(stream, UV_EOF, buf);
- stream->flags &= ~UV_STREAM_READING;
+ stream->flags &= ~UV_HANDLE_READING;
}
@@ -1121,6 +1105,7 @@ static int uv__stream_recv_cmsg(uv_stream_t* stream, struct msghdr* msg) {
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-folding-constant"
+# pragma clang diagnostic ignored "-Wvla-extension"
#endif
static void uv__read(uv_stream_t* stream) {
@@ -1132,7 +1117,7 @@ static void uv__read(uv_stream_t* stream) {
int err;
int is_ipc;
- stream->flags &= ~UV_STREAM_READ_PARTIAL;
+ stream->flags &= ~UV_HANDLE_READ_PARTIAL;
/* Prevent loop starvation when the data comes in as fast as (or faster than)
* we can read it. XXX Need to rearm fd if we switch to edge-triggered I/O.
@@ -1141,11 +1126,11 @@ static void uv__read(uv_stream_t* stream) {
is_ipc = stream->type == UV_NAMED_PIPE && ((uv_pipe_t*) stream)->ipc;
- /* XXX: Maybe instead of having UV_STREAM_READING we just test if
+ /* XXX: Maybe instead of having UV_HANDLE_READING we just test if
* tcp->read_cb is NULL or not?
*/
while (stream->read_cb
- && (stream->flags & UV_STREAM_READING)
+ && (stream->flags & UV_HANDLE_READING)
&& (count-- > 0)) {
assert(stream->alloc_cb != NULL);
@@ -1186,7 +1171,7 @@ static void uv__read(uv_stream_t* stream) {
/* Error */
if (errno == EAGAIN || errno == EWOULDBLOCK) {
/* Wait for the next one. */
- if (stream->flags & UV_STREAM_READING) {
+ if (stream->flags & UV_HANDLE_READING) {
uv__io_start(stream->loop, &stream->io_watcher, POLLIN);
uv__stream_osx_interrupt_select(stream);
}
@@ -1199,8 +1184,8 @@ static void uv__read(uv_stream_t* stream) {
} else {
/* Error. User should call uv_close(). */
stream->read_cb(stream, UV__ERR(errno), &buf);
- if (stream->flags & UV_STREAM_READING) {
- stream->flags &= ~UV_STREAM_READING;
+ if (stream->flags & UV_HANDLE_READING) {
+ stream->flags &= ~UV_HANDLE_READING;
uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
if (!uv__io_active(&stream->io_watcher, POLLOUT))
uv__handle_stop(stream);
@@ -1250,7 +1235,7 @@ static void uv__read(uv_stream_t* stream) {
/* Return if we didn't fill the buffer, there is no more data to read. */
if (nread < buflen) {
- stream->flags |= UV_STREAM_READ_PARTIAL;
+ stream->flags |= UV_HANDLE_READ_PARTIAL;
return;
}
}
@@ -1271,9 +1256,9 @@ int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) {
stream->type == UV_TTY ||
stream->type == UV_NAMED_PIPE);
- if (!(stream->flags & UV_STREAM_WRITABLE) ||
- stream->flags & UV_STREAM_SHUT ||
- stream->flags & UV_STREAM_SHUTTING ||
+ if (!(stream->flags & UV_HANDLE_WRITABLE) ||
+ stream->flags & UV_HANDLE_SHUT ||
+ stream->flags & UV_HANDLE_SHUTTING ||
uv__is_closing(stream)) {
return UV_ENOTCONN;
}
@@ -1285,7 +1270,7 @@ int uv_shutdown(uv_shutdown_t* req, uv_stream_t* stream, uv_shutdown_cb cb) {
req->handle = stream;
req->cb = cb;
stream->shutdown_req = req;
- stream->flags |= UV_STREAM_SHUTTING;
+ stream->flags |= UV_HANDLE_SHUTTING;
uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
uv__stream_osx_interrupt_select(stream);
@@ -1302,7 +1287,7 @@ static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
assert(stream->type == UV_TCP ||
stream->type == UV_NAMED_PIPE ||
stream->type == UV_TTY);
- assert(!(stream->flags & UV_CLOSING));
+ assert(!(stream->flags & UV_HANDLE_CLOSING));
if (stream->connect_req) {
uv__stream_connect(stream);
@@ -1311,7 +1296,7 @@ static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
assert(uv__stream_fd(stream) >= 0);
- /* Ignore POLLHUP here. Even it it's set, there may still be data to read. */
+ /* Ignore POLLHUP here. Even if it's set, there may still be data to read. */
if (events & (POLLIN | POLLERR | POLLHUP))
uv__read(stream);
@@ -1325,9 +1310,9 @@ static void uv__stream_io(uv_loop_t* loop, uv__io_t* w, unsigned int events) {
* report the EOF yet because there is still data to read.
*/
if ((events & POLLHUP) &&
- (stream->flags & UV_STREAM_READING) &&
- (stream->flags & UV_STREAM_READ_PARTIAL) &&
- !(stream->flags & UV_STREAM_READ_EOF)) {
+ (stream->flags & UV_HANDLE_READING) &&
+ (stream->flags & UV_HANDLE_READ_PARTIAL) &&
+ !(stream->flags & UV_HANDLE_READ_EOF)) {
uv_buf_t buf = { NULL, 0 };
uv__stream_eof(stream, &buf);
}
@@ -1417,7 +1402,7 @@ int uv_write2(uv_write_t* req,
if (uv__stream_fd(stream) < 0)
return UV_EBADF;
- if (!(stream->flags & UV_STREAM_WRITABLE))
+ if (!(stream->flags & UV_HANDLE_WRITABLE))
return -EPIPE;
if (send_handle) {
@@ -1487,7 +1472,7 @@ int uv_write2(uv_write_t* req,
* if this assert fires then somehow the blocking stream isn't being
* sufficiently flushed in uv__write.
*/
- assert(!(stream->flags & UV_STREAM_BLOCKING));
+ assert(!(stream->flags & UV_HANDLE_BLOCKING_WRITES));
uv__io_start(stream->loop, &stream->io_watcher, POLLOUT);
uv__stream_osx_interrupt_select(stream);
}
@@ -1568,16 +1553,16 @@ int uv_read_start(uv_stream_t* stream,
assert(stream->type == UV_TCP || stream->type == UV_NAMED_PIPE ||
stream->type == UV_TTY);
- if (stream->flags & UV_CLOSING)
+ if (stream->flags & UV_HANDLE_CLOSING)
return UV_EINVAL;
- if (!(stream->flags & UV_STREAM_READABLE))
+ if (!(stream->flags & UV_HANDLE_READABLE))
return -ENOTCONN;
- /* The UV_STREAM_READING flag is irrelevant of the state of the tcp - it just
+ /* The UV_HANDLE_READING flag is irrelevant of the state of the tcp - it just
* expresses the desired state of the user.
*/
- stream->flags |= UV_STREAM_READING;
+ stream->flags |= UV_HANDLE_READING;
/* TODO: try to do the read inline? */
/* TODO: keep track of tcp state. If we've gotten a EOF then we should
@@ -1598,10 +1583,10 @@ int uv_read_start(uv_stream_t* stream,
int uv_read_stop(uv_stream_t* stream) {
- if (!(stream->flags & UV_STREAM_READING))
+ if (!(stream->flags & UV_HANDLE_READING))
return 0;
- stream->flags &= ~UV_STREAM_READING;
+ stream->flags &= ~UV_HANDLE_READING;
uv__io_stop(stream->loop, &stream->io_watcher, POLLIN);
if (!uv__io_active(&stream->io_watcher, POLLOUT))
uv__handle_stop(stream);
@@ -1614,12 +1599,12 @@ int uv_read_stop(uv_stream_t* stream) {
int uv_is_readable(const uv_stream_t* stream) {
- return !!(stream->flags & UV_STREAM_READABLE);
+ return !!(stream->flags & UV_HANDLE_READABLE);
}
int uv_is_writable(const uv_stream_t* stream) {
- return !!(stream->flags & UV_STREAM_WRITABLE);
+ return !!(stream->flags & UV_HANDLE_WRITABLE);
}
@@ -1668,6 +1653,7 @@ void uv__stream_close(uv_stream_t* handle) {
uv__io_close(handle->loop, &handle->io_watcher);
uv_read_stop(handle);
uv__handle_stop(handle);
+ handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
if (handle->io_watcher.fd != -1) {
/* Don't close stdio file descriptors. Nothing good comes from it. */
diff --git a/Utilities/cmlibuv/src/unix/sunos.c b/Utilities/cmlibuv/src/unix/sunos.c
index b92888e10..aac650411 100644
--- a/Utilities/cmlibuv/src/unix/sunos.c
+++ b/Utilities/cmlibuv/src/unix/sunos.c
@@ -696,6 +696,8 @@ void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count) {
#ifdef SUNOS_NO_IFADDRS
int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
+ *count = 0;
+ *addresses = NULL;
return UV_ENOSYS;
}
#else /* SUNOS_NO_IFADDRS */
@@ -709,13 +711,14 @@ static int uv__set_phys_addr(uv_interface_address_t* address,
struct sockaddr_dl* sa_addr;
int sockfd;
- int i;
+ size_t i;
struct arpreq arpreq;
/* This appears to only work as root */
sa_addr = (struct sockaddr_dl*)(ent->ifa_addr);
memcpy(address->phys_addr, LLADDR(sa_addr), sizeof(address->phys_addr));
for (i = 0; i < sizeof(address->phys_addr); i++) {
+ /* Check that all bytes of phys_addr are zero. */
if (address->phys_addr[i] != 0)
return 0;
}
@@ -762,11 +765,12 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
struct ifaddrs* addrs;
struct ifaddrs* ent;
+ *count = 0;
+ *addresses = NULL;
+
if (getifaddrs(&addrs))
return UV__ERR(errno);
- *count = 0;
-
/* Count the number of interfaces */
for (ent = addrs; ent != NULL; ent = ent->ifa_next) {
if (uv__ifaddr_exclude(ent))
@@ -774,6 +778,11 @@ int uv_interface_addresses(uv_interface_address_t** addresses, int* count) {
(*count)++;
}
+ if (*count == 0) {
+ freeifaddrs(addrs);
+ return 0;
+ }
+
*addresses = uv__malloc(*count * sizeof(**addresses));
if (!(*addresses)) {
freeifaddrs(addrs);
diff --git a/Utilities/cmlibuv/src/unix/tcp.c b/Utilities/cmlibuv/src/unix/tcp.c
index 9a46793fd..2982851dc 100644
--- a/Utilities/cmlibuv/src/unix/tcp.c
+++ b/Utilities/cmlibuv/src/unix/tcp.c
@@ -216,7 +216,7 @@ int uv__tcp_connect(uv_connect_t* req,
err = maybe_new_socket(handle,
addr->sa_family,
- UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+ UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
if (err)
return err;
@@ -263,13 +263,16 @@ int uv__tcp_connect(uv_connect_t* req,
int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) {
int err;
+ if (uv__fd_exists(handle->loop, sock))
+ return UV_EEXIST;
+
err = uv__nonblock(sock, 1);
if (err)
return err;
return uv__stream_open((uv_stream_t*)handle,
sock,
- UV_STREAM_READABLE | UV_STREAM_WRITABLE);
+ UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
}
@@ -331,7 +334,7 @@ int uv_tcp_listen(uv_tcp_t* tcp, int backlog, uv_connection_cb cb) {
}
if (single_accept)
- tcp->flags |= UV_TCP_SINGLE_ACCEPT;
+ tcp->flags |= UV_HANDLE_TCP_SINGLE_ACCEPT;
flags = 0;
#if defined(__MVS__)
@@ -398,9 +401,9 @@ int uv_tcp_nodelay(uv_tcp_t* handle, int on) {
}
if (on)
- handle->flags |= UV_TCP_NODELAY;
+ handle->flags |= UV_HANDLE_TCP_NODELAY;
else
- handle->flags &= ~UV_TCP_NODELAY;
+ handle->flags &= ~UV_HANDLE_TCP_NODELAY;
return 0;
}
@@ -416,9 +419,9 @@ int uv_tcp_keepalive(uv_tcp_t* handle, int on, unsigned int delay) {
}
if (on)
- handle->flags |= UV_TCP_KEEPALIVE;
+ handle->flags |= UV_HANDLE_TCP_KEEPALIVE;
else
- handle->flags &= ~UV_TCP_KEEPALIVE;
+ handle->flags &= ~UV_HANDLE_TCP_KEEPALIVE;
/* TODO Store delay if uv__stream_fd(handle) == -1 but don't want to enlarge
* uv_tcp_t with an int that's almost never used...
@@ -430,9 +433,9 @@ int uv_tcp_keepalive(uv_tcp_t* handle, int on, unsigned int delay) {
int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable) {
if (enable)
- handle->flags &= ~UV_TCP_SINGLE_ACCEPT;
+ handle->flags &= ~UV_HANDLE_TCP_SINGLE_ACCEPT;
else
- handle->flags |= UV_TCP_SINGLE_ACCEPT;
+ handle->flags |= UV_HANDLE_TCP_SINGLE_ACCEPT;
return 0;
}
diff --git a/Utilities/cmlibuv/src/unix/thread.c b/Utilities/cmlibuv/src/unix/thread.c
index 303bc6ec8..29004707a 100644
--- a/Utilities/cmlibuv/src/unix/thread.c
+++ b/Utilities/cmlibuv/src/unix/thread.c
@@ -44,108 +44,119 @@
#undef NANOSEC
#define NANOSEC ((uint64_t) 1e9)
+#if defined(PTHREAD_BARRIER_SERIAL_THREAD)
+STATIC_ASSERT(sizeof(uv_barrier_t) == sizeof(pthread_barrier_t));
+#endif
-#if defined(UV__PTHREAD_BARRIER_FALLBACK)
-/* TODO: support barrier_attr */
-int pthread_barrier_init(pthread_barrier_t* barrier,
- const void* barrier_attr,
- unsigned count) {
+/* Note: guard clauses should match uv_barrier_t's in include/uv/uv-unix.h. */
+#if defined(_AIX) || !defined(PTHREAD_BARRIER_SERIAL_THREAD)
+int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
+ struct _uv_barrier* b;
int rc;
- _uv_barrier* b;
if (barrier == NULL || count == 0)
- return EINVAL;
-
- if (barrier_attr != NULL)
- return ENOTSUP;
+ return UV_EINVAL;
b = uv__malloc(sizeof(*b));
if (b == NULL)
- return ENOMEM;
+ return UV_ENOMEM;
b->in = 0;
b->out = 0;
b->threshold = count;
- if ((rc = pthread_mutex_init(&b->mutex, NULL)) != 0)
+ rc = uv_mutex_init(&b->mutex);
+ if (rc != 0)
goto error2;
- if ((rc = pthread_cond_init(&b->cond, NULL)) != 0)
+
+ rc = uv_cond_init(&b->cond);
+ if (rc != 0)
goto error;
barrier->b = b;
return 0;
error:
- pthread_mutex_destroy(&b->mutex);
+ uv_mutex_destroy(&b->mutex);
error2:
uv__free(b);
return rc;
}
-int pthread_barrier_wait(pthread_barrier_t* barrier) {
- int rc;
- _uv_barrier* b;
+
+int uv_barrier_wait(uv_barrier_t* barrier) {
+ struct _uv_barrier* b;
+ int last;
if (barrier == NULL || barrier->b == NULL)
- return EINVAL;
+ return UV_EINVAL;
b = barrier->b;
- /* Lock the mutex*/
- if ((rc = pthread_mutex_lock(&b->mutex)) != 0)
- return rc;
+ uv_mutex_lock(&b->mutex);
- /* Increment the count. If this is the first thread to reach the threshold,
- wake up waiters, unlock the mutex, then return
- PTHREAD_BARRIER_SERIAL_THREAD. */
if (++b->in == b->threshold) {
b->in = 0;
- b->out = b->threshold - 1;
- rc = pthread_cond_signal(&b->cond);
- assert(rc == 0);
-
- pthread_mutex_unlock(&b->mutex);
- return PTHREAD_BARRIER_SERIAL_THREAD;
+ b->out = b->threshold;
+ uv_cond_signal(&b->cond);
+ } else {
+ do
+ uv_cond_wait(&b->cond, &b->mutex);
+ while (b->in != 0);
}
- /* Otherwise, wait for other threads until in is set to 0,
- then return 0 to indicate this is not the first thread. */
- do {
- if ((rc = pthread_cond_wait(&b->cond, &b->mutex)) != 0)
- break;
- } while (b->in != 0);
-
- /* mark thread exit */
- b->out--;
- pthread_cond_signal(&b->cond);
- pthread_mutex_unlock(&b->mutex);
- return rc;
+
+ last = (--b->out == 0);
+ if (!last)
+ uv_cond_signal(&b->cond); /* Not needed for last thread. */
+
+ uv_mutex_unlock(&b->mutex);
+ return last;
}
-int pthread_barrier_destroy(pthread_barrier_t* barrier) {
- int rc;
- _uv_barrier* b;
- if (barrier == NULL || barrier->b == NULL)
- return EINVAL;
+void uv_barrier_destroy(uv_barrier_t* barrier) {
+ struct _uv_barrier* b;
b = barrier->b;
+ uv_mutex_lock(&b->mutex);
- if ((rc = pthread_mutex_lock(&b->mutex)) != 0)
- return rc;
+ assert(b->in == 0);
+ assert(b->out == 0);
- if (b->in > 0 || b->out > 0)
- rc = EBUSY;
-
- pthread_mutex_unlock(&b->mutex);
+ if (b->in != 0 || b->out != 0)
+ abort();
- if (rc)
- return rc;
+ uv_mutex_unlock(&b->mutex);
+ uv_mutex_destroy(&b->mutex);
+ uv_cond_destroy(&b->cond);
- pthread_cond_destroy(&b->cond);
- pthread_mutex_destroy(&b->mutex);
uv__free(barrier->b);
barrier->b = NULL;
- return 0;
}
+
+#else
+
+int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
+ return UV__ERR(pthread_barrier_init(barrier, NULL, count));
+}
+
+
+int uv_barrier_wait(uv_barrier_t* barrier) {
+ int rc;
+
+ rc = pthread_barrier_wait(barrier);
+ if (rc != 0)
+ if (rc != PTHREAD_BARRIER_SERIAL_THREAD)
+ abort();
+
+ return rc == PTHREAD_BARRIER_SERIAL_THREAD;
+}
+
+
+void uv_barrier_destroy(uv_barrier_t* barrier) {
+ if (pthread_barrier_destroy(barrier))
+ abort();
+}
+
#endif
@@ -771,25 +782,6 @@ int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) {
}
-int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
- return UV__ERR(pthread_barrier_init(barrier, NULL, count));
-}
-
-
-void uv_barrier_destroy(uv_barrier_t* barrier) {
- if (pthread_barrier_destroy(barrier))
- abort();
-}
-
-
-int uv_barrier_wait(uv_barrier_t* barrier) {
- int r = pthread_barrier_wait(barrier);
- if (r && r != PTHREAD_BARRIER_SERIAL_THREAD)
- abort();
- return r == PTHREAD_BARRIER_SERIAL_THREAD;
-}
-
-
int uv_key_create(uv_key_t* key) {
return UV__ERR(pthread_key_create(key, NULL));
}
diff --git a/Utilities/cmlibuv/src/unix/tty.c b/Utilities/cmlibuv/src/unix/tty.c
index e8ea302f2..b8bc2838d 100644
--- a/Utilities/cmlibuv/src/unix/tty.c
+++ b/Utilities/cmlibuv/src/unix/tty.c
@@ -92,13 +92,15 @@ static int uv__tty_is_slave(const int fd) {
return result;
}
-int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
+int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int unused) {
uv_handle_type type;
int flags = 0;
int newfd = -1;
int r;
int saved_flags;
+ int mode;
char path[256];
+ (void)unused; /* deprecated parameter is no longer needed */
/* File descriptors that refer to files cannot be monitored with epoll.
* That restriction also applies to character devices like /dev/random
@@ -108,6 +110,15 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
if (type == UV_FILE || type == UV_UNKNOWN_HANDLE)
return UV_EINVAL;
+ /* Save the fd flags in case we need to restore them due to an error. */
+ do
+ saved_flags = fcntl(fd, F_GETFL);
+ while (saved_flags == -1 && errno == EINTR);
+
+ if (saved_flags == -1)
+ return UV__ERR(errno);
+ mode = saved_flags & O_ACCMODE;
+
/* Reopen the file descriptor when it refers to a tty. This lets us put the
* tty in non-blocking mode without affecting other processes that share it
* with us.
@@ -125,14 +136,14 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
* slave device.
*/
if (uv__tty_is_slave(fd) && ttyname_r(fd, path, sizeof(path)) == 0)
- r = uv__open_cloexec(path, O_RDWR);
+ r = uv__open_cloexec(path, mode);
else
r = -1;
if (r < 0) {
/* fallback to using blocking writes */
- if (!readable)
- flags |= UV_STREAM_BLOCKING;
+ if (mode != O_RDONLY)
+ flags |= UV_HANDLE_BLOCKING_WRITES;
goto skip;
}
@@ -151,22 +162,6 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) {
fd = newfd;
}
-#if defined(__APPLE__)
- /* Save the fd flags in case we need to restore them due to an error. */
- do
- saved_flags = fcntl(fd, F_GETFL);
- while (saved_flags == -1 && errno == EINTR);
-
- if (saved_flags == -1) {
- if (newfd != -1)
- uv__close(newfd);
- return UV__ERR(errno);
- }
-#endif
-
- /* Pacify the compiler. */
- (void) &saved_flags;
-
skip:
uv__stream_init(loop, (uv_stream_t*) tty, UV_TTY);
@@ -174,7 +169,7 @@ skip:
* the handle queue, since it was added by uv__handle_init in uv_stream_init.
*/
- if (!(flags & UV_STREAM_BLOCKING))
+ if (!(flags & UV_HANDLE_BLOCKING_WRITES))
uv__nonblock(fd, 1);
#if defined(__APPLE__)
@@ -191,10 +186,10 @@ skip:
}
#endif
- if (readable)
- flags |= UV_STREAM_READABLE;
- else
- flags |= UV_STREAM_WRITABLE;
+ if (mode != O_WRONLY)
+ flags |= UV_HANDLE_READABLE;
+ if (mode != O_RDONLY)
+ flags |= UV_HANDLE_WRITABLE;
uv__stream_open((uv_stream_t*) tty, fd, flags);
tty->mode = UV_TTY_MODE_NORMAL;
diff --git a/Utilities/cmlibuv/src/unix/udp.c b/Utilities/cmlibuv/src/unix/udp.c
index 74d613b68..ec337ec8b 100644
--- a/Utilities/cmlibuv/src/unix/udp.c
+++ b/Utilities/cmlibuv/src/unix/udp.c
@@ -92,8 +92,8 @@ static void uv__udp_run_completed(uv_udp_t* handle) {
uv_udp_send_t* req;
QUEUE* q;
- assert(!(handle->flags & UV_UDP_PROCESSING));
- handle->flags |= UV_UDP_PROCESSING;
+ assert(!(handle->flags & UV_HANDLE_UDP_PROCESSING));
+ handle->flags |= UV_HANDLE_UDP_PROCESSING;
while (!QUEUE_EMPTY(&handle->write_completed_queue)) {
q = QUEUE_HEAD(&handle->write_completed_queue);
@@ -128,7 +128,7 @@ static void uv__udp_run_completed(uv_udp_t* handle) {
uv__handle_stop(handle);
}
- handle->flags &= ~UV_UDP_PROCESSING;
+ handle->flags &= ~UV_HANDLE_UDP_PROCESSING;
}
@@ -427,7 +427,7 @@ int uv__udp_send(uv_udp_send_t* req,
QUEUE_INSERT_TAIL(&handle->write_queue, &req->queue);
uv__handle_start(handle);
- if (empty_queue && !(handle->flags & UV_UDP_PROCESSING)) {
+ if (empty_queue && !(handle->flags & UV_HANDLE_UDP_PROCESSING)) {
uv__udp_sendmsg(handle);
/* `uv__udp_sendmsg` may not be able to do non-blocking write straight
@@ -624,6 +624,9 @@ int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) {
if (handle->io_watcher.fd != -1)
return UV_EBUSY;
+ if (uv__fd_exists(handle->loop, sock))
+ return UV_EEXIST;
+
err = uv__nonblock(sock, 1);
if (err)
return err;
@@ -757,14 +760,16 @@ int uv_udp_set_multicast_ttl(uv_udp_t* handle, int ttl) {
* IP_MULTICAST_TTL, so hardcode the size of the option in the IPv6 case,
* and use the general uv__setsockopt_maybe_char call otherwise.
*/
-#if defined(__sun) || defined(_AIX) || defined(__MVS__)
+#if defined(__sun) || defined(_AIX) || defined(__OpenBSD__) || \
+ defined(__MVS__)
if (handle->flags & UV_HANDLE_IPV6)
return uv__setsockopt(handle,
IP_MULTICAST_TTL,
IPV6_MULTICAST_HOPS,
&ttl,
sizeof(ttl));
-#endif /* defined(__sun) || defined(_AIX) || defined(__MVS__) */
+#endif /* defined(__sun) || defined(_AIX) || defined(__OpenBSD__) || \
+ defined(__MVS__) */
return uv__setsockopt_maybe_char(handle,
IP_MULTICAST_TTL,
@@ -780,14 +785,16 @@ int uv_udp_set_multicast_loop(uv_udp_t* handle, int on) {
* IP_MULTICAST_LOOP, so hardcode the size of the option in the IPv6 case,
* and use the general uv__setsockopt_maybe_char call otherwise.
*/
-#if defined(__sun) || defined(_AIX) || defined(__MVS__)
+#if defined(__sun) || defined(_AIX) || defined(__OpenBSD__) || \
+ defined(__MVS__)
if (handle->flags & UV_HANDLE_IPV6)
return uv__setsockopt(handle,
IP_MULTICAST_LOOP,
IPV6_MULTICAST_LOOP,
&on,
sizeof(on));
-#endif /* defined(__sun) || defined(_AIX) || defined(__MVS__) */
+#endif /* defined(__sun) || defined(_AIX) ||defined(__OpenBSD__) ||
+ defined(__MVS__) */
return uv__setsockopt_maybe_char(handle,
IP_MULTICAST_LOOP,
diff --git a/Utilities/cmlibuv/src/uv-common.c b/Utilities/cmlibuv/src/uv-common.c
index 15dec082f..907ebf2f2 100644
--- a/Utilities/cmlibuv/src/uv-common.c
+++ b/Utilities/cmlibuv/src/uv-common.c
@@ -72,7 +72,9 @@ char* uv__strndup(const char* s, size_t n) {
}
void* uv__malloc(size_t size) {
- return uv__allocator.local_malloc(size);
+ if (size > 0)
+ return uv__allocator.local_malloc(size);
+ return NULL;
}
void uv__free(void* ptr) {
@@ -91,7 +93,10 @@ void* uv__calloc(size_t count, size_t size) {
}
void* uv__realloc(void* ptr, size_t size) {
- return uv__allocator.local_realloc(ptr, size);
+ if (size > 0)
+ return uv__allocator.local_realloc(ptr, size);
+ uv__free(ptr);
+ return NULL;
}
int uv_replace_allocator(uv_malloc_func malloc_func,
@@ -155,6 +160,18 @@ static const char* uv__unknown_err_code(int err) {
return copy != NULL ? copy : "Unknown system error";
}
+#define UV_ERR_NAME_GEN_R(name, _) \
+case UV_## name: \
+ uv__strscpy(buf, #name, buflen); break;
+char* uv_err_name_r(int err, char* buf, size_t buflen) {
+ switch (err) {
+ UV_ERRNO_MAP(UV_ERR_NAME_GEN_R)
+ default: snprintf(buf, buflen, "Unknown system error %d", err);
+ }
+ return buf;
+}
+#undef UV_ERR_NAME_GEN_R
+
#define UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name;
const char* uv_err_name(int err) {
@@ -166,6 +183,19 @@ const char* uv_err_name(int err) {
#undef UV_ERR_NAME_GEN
+#define UV_STRERROR_GEN_R(name, msg) \
+case UV_ ## name: \
+ snprintf(buf, buflen, "%s", msg); break;
+char* uv_strerror_r(int err, char* buf, size_t buflen) {
+ switch (err) {
+ UV_ERRNO_MAP(UV_STRERROR_GEN_R)
+ default: snprintf(buf, buflen, "Unknown system error %d", err);
+ }
+ return buf;
+}
+#undef UV_STRERROR_GEN_R
+
+
#define UV_STRERROR_GEN(name, msg) case UV_ ## name: return msg;
const char* uv_strerror(int err) {
switch (err) {
@@ -359,7 +389,7 @@ void uv_walk(uv_loop_t* loop, uv_walk_cb walk_cb, void* arg) {
QUEUE_REMOVE(q);
QUEUE_INSERT_TAIL(&loop->handle_queue, q);
- if (h->flags & UV__HANDLE_INTERNAL) continue;
+ if (h->flags & UV_HANDLE_INTERNAL) continue;
walk_cb(h, arg);
}
}
@@ -388,9 +418,9 @@ static void uv__print_handles(uv_loop_t* loop, int only_active, FILE* stream) {
fprintf(stream,
"[%c%c%c] %-8s %p\n",
- "R-"[!(h->flags & UV__HANDLE_REF)],
- "A-"[!(h->flags & UV__HANDLE_ACTIVE)],
- "I-"[!(h->flags & UV__HANDLE_INTERNAL)],
+ "R-"[!(h->flags & UV_HANDLE_REF)],
+ "A-"[!(h->flags & UV_HANDLE_ACTIVE)],
+ "I-"[!(h->flags & UV_HANDLE_INTERNAL)],
type,
(void*)h);
}
@@ -634,7 +664,7 @@ int uv_loop_close(uv_loop_t* loop) {
QUEUE_FOREACH(q, &loop->handle_queue) {
h = QUEUE_DATA(q, uv_handle_t, handle_queue);
- if (!(h->flags & UV__HANDLE_INTERNAL))
+ if (!(h->flags & UV_HANDLE_INTERNAL))
return UV_EBUSY;
}
diff --git a/Utilities/cmlibuv/src/uv-common.h b/Utilities/cmlibuv/src/uv-common.h
index c497d014f..15ac4d02c 100644
--- a/Utilities/cmlibuv/src/uv-common.h
+++ b/Utilities/cmlibuv/src/uv-common.h
@@ -32,14 +32,15 @@
#include <stddef.h>
#if defined(_MSC_VER) && _MSC_VER < 1600
-# include "stdint-msvc2008.h"
+# include "uv/stdint-msvc2008.h"
#else
# include <stdint.h>
#endif
#include "uv.h"
-#include "tree.h"
+#include "uv/tree.h"
#include "queue.h"
+#include "strscpy.h"
#if EDOM > 0
# define UV__ERR(x) (-(x))
@@ -59,22 +60,67 @@ extern int snprintf(char*, size_t, const char*, ...);
#define STATIC_ASSERT(expr) \
void uv__static_assert(int static_assert_failed[1 - 2 * !(expr)])
-#ifndef _WIN32
+/* Handle flags. Some flags are specific to Windows or UNIX. */
enum {
- UV__SIGNAL_ONE_SHOT = 0x80000, /* On signal reception remove sighandler */
- UV__HANDLE_INTERNAL = 0x8000,
- UV__HANDLE_ACTIVE = 0x4000,
- UV__HANDLE_REF = 0x2000,
- UV__HANDLE_CLOSING = 0 /* no-op on unix */
+ /* Used by all handles. */
+ UV_HANDLE_CLOSING = 0x00000001,
+ UV_HANDLE_CLOSED = 0x00000002,
+ UV_HANDLE_ACTIVE = 0x00000004,
+ UV_HANDLE_REF = 0x00000008,
+ UV_HANDLE_INTERNAL = 0x00000010,
+ UV_HANDLE_ENDGAME_QUEUED = 0x00000020,
+
+ /* Used by streams. */
+ UV_HANDLE_LISTENING = 0x00000040,
+ UV_HANDLE_CONNECTION = 0x00000080,
+ UV_HANDLE_SHUTTING = 0x00000100,
+ UV_HANDLE_SHUT = 0x00000200,
+ UV_HANDLE_READ_PARTIAL = 0x00000400,
+ UV_HANDLE_READ_EOF = 0x00000800,
+
+ /* Used by streams and UDP handles. */
+ UV_HANDLE_READING = 0x00001000,
+ UV_HANDLE_BOUND = 0x00002000,
+ UV_HANDLE_READABLE = 0x00004000,
+ UV_HANDLE_WRITABLE = 0x00008000,
+ UV_HANDLE_READ_PENDING = 0x00010000,
+ UV_HANDLE_SYNC_BYPASS_IOCP = 0x00020000,
+ UV_HANDLE_ZERO_READ = 0x00040000,
+ UV_HANDLE_EMULATE_IOCP = 0x00080000,
+ UV_HANDLE_BLOCKING_WRITES = 0x00100000,
+ UV_HANDLE_CANCELLATION_PENDING = 0x00200000,
+
+ /* Used by uv_tcp_t and uv_udp_t handles */
+ UV_HANDLE_IPV6 = 0x00400000,
+
+ /* Only used by uv_tcp_t handles. */
+ UV_HANDLE_TCP_NODELAY = 0x01000000,
+ UV_HANDLE_TCP_KEEPALIVE = 0x02000000,
+ UV_HANDLE_TCP_SINGLE_ACCEPT = 0x04000000,
+ UV_HANDLE_TCP_ACCEPT_STATE_CHANGING = 0x08000000,
+ UV_HANDLE_TCP_SOCKET_CLOSED = 0x10000000,
+ UV_HANDLE_SHARED_TCP_SOCKET = 0x20000000,
+
+ /* Only used by uv_udp_t handles. */
+ UV_HANDLE_UDP_PROCESSING = 0x01000000,
+
+ /* Only used by uv_pipe_t handles. */
+ UV_HANDLE_NON_OVERLAPPED_PIPE = 0x01000000,
+ UV_HANDLE_PIPESERVER = 0x02000000,
+
+ /* Only used by uv_tty_t handles. */
+ UV_HANDLE_TTY_READABLE = 0x01000000,
+ UV_HANDLE_TTY_RAW = 0x02000000,
+ UV_HANDLE_TTY_SAVED_POSITION = 0x04000000,
+ UV_HANDLE_TTY_SAVED_ATTRIBUTES = 0x08000000,
+
+ /* Only used by uv_signal_t handles. */
+ UV_SIGNAL_ONE_SHOT_DISPATCHED = 0x01000000,
+ UV_SIGNAL_ONE_SHOT = 0x02000000,
+
+ /* Only used by uv_poll_t handles. */
+ UV_HANDLE_POLL_SLOW = 0x01000000
};
-#else
-# define UV__SIGNAL_ONE_SHOT_DISPATCHED 0x200
-# define UV__SIGNAL_ONE_SHOT 0x100
-# define UV__HANDLE_INTERNAL 0x80
-# define UV__HANDLE_ACTIVE 0x40
-# define UV__HANDLE_REF 0x20
-# define UV__HANDLE_CLOSING 0x01
-#endif
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
@@ -119,8 +165,15 @@ void uv__fs_poll_close(uv_fs_poll_t* handle);
int uv__getaddrinfo_translate_error(int sys_err); /* EAI_* error. */
+enum uv__work_kind {
+ UV__WORK_CPU,
+ UV__WORK_FAST_IO,
+ UV__WORK_SLOW_IO
+};
+
void uv__work_submit(uv_loop_t* loop,
struct uv__work *w,
+ enum uv__work_kind kind,
void (*work)(struct uv__work *w),
void (*done)(struct uv__work *w, int status));
@@ -132,6 +185,10 @@ int uv__socket_sockopt(uv_handle_t* handle, int optname, int* value);
void uv__fs_scandir_cleanup(uv_fs_t* req);
+int uv__next_timeout(const uv_loop_t* loop);
+void uv__run_timers(uv_loop_t* loop);
+void uv__timer_close(uv_timer_t* handle);
+
#define uv__has_active_reqs(loop) \
((loop)->active_reqs.count > 0)
@@ -164,49 +221,47 @@ void uv__fs_scandir_cleanup(uv_fs_t* req);
while (0)
#define uv__is_active(h) \
- (((h)->flags & UV__HANDLE_ACTIVE) != 0)
+ (((h)->flags & UV_HANDLE_ACTIVE) != 0)
#define uv__is_closing(h) \
- (((h)->flags & (UV_CLOSING | UV_CLOSED)) != 0)
+ (((h)->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED)) != 0)
#define uv__handle_start(h) \
do { \
- assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \
- if (((h)->flags & UV__HANDLE_ACTIVE) != 0) break; \
- (h)->flags |= UV__HANDLE_ACTIVE; \
- if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_add(h); \
+ if (((h)->flags & UV_HANDLE_ACTIVE) != 0) break; \
+ (h)->flags |= UV_HANDLE_ACTIVE; \
+ if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_add(h); \
} \
while (0)
#define uv__handle_stop(h) \
do { \
- assert(((h)->flags & UV__HANDLE_CLOSING) == 0); \
- if (((h)->flags & UV__HANDLE_ACTIVE) == 0) break; \
- (h)->flags &= ~UV__HANDLE_ACTIVE; \
- if (((h)->flags & UV__HANDLE_REF) != 0) uv__active_handle_rm(h); \
+ if (((h)->flags & UV_HANDLE_ACTIVE) == 0) break; \
+ (h)->flags &= ~UV_HANDLE_ACTIVE; \
+ if (((h)->flags & UV_HANDLE_REF) != 0) uv__active_handle_rm(h); \
} \
while (0)
#define uv__handle_ref(h) \
do { \
- if (((h)->flags & UV__HANDLE_REF) != 0) break; \
- (h)->flags |= UV__HANDLE_REF; \
- if (((h)->flags & UV__HANDLE_CLOSING) != 0) break; \
- if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_add(h); \
+ if (((h)->flags & UV_HANDLE_REF) != 0) break; \
+ (h)->flags |= UV_HANDLE_REF; \
+ if (((h)->flags & UV_HANDLE_CLOSING) != 0) break; \
+ if (((h)->flags & UV_HANDLE_ACTIVE) != 0) uv__active_handle_add(h); \
} \
while (0)
#define uv__handle_unref(h) \
do { \
- if (((h)->flags & UV__HANDLE_REF) == 0) break; \
- (h)->flags &= ~UV__HANDLE_REF; \
- if (((h)->flags & UV__HANDLE_CLOSING) != 0) break; \
- if (((h)->flags & UV__HANDLE_ACTIVE) != 0) uv__active_handle_rm(h); \
+ if (((h)->flags & UV_HANDLE_REF) == 0) break; \
+ (h)->flags &= ~UV_HANDLE_REF; \
+ if (((h)->flags & UV_HANDLE_CLOSING) != 0) break; \
+ if (((h)->flags & UV_HANDLE_ACTIVE) != 0) uv__active_handle_rm(h); \
} \
while (0)
#define uv__has_ref(h) \
- (((h)->flags & UV__HANDLE_REF) != 0)
+ (((h)->flags & UV_HANDLE_REF) != 0)
#if defined(_WIN32)
# define uv__handle_platform_init(h) ((h)->u.fd = -1)
@@ -218,7 +273,7 @@ void uv__fs_scandir_cleanup(uv_fs_t* req);
do { \
(h)->loop = (loop_); \
(h)->type = (type_); \
- (h)->flags = UV__HANDLE_REF; /* Ref the loop when active. */ \
+ (h)->flags = UV_HANDLE_REF; /* Ref the loop when active. */ \
QUEUE_INSERT_TAIL(&(loop_)->handle_queue, &(h)->handle_queue); \
uv__handle_platform_init(h); \
} \
diff --git a/Utilities/cmlibuv/src/uv-data-getter-setters.c b/Utilities/cmlibuv/src/uv-data-getter-setters.c
index 533e4a2fe..b7fcd4a7f 100644
--- a/Utilities/cmlibuv/src/uv-data-getter-setters.c
+++ b/Utilities/cmlibuv/src/uv-data-getter-setters.c
@@ -3,11 +3,11 @@
const char* uv_handle_type_name(uv_handle_type type) {
switch (type) {
#define XX(uc,lc) case UV_##uc: return #lc;
- UV_HANDLE_TYPE_MAP(XX)
+ UV_HANDLE_TYPE_MAP(XX)
#undef XX
- case UV_FILE: return "file";
- case UV_HANDLE_TYPE_MAX:
- case UV_UNKNOWN_HANDLE: return NULL;
+ case UV_FILE: return "file";
+ case UV_HANDLE_TYPE_MAX:
+ case UV_UNKNOWN_HANDLE: return NULL;
}
return NULL;
}
@@ -31,10 +31,12 @@ void uv_handle_set_data(uv_handle_t* handle, void* data) {
const char* uv_req_type_name(uv_req_type type) {
switch (type) {
#define XX(uc,lc) case UV_##uc: return #lc;
- UV_REQ_TYPE_MAP(XX)
+ UV_REQ_TYPE_MAP(XX)
#undef XX
- case UV_REQ_TYPE_MAX:
- case UV_UNKNOWN_REQ: return NULL;
+ case UV_REQ_TYPE_MAX:
+ case UV_UNKNOWN_REQ:
+ default: /* UV_REQ_TYPE_PRIVATE */
+ return NULL;
}
return NULL;
}
diff --git a/Utilities/cmlibuv/src/win/async.c b/Utilities/cmlibuv/src/win/async.c
index 0b636ed1e..d787f6604 100644
--- a/Utilities/cmlibuv/src/win/async.c
+++ b/Utilities/cmlibuv/src/win/async.c
@@ -29,7 +29,7 @@
void uv_async_endgame(uv_loop_t* loop, uv_async_t* handle) {
- if (handle->flags & UV__HANDLE_CLOSING &&
+ if (handle->flags & UV_HANDLE_CLOSING &&
!handle->async_sent) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
uv__handle_close(handle);
@@ -71,9 +71,9 @@ int uv_async_send(uv_async_t* handle) {
return -1;
}
- /* The user should make sure never to call uv_async_send to a closing */
- /* or closed handle. */
- assert(!(handle->flags & UV__HANDLE_CLOSING));
+ /* The user should make sure never to call uv_async_send to a closing or
+ * closed handle. */
+ assert(!(handle->flags & UV_HANDLE_CLOSING));
if (!uv__atomic_exchange_set(&handle->async_sent)) {
POST_COMPLETION_FOR_REQ(loop, &handle->async_req);
@@ -90,7 +90,7 @@ void uv_process_async_wakeup_req(uv_loop_t* loop, uv_async_t* handle,
handle->async_sent = 0;
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
uv_want_endgame(loop, (uv_handle_t*)handle);
} else if (handle->async_cb != NULL) {
handle->async_cb(handle);
diff --git a/Utilities/cmlibuv/src/win/atomicops-inl.h b/Utilities/cmlibuv/src/win/atomicops-inl.h
index 6d8126f69..52713cf30 100644
--- a/Utilities/cmlibuv/src/win/atomicops-inl.h
+++ b/Utilities/cmlibuv/src/win/atomicops-inl.h
@@ -29,10 +29,10 @@
/* Atomic set operation on char */
#ifdef _MSC_VER /* MSVC */
-/* _InterlockedOr8 is supported by MSVC on x32 and x64. It is slightly less */
-/* efficient than InterlockedExchange, but InterlockedExchange8 does not */
-/* exist, and interlocked operations on larger targets might require the */
-/* target to be aligned. */
+/* _InterlockedOr8 is supported by MSVC on x32 and x64. It is slightly less
+ * efficient than InterlockedExchange, but InterlockedExchange8 does not exist,
+ * and interlocked operations on larger targets might require the target to be
+ * aligned. */
#pragma intrinsic(_InterlockedOr8)
static char INLINE uv__atomic_exchange_set(char volatile* target) {
diff --git a/Utilities/cmlibuv/src/win/core.c b/Utilities/cmlibuv/src/win/core.c
index b8aad11b7..58309c696 100644
--- a/Utilities/cmlibuv/src/win/core.c
+++ b/Utilities/cmlibuv/src/win/core.c
@@ -33,6 +33,7 @@
#include "internal.h"
#include "queue.h"
#include "handle-inl.h"
+#include "heap-inl.h"
#include "req-inl.h"
/* uv_once initialization guards */
@@ -221,6 +222,7 @@ static void uv_init(void) {
int uv_loop_init(uv_loop_t* loop) {
+ struct heap* timer_heap;
int err;
/* Initialize libuv itself first */
@@ -246,7 +248,13 @@ int uv_loop_init(uv_loop_t* loop) {
loop->endgame_handles = NULL;
- RB_INIT(&loop->timers);
+ loop->timer_heap = timer_heap = uv__malloc(sizeof(*timer_heap));
+ if (timer_heap == NULL) {
+ err = UV_ENOMEM;
+ goto fail_timers_alloc;
+ }
+
+ heap_init(timer_heap);
loop->check_handles = NULL;
loop->prepare_handles = NULL;
@@ -273,7 +281,7 @@ int uv_loop_init(uv_loop_t* loop) {
goto fail_async_init;
uv__handle_unref(&loop->wq_async);
- loop->wq_async.flags |= UV__HANDLE_INTERNAL;
+ loop->wq_async.flags |= UV_HANDLE_INTERNAL;
err = uv__loops_add(loop);
if (err)
@@ -285,6 +293,10 @@ fail_async_init:
uv_mutex_destroy(&loop->wq_mutex);
fail_mutex_init:
+ uv__free(timer_heap);
+ loop->timer_heap = NULL;
+
+fail_timers_alloc:
CloseHandle(loop->iocp);
loop->iocp = INVALID_HANDLE_VALUE;
@@ -292,6 +304,13 @@ fail_mutex_init:
}
+void uv_update_time(uv_loop_t* loop) {
+ uint64_t new_time = uv__hrtime(1000);
+ assert(new_time >= loop->time);
+ loop->time = new_time;
+}
+
+
void uv__once_init(void) {
uv_once(&uv_init_guard_, uv_init);
}
@@ -320,6 +339,9 @@ void uv__loop_close(uv_loop_t* loop) {
uv_mutex_unlock(&loop->wq_mutex);
uv_mutex_destroy(&loop->wq_mutex);
+ uv__free(loop->timer_heap);
+ loop->timer_heap = NULL;
+
CloseHandle(loop->iocp);
}
@@ -359,7 +381,7 @@ int uv_backend_timeout(const uv_loop_t* loop) {
}
-static void uv_poll(uv_loop_t* loop, DWORD timeout) {
+static void uv__poll_wine(uv_loop_t* loop, DWORD timeout) {
DWORD bytes;
ULONG_PTR key;
OVERLAPPED* overlapped;
@@ -410,7 +432,7 @@ static void uv_poll(uv_loop_t* loop, DWORD timeout) {
}
-static void uv_poll_ex(uv_loop_t* loop, DWORD timeout) {
+static void uv__poll(uv_loop_t* loop, DWORD timeout) {
BOOL success;
uv_req_t* req;
OVERLAPPED_ENTRY overlappeds[128];
@@ -422,12 +444,12 @@ static void uv_poll_ex(uv_loop_t* loop, DWORD timeout) {
timeout_time = loop->time + timeout;
for (repeat = 0; ; repeat++) {
- success = pGetQueuedCompletionStatusEx(loop->iocp,
- overlappeds,
- ARRAY_SIZE(overlappeds),
- &count,
- timeout,
- FALSE);
+ success = GetQueuedCompletionStatusEx(loop->iocp,
+ overlappeds,
+ ARRAY_SIZE(overlappeds),
+ &count,
+ timeout,
+ FALSE);
if (success) {
for (i = 0; i < count; i++) {
@@ -485,12 +507,6 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) {
DWORD timeout;
int r;
int ran_pending;
- void (*poll)(uv_loop_t* loop, DWORD timeout);
-
- if (pGetQueuedCompletionStatusEx)
- poll = &uv_poll_ex;
- else
- poll = &uv_poll;
r = uv__loop_alive(loop);
if (!r)
@@ -498,7 +514,7 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) {
while (r != 0 && loop->stop_flag == 0) {
uv_update_time(loop);
- uv_process_timers(loop);
+ uv__run_timers(loop);
ran_pending = uv_process_reqs(loop);
uv_idle_invoke(loop);
@@ -508,7 +524,11 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) {
if ((mode == UV_RUN_ONCE && !ran_pending) || mode == UV_RUN_DEFAULT)
timeout = uv_backend_timeout(loop);
- (*poll)(loop, timeout);
+ if (pGetQueuedCompletionStatusEx)
+ uv__poll(loop, timeout);
+ else
+ uv__poll_wine(loop, timeout);
+
uv_check_invoke(loop);
uv_process_endgames(loop);
@@ -522,7 +542,7 @@ int uv_run(uv_loop_t *loop, uv_run_mode mode) {
* UV_RUN_NOWAIT makes no guarantees about progress so it's omitted from
* the check.
*/
- uv_process_timers(loop);
+ uv__run_timers(loop);
}
r = uv__loop_alive(loop);
diff --git a/Utilities/cmlibuv/src/win/dl.c b/Utilities/cmlibuv/src/win/dl.c
index 97ac1c1ad..676be4dc7 100644
--- a/Utilities/cmlibuv/src/win/dl.c
+++ b/Utilities/cmlibuv/src/win/dl.c
@@ -64,7 +64,8 @@ void uv_dlclose(uv_lib_t* lib) {
int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr) {
- *ptr = (void*) GetProcAddress(lib->handle, name);
+ /* Cast though integer to suppress pedantic warning about forbidden cast. */
+ *ptr = (void*)(uintptr_t) GetProcAddress(lib->handle, name);
return uv__dlerror(lib, "", *ptr ? 0 : GetLastError());
}
@@ -75,8 +76,9 @@ const char* uv_dlerror(const uv_lib_t* lib) {
static void uv__format_fallback_error(uv_lib_t* lib, int errorno){
- DWORD_PTR args[1] = { (DWORD_PTR) errorno };
- LPSTR fallback_error = "error: %1!d!";
+ static const CHAR fallback_error[] = "error: %1!d!";
+ DWORD_PTR args[1];
+ args[0] = (DWORD_PTR) errorno;
FormatMessageA(FORMAT_MESSAGE_FROM_STRING |
FORMAT_MESSAGE_ARGUMENT_ARRAY |
@@ -107,7 +109,8 @@ static int uv__dlerror(uv_lib_t* lib, const char* filename, DWORD errorno) {
MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
(LPSTR) &lib->errmsg, 0, NULL);
- if (!res && GetLastError() == ERROR_MUI_FILE_NOT_FOUND) {
+ if (!res && (GetLastError() == ERROR_MUI_FILE_NOT_FOUND ||
+ GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND)) {
res = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorno,
diff --git a/Utilities/cmlibuv/src/win/error.c b/Utilities/cmlibuv/src/win/error.c
index 9b03bfef6..24924ba81 100644
--- a/Utilities/cmlibuv/src/win/error.c
+++ b/Utilities/cmlibuv/src/win/error.c
@@ -46,8 +46,8 @@ void uv_fatal_error(const int errorno, const char* syscall) {
errmsg = "Unknown error";
}
- /* FormatMessage messages include a newline character already, */
- /* so don't add another. */
+ /* FormatMessage messages include a newline character already, so don't add
+ * another. */
if (syscall) {
fprintf(stderr, "%s: (%d) %s", syscall, errorno, errmsg);
} else {
diff --git a/Utilities/cmlibuv/src/win/fs-event.c b/Utilities/cmlibuv/src/win/fs-event.c
index 14c9af9ad..acf8e1107 100644
--- a/Utilities/cmlibuv/src/win/fs-event.c
+++ b/Utilities/cmlibuv/src/win/fs-event.c
@@ -83,7 +83,7 @@ static void uv_relative_path(const WCHAR* filename,
static int uv_split_path(const WCHAR* filename, WCHAR** dir,
WCHAR** file) {
size_t len, i;
-
+
if (filename == NULL) {
if (dir != NULL)
*dir = NULL;
@@ -215,11 +215,11 @@ int uv_fs_event_start(uv_fs_event_t* handle,
uv__free(long_path);
long_path = NULL;
}
- }
- if (long_path) {
- uv__free(pathw);
- pathw = long_path;
+ if (long_path) {
+ uv__free(pathw);
+ pathw = long_path;
+ }
}
dir_to_watch = pathw;
@@ -230,8 +230,11 @@ int uv_fs_event_start(uv_fs_event_t* handle,
*/
/* Convert to short path. */
- short_path = short_path_buffer;
- if (!GetShortPathNameW(pathw, short_path, ARRAY_SIZE(short_path))) {
+ if (GetShortPathNameW(pathw,
+ short_path_buffer,
+ ARRAY_SIZE(short_path_buffer))) {
+ short_path = short_path_buffer;
+ } else {
short_path = NULL;
}
@@ -419,7 +422,7 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
* - We are not active, just ignore the callback
*/
if (!uv__is_active(handle)) {
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
uv_want_endgame(loop, (uv_handle_t*) handle);
}
return;
@@ -543,7 +546,7 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
}
offset = file_info->NextEntryOffset;
- } while (offset && !(handle->flags & UV__HANDLE_CLOSING));
+ } while (offset && !(handle->flags & UV_HANDLE_CLOSING));
} else {
handle->cb(handle, NULL, UV_CHANGE, 0);
}
@@ -552,7 +555,7 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req,
handle->cb(handle, NULL, 0, uv_translate_sys_error(err));
}
- if (!(handle->flags & UV__HANDLE_CLOSING)) {
+ if (!(handle->flags & UV_HANDLE_CLOSING)) {
uv_fs_event_queue_readdirchanges(loop, handle);
} else {
uv_want_endgame(loop, (uv_handle_t*)handle);
@@ -573,7 +576,7 @@ void uv_fs_event_close(uv_loop_t* loop, uv_fs_event_t* handle) {
void uv_fs_event_endgame(uv_loop_t* loop, uv_fs_event_t* handle) {
- if ((handle->flags & UV__HANDLE_CLOSING) && !handle->req_pending) {
+ if ((handle->flags & UV_HANDLE_CLOSING) && !handle->req_pending) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
if (handle->buffer) {
diff --git a/Utilities/cmlibuv/src/win/fs.c b/Utilities/cmlibuv/src/win/fs.c
index 30b87ac51..65d936bf0 100644
--- a/Utilities/cmlibuv/src/win/fs.c
+++ b/Utilities/cmlibuv/src/win/fs.c
@@ -55,7 +55,11 @@
do { \
if (cb != NULL) { \
uv__req_register(loop, req); \
- uv__work_submit(loop, &req->work_req, uv__fs_work, uv__fs_done); \
+ uv__work_submit(loop, \
+ &req->work_req, \
+ UV__WORK_FAST_IO, \
+ uv__fs_work, \
+ uv__fs_done); \
return 0; \
} else { \
uv__fs_work(&req->work_req); \
@@ -92,14 +96,17 @@
return; \
}
+#define MILLIONu (1000U * 1000U)
+#define BILLIONu (1000U * 1000U * 1000U)
+
#define FILETIME_TO_UINT(filetime) \
- (*((uint64_t*) &(filetime)) - 116444736000000000ULL)
+ (*((uint64_t*) &(filetime)) - (uint64_t) 116444736 * BILLIONu)
#define FILETIME_TO_TIME_T(filetime) \
- (FILETIME_TO_UINT(filetime) / 10000000ULL)
+ (FILETIME_TO_UINT(filetime) / (10u * MILLIONu))
#define FILETIME_TO_TIME_NS(filetime, secs) \
- ((FILETIME_TO_UINT(filetime) - (secs * 10000000ULL)) * 100)
+ ((FILETIME_TO_UINT(filetime) - (secs * (uint64_t) 10 * MILLIONu)) * 100U)
#define FILETIME_TO_TIMESPEC(ts, filetime) \
do { \
@@ -109,8 +116,8 @@
#define TIME_T_TO_FILETIME(time, filetime_ptr) \
do { \
- uint64_t bigtime = ((uint64_t) ((time) * 10000000ULL)) + \
- 116444736000000000ULL; \
+ uint64_t bigtime = ((uint64_t) ((time) * (uint64_t) 10 * MILLIONu)) + \
+ (uint64_t) 116444736 * BILLIONu; \
(filetime_ptr)->dwLowDateTime = bigtime & 0xFFFFFFFF; \
(filetime_ptr)->dwHighDateTime = bigtime >> 32; \
} while(0)
@@ -326,12 +333,11 @@ INLINE static int fs__readlink_handle(HANDLE handle, char** target_ptr,
reparse_data->SymbolicLinkReparseBuffer.SubstituteNameLength /
sizeof(WCHAR);
- /* Real symlinks can contain pretty much everything, but the only thing */
- /* we really care about is undoing the implicit conversion to an NT */
- /* namespaced path that CreateSymbolicLink will perform on absolute */
- /* paths. If the path is win32-namespaced then the user must have */
- /* explicitly made it so, and we better just return the unmodified */
- /* reparse data. */
+ /* Real symlinks can contain pretty much everything, but the only thing we
+ * really care about is undoing the implicit conversion to an NT namespaced
+ * path that CreateSymbolicLink will perform on absolute paths. If the path
+ * is win32-namespaced then the user must have explicitly made it so, and
+ * we better just return the unmodified reparse data. */
if (w_target_len >= 4 &&
w_target[0] == L'\\' &&
w_target[1] == L'?' &&
@@ -352,8 +358,8 @@ INLINE static int fs__readlink_handle(HANDLE handle, char** target_ptr,
(w_target[5] == L'N' || w_target[5] == L'n') &&
(w_target[6] == L'C' || w_target[6] == L'c') &&
w_target[7] == L'\\') {
- /* \??\UNC\<server>\<share>\ - make sure the final path looks like */
- /* \\<server>\<share>\ */
+ /* \??\UNC\<server>\<share>\ - make sure the final path looks like
+ * \\<server>\<share>\ */
w_target += 6;
w_target[0] = L'\\';
w_target_len -= 6;
@@ -368,11 +374,11 @@ INLINE static int fs__readlink_handle(HANDLE handle, char** target_ptr,
w_target_len = reparse_data->MountPointReparseBuffer.SubstituteNameLength /
sizeof(WCHAR);
- /* Only treat junctions that look like \??\<drive>:\ as symlink. */
- /* Junctions can also be used as mount points, like \??\Volume{<guid>}, */
- /* but that's confusing for programs since they wouldn't be able to */
- /* actually understand such a path when returned by uv_readlink(). */
- /* UNC paths are never valid for junctions so we don't care about them. */
+ /* Only treat junctions that look like \??\<drive>:\ as symlink. Junctions
+ * can also be used as mount points, like \??\Volume{<guid>}, but that's
+ * confusing for programs since they wouldn't be able to actually
+ * understand such a path when returned by uv_readlink(). UNC paths are
+ * never valid for junctions so we don't care about them. */
if (!(w_target_len >= 6 &&
w_target[0] == L'\\' &&
w_target[1] == L'?' &&
@@ -409,8 +415,8 @@ void fs__open(uv_fs_t* req) {
int fd, current_umask;
int flags = req->fs.info.file_flags;
- /* Obtain the active umask. umask() never fails and returns the previous */
- /* umask. */
+ /* Obtain the active umask. umask() never fails and returns the previous
+ * umask. */
current_umask = umask(0);
umask(current_umask);
@@ -502,6 +508,33 @@ void fs__open(uv_fs_t* req) {
}
if (flags & UV_FS_O_DIRECT) {
+ /*
+ * FILE_APPEND_DATA and FILE_FLAG_NO_BUFFERING are mutually exclusive.
+ * Windows returns 87, ERROR_INVALID_PARAMETER if these are combined.
+ *
+ * FILE_APPEND_DATA is included in FILE_GENERIC_WRITE:
+ *
+ * FILE_GENERIC_WRITE = STANDARD_RIGHTS_WRITE |
+ * FILE_WRITE_DATA |
+ * FILE_WRITE_ATTRIBUTES |
+ * FILE_WRITE_EA |
+ * FILE_APPEND_DATA |
+ * SYNCHRONIZE
+ *
+ * Note: Appends are also permitted by FILE_WRITE_DATA.
+ *
+ * In order for direct writes and direct appends to succeed, we therefore
+ * exclude FILE_APPEND_DATA if FILE_WRITE_DATA is specified, and otherwise
+ * fail if the user's sole permission is a direct append, since this
+ * particular combination is invalid.
+ */
+ if (access & FILE_APPEND_DATA) {
+ if (access & FILE_WRITE_DATA) {
+ access &= ~FILE_APPEND_DATA;
+ } else {
+ goto einval;
+ }
+ }
attributes |= FILE_FLAG_NO_BUFFERING;
}
@@ -530,8 +563,8 @@ void fs__open(uv_fs_t* req) {
DWORD error = GetLastError();
if (error == ERROR_FILE_EXISTS && (flags & UV_FS_O_CREAT) &&
!(flags & UV_FS_O_EXCL)) {
- /* Special case: when ERROR_FILE_EXISTS happens and UV_FS_O_CREAT was */
- /* specified, it means the path referred to a directory. */
+ /* Special case: when ERROR_FILE_EXISTS happens and UV_FS_O_CREAT was
+ * specified, it means the path referred to a directory. */
SET_REQ_UV_ERROR(req, UV_EISDIR, error);
} else {
SET_REQ_WIN32_ERROR(req, GetLastError());
@@ -756,9 +789,9 @@ void fs__unlink(uv_fs_t* req) {
}
if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- /* Do not allow deletion of directories, unless it is a symlink. When */
- /* the path refers to a non-symlink directory, report EPERM as mandated */
- /* by POSIX.1. */
+ /* Do not allow deletion of directories, unless it is a symlink. When the
+ * path refers to a non-symlink directory, report EPERM as mandated by
+ * POSIX.1. */
/* Check if it is a reparse point. If it's not, it's a normal directory. */
if (!(info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
@@ -767,8 +800,8 @@ void fs__unlink(uv_fs_t* req) {
return;
}
- /* Read the reparse point and check if it is a valid symlink. */
- /* If not, don't unlink. */
+ /* Read the reparse point and check if it is a valid symlink. If not, don't
+ * unlink. */
if (fs__readlink_handle(handle, NULL, NULL) < 0) {
DWORD error = GetLastError();
if (error == ERROR_SYMLINK_NOT_SUPPORTED)
@@ -783,9 +816,8 @@ void fs__unlink(uv_fs_t* req) {
/* Remove read-only attribute */
FILE_BASIC_INFORMATION basic = { 0 };
- basic.FileAttributes = info.dwFileAttributes
- & ~(FILE_ATTRIBUTE_READONLY)
- | FILE_ATTRIBUTE_ARCHIVE;
+ basic.FileAttributes = (info.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY) |
+ FILE_ATTRIBUTE_ARCHIVE;
status = pNtSetInformationFile(handle,
&iosb,
@@ -1196,7 +1228,7 @@ INLINE static int fs__stat_handle(HANDLE handle, uv_stat_t* statbuf,
/* st_blocks contains the on-disk allocation size in 512-byte units. */
statbuf->st_blocks =
- file_info.StandardInformation.AllocationSize.QuadPart >> 9ULL;
+ (uint64_t) file_info.StandardInformation.AllocationSize.QuadPart >> 9;
statbuf->st_nlink = file_info.StandardInformation.NumberOfLinks;
@@ -1490,6 +1522,7 @@ static void fs__chmod(uv_fs_t* req) {
static void fs__fchmod(uv_fs_t* req) {
int fd = req->file.fd;
+ int clear_archive_flag;
HANDLE handle;
NTSTATUS nt_status;
IO_STATUS_BLOCK io_status;
@@ -1497,7 +1530,11 @@ static void fs__fchmod(uv_fs_t* req) {
VERIFY_FD(fd, req);
- handle = uv__get_osfhandle(fd);
+ handle = ReOpenFile(uv__get_osfhandle(fd), FILE_WRITE_ATTRIBUTES, 0, 0);
+ if (handle == INVALID_HANDLE_VALUE) {
+ SET_REQ_WIN32_ERROR(req, GetLastError());
+ return;
+ }
nt_status = pNtQueryInformationFile(handle,
&io_status,
@@ -1507,7 +1544,27 @@ static void fs__fchmod(uv_fs_t* req) {
if (!NT_SUCCESS(nt_status)) {
SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(nt_status));
- return;
+ goto fchmod_cleanup;
+ }
+
+ /* Test if the Archive attribute is cleared */
+ if ((file_info.FileAttributes & FILE_ATTRIBUTE_ARCHIVE) == 0) {
+ /* Set Archive flag, otherwise setting or clearing the read-only
+ flag will not work */
+ file_info.FileAttributes |= FILE_ATTRIBUTE_ARCHIVE;
+ nt_status = pNtSetInformationFile(handle,
+ &io_status,
+ &file_info,
+ sizeof file_info,
+ FileBasicInformation);
+ if (!NT_SUCCESS(nt_status)) {
+ SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(nt_status));
+ goto fchmod_cleanup;
+ }
+ /* Remeber to clear the flag later on */
+ clear_archive_flag = 1;
+ } else {
+ clear_archive_flag = 0;
}
if (req->fs.info.mode & _S_IWRITE) {
@@ -1524,10 +1581,28 @@ static void fs__fchmod(uv_fs_t* req) {
if (!NT_SUCCESS(nt_status)) {
SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(nt_status));
- return;
+ goto fchmod_cleanup;
+ }
+
+ if (clear_archive_flag) {
+ file_info.FileAttributes &= ~FILE_ATTRIBUTE_ARCHIVE;
+ if (file_info.FileAttributes == 0) {
+ file_info.FileAttributes = FILE_ATTRIBUTE_NORMAL;
+ }
+ nt_status = pNtSetInformationFile(handle,
+ &io_status,
+ &file_info,
+ sizeof file_info,
+ FileBasicInformation);
+ if (!NT_SUCCESS(nt_status)) {
+ SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(nt_status));
+ goto fchmod_cleanup;
+ }
}
SET_REQ_SUCCESS(req);
+fchmod_cleanup:
+ CloseHandle(handle);
}
@@ -1787,17 +1862,13 @@ static void fs__symlink(uv_fs_t* req) {
fs__create_junction(req, pathw, new_pathw);
return;
}
- if (!pCreateSymbolicLinkW) {
- SET_REQ_UV_ERROR(req, UV_ENOSYS, ERROR_NOT_SUPPORTED);
- return;
- }
if (req->fs.info.file_flags & UV_FS_SYMLINK_DIR)
flags = SYMBOLIC_LINK_FLAG_DIRECTORY | uv__file_symlink_usermode_flag;
else
flags = uv__file_symlink_usermode_flag;
- if (pCreateSymbolicLinkW(new_pathw, pathw, flags)) {
+ if (CreateSymbolicLinkW(new_pathw, pathw, flags)) {
SET_REQ_RESULT(req, 0);
return;
}
@@ -1848,13 +1919,13 @@ static void fs__readlink(uv_fs_t* req) {
}
-static size_t fs__realpath_handle(HANDLE handle, char** realpath_ptr) {
+static ssize_t fs__realpath_handle(HANDLE handle, char** realpath_ptr) {
int r;
DWORD w_realpath_len;
WCHAR* w_realpath_ptr = NULL;
WCHAR* w_realpath_buf;
- w_realpath_len = pGetFinalPathNameByHandleW(handle, NULL, 0, VOLUME_NAME_DOS);
+ w_realpath_len = GetFinalPathNameByHandleW(handle, NULL, 0, VOLUME_NAME_DOS);
if (w_realpath_len == 0) {
return -1;
}
@@ -1866,10 +1937,8 @@ static size_t fs__realpath_handle(HANDLE handle, char** realpath_ptr) {
}
w_realpath_ptr = w_realpath_buf;
- if (pGetFinalPathNameByHandleW(handle,
- w_realpath_ptr,
- w_realpath_len,
- VOLUME_NAME_DOS) == 0) {
+ if (GetFinalPathNameByHandleW(
+ handle, w_realpath_ptr, w_realpath_len, VOLUME_NAME_DOS) == 0) {
uv__free(w_realpath_buf);
SetLastError(ERROR_INVALID_HANDLE);
return -1;
@@ -1901,11 +1970,6 @@ static size_t fs__realpath_handle(HANDLE handle, char** realpath_ptr) {
static void fs__realpath(uv_fs_t* req) {
HANDLE handle;
- if (!pGetFinalPathNameByHandleW) {
- SET_REQ_UV_ERROR(req, UV_ENOSYS, ERROR_NOT_SUPPORTED);
- return;
- }
-
handle = CreateFileW(req->file.pathw,
0,
0,
@@ -1940,6 +2004,10 @@ static void fs__fchown(uv_fs_t* req) {
}
+static void fs__lchown(uv_fs_t* req) {
+ req->result = 0;
+}
+
static void uv__fs_work(struct uv__work* w) {
uv_fs_t* req;
@@ -1977,6 +2045,7 @@ static void uv__fs_work(struct uv__work* w) {
XX(REALPATH, realpath)
XX(CHOWN, chown)
XX(FCHOWN, fchown);
+ XX(LCHOWN, lchown);
default:
assert(!"bad uv_fs_type");
}
@@ -2262,6 +2331,19 @@ int uv_fs_fchown(uv_loop_t* loop, uv_fs_t* req, uv_file fd, uv_uid_t uid,
}
+int uv_fs_lchown(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_uid_t uid,
+ uv_gid_t gid, uv_fs_cb cb) {
+ int err;
+
+ INIT(UV_FS_LCHOWN);
+ err = fs__capture_path(req, path, NULL, cb != NULL);
+ if (err) {
+ return uv_translate_sys_error(err);
+ }
+ POST;
+}
+
+
int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) {
int err;
diff --git a/Utilities/cmlibuv/src/win/getaddrinfo.c b/Utilities/cmlibuv/src/win/getaddrinfo.c
index 5adc7663b..dfab860a7 100644
--- a/Utilities/cmlibuv/src/win/getaddrinfo.c
+++ b/Utilities/cmlibuv/src/win/getaddrinfo.c
@@ -24,6 +24,7 @@
#include "uv.h"
#include "internal.h"
#include "req-inl.h"
+#include "idna.h"
/* EAI_* constants. */
#include <winsock2.h>
@@ -71,8 +72,8 @@ int uv__getaddrinfo_translate_error(int sys_err) {
#endif
-/* adjust size value to be multiple of 4. Use to keep pointer aligned */
-/* Do we need different versions of this for different architectures? */
+/* Adjust size value to be multiple of 4. Use to keep pointer aligned.
+ * Do we need different versions of this for different architectures? */
#define ALIGNED_SIZE(X) ((((X) + 3) >> 2) << 2)
#ifndef NDIS_IF_MAX_STRING_SIZE
@@ -124,8 +125,7 @@ static void uv__getaddrinfo_done(struct uv__work* w, int status) {
}
if (req->retcode == 0) {
- /* convert addrinfoW to addrinfo */
- /* first calculate required length */
+ /* Convert addrinfoW to addrinfo. First calculate required length. */
addrinfow_ptr = req->addrinfow;
while (addrinfow_ptr != NULL) {
addrinfo_len += addrinfo_struct_len +
@@ -260,11 +260,13 @@ int uv_getaddrinfo(uv_loop_t* loop,
const char* node,
const char* service,
const struct addrinfo* hints) {
+ char hostname_ascii[256];
int nodesize = 0;
int servicesize = 0;
int hintssize = 0;
char* alloc_ptr = NULL;
int err;
+ long rc;
if (req == NULL || (node == NULL && service == NULL)) {
return UV_EINVAL;
@@ -278,12 +280,19 @@ int uv_getaddrinfo(uv_loop_t* loop,
/* calculate required memory size for all input values */
if (node != NULL) {
- nodesize = ALIGNED_SIZE(MultiByteToWideChar(CP_UTF8, 0, node, -1, NULL, 0) *
- sizeof(WCHAR));
+ rc = uv__idna_toascii(node,
+ node + strlen(node),
+ hostname_ascii,
+ hostname_ascii + sizeof(hostname_ascii));
+ if (rc < 0)
+ return rc;
+ nodesize = ALIGNED_SIZE(MultiByteToWideChar(CP_UTF8, 0, hostname_ascii,
+ -1, NULL, 0) * sizeof(WCHAR));
if (nodesize == 0) {
err = GetLastError();
goto error;
}
+ node = hostname_ascii;
}
if (service != NULL) {
@@ -313,8 +322,8 @@ int uv_getaddrinfo(uv_loop_t* loop,
/* save alloc_ptr now so we can free if error */
req->alloc = (void*)alloc_ptr;
- /* convert node string to UTF16 into allocated memory and save pointer in */
- /* the request. */
+ /* Convert node string to UTF16 into allocated memory and save pointer in the
+ * request. */
if (node != NULL) {
req->node = (WCHAR*)alloc_ptr;
if (MultiByteToWideChar(CP_UTF8,
@@ -331,8 +340,8 @@ int uv_getaddrinfo(uv_loop_t* loop,
req->node = NULL;
}
- /* convert service string to UTF16 into allocated memory and save pointer */
- /* in the req. */
+ /* Convert service string to UTF16 into allocated memory and save pointer in
+ * the req. */
if (service != NULL) {
req->service = (WCHAR*)alloc_ptr;
if (MultiByteToWideChar(CP_UTF8,
@@ -369,6 +378,7 @@ int uv_getaddrinfo(uv_loop_t* loop,
if (getaddrinfo_cb) {
uv__work_submit(loop,
&req->work_req,
+ UV__WORK_SLOW_IO,
uv__getaddrinfo_work,
uv__getaddrinfo_done);
return 0;
@@ -392,21 +402,15 @@ int uv_if_indextoname(unsigned int ifindex, char* buffer, size_t* size) {
DWORD bufsize;
int r;
- uv__once_init();
-
if (buffer == NULL || size == NULL || *size == 0)
return UV_EINVAL;
- if (pConvertInterfaceIndexToLuid == NULL)
- return UV_ENOSYS;
- r = pConvertInterfaceIndexToLuid(ifindex, &luid);
+ r = ConvertInterfaceIndexToLuid(ifindex, &luid);
if (r != 0)
return uv_translate_sys_error(r);
- if (pConvertInterfaceLuidToNameW == NULL)
- return UV_ENOSYS;
- r = pConvertInterfaceLuidToNameW(&luid, wname, ARRAY_SIZE(wname));
+ r = ConvertInterfaceLuidToNameW(&luid, wname, ARRAY_SIZE(wname));
if (r != 0)
return uv_translate_sys_error(r);
diff --git a/Utilities/cmlibuv/src/win/getnameinfo.c b/Utilities/cmlibuv/src/win/getnameinfo.c
index 9f10cd2a5..b3773380c 100644
--- a/Utilities/cmlibuv/src/win/getnameinfo.c
+++ b/Utilities/cmlibuv/src/win/getnameinfo.c
@@ -42,7 +42,7 @@ static void uv__getnameinfo_work(struct uv__work* w) {
uv_getnameinfo_t* req;
WCHAR host[NI_MAXHOST];
WCHAR service[NI_MAXSERV];
- int ret = 0;
+ int ret;
req = container_of(w, uv_getnameinfo_t, work_req);
if (GetNameInfoW((struct sockaddr*)&req->storage,
@@ -53,27 +53,34 @@ static void uv__getnameinfo_work(struct uv__work* w) {
ARRAY_SIZE(service),
req->flags)) {
ret = WSAGetLastError();
+ req->retcode = uv__getaddrinfo_translate_error(ret);
+ return;
+ }
+
+ ret = WideCharToMultiByte(CP_UTF8,
+ 0,
+ host,
+ -1,
+ req->host,
+ sizeof(req->host),
+ NULL,
+ NULL);
+ if (ret == 0) {
+ req->retcode = uv_translate_sys_error(GetLastError());
+ return;
+ }
+
+ ret = WideCharToMultiByte(CP_UTF8,
+ 0,
+ service,
+ -1,
+ req->service,
+ sizeof(req->service),
+ NULL,
+ NULL);
+ if (ret == 0) {
+ req->retcode = uv_translate_sys_error(GetLastError());
}
- req->retcode = uv__getaddrinfo_translate_error(ret);
-
- /* convert results to UTF-8 */
- WideCharToMultiByte(CP_UTF8,
- 0,
- host,
- -1,
- req->host,
- sizeof(req->host),
- NULL,
- NULL);
-
- WideCharToMultiByte(CP_UTF8,
- 0,
- service,
- -1,
- req->service,
- sizeof(req->service),
- NULL,
- NULL);
}
@@ -138,6 +145,7 @@ int uv_getnameinfo(uv_loop_t* loop,
if (getnameinfo_cb) {
uv__work_submit(loop,
&req->work_req,
+ UV__WORK_SLOW_IO,
uv__getnameinfo_work,
uv__getnameinfo_done);
return 0;
diff --git a/Utilities/cmlibuv/src/win/handle-inl.h b/Utilities/cmlibuv/src/win/handle-inl.h
index 8d0334cc5..82c657d57 100644
--- a/Utilities/cmlibuv/src/win/handle-inl.h
+++ b/Utilities/cmlibuv/src/win/handle-inl.h
@@ -32,7 +32,7 @@
#define DECREASE_ACTIVE_COUNT(loop, handle) \
do { \
if (--(handle)->activecnt == 0 && \
- !((handle)->flags & UV__HANDLE_CLOSING)) { \
+ !((handle)->flags & UV_HANDLE_CLOSING)) { \
uv__handle_stop((handle)); \
} \
assert((handle)->activecnt >= 0); \
@@ -53,7 +53,7 @@
assert(handle->reqs_pending > 0); \
handle->reqs_pending--; \
\
- if (handle->flags & UV__HANDLE_CLOSING && \
+ if (handle->flags & UV_HANDLE_CLOSING && \
handle->reqs_pending == 0) { \
uv_want_endgame(loop, (uv_handle_t*)handle); \
} \
@@ -62,14 +62,14 @@
#define uv__handle_closing(handle) \
do { \
- assert(!((handle)->flags & UV__HANDLE_CLOSING)); \
+ assert(!((handle)->flags & UV_HANDLE_CLOSING)); \
\
- if (!(((handle)->flags & UV__HANDLE_ACTIVE) && \
- ((handle)->flags & UV__HANDLE_REF))) \
+ if (!(((handle)->flags & UV_HANDLE_ACTIVE) && \
+ ((handle)->flags & UV_HANDLE_REF))) \
uv__active_handle_add((uv_handle_t*) (handle)); \
\
- (handle)->flags |= UV__HANDLE_CLOSING; \
- (handle)->flags &= ~UV__HANDLE_ACTIVE; \
+ (handle)->flags |= UV_HANDLE_CLOSING; \
+ (handle)->flags &= ~UV_HANDLE_ACTIVE; \
} while (0)
@@ -126,7 +126,8 @@ INLINE static void uv_process_endgames(uv_loop_t* loop) {
break;
case UV_TIMER:
- uv_timer_endgame(loop, (uv_timer_t*) handle);
+ uv__timer_close((uv_timer_t*) handle);
+ uv__handle_close(handle);
break;
case UV_PREPARE:
@@ -164,10 +165,10 @@ INLINE static void uv_process_endgames(uv_loop_t* loop) {
INLINE static HANDLE uv__get_osfhandle(int fd)
{
- /* _get_osfhandle() raises an assert in debug builds if the FD is invalid. */
- /* But it also correctly checks the FD and returns INVALID_HANDLE_VALUE */
- /* for invalid FDs in release builds (or if you let the assert continue). */
- /* So this wrapper function disables asserts when calling _get_osfhandle. */
+ /* _get_osfhandle() raises an assert in debug builds if the FD is invalid.
+ * But it also correctly checks the FD and returns INVALID_HANDLE_VALUE for
+ * invalid FDs in release builds (or if you let the assert continue). So this
+ * wrapper function disables asserts when calling _get_osfhandle. */
HANDLE handle;
UV_BEGIN_DISABLE_CRT_ASSERT();
diff --git a/Utilities/cmlibuv/src/win/handle.c b/Utilities/cmlibuv/src/win/handle.c
index 39150702d..9d76c3f54 100644
--- a/Utilities/cmlibuv/src/win/handle.c
+++ b/Utilities/cmlibuv/src/win/handle.c
@@ -59,15 +59,15 @@ uv_handle_type uv_guess_handle(uv_file file) {
int uv_is_active(const uv_handle_t* handle) {
- return (handle->flags & UV__HANDLE_ACTIVE) &&
- !(handle->flags & UV__HANDLE_CLOSING);
+ return (handle->flags & UV_HANDLE_ACTIVE) &&
+ !(handle->flags & UV_HANDLE_CLOSING);
}
void uv_close(uv_handle_t* handle, uv_close_cb cb) {
uv_loop_t* loop = handle->loop;
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
assert(0);
return;
}
@@ -150,10 +150,14 @@ void uv_close(uv_handle_t* handle, uv_close_cb cb) {
int uv_is_closing(const uv_handle_t* handle) {
- return !!(handle->flags & (UV__HANDLE_CLOSING | UV_HANDLE_CLOSED));
+ return !!(handle->flags & (UV_HANDLE_CLOSING | UV_HANDLE_CLOSED));
}
uv_os_fd_t uv_get_osfhandle(int fd) {
return uv__get_osfhandle(fd);
}
+
+int uv_open_osfhandle(uv_os_fd_t os_fd) {
+ return _open_osfhandle((intptr_t) os_fd, 0);
+}
diff --git a/Utilities/cmlibuv/src/win/internal.h b/Utilities/cmlibuv/src/win/internal.h
index 849bc8290..206ab5f62 100644
--- a/Utilities/cmlibuv/src/win/internal.h
+++ b/Utilities/cmlibuv/src/win/internal.h
@@ -29,7 +29,7 @@
#include "uv.h"
#include "../uv-common.h"
-#include "tree.h"
+#include "uv/tree.h"
#include "winapi.h"
#include "winsock.h"
@@ -62,77 +62,19 @@ extern UV_THREAD_LOCAL int uv__crt_assert_enabled;
#endif
/*
- * Handles
- * (also see handle-inl.h)
- */
-
-/* Used by all handles. */
-#define UV_HANDLE_CLOSED 0x00000002
-#define UV_HANDLE_ENDGAME_QUEUED 0x00000008
-
-/* uv-common.h: #define UV__HANDLE_CLOSING 0x00000001 */
-/* uv-common.h: #define UV__HANDLE_ACTIVE 0x00000040 */
-/* uv-common.h: #define UV__HANDLE_REF 0x00000020 */
-/* uv-common.h: #define UV_HANDLE_INTERNAL 0x00000080 */
-
-/* Used by streams and UDP handles. */
-#define UV_HANDLE_READING 0x00000100
-#define UV_HANDLE_BOUND 0x00000200
-#define UV_HANDLE_LISTENING 0x00000800
-#define UV_HANDLE_CONNECTION 0x00001000
-#define UV_HANDLE_READABLE 0x00008000
-#define UV_HANDLE_WRITABLE 0x00010000
-#define UV_HANDLE_READ_PENDING 0x00020000
-#define UV_HANDLE_SYNC_BYPASS_IOCP 0x00040000
-#define UV_HANDLE_ZERO_READ 0x00080000
-#define UV_HANDLE_EMULATE_IOCP 0x00100000
-#define UV_HANDLE_BLOCKING_WRITES 0x00200000
-#define UV_HANDLE_CANCELLATION_PENDING 0x00400000
-
-/* Used by uv_tcp_t and uv_udp_t handles */
-#define UV_HANDLE_IPV6 0x01000000
-
-/* Only used by uv_tcp_t handles. */
-#define UV_HANDLE_TCP_NODELAY 0x02000000
-#define UV_HANDLE_TCP_KEEPALIVE 0x04000000
-#define UV_HANDLE_TCP_SINGLE_ACCEPT 0x08000000
-#define UV_HANDLE_TCP_ACCEPT_STATE_CHANGING 0x10000000
-#define UV_HANDLE_TCP_SOCKET_CLOSED 0x20000000
-#define UV_HANDLE_SHARED_TCP_SOCKET 0x40000000
-
-/* Only used by uv_pipe_t handles. */
-#define UV_HANDLE_NON_OVERLAPPED_PIPE 0x01000000
-#define UV_HANDLE_PIPESERVER 0x02000000
-#define UV_HANDLE_PIPE_READ_CANCELABLE 0x04000000
-
-/* Only used by uv_tty_t handles. */
-#define UV_HANDLE_TTY_READABLE 0x01000000
-#define UV_HANDLE_TTY_RAW 0x02000000
-#define UV_HANDLE_TTY_SAVED_POSITION 0x04000000
-#define UV_HANDLE_TTY_SAVED_ATTRIBUTES 0x08000000
-
-/* Only used by uv_poll_t handles. */
-#define UV_HANDLE_POLL_SLOW 0x02000000
-
-
-/*
- * Requests: see req-inl.h
- */
-
-
-/*
- * Streams: see stream-inl.h
- */
-
-
-/*
* TCP
*/
+typedef enum {
+ UV__IPC_SOCKET_XFER_NONE = 0,
+ UV__IPC_SOCKET_XFER_TCP_CONNECTION,
+ UV__IPC_SOCKET_XFER_TCP_SERVER
+} uv__ipc_socket_xfer_type_t;
+
typedef struct {
WSAPROTOCOL_INFOW socket_info;
- int delayed_error;
-} uv__ipc_socket_info_ex;
+ uint32_t delayed_error;
+} uv__ipc_socket_xfer_info_t;
int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb);
int uv_tcp_accept(uv_tcp_t* server, uv_tcp_t* client);
@@ -154,11 +96,13 @@ void uv_process_tcp_connect_req(uv_loop_t* loop, uv_tcp_t* handle,
void uv_tcp_close(uv_loop_t* loop, uv_tcp_t* tcp);
void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle);
-int uv_tcp_import(uv_tcp_t* tcp, uv__ipc_socket_info_ex* socket_info_ex,
- int tcp_connection);
-
-int uv_tcp_duplicate_socket(uv_tcp_t* handle, int pid,
- LPWSAPROTOCOL_INFOW protocol_info);
+int uv__tcp_xfer_export(uv_tcp_t* handle,
+ int pid,
+ uv__ipc_socket_xfer_type_t* xfer_type,
+ uv__ipc_socket_xfer_info_t* xfer_info);
+int uv__tcp_xfer_import(uv_tcp_t* tcp,
+ uv__ipc_socket_xfer_type_t xfer_type,
+ uv__ipc_socket_xfer_info_t* xfer_info);
/*
@@ -182,14 +126,14 @@ int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb);
int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client);
int uv_pipe_read_start(uv_pipe_t* handle, uv_alloc_cb alloc_cb,
uv_read_cb read_cb);
-int uv_pipe_write(uv_loop_t* loop, uv_write_t* req, uv_pipe_t* handle,
- const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb);
-int uv_pipe_write2(uv_loop_t* loop, uv_write_t* req, uv_pipe_t* handle,
- const uv_buf_t bufs[], unsigned int nbufs, uv_stream_t* send_handle,
- uv_write_cb cb);
-void uv__pipe_pause_read(uv_pipe_t* handle);
-void uv__pipe_unpause_read(uv_pipe_t* handle);
-void uv__pipe_stop_read(uv_pipe_t* handle);
+void uv__pipe_read_stop(uv_pipe_t* handle);
+int uv__pipe_write(uv_loop_t* loop,
+ uv_write_t* req,
+ uv_pipe_t* handle,
+ const uv_buf_t bufs[],
+ size_t nbufs,
+ uv_stream_t* send_handle,
+ uv_write_cb cb);
void uv_process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle,
uv_req_t* req);
@@ -252,15 +196,6 @@ void uv_poll_endgame(uv_loop_t* loop, uv_poll_t* handle);
/*
- * Timers
- */
-void uv_timer_endgame(uv_loop_t* loop, uv_timer_t* handle);
-
-DWORD uv__next_timeout(const uv_loop_t* loop);
-void uv_process_timers(uv_loop_t* loop);
-
-
-/*
* Loop watchers
*/
void uv_loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle);
@@ -336,7 +271,6 @@ void uv__fs_poll_endgame(uv_loop_t* loop, uv_fs_poll_t* handle);
void uv__util_init(void);
uint64_t uv__hrtime(double scale);
-int uv_current_pid(void);
__declspec(noreturn) void uv_fatal_error(const int errorno, const char* syscall);
int uv__getpwuid_r(uv_passwd_t* pwd);
int uv__convert_utf16_to_utf8(const WCHAR* utf16, int utf16len, char** utf8);
diff --git a/Utilities/cmlibuv/src/win/loop-watcher.c b/Utilities/cmlibuv/src/win/loop-watcher.c
index 20e4509f8..ad7fbea16 100644
--- a/Utilities/cmlibuv/src/win/loop-watcher.c
+++ b/Utilities/cmlibuv/src/win/loop-watcher.c
@@ -27,7 +27,7 @@
void uv_loop_watcher_endgame(uv_loop_t* loop, uv_handle_t* handle) {
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
handle->flags |= UV_HANDLE_CLOSED;
uv__handle_close(handle);
diff --git a/Utilities/cmlibuv/src/win/pipe.c b/Utilities/cmlibuv/src/win/pipe.c
index 83ee4f99c..277f6497a 100644
--- a/Utilities/cmlibuv/src/win/pipe.c
+++ b/Utilities/cmlibuv/src/win/pipe.c
@@ -21,39 +21,28 @@
#include <assert.h>
#include <io.h>
-#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
-#include "uv.h"
-#include "internal.h"
#include "handle-inl.h"
-#include "stream-inl.h"
+#include "internal.h"
#include "req-inl.h"
+#include "stream-inl.h"
+#include "uv-common.h"
+#include "uv.h"
#include <aclapi.h>
#include <accctrl.h>
-typedef struct uv__ipc_queue_item_s uv__ipc_queue_item_t;
-
-struct uv__ipc_queue_item_s {
- /*
- * NOTE: It is important for socket_info_ex to be the first field,
- * because we will we assigning it to the pending_ipc_info.socket_info
- */
- uv__ipc_socket_info_ex socket_info_ex;
- QUEUE member;
- int tcp_connection;
-};
-
/* A zero-size buffer for use by uv_pipe_read */
static char uv_zero_[] = "";
/* Null uv_buf_t */
static const uv_buf_t uv_null_buf_ = { 0, NULL };
-/* The timeout that the pipe will wait for the remote end to write data */
-/* when the local ends wants to shut it down. */
+/* The timeout that the pipe will wait for the remote end to write data when
+ * the local ends wants to shut it down. */
static const int64_t eof_timeout = 50; /* ms */
static const int default_pending_pipe_instances = 4;
@@ -62,22 +51,44 @@ static const int default_pending_pipe_instances = 4;
static char pipe_prefix[] = "\\\\?\\pipe";
static const int pipe_prefix_len = sizeof(pipe_prefix) - 1;
-/* IPC protocol flags. */
-#define UV_IPC_RAW_DATA 0x0001
-#define UV_IPC_TCP_SERVER 0x0002
-#define UV_IPC_TCP_CONNECTION 0x0004
+/* IPC incoming xfer queue item. */
+typedef struct {
+ uv__ipc_socket_xfer_type_t xfer_type;
+ uv__ipc_socket_xfer_info_t xfer_info;
+ QUEUE member;
+} uv__ipc_xfer_queue_item_t;
+
+/* IPC frame header flags. */
+/* clang-format off */
+enum {
+ UV__IPC_FRAME_HAS_DATA = 0x01,
+ UV__IPC_FRAME_HAS_SOCKET_XFER = 0x02,
+ UV__IPC_FRAME_XFER_IS_TCP_CONNECTION = 0x04,
+ /* These are combinations of the flags above. */
+ UV__IPC_FRAME_XFER_FLAGS = 0x06,
+ UV__IPC_FRAME_VALID_FLAGS = 0x07
+};
+/* clang-format on */
/* IPC frame header. */
typedef struct {
- int flags;
- uint64_t raw_data_length;
-} uv_ipc_frame_header_t;
-
-/* IPC frame, which contains an imported TCP socket stream. */
+ uint32_t flags;
+ uint32_t reserved1; /* Ignored. */
+ uint32_t data_length; /* Must be zero if there is no data. */
+ uint32_t reserved2; /* Must be zero. */
+} uv__ipc_frame_header_t;
+
+/* To implement the IPC protocol correctly, these structures must have exactly
+ * the right size. */
+STATIC_ASSERT(sizeof(uv__ipc_frame_header_t) == 16);
+STATIC_ASSERT(sizeof(uv__ipc_socket_xfer_info_t) == 632);
+
+/* Coalesced write request. */
typedef struct {
- uv_ipc_frame_header_t header;
- uv__ipc_socket_info_ex socket_info_ex;
-} uv_ipc_frame_uv_stream;
+ uv_write_t req; /* Internal heap-allocated write request. */
+ uv_write_t* user_req; /* Pointer to user-specified uv_write_t. */
+} uv__coalesced_write_t;
+
static void eof_timer_init(uv_pipe_t* pipe);
static void eof_timer_start(uv_pipe_t* pipe);
@@ -98,15 +109,12 @@ int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) {
handle->reqs_pending = 0;
handle->handle = INVALID_HANDLE_VALUE;
handle->name = NULL;
- handle->pipe.conn.ipc_pid = 0;
- handle->pipe.conn.remaining_ipc_rawdata_bytes = 0;
- QUEUE_INIT(&handle->pipe.conn.pending_ipc_info.queue);
- handle->pipe.conn.pending_ipc_info.queue_len = 0;
+ handle->pipe.conn.ipc_remote_pid = 0;
+ handle->pipe.conn.ipc_data_frame.payload_remaining = 0;
+ QUEUE_INIT(&handle->pipe.conn.ipc_xfer_queue);
+ handle->pipe.conn.ipc_xfer_queue_length = 0;
handle->ipc = ipc;
handle->pipe.conn.non_overlapped_writes_tail = NULL;
- handle->pipe.conn.readfile_thread = NULL;
-
- UV_REQ_INIT(&handle->pipe.conn.ipc_header_write_req, UV_UNKNOWN_REQ);
return 0;
}
@@ -117,10 +125,9 @@ static void uv_pipe_connection_init(uv_pipe_t* handle) {
handle->read_req.data = handle;
handle->pipe.conn.eof_timer = NULL;
assert(!(handle->flags & UV_HANDLE_PIPESERVER));
- if (pCancelSynchronousIo &&
- handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
- uv_mutex_init(&handle->pipe.conn.readfile_mutex);
- handle->flags |= UV_HANDLE_PIPE_READ_CANCELABLE;
+ if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
+ handle->pipe.conn.readfile_thread_handle = NULL;
+ InitializeCriticalSection(&handle->pipe.conn.readfile_thread_lock);
}
}
@@ -347,12 +354,7 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
NTSTATUS nt_status;
IO_STATUS_BLOCK io_status;
FILE_PIPE_LOCAL_INFORMATION pipe_info;
- uv__ipc_queue_item_t* item;
-
- if (handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE) {
- handle->flags &= ~UV_HANDLE_PIPE_READ_CANCELABLE;
- uv_mutex_destroy(&handle->pipe.conn.readfile_mutex);
- }
+ uv__ipc_xfer_queue_item_t* xfer_queue_item;
if ((handle->flags & UV_HANDLE_CONNECTION) &&
handle->stream.conn.shutdown_req != NULL &&
@@ -362,7 +364,7 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
/* Clear the shutdown_req field so we don't go here again. */
handle->stream.conn.shutdown_req = NULL;
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
UNREGISTER_HANDLE_REQ(loop, handle, req);
/* Already closing. Cancel the shutdown. */
@@ -423,33 +425,33 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
}
}
- if (handle->flags & UV__HANDLE_CLOSING &&
+ if (handle->flags & UV_HANDLE_CLOSING &&
handle->reqs_pending == 0) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
if (handle->flags & UV_HANDLE_CONNECTION) {
/* Free pending sockets */
- while (!QUEUE_EMPTY(&handle->pipe.conn.pending_ipc_info.queue)) {
+ while (!QUEUE_EMPTY(&handle->pipe.conn.ipc_xfer_queue)) {
QUEUE* q;
SOCKET socket;
- q = QUEUE_HEAD(&handle->pipe.conn.pending_ipc_info.queue);
+ q = QUEUE_HEAD(&handle->pipe.conn.ipc_xfer_queue);
QUEUE_REMOVE(q);
- item = QUEUE_DATA(q, uv__ipc_queue_item_t, member);
+ xfer_queue_item = QUEUE_DATA(q, uv__ipc_xfer_queue_item_t, member);
/* Materialize socket and close it */
socket = WSASocketW(FROM_PROTOCOL_INFO,
FROM_PROTOCOL_INFO,
FROM_PROTOCOL_INFO,
- &item->socket_info_ex.socket_info,
+ &xfer_queue_item->xfer_info.socket_info,
0,
WSA_FLAG_OVERLAPPED);
- uv__free(item);
+ uv__free(xfer_queue_item);
if (socket != INVALID_SOCKET)
closesocket(socket);
}
- handle->pipe.conn.pending_ipc_info.queue_len = 0;
+ handle->pipe.conn.ipc_xfer_queue_length = 0;
if (handle->flags & UV_HANDLE_EMULATE_IOCP) {
if (handle->read_req.wait_handle != INVALID_HANDLE_VALUE) {
@@ -461,6 +463,9 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) {
handle->read_req.event_handle = NULL;
}
}
+
+ if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE)
+ DeleteCriticalSection(&handle->pipe.conn.readfile_thread_lock);
}
if (handle->flags & UV_HANDLE_PIPESERVER) {
@@ -595,8 +600,8 @@ static DWORD WINAPI pipe_connect_thread_proc(void* parameter) {
loop = handle->loop;
assert(loop);
- /* We're here because CreateFile on a pipe returned ERROR_PIPE_BUSY. */
- /* We wait for the pipe to become available with WaitNamedPipe. */
+ /* We're here because CreateFile on a pipe returned ERROR_PIPE_BUSY. We wait
+ * for the pipe to become available with WaitNamedPipe. */
while (WaitNamedPipeW(handle->name, 30000)) {
/* The pipe is now available, try to connect. */
pipeHandle = open_named_pipe(handle->name, &duplex_flags);
@@ -706,55 +711,68 @@ error:
}
-void uv__pipe_pause_read(uv_pipe_t* handle) {
- if (handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE) {
- /* Pause the ReadFile task briefly, to work
- around the Windows kernel bug that causes
- any access to a NamedPipe to deadlock if
- any process has called ReadFile */
- HANDLE h;
- uv_mutex_lock(&handle->pipe.conn.readfile_mutex);
- h = handle->pipe.conn.readfile_thread;
- while (h) {
- /* spinlock: we expect this to finish quickly,
- or we are probably about to deadlock anyways
- (in the kernel), so it doesn't matter */
- pCancelSynchronousIo(h);
- SwitchToThread(); /* yield thread control briefly */
- h = handle->pipe.conn.readfile_thread;
- }
- }
-}
+void uv__pipe_interrupt_read(uv_pipe_t* handle) {
+ BOOL r;
+
+ if (!(handle->flags & UV_HANDLE_READ_PENDING))
+ return; /* No pending reads. */
+ if (handle->flags & UV_HANDLE_CANCELLATION_PENDING)
+ return; /* Already cancelled. */
+ if (handle->handle == INVALID_HANDLE_VALUE)
+ return; /* Pipe handle closed. */
+ if (!(handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE)) {
+ /* Cancel asynchronous read. */
+ r = CancelIoEx(handle->handle, &handle->read_req.u.io.overlapped);
+ assert(r || GetLastError() == ERROR_NOT_FOUND);
-void uv__pipe_unpause_read(uv_pipe_t* handle) {
- if (handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE) {
- uv_mutex_unlock(&handle->pipe.conn.readfile_mutex);
+ } else {
+ /* Cancel synchronous read (which is happening in the thread pool). */
+ HANDLE thread;
+ volatile HANDLE* thread_ptr = &handle->pipe.conn.readfile_thread_handle;
+
+ EnterCriticalSection(&handle->pipe.conn.readfile_thread_lock);
+
+ thread = *thread_ptr;
+ if (thread == NULL) {
+ /* The thread pool thread has not yet reached the point of blocking, we
+ * can pre-empt it by setting thread_handle to INVALID_HANDLE_VALUE. */
+ *thread_ptr = INVALID_HANDLE_VALUE;
+
+ } else {
+ /* Spin until the thread has acknowledged (by setting the thread to
+ * INVALID_HANDLE_VALUE) that it is past the point of blocking. */
+ while (thread != INVALID_HANDLE_VALUE) {
+ r = CancelSynchronousIo(thread);
+ assert(r || GetLastError() == ERROR_NOT_FOUND);
+ SwitchToThread(); /* Yield thread. */
+ thread = *thread_ptr;
+ }
+ }
+
+ LeaveCriticalSection(&handle->pipe.conn.readfile_thread_lock);
}
+
+ /* Set flag to indicate that read has been cancelled. */
+ handle->flags |= UV_HANDLE_CANCELLATION_PENDING;
}
-void uv__pipe_stop_read(uv_pipe_t* handle) {
- if (pCancelIoEx &&
- !(handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) &&
- !(handle->flags & UV_HANDLE_EMULATE_IOCP) &&
- handle->flags & UV_HANDLE_READING &&
- handle->read_req.type == UV_READ) {
- pCancelIoEx(handle->handle, &handle->read_req.u.io.overlapped);
- }
+void uv__pipe_read_stop(uv_pipe_t* handle) {
handle->flags &= ~UV_HANDLE_READING;
- uv__pipe_pause_read((uv_pipe_t*)handle);
- uv__pipe_unpause_read((uv_pipe_t*)handle);
+ DECREASE_ACTIVE_COUNT(handle->loop, handle);
+
+ uv__pipe_interrupt_read(handle);
}
-/* Cleans up uv_pipe_t (server or connection) and all resources associated */
-/* with it. */
+/* Cleans up uv_pipe_t (server or connection) and all resources associated with
+ * it. */
void uv_pipe_cleanup(uv_loop_t* loop, uv_pipe_t* handle) {
int i;
HANDLE pipeHandle;
- uv__pipe_stop_read(handle);
+ uv__pipe_interrupt_read(handle);
if (handle->name) {
uv__free(handle->name);
@@ -864,23 +882,22 @@ int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client) {
uv_pipe_t* pipe_client;
uv_pipe_accept_t* req;
QUEUE* q;
- uv__ipc_queue_item_t* item;
+ uv__ipc_xfer_queue_item_t* item;
int err;
if (server->ipc) {
- if (QUEUE_EMPTY(&server->pipe.conn.pending_ipc_info.queue)) {
+ if (QUEUE_EMPTY(&server->pipe.conn.ipc_xfer_queue)) {
/* No valid pending sockets. */
return WSAEWOULDBLOCK;
}
- q = QUEUE_HEAD(&server->pipe.conn.pending_ipc_info.queue);
+ q = QUEUE_HEAD(&server->pipe.conn.ipc_xfer_queue);
QUEUE_REMOVE(q);
- server->pipe.conn.pending_ipc_info.queue_len--;
- item = QUEUE_DATA(q, uv__ipc_queue_item_t, member);
+ server->pipe.conn.ipc_xfer_queue_length--;
+ item = QUEUE_DATA(q, uv__ipc_xfer_queue_item_t, member);
- err = uv_tcp_import((uv_tcp_t*)client,
- &item->socket_info_ex,
- item->tcp_connection);
+ err = uv__tcp_xfer_import(
+ (uv_tcp_t*) client, item->xfer_type, &item->xfer_info);
if (err != 0)
return err;
@@ -889,8 +906,8 @@ int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client) {
} else {
pipe_client = (uv_pipe_t*)client;
- /* Find a connection instance that has been connected, but not yet */
- /* accepted. */
+ /* Find a connection instance that has been connected, but not yet
+ * accepted. */
req = server->pipe.serv.pending_accepts;
if (!req) {
@@ -908,7 +925,7 @@ int uv_pipe_accept(uv_pipe_t* server, uv_stream_t* client) {
req->next_pending = NULL;
req->pipeHandle = INVALID_HANDLE_VALUE;
- if (!(server->flags & UV__HANDLE_CLOSING)) {
+ if (!(server->flags & UV_HANDLE_CLOSING)) {
uv_pipe_queue_accept(loop, server, req, FALSE);
}
}
@@ -953,74 +970,75 @@ int uv_pipe_listen(uv_pipe_t* handle, int backlog, uv_connection_cb cb) {
}
-static DWORD WINAPI uv_pipe_zero_readfile_thread_proc(void* parameter) {
- int result;
- DWORD bytes;
- uv_read_t* req = (uv_read_t*) parameter;
+static DWORD WINAPI uv_pipe_zero_readfile_thread_proc(void* arg) {
+ uv_read_t* req = (uv_read_t*) arg;
uv_pipe_t* handle = (uv_pipe_t*) req->data;
uv_loop_t* loop = handle->loop;
- HANDLE hThread = NULL;
+ volatile HANDLE* thread_ptr = &handle->pipe.conn.readfile_thread_handle;
+ CRITICAL_SECTION* lock = &handle->pipe.conn.readfile_thread_lock;
+ HANDLE thread;
+ DWORD bytes;
DWORD err;
- uv_mutex_t *m = &handle->pipe.conn.readfile_mutex;
- assert(req != NULL);
assert(req->type == UV_READ);
assert(handle->type == UV_NAMED_PIPE);
- if (handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE) {
- uv_mutex_lock(m); /* mutex controls *setting* of readfile_thread */
- if (DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
- GetCurrentProcess(), &hThread,
- 0, FALSE, DUPLICATE_SAME_ACCESS)) {
- handle->pipe.conn.readfile_thread = hThread;
- } else {
- hThread = NULL;
- }
- uv_mutex_unlock(m);
+ err = 0;
+
+ /* Create a handle to the current thread. */
+ if (!DuplicateHandle(GetCurrentProcess(),
+ GetCurrentThread(),
+ GetCurrentProcess(),
+ &thread,
+ 0,
+ FALSE,
+ DUPLICATE_SAME_ACCESS)) {
+ err = GetLastError();
+ goto out1;
}
-restart_readfile:
- if (handle->flags & UV_HANDLE_READING) {
- result = ReadFile(handle->handle,
- &uv_zero_,
- 0,
- &bytes,
- NULL);
- if (!result) {
- err = GetLastError();
- if (err == ERROR_OPERATION_ABORTED &&
- handle->flags & UV_HANDLE_PIPE_READ_CANCELABLE) {
- if (handle->flags & UV_HANDLE_READING) {
- /* just a brief break to do something else */
- handle->pipe.conn.readfile_thread = NULL;
- /* resume after it is finished */
- uv_mutex_lock(m);
- handle->pipe.conn.readfile_thread = hThread;
- uv_mutex_unlock(m);
- goto restart_readfile;
- } else {
- result = 1; /* successfully stopped reading */
- }
- }
- }
+
+ /* The lock needs to be held when thread handle is modified. */
+ EnterCriticalSection(lock);
+ if (*thread_ptr == INVALID_HANDLE_VALUE) {
+ /* uv__pipe_interrupt_read() cancelled reading before we got here. */
+ err = ERROR_OPERATION_ABORTED;
} else {
- result = 1; /* successfully aborted read before it even started */
- }
- if (hThread) {
- assert(hThread == handle->pipe.conn.readfile_thread);
- /* mutex does not control clearing readfile_thread */
- handle->pipe.conn.readfile_thread = NULL;
- uv_mutex_lock(m);
- /* only when we hold the mutex lock is it safe to
- open or close the handle */
- CloseHandle(hThread);
- uv_mutex_unlock(m);
+ /* Let main thread know which worker thread is doing the blocking read. */
+ assert(*thread_ptr == NULL);
+ *thread_ptr = thread;
}
+ LeaveCriticalSection(lock);
- if (!result) {
- SET_REQ_ERROR(req, err);
- }
+ if (err)
+ goto out2;
+
+ /* Block the thread until data is available on the pipe, or the read is
+ * cancelled. */
+ if (!ReadFile(handle->handle, &uv_zero_, 0, &bytes, NULL))
+ err = GetLastError();
+
+ /* Let the main thread know the worker is past the point of blocking. */
+ assert(thread == *thread_ptr);
+ *thread_ptr = INVALID_HANDLE_VALUE;
+
+ /* Briefly acquire the mutex. Since the main thread holds the lock while it
+ * is spinning trying to cancel this thread's I/O, we will block here until
+ * it stops doing that. */
+ EnterCriticalSection(lock);
+ LeaveCriticalSection(lock);
+out2:
+ /* Close the handle to the current thread. */
+ CloseHandle(thread);
+
+out1:
+ /* Set request status and post a completion record to the IOCP. */
+ if (err)
+ SET_REQ_ERROR(req, err);
+ else
+ SET_REQ_SUCCESS(req);
POST_COMPLETION_FOR_REQ(loop, req);
+
return 0;
}
@@ -1102,6 +1120,7 @@ static void uv_pipe_queue_read(uv_loop_t* loop, uv_pipe_t* handle) {
req = &handle->read_req;
if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
+ handle->pipe.conn.readfile_thread_handle = NULL; /* Reset cancellation. */
if (!QueueUserWorkItem(&uv_pipe_zero_readfile_thread_proc,
req,
WT_EXECUTELONGFUNCTION)) {
@@ -1169,8 +1188,8 @@ int uv_pipe_read_start(uv_pipe_t* handle,
handle->read_cb = read_cb;
handle->alloc_cb = alloc_cb;
- /* If reading was stopped and then started again, there could still be a */
- /* read request pending. */
+ /* If reading was stopped and then started again, there could still be a read
+ * request pending. */
if (!(handle->flags & UV_HANDLE_READ_PENDING))
uv_pipe_queue_read(loop, handle);
@@ -1226,154 +1245,110 @@ static void uv_queue_non_overlapped_write(uv_pipe_t* handle) {
}
-static int uv_pipe_write_impl(uv_loop_t* loop,
- uv_write_t* req,
- uv_pipe_t* handle,
- const uv_buf_t bufs[],
- unsigned int nbufs,
- uv_stream_t* send_handle,
- uv_write_cb cb) {
- int err;
- int result;
- uv_tcp_t* tcp_send_handle;
- uv_write_t* ipc_header_req = NULL;
- uv_ipc_frame_uv_stream ipc_frame;
+static int uv__build_coalesced_write_req(uv_write_t* user_req,
+ const uv_buf_t bufs[],
+ size_t nbufs,
+ uv_write_t** req_out,
+ uv_buf_t* write_buf_out) {
+ /* Pack into a single heap-allocated buffer:
+ * (a) a uv_write_t structure where libuv stores the actual state.
+ * (b) a pointer to the original uv_write_t.
+ * (c) data from all `bufs` entries.
+ */
+ char* heap_buffer;
+ size_t heap_buffer_length, heap_buffer_offset;
+ uv__coalesced_write_t* coalesced_write_req; /* (a) + (b) */
+ char* data_start; /* (c) */
+ size_t data_length;
+ unsigned int i;
+
+ /* Compute combined size of all combined buffers from `bufs`. */
+ data_length = 0;
+ for (i = 0; i < nbufs; i++)
+ data_length += bufs[i].len;
+
+ /* The total combined size of data buffers should not exceed UINT32_MAX,
+ * because WriteFile() won't accept buffers larger than that. */
+ if (data_length > UINT32_MAX)
+ return WSAENOBUFS; /* Maps to UV_ENOBUFS. */
+
+ /* Compute heap buffer size. */
+ heap_buffer_length = sizeof *coalesced_write_req + /* (a) + (b) */
+ data_length; /* (c) */
+
+ /* Allocate buffer. */
+ heap_buffer = uv__malloc(heap_buffer_length);
+ if (heap_buffer == NULL)
+ return ERROR_NOT_ENOUGH_MEMORY; /* Maps to UV_ENOMEM. */
+
+ /* Copy uv_write_t information to the buffer. */
+ coalesced_write_req = (uv__coalesced_write_t*) heap_buffer;
+ coalesced_write_req->req = *user_req; /* copy (a) */
+ coalesced_write_req->req.coalesced = 1;
+ coalesced_write_req->user_req = user_req; /* copy (b) */
+ heap_buffer_offset = sizeof *coalesced_write_req; /* offset (a) + (b) */
+
+ /* Copy data buffers to the heap buffer. */
+ data_start = &heap_buffer[heap_buffer_offset];
+ for (i = 0; i < nbufs; i++) {
+ memcpy(&heap_buffer[heap_buffer_offset],
+ bufs[i].base,
+ bufs[i].len); /* copy (c) */
+ heap_buffer_offset += bufs[i].len; /* offset (c) */
+ }
+ assert(heap_buffer_offset == heap_buffer_length);
+
+ /* Set out arguments and return. */
+ *req_out = &coalesced_write_req->req;
+ *write_buf_out = uv_buf_init(data_start, (unsigned int) data_length);
+ return 0;
+}
- if (nbufs != 1 && (nbufs != 0 || !send_handle)) {
- return ERROR_NOT_SUPPORTED;
- }
- /* Only TCP handles are supported for sharing. */
- if (send_handle && ((send_handle->type != UV_TCP) ||
- (!(send_handle->flags & UV_HANDLE_BOUND) &&
- !(send_handle->flags & UV_HANDLE_CONNECTION)))) {
- return ERROR_NOT_SUPPORTED;
- }
+static int uv__pipe_write_data(uv_loop_t* loop,
+ uv_write_t* req,
+ uv_pipe_t* handle,
+ const uv_buf_t bufs[],
+ size_t nbufs,
+ uv_write_cb cb,
+ int copy_always) {
+ int err;
+ int result;
+ uv_buf_t write_buf;
assert(handle->handle != INVALID_HANDLE_VALUE);
UV_REQ_INIT(req, UV_WRITE);
req->handle = (uv_stream_t*) handle;
+ req->send_handle = NULL;
req->cb = cb;
- req->ipc_header = 0;
+ /* Private fields. */
+ req->coalesced = 0;
req->event_handle = NULL;
req->wait_handle = INVALID_HANDLE_VALUE;
memset(&req->u.io.overlapped, 0, sizeof(req->u.io.overlapped));
-
- if (handle->ipc) {
- assert(!(handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE));
- ipc_frame.header.flags = 0;
-
- /* Use the IPC framing protocol. */
- if (send_handle) {
- tcp_send_handle = (uv_tcp_t*)send_handle;
-
- if (handle->pipe.conn.ipc_pid == 0) {
- handle->pipe.conn.ipc_pid = uv_current_pid();
- }
-
- err = uv_tcp_duplicate_socket(tcp_send_handle, handle->pipe.conn.ipc_pid,
- &ipc_frame.socket_info_ex.socket_info);
- if (err) {
- return err;
- }
-
- ipc_frame.socket_info_ex.delayed_error = tcp_send_handle->delayed_error;
-
- ipc_frame.header.flags |= UV_IPC_TCP_SERVER;
-
- if (tcp_send_handle->flags & UV_HANDLE_CONNECTION) {
- ipc_frame.header.flags |= UV_IPC_TCP_CONNECTION;
- }
- }
-
- if (nbufs == 1) {
- ipc_frame.header.flags |= UV_IPC_RAW_DATA;
- ipc_frame.header.raw_data_length = bufs[0].len;
- }
-
- /*
- * Use the provided req if we're only doing a single write.
- * If we're doing multiple writes, use ipc_header_write_req to do
- * the first write, and then use the provided req for the second write.
- */
- if (!(ipc_frame.header.flags & UV_IPC_RAW_DATA)) {
- ipc_header_req = req;
- } else {
- /*
- * Try to use the preallocated write req if it's available.
- * Otherwise allocate a new one.
- */
- if (handle->pipe.conn.ipc_header_write_req.type != UV_WRITE) {
- ipc_header_req = (uv_write_t*)&handle->pipe.conn.ipc_header_write_req;
- } else {
- ipc_header_req = (uv_write_t*)uv__malloc(sizeof(uv_write_t));
- if (!ipc_header_req) {
- uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc");
- }
- }
-
- UV_REQ_INIT(ipc_header_req, UV_WRITE);
- ipc_header_req->handle = (uv_stream_t*) handle;
- ipc_header_req->cb = NULL;
- ipc_header_req->ipc_header = 1;
- }
-
- /* Write the header or the whole frame. */
- memset(&ipc_header_req->u.io.overlapped, 0,
- sizeof(ipc_header_req->u.io.overlapped));
-
- /* Using overlapped IO, but wait for completion before returning.
- This write is blocking because ipc_frame is on stack. */
- ipc_header_req->u.io.overlapped.hEvent = CreateEvent(NULL, 1, 0, NULL);
- if (!ipc_header_req->u.io.overlapped.hEvent) {
- uv_fatal_error(GetLastError(), "CreateEvent");
- }
-
- result = WriteFile(handle->handle,
- &ipc_frame,
- ipc_frame.header.flags & UV_IPC_TCP_SERVER ?
- sizeof(ipc_frame) : sizeof(ipc_frame.header),
- NULL,
- &ipc_header_req->u.io.overlapped);
- if (!result && GetLastError() != ERROR_IO_PENDING) {
- err = GetLastError();
- CloseHandle(ipc_header_req->u.io.overlapped.hEvent);
+ req->write_buffer = uv_null_buf_;
+
+ if (nbufs == 0) {
+ /* Write empty buffer. */
+ write_buf = uv_null_buf_;
+ } else if (nbufs == 1 && !copy_always) {
+ /* Write directly from bufs[0]. */
+ write_buf = bufs[0];
+ } else {
+ /* Coalesce all `bufs` into one big buffer. This also creates a new
+ * write-request structure that replaces the old one. */
+ err = uv__build_coalesced_write_req(req, bufs, nbufs, &req, &write_buf);
+ if (err != 0)
return err;
- }
-
- if (!result) {
- /* Request not completed immediately. Wait for it.*/
- if (WaitForSingleObject(ipc_header_req->u.io.overlapped.hEvent, INFINITE) !=
- WAIT_OBJECT_0) {
- err = GetLastError();
- CloseHandle(ipc_header_req->u.io.overlapped.hEvent);
- return err;
- }
- }
- ipc_header_req->u.io.queued_bytes = 0;
- CloseHandle(ipc_header_req->u.io.overlapped.hEvent);
- ipc_header_req->u.io.overlapped.hEvent = NULL;
-
- REGISTER_HANDLE_REQ(loop, handle, ipc_header_req);
- handle->reqs_pending++;
- handle->stream.conn.write_reqs_pending++;
-
- /* If we don't have any raw data to write - we're done. */
- if (!(ipc_frame.header.flags & UV_IPC_RAW_DATA)) {
- return 0;
- }
}
if ((handle->flags &
(UV_HANDLE_BLOCKING_WRITES | UV_HANDLE_NON_OVERLAPPED_PIPE)) ==
(UV_HANDLE_BLOCKING_WRITES | UV_HANDLE_NON_OVERLAPPED_PIPE)) {
DWORD bytes;
- result = WriteFile(handle->handle,
- bufs[0].base,
- bufs[0].len,
- &bytes,
- NULL);
+ result =
+ WriteFile(handle->handle, write_buf.base, write_buf.len, &bytes, NULL);
if (!result) {
err = GetLastError();
@@ -1389,14 +1364,14 @@ static int uv_pipe_write_impl(uv_loop_t* loop,
POST_COMPLETION_FOR_REQ(loop, req);
return 0;
} else if (handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
- req->write_buffer = bufs[0];
+ req->write_buffer = write_buf;
uv_insert_non_overlapped_write_req(handle, req);
if (handle->stream.conn.write_reqs_pending == 0) {
uv_queue_non_overlapped_write(handle);
}
/* Request queued by the kernel. */
- req->u.io.queued_bytes = bufs[0].len;
+ req->u.io.queued_bytes = write_buf.len;
handle->write_queue_size += req->u.io.queued_bytes;
} else if (handle->flags & UV_HANDLE_BLOCKING_WRITES) {
/* Using overlapped IO, but wait for completion before returning */
@@ -1406,8 +1381,8 @@ static int uv_pipe_write_impl(uv_loop_t* loop,
}
result = WriteFile(handle->handle,
- bufs[0].base,
- bufs[0].len,
+ write_buf.base,
+ write_buf.len,
NULL,
&req->u.io.overlapped);
@@ -1422,13 +1397,13 @@ static int uv_pipe_write_impl(uv_loop_t* loop,
req->u.io.queued_bytes = 0;
} else {
/* Request queued by the kernel. */
- req->u.io.queued_bytes = bufs[0].len;
+ req->u.io.queued_bytes = write_buf.len;
handle->write_queue_size += req->u.io.queued_bytes;
if (WaitForSingleObject(req->u.io.overlapped.hEvent, INFINITE) !=
WAIT_OBJECT_0) {
err = GetLastError();
CloseHandle(req->u.io.overlapped.hEvent);
- return uv_translate_sys_error(err);
+ return err;
}
}
CloseHandle(req->u.io.overlapped.hEvent);
@@ -1439,8 +1414,8 @@ static int uv_pipe_write_impl(uv_loop_t* loop,
return 0;
} else {
result = WriteFile(handle->handle,
- bufs[0].base,
- bufs[0].len,
+ write_buf.base,
+ write_buf.len,
NULL,
&req->u.io.overlapped);
@@ -1453,7 +1428,7 @@ static int uv_pipe_write_impl(uv_loop_t* loop,
req->u.io.queued_bytes = 0;
} else {
/* Request queued by the kernel. */
- req->u.io.queued_bytes = bufs[0].len;
+ req->u.io.queued_bytes = write_buf.len;
handle->write_queue_size += req->u.io.queued_bytes;
}
@@ -1478,35 +1453,143 @@ static int uv_pipe_write_impl(uv_loop_t* loop,
}
-int uv_pipe_write(uv_loop_t* loop,
- uv_write_t* req,
- uv_pipe_t* handle,
- const uv_buf_t bufs[],
- unsigned int nbufs,
- uv_write_cb cb) {
- return uv_pipe_write_impl(loop, req, handle, bufs, nbufs, NULL, cb);
+static DWORD uv__pipe_get_ipc_remote_pid(uv_pipe_t* handle) {
+ DWORD* pid = &handle->pipe.conn.ipc_remote_pid;
+
+ /* If the both ends of the IPC pipe are owned by the same process,
+ * the remote end pid may not yet be set. If so, do it here.
+ * TODO: this is weird; it'd probably better to use a handshake. */
+ if (*pid == 0)
+ *pid = GetCurrentProcessId();
+
+ return *pid;
+}
+
+
+int uv__pipe_write_ipc(uv_loop_t* loop,
+ uv_write_t* req,
+ uv_pipe_t* handle,
+ const uv_buf_t data_bufs[],
+ size_t data_buf_count,
+ uv_stream_t* send_handle,
+ uv_write_cb cb) {
+ uv_buf_t stack_bufs[6];
+ uv_buf_t* bufs;
+ size_t buf_count, buf_index;
+ uv__ipc_frame_header_t frame_header;
+ uv__ipc_socket_xfer_type_t xfer_type = UV__IPC_SOCKET_XFER_NONE;
+ uv__ipc_socket_xfer_info_t xfer_info;
+ uint64_t data_length;
+ size_t i;
+ int err;
+
+ /* Compute the combined size of data buffers. */
+ data_length = 0;
+ for (i = 0; i < data_buf_count; i++)
+ data_length += data_bufs[i].len;
+ if (data_length > UINT32_MAX)
+ return WSAENOBUFS; /* Maps to UV_ENOBUFS. */
+
+ /* Prepare the frame's socket xfer payload. */
+ if (send_handle != NULL) {
+ uv_tcp_t* send_tcp_handle = (uv_tcp_t*) send_handle;
+
+ /* Verify that `send_handle` it is indeed a tcp handle. */
+ if (send_tcp_handle->type != UV_TCP)
+ return ERROR_NOT_SUPPORTED;
+
+ /* Export the tcp handle. */
+ err = uv__tcp_xfer_export(send_tcp_handle,
+ uv__pipe_get_ipc_remote_pid(handle),
+ &xfer_type,
+ &xfer_info);
+ if (err != 0)
+ return err;
+ }
+
+ /* Compute the number of uv_buf_t's required. */
+ buf_count = 1 + data_buf_count; /* Frame header and data buffers. */
+ if (send_handle != NULL)
+ buf_count += 1; /* One extra for the socket xfer information. */
+
+ /* Use the on-stack buffer array if it is big enough; otherwise allocate
+ * space for it on the heap. */
+ if (buf_count < ARRAY_SIZE(stack_bufs)) {
+ /* Use on-stack buffer array. */
+ bufs = stack_bufs;
+ } else {
+ /* Use heap-allocated buffer array. */
+ bufs = uv__calloc(buf_count, sizeof(uv_buf_t));
+ if (bufs == NULL)
+ return ERROR_NOT_ENOUGH_MEMORY; /* Maps to UV_ENOMEM. */
+ }
+ buf_index = 0;
+
+ /* Initialize frame header and add it to the buffers list. */
+ memset(&frame_header, 0, sizeof frame_header);
+ bufs[buf_index++] = uv_buf_init((char*) &frame_header, sizeof frame_header);
+
+ if (send_handle != NULL) {
+ /* Add frame header flags. */
+ switch (xfer_type) {
+ case UV__IPC_SOCKET_XFER_TCP_CONNECTION:
+ frame_header.flags |= UV__IPC_FRAME_HAS_SOCKET_XFER |
+ UV__IPC_FRAME_XFER_IS_TCP_CONNECTION;
+ break;
+ case UV__IPC_SOCKET_XFER_TCP_SERVER:
+ frame_header.flags |= UV__IPC_FRAME_HAS_SOCKET_XFER;
+ break;
+ default:
+ assert(0); /* Unreachable. */
+ }
+ /* Add xfer info buffer. */
+ bufs[buf_index++] = uv_buf_init((char*) &xfer_info, sizeof xfer_info);
+ }
+
+ if (data_length > 0) {
+ /* Update frame header. */
+ frame_header.flags |= UV__IPC_FRAME_HAS_DATA;
+ frame_header.data_length = (uint32_t) data_length;
+ /* Add data buffers to buffers list. */
+ for (i = 0; i < data_buf_count; i++)
+ bufs[buf_index++] = data_bufs[i];
+ }
+
+ /* Write buffers. We set the `always_copy` flag, so it is not a problem that
+ * some of the written data lives on the stack. */
+ err = uv__pipe_write_data(loop, req, handle, bufs, buf_count, cb, 1);
+
+ /* If we had to heap-allocate the bufs array, free it now. */
+ if (bufs != stack_bufs) {
+ uv__free(bufs);
+ }
+
+ return err;
}
-int uv_pipe_write2(uv_loop_t* loop,
+int uv__pipe_write(uv_loop_t* loop,
uv_write_t* req,
uv_pipe_t* handle,
const uv_buf_t bufs[],
- unsigned int nbufs,
+ size_t nbufs,
uv_stream_t* send_handle,
uv_write_cb cb) {
- if (!handle->ipc) {
- return WSAEINVAL;
+ if (handle->ipc) {
+ /* IPC pipe write: use framing protocol. */
+ return uv__pipe_write_ipc(loop, req, handle, bufs, nbufs, send_handle, cb);
+ } else {
+ /* Non-IPC pipe write: put data on the wire directly. */
+ assert(send_handle == NULL);
+ return uv__pipe_write_data(loop, req, handle, bufs, nbufs, cb, 0);
}
-
- return uv_pipe_write_impl(loop, req, handle, bufs, nbufs, send_handle, cb);
}
static void uv_pipe_read_eof(uv_loop_t* loop, uv_pipe_t* handle,
uv_buf_t buf) {
- /* If there is an eof timer running, we don't need it any more, */
- /* so discard it. */
+ /* If there is an eof timer running, we don't need it any more, so discard
+ * it. */
eof_timer_destroy(handle);
handle->flags &= ~UV_HANDLE_READABLE;
@@ -1518,8 +1601,8 @@ static void uv_pipe_read_eof(uv_loop_t* loop, uv_pipe_t* handle,
static void uv_pipe_read_error(uv_loop_t* loop, uv_pipe_t* handle, int error,
uv_buf_t buf) {
- /* If there is an eof timer running, we don't need it any more, */
- /* so discard it. */
+ /* If there is an eof timer running, we don't need it any more, so discard
+ * it. */
eof_timer_destroy(handle);
uv_read_stop((uv_stream_t*) handle);
@@ -1530,10 +1613,7 @@ static void uv_pipe_read_error(uv_loop_t* loop, uv_pipe_t* handle, int error,
static void uv_pipe_read_error_or_eof(uv_loop_t* loop, uv_pipe_t* handle,
int error, uv_buf_t buf) {
- if (error == ERROR_OPERATION_ABORTED) {
- /* do nothing (equivalent to EINTR) */
- }
- else if (error == ERROR_BROKEN_PIPE) {
+ if (error == ERROR_BROKEN_PIPE) {
uv_pipe_read_eof(loop, handle, buf);
} else {
uv_pipe_read_error(loop, handle, error, buf);
@@ -1541,152 +1621,228 @@ static void uv_pipe_read_error_or_eof(uv_loop_t* loop, uv_pipe_t* handle,
}
-void uv__pipe_insert_pending_socket(uv_pipe_t* handle,
- uv__ipc_socket_info_ex* info,
- int tcp_connection) {
- uv__ipc_queue_item_t* item;
+static void uv__pipe_queue_ipc_xfer_info(
+ uv_pipe_t* handle,
+ uv__ipc_socket_xfer_type_t xfer_type,
+ uv__ipc_socket_xfer_info_t* xfer_info) {
+ uv__ipc_xfer_queue_item_t* item;
- item = (uv__ipc_queue_item_t*) uv__malloc(sizeof(*item));
+ item = (uv__ipc_xfer_queue_item_t*) uv__malloc(sizeof(*item));
if (item == NULL)
uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc");
- memcpy(&item->socket_info_ex, info, sizeof(item->socket_info_ex));
- item->tcp_connection = tcp_connection;
- QUEUE_INSERT_TAIL(&handle->pipe.conn.pending_ipc_info.queue, &item->member);
- handle->pipe.conn.pending_ipc_info.queue_len++;
+ item->xfer_type = xfer_type;
+ item->xfer_info = *xfer_info;
+
+ QUEUE_INSERT_TAIL(&handle->pipe.conn.ipc_xfer_queue, &item->member);
+ handle->pipe.conn.ipc_xfer_queue_length++;
+}
+
+
+/* Read an exact number of bytes from a pipe. If an error or end-of-file is
+ * encountered before the requested number of bytes are read, an error is
+ * returned. */
+static int uv__pipe_read_exactly(HANDLE h, void* buffer, DWORD count) {
+ DWORD bytes_read, bytes_read_now;
+
+ bytes_read = 0;
+ while (bytes_read < count) {
+ if (!ReadFile(h,
+ (char*) buffer + bytes_read,
+ count - bytes_read,
+ &bytes_read_now,
+ NULL)) {
+ return GetLastError();
+ }
+
+ bytes_read += bytes_read_now;
+ }
+
+ assert(bytes_read == count);
+ return 0;
}
-void uv_process_pipe_read_req(uv_loop_t* loop, uv_pipe_t* handle,
- uv_req_t* req) {
- DWORD bytes, avail;
+static DWORD uv__pipe_read_data(uv_loop_t* loop,
+ uv_pipe_t* handle,
+ DWORD suggested_bytes,
+ DWORD max_bytes) {
+ DWORD bytes_read;
uv_buf_t buf;
- uv_ipc_frame_uv_stream ipc_frame;
+ /* Ask the user for a buffer to read data into. */
+ buf = uv_buf_init(NULL, 0);
+ handle->alloc_cb((uv_handle_t*) handle, suggested_bytes, &buf);
+ if (buf.base == NULL || buf.len == 0) {
+ handle->read_cb((uv_stream_t*) handle, UV_ENOBUFS, &buf);
+ return 0; /* Break out of read loop. */
+ }
+
+ /* Ensure we read at most the smaller of:
+ * (a) the length of the user-allocated buffer.
+ * (b) the maximum data length as specified by the `max_bytes` argument.
+ */
+ if (max_bytes > buf.len)
+ max_bytes = buf.len;
+
+ /* Read into the user buffer. */
+ if (!ReadFile(handle->handle, buf.base, max_bytes, &bytes_read, NULL)) {
+ uv_pipe_read_error_or_eof(loop, handle, GetLastError(), buf);
+ return 0; /* Break out of read loop. */
+ }
+
+ /* Call the read callback. */
+ handle->read_cb((uv_stream_t*) handle, bytes_read, &buf);
+
+ return bytes_read;
+}
+
+
+static DWORD uv__pipe_read_ipc(uv_loop_t* loop, uv_pipe_t* handle) {
+ uint32_t* data_remaining = &handle->pipe.conn.ipc_data_frame.payload_remaining;
+ int err;
+
+ if (*data_remaining > 0) {
+ /* Read frame data payload. */
+ DWORD bytes_read =
+ uv__pipe_read_data(loop, handle, *data_remaining, *data_remaining);
+ *data_remaining -= bytes_read;
+ return bytes_read;
+
+ } else {
+ /* Start of a new IPC frame. */
+ uv__ipc_frame_header_t frame_header;
+ uint32_t xfer_flags;
+ uv__ipc_socket_xfer_type_t xfer_type;
+ uv__ipc_socket_xfer_info_t xfer_info;
+
+ /* Read the IPC frame header. */
+ err = uv__pipe_read_exactly(
+ handle->handle, &frame_header, sizeof frame_header);
+ if (err)
+ goto error;
+
+ /* Validate that flags are valid. */
+ if ((frame_header.flags & ~UV__IPC_FRAME_VALID_FLAGS) != 0)
+ goto invalid;
+ /* Validate that reserved2 is zero. */
+ if (frame_header.reserved2 != 0)
+ goto invalid;
+
+ /* Parse xfer flags. */
+ xfer_flags = frame_header.flags & UV__IPC_FRAME_XFER_FLAGS;
+ if (xfer_flags & UV__IPC_FRAME_HAS_SOCKET_XFER) {
+ /* Socket coming -- determine the type. */
+ xfer_type = xfer_flags & UV__IPC_FRAME_XFER_IS_TCP_CONNECTION
+ ? UV__IPC_SOCKET_XFER_TCP_CONNECTION
+ : UV__IPC_SOCKET_XFER_TCP_SERVER;
+ } else if (xfer_flags == 0) {
+ /* No socket. */
+ xfer_type = UV__IPC_SOCKET_XFER_NONE;
+ } else {
+ /* Invalid flags. */
+ goto invalid;
+ }
+
+ /* Parse data frame information. */
+ if (frame_header.flags & UV__IPC_FRAME_HAS_DATA) {
+ *data_remaining = frame_header.data_length;
+ } else if (frame_header.data_length != 0) {
+ /* Data length greater than zero but data flag not set -- invalid. */
+ goto invalid;
+ }
+
+ /* If no socket xfer info follows, return here. Data will be read in a
+ * subsequent invocation of uv__pipe_read_ipc(). */
+ if (xfer_type == UV__IPC_SOCKET_XFER_NONE)
+ return sizeof frame_header; /* Number of bytes read. */
+
+ /* Read transferred socket information. */
+ err = uv__pipe_read_exactly(handle->handle, &xfer_info, sizeof xfer_info);
+ if (err)
+ goto error;
+
+ /* Store the pending socket info. */
+ uv__pipe_queue_ipc_xfer_info(handle, xfer_type, &xfer_info);
+
+ /* Return number of bytes read. */
+ return sizeof frame_header + sizeof xfer_info;
+ }
+
+invalid:
+ /* Invalid frame. */
+ err = WSAECONNABORTED; /* Maps to UV_ECONNABORTED. */
+
+error:
+ uv_pipe_read_error_or_eof(loop, handle, err, uv_null_buf_);
+ return 0; /* Break out of read loop. */
+}
+
+
+void uv_process_pipe_read_req(uv_loop_t* loop,
+ uv_pipe_t* handle,
+ uv_req_t* req) {
assert(handle->type == UV_NAMED_PIPE);
- handle->flags &= ~UV_HANDLE_READ_PENDING;
+ handle->flags &= ~(UV_HANDLE_READ_PENDING | UV_HANDLE_CANCELLATION_PENDING);
+ DECREASE_PENDING_REQ_COUNT(handle);
eof_timer_stop(handle);
- if (!REQ_SUCCESS(req)) {
- /* An error occurred doing the 0-read. */
- if (handle->flags & UV_HANDLE_READING) {
- uv_pipe_read_error_or_eof(loop,
- handle,
- GET_REQ_ERROR(req),
- uv_null_buf_);
- }
- } else {
- /* Do non-blocking reads until the buffer is empty */
- while (handle->flags & UV_HANDLE_READING) {
- if (!PeekNamedPipe(handle->handle,
- NULL,
- 0,
- NULL,
- &avail,
- NULL)) {
- uv_pipe_read_error_or_eof(loop, handle, GetLastError(), uv_null_buf_);
- break;
- }
+ /* At this point, we're done with bookkeeping. If the user has stopped
+ * reading the pipe in the meantime, there is nothing left to do, since there
+ * is no callback that we can call. */
+ if (!(handle->flags & UV_HANDLE_READING))
+ return;
- if (avail == 0) {
- /* There is nothing to read after all. */
- break;
- }
+ if (!REQ_SUCCESS(req)) {
+ /* An error occurred doing the zero-read. */
+ DWORD err = GET_REQ_ERROR(req);
- if (handle->ipc) {
- /* Use the IPC framing protocol to read the incoming data. */
- if (handle->pipe.conn.remaining_ipc_rawdata_bytes == 0) {
- /* We're reading a new frame. First, read the header. */
- assert(avail >= sizeof(ipc_frame.header));
-
- if (!ReadFile(handle->handle,
- &ipc_frame.header,
- sizeof(ipc_frame.header),
- &bytes,
- NULL)) {
- uv_pipe_read_error_or_eof(loop, handle, GetLastError(),
- uv_null_buf_);
- break;
- }
-
- assert(bytes == sizeof(ipc_frame.header));
- assert(ipc_frame.header.flags <= (UV_IPC_TCP_SERVER | UV_IPC_RAW_DATA |
- UV_IPC_TCP_CONNECTION));
-
- if (ipc_frame.header.flags & UV_IPC_TCP_SERVER) {
- assert(avail - sizeof(ipc_frame.header) >=
- sizeof(ipc_frame.socket_info_ex));
-
- /* Read the TCP socket info. */
- if (!ReadFile(handle->handle,
- &ipc_frame.socket_info_ex,
- sizeof(ipc_frame) - sizeof(ipc_frame.header),
- &bytes,
- NULL)) {
- uv_pipe_read_error_or_eof(loop, handle, GetLastError(),
- uv_null_buf_);
- break;
- }
-
- assert(bytes == sizeof(ipc_frame) - sizeof(ipc_frame.header));
-
- /* Store the pending socket info. */
- uv__pipe_insert_pending_socket(
- handle,
- &ipc_frame.socket_info_ex,
- ipc_frame.header.flags & UV_IPC_TCP_CONNECTION);
- }
-
- if (ipc_frame.header.flags & UV_IPC_RAW_DATA) {
- handle->pipe.conn.remaining_ipc_rawdata_bytes =
- ipc_frame.header.raw_data_length;
- continue;
- }
- } else {
- avail = min(avail, (DWORD)handle->pipe.conn.remaining_ipc_rawdata_bytes);
- }
- }
+ /* If the read was cancelled by uv__pipe_interrupt_read(), the request may
+ * indicate an ERROR_OPERATION_ABORTED error. This error isn't relevant to
+ * the user; we'll start a new zero-read at the end of this function. */
+ if (err != ERROR_OPERATION_ABORTED)
+ uv_pipe_read_error_or_eof(loop, handle, err, uv_null_buf_);
- buf = uv_buf_init(NULL, 0);
- handle->alloc_cb((uv_handle_t*) handle, avail, &buf);
- if (buf.base == NULL || buf.len == 0) {
- handle->read_cb((uv_stream_t*) handle, UV_ENOBUFS, &buf);
+ } else {
+ /* The zero-read completed without error, indicating there is data
+ * available in the kernel buffer. */
+ DWORD avail;
+
+ /* Get the number of bytes available. */
+ avail = 0;
+ if (!PeekNamedPipe(handle->handle, NULL, 0, NULL, &avail, NULL))
+ uv_pipe_read_error_or_eof(loop, handle, GetLastError(), uv_null_buf_);
+
+ /* Read until we've either read all the bytes available, or the 'reading'
+ * flag is cleared. */
+ while (avail > 0 && handle->flags & UV_HANDLE_READING) {
+ /* Depending on the type of pipe, read either IPC frames or raw data. */
+ DWORD bytes_read =
+ handle->ipc ? uv__pipe_read_ipc(loop, handle)
+ : uv__pipe_read_data(loop, handle, avail, (DWORD) -1);
+
+ /* If no bytes were read, treat this as an indication that an error
+ * occurred, and break out of the read loop. */
+ if (bytes_read == 0)
break;
- }
- assert(buf.base != NULL);
-
- if (ReadFile(handle->handle,
- buf.base,
- min(buf.len, avail),
- &bytes,
- NULL)) {
- /* Successful read */
- if (handle->ipc) {
- assert(handle->pipe.conn.remaining_ipc_rawdata_bytes >= bytes);
- handle->pipe.conn.remaining_ipc_rawdata_bytes =
- handle->pipe.conn.remaining_ipc_rawdata_bytes - bytes;
- }
- handle->read_cb((uv_stream_t*)handle, bytes, &buf);
- /* Read again only if bytes == buf.len */
- if (bytes <= buf.len) {
- break;
- }
- } else {
- uv_pipe_read_error_or_eof(loop, handle, GetLastError(), buf);
+ /* It is possible that more bytes were read than we thought were
+ * available. To prevent `avail` from underflowing, break out of the loop
+ * if this is the case. */
+ if (bytes_read > avail)
break;
- }
- }
- /* Post another 0-read if still reading and not closing. */
- if ((handle->flags & UV_HANDLE_READING) &&
- !(handle->flags & UV_HANDLE_READ_PENDING)) {
- uv_pipe_queue_read(loop, handle);
+ /* Recompute the number of bytes available. */
+ avail -= bytes_read;
}
}
- DECREASE_PENDING_REQ_COUNT(handle);
+ /* Start another zero-read request if necessary. */
+ if ((handle->flags & UV_HANDLE_READING) &&
+ !(handle->flags & UV_HANDLE_READ_PENDING)) {
+ uv_pipe_queue_read(loop, handle);
+ }
}
@@ -1712,17 +1868,19 @@ void uv_process_pipe_write_req(uv_loop_t* loop, uv_pipe_t* handle,
}
}
- if (req->ipc_header) {
- if (req == &handle->pipe.conn.ipc_header_write_req) {
- req->type = UV_UNKNOWN_REQ;
- } else {
- uv__free(req);
- }
- } else {
- if (req->cb) {
- err = GET_REQ_ERROR(req);
- req->cb(req, uv_translate_sys_error(err));
- }
+ err = GET_REQ_ERROR(req);
+
+ /* If this was a coalesced write, extract pointer to the user_provided
+ * uv_write_t structure so we can pass the expected pointer to the callback,
+ * then free the heap-allocated write req. */
+ if (req->coalesced) {
+ uv__coalesced_write_t* coalesced_write =
+ container_of(req, uv__coalesced_write_t, req);
+ req = coalesced_write->user_req;
+ uv__free(coalesced_write);
+ }
+ if (req->cb) {
+ req->cb(req, uv_translate_sys_error(err));
}
handle->stream.conn.write_reqs_pending--;
@@ -1748,7 +1906,7 @@ void uv_process_pipe_accept_req(uv_loop_t* loop, uv_pipe_t* handle,
assert(handle->type == UV_NAMED_PIPE);
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
/* The req->pipeHandle should be freed already in uv_pipe_cleanup(). */
assert(req->pipeHandle == INVALID_HANDLE_VALUE);
DECREASE_PENDING_REQ_COUNT(handle);
@@ -1768,7 +1926,7 @@ void uv_process_pipe_accept_req(uv_loop_t* loop, uv_pipe_t* handle,
CloseHandle(req->pipeHandle);
req->pipeHandle = INVALID_HANDLE_VALUE;
}
- if (!(handle->flags & UV__HANDLE_CLOSING)) {
+ if (!(handle->flags & UV_HANDLE_CLOSING)) {
uv_pipe_queue_accept(loop, handle, req, FALSE);
}
}
@@ -1806,19 +1964,19 @@ void uv_process_pipe_shutdown_req(uv_loop_t* loop, uv_pipe_t* handle,
UNREGISTER_HANDLE_REQ(loop, handle, req);
if (handle->flags & UV_HANDLE_READABLE) {
- /* Initialize and optionally start the eof timer. Only do this if the */
- /* pipe is readable and we haven't seen EOF come in ourselves. */
+ /* Initialize and optionally start the eof timer. Only do this if the pipe
+ * is readable and we haven't seen EOF come in ourselves. */
eof_timer_init(handle);
- /* If reading start the timer right now. */
- /* Otherwise uv_pipe_queue_read will start it. */
+ /* If reading start the timer right now. Otherwise uv_pipe_queue_read will
+ * start it. */
if (handle->flags & UV_HANDLE_READ_PENDING) {
eof_timer_start(handle);
}
} else {
- /* This pipe is not readable. We can just close it to let the other end */
- /* know that we're done writing. */
+ /* This pipe is not readable. We can just close it to let the other end
+ * know that we're done writing. */
close_pipe(handle);
}
@@ -1869,17 +2027,16 @@ static void eof_timer_cb(uv_timer_t* timer) {
assert(pipe->type == UV_NAMED_PIPE);
- /* This should always be true, since we start the timer only */
- /* in uv_pipe_queue_read after successfully calling ReadFile, */
- /* or in uv_process_pipe_shutdown_req if a read is pending, */
- /* and we always immediately stop the timer in */
- /* uv_process_pipe_read_req. */
+ /* This should always be true, since we start the timer only in
+ * uv_pipe_queue_read after successfully calling ReadFile, or in
+ * uv_process_pipe_shutdown_req if a read is pending, and we always
+ * immediately stop the timer in uv_process_pipe_read_req. */
assert(pipe->flags & UV_HANDLE_READ_PENDING);
- /* If there are many packets coming off the iocp then the timer callback */
- /* may be called before the read request is coming off the queue. */
- /* Therefore we check here if the read request has completed but will */
- /* be processed later. */
+ /* If there are many packets coming off the iocp then the timer callback may
+ * be called before the read request is coming off the queue. Therefore we
+ * check here if the read request has completed but will be processed later.
+ */
if ((pipe->flags & UV_HANDLE_READ_PENDING) &&
HasOverlappedIoCompleted(&pipe->read_req.u.io.overlapped)) {
return;
@@ -1888,12 +2045,12 @@ static void eof_timer_cb(uv_timer_t* timer) {
/* Force both ends off the pipe. */
close_pipe(pipe);
- /* Stop reading, so the pending read that is going to fail will */
- /* not be reported to the user. */
+ /* Stop reading, so the pending read that is going to fail will not be
+ * reported to the user. */
uv_read_stop((uv_stream_t*) pipe);
- /* Report the eof and update flags. This will get reported even if the */
- /* user stopped reading in the meantime. TODO: is that okay? */
+ /* Report the eof and update flags. This will get reported even if the user
+ * stopped reading in the meantime. TODO: is that okay? */
uv_pipe_read_eof(loop, pipe, uv_null_buf_);
}
@@ -1980,8 +2137,8 @@ int uv_pipe_open(uv_pipe_t* pipe, uv_file file) {
if (pipe->ipc) {
assert(!(pipe->flags & UV_HANDLE_NON_OVERLAPPED_PIPE));
- pipe->pipe.conn.ipc_pid = uv_os_getppid();
- assert(pipe->pipe.conn.ipc_pid != -1);
+ pipe->pipe.conn.ipc_remote_pid = uv_os_getppid();
+ assert(pipe->pipe.conn.ipc_remote_pid != (DWORD) -1);
}
return 0;
}
@@ -2006,7 +2163,15 @@ static int uv__pipe_getname(const uv_pipe_t* handle, char* buffer, size_t* size)
return UV_EINVAL;
}
- uv__pipe_pause_read((uv_pipe_t*)handle); /* cast away const warning */
+ /* NtQueryInformationFile will block if another thread is performing a
+ * blocking operation on the queried handle. If the pipe handle is
+ * synchronous, there may be a worker thread currently calling ReadFile() on
+ * the pipe handle, which could cause a deadlock. To avoid this, interrupt
+ * the read. */
+ if (handle->flags & UV_HANDLE_CONNECTION &&
+ handle->flags & UV_HANDLE_NON_OVERLAPPED_PIPE) {
+ uv__pipe_interrupt_read((uv_pipe_t*) handle); /* cast away const warning */
+ }
nt_status = pNtQueryInformationFile(handle->handle,
&io_status,
@@ -2097,7 +2262,6 @@ error:
uv__free(name_info);
cleanup:
- uv__pipe_unpause_read((uv_pipe_t*)handle); /* cast away const warning */
return err;
}
@@ -2105,7 +2269,7 @@ cleanup:
int uv_pipe_pending_count(uv_pipe_t* handle) {
if (!handle->ipc)
return 0;
- return handle->pipe.conn.pending_ipc_info.queue_len;
+ return handle->pipe.conn.ipc_xfer_queue_length;
}
@@ -2138,14 +2302,14 @@ int uv_pipe_getpeername(const uv_pipe_t* handle, char* buffer, size_t* size) {
uv_handle_type uv_pipe_pending_type(uv_pipe_t* handle) {
if (!handle->ipc)
return UV_UNKNOWN_HANDLE;
- if (handle->pipe.conn.pending_ipc_info.queue_len == 0)
+ if (handle->pipe.conn.ipc_xfer_queue_length == 0)
return UV_UNKNOWN_HANDLE;
else
return UV_TCP;
}
int uv_pipe_chmod(uv_pipe_t* handle, int mode) {
- SID_IDENTIFIER_AUTHORITY sid_world = SECURITY_WORLD_SID_AUTHORITY;
+ SID_IDENTIFIER_AUTHORITY sid_world = { SECURITY_WORLD_SID_AUTHORITY };
PACL old_dacl, new_dacl;
PSECURITY_DESCRIPTOR sd;
EXPLICIT_ACCESS ea;
@@ -2180,7 +2344,7 @@ int uv_pipe_chmod(uv_pipe_t* handle, int mode) {
error = GetLastError();
goto clean_sid;
}
-
+
memset(&ea, 0, sizeof(EXPLICIT_ACCESS));
if (mode & UV_READABLE)
ea.grfAccessPermissions |= GENERIC_READ | FILE_WRITE_ATTRIBUTES;
diff --git a/Utilities/cmlibuv/src/win/poll.c b/Utilities/cmlibuv/src/win/poll.c
index a648ba711..3c6678600 100644
--- a/Utilities/cmlibuv/src/win/poll.c
+++ b/Utilities/cmlibuv/src/win/poll.c
@@ -75,7 +75,7 @@ static AFD_POLL_INFO* uv__get_afd_poll_info_dummy(void) {
static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) {
uv_req_t* req;
AFD_POLL_INFO* afd_poll_info;
- DWORD result;
+ int result;
/* Find a yet unsubmitted req to submit. */
if (handle->submitted_events_1 == 0) {
@@ -91,16 +91,16 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) {
handle->mask_events_1 = handle->events;
handle->mask_events_2 = 0;
} else {
- /* Just wait until there's an unsubmitted req. */
- /* This will happen almost immediately as one of the 2 outstanding */
- /* requests is about to return. When this happens, */
- /* uv__fast_poll_process_poll_req will be called, and the pending */
- /* events, if needed, will be processed in a subsequent request. */
+ /* Just wait until there's an unsubmitted req. This will happen almost
+ * immediately as one of the 2 outstanding requests is about to return.
+ * When this happens, uv__fast_poll_process_poll_req will be called, and
+ * the pending events, if needed, will be processed in a subsequent
+ * request. */
return;
}
- /* Setting Exclusive to TRUE makes the other poll request return if there */
- /* is any. */
+ /* Setting Exclusive to TRUE makes the other poll request return if there is
+ * any. */
afd_poll_info->Exclusive = TRUE;
afd_poll_info->NumberOfHandles = 1;
afd_poll_info->Timeout.QuadPart = INT64_MAX;
@@ -136,7 +136,7 @@ static void uv__fast_poll_submit_poll_req(uv_loop_t* loop, uv_poll_t* handle) {
static int uv__fast_poll_cancel_poll_req(uv_loop_t* loop, uv_poll_t* handle) {
AFD_POLL_INFO afd_poll_info;
- DWORD result;
+ int result;
afd_poll_info.Exclusive = TRUE;
afd_poll_info.NumberOfHandles = 1;
@@ -218,7 +218,7 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
if ((handle->events & ~(handle->submitted_events_1 |
handle->submitted_events_2)) != 0) {
uv__fast_poll_submit_poll_req(loop, handle);
- } else if ((handle->flags & UV__HANDLE_CLOSING) &&
+ } else if ((handle->flags & UV_HANDLE_CLOSING) &&
handle->submitted_events_1 == 0 &&
handle->submitted_events_2 == 0) {
uv_want_endgame(loop, (uv_handle_t*) handle);
@@ -228,7 +228,7 @@ static void uv__fast_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
static int uv__fast_poll_set(uv_loop_t* loop, uv_poll_t* handle, int events) {
assert(handle->type == UV_POLL);
- assert(!(handle->flags & UV__HANDLE_CLOSING));
+ assert(!(handle->flags & UV_HANDLE_CLOSING));
assert((events & ~(UV_READABLE | UV_WRITABLE | UV_DISCONNECT)) == 0);
handle->events = events;
@@ -257,8 +257,8 @@ static int uv__fast_poll_close(uv_loop_t* loop, uv_poll_t* handle) {
uv_want_endgame(loop, (uv_handle_t*) handle);
return 0;
} else {
- /* Cancel outstanding poll requests by executing another, unique poll */
- /* request that forces the outstanding ones to return. */
+ /* Cancel outstanding poll requests by executing another, unique poll
+ * request that forces the outstanding ones to return. */
return uv__fast_poll_cancel_poll_req(loop, handle);
}
}
@@ -316,9 +316,8 @@ static SOCKET uv__fast_poll_get_peer_socket(uv_loop_t* loop,
return INVALID_SOCKET;
}
- /* If we didn't (try) to create a peer socket yet, try to make one. Don't */
- /* try again if the peer socket creation failed earlier for the same */
- /* protocol. */
+ /* If we didn't (try) to create a peer socket yet, try to make one. Don't try
+ * again if the peer socket creation failed earlier for the same protocol. */
peer_socket = loop->poll_peer_sockets[index];
if (peer_socket == 0) {
peer_socket = uv__fast_poll_create_peer_socket(loop->iocp, protocol_info);
@@ -357,8 +356,8 @@ static DWORD WINAPI uv__slow_poll_thread_proc(void* arg) {
efds.fd_count = 0;
}
- /* Make the select() time out after 3 minutes. If select() hangs because */
- /* the user closed the socket, we will at least not hang indefinitely. */
+ /* Make the select() time out after 3 minutes. If select() hangs because the
+ * user closed the socket, we will at least not hang indefinitely. */
timeout.tv_sec = 3 * 60;
timeout.tv_usec = 0;
@@ -462,7 +461,7 @@ static void uv__slow_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
if ((handle->events & ~(handle->submitted_events_1 |
handle->submitted_events_2)) != 0) {
uv__slow_poll_submit_poll_req(loop, handle);
- } else if ((handle->flags & UV__HANDLE_CLOSING) &&
+ } else if ((handle->flags & UV_HANDLE_CLOSING) &&
handle->submitted_events_1 == 0 &&
handle->submitted_events_2 == 0) {
uv_want_endgame(loop, (uv_handle_t*) handle);
@@ -472,7 +471,7 @@ static void uv__slow_poll_process_poll_req(uv_loop_t* loop, uv_poll_t* handle,
static int uv__slow_poll_set(uv_loop_t* loop, uv_poll_t* handle, int events) {
assert(handle->type == UV_POLL);
- assert(!(handle->flags & UV__HANDLE_CLOSING));
+ assert(!(handle->flags & UV_HANDLE_CLOSING));
assert((events & ~(UV_READABLE | UV_WRITABLE)) == 0);
handle->events = events;
@@ -522,10 +521,10 @@ int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
if (ioctlsocket(socket, FIONBIO, &yes) == SOCKET_ERROR)
return uv_translate_sys_error(WSAGetLastError());
- /* Try to obtain a base handle for the socket. This increases this chances */
- /* that we find an AFD handle and are able to use the fast poll mechanism. */
- /* This will always fail on windows XP/2k3, since they don't support the */
- /* SIO_BASE_HANDLE ioctl. */
+/* Try to obtain a base handle for the socket. This increases this chances that
+ * we find an AFD handle and are able to use the fast poll mechanism. This will
+ * always fail on windows XP/2k3, since they don't support the. SIO_BASE_HANDLE
+ * ioctl. */
#ifndef NDEBUG
base_socket = INVALID_SOCKET;
#endif
@@ -557,9 +556,9 @@ int uv_poll_init_socket(uv_loop_t* loop, uv_poll_t* handle,
return uv_translate_sys_error(WSAGetLastError());
}
- /* Get the peer socket that is needed to enable fast poll. If the returned */
- /* value is NULL, the protocol is not implemented by MSAFD and we'll have */
- /* to use slow mode. */
+ /* Get the peer socket that is needed to enable fast poll. If the returned
+ * value is NULL, the protocol is not implemented by MSAFD and we'll have to
+ * use slow mode. */
peer_socket = uv__fast_poll_get_peer_socket(loop, &protocol_info);
if (peer_socket != INVALID_SOCKET) {
@@ -634,7 +633,7 @@ int uv_poll_close(uv_loop_t* loop, uv_poll_t* handle) {
void uv_poll_endgame(uv_loop_t* loop, uv_poll_t* handle) {
- assert(handle->flags & UV__HANDLE_CLOSING);
+ assert(handle->flags & UV_HANDLE_CLOSING);
assert(!(handle->flags & UV_HANDLE_CLOSED));
assert(handle->submitted_events_1 == 0);
diff --git a/Utilities/cmlibuv/src/win/process-stdio.c b/Utilities/cmlibuv/src/win/process-stdio.c
index 032e30935..355d61880 100644
--- a/Utilities/cmlibuv/src/win/process-stdio.c
+++ b/Utilities/cmlibuv/src/win/process-stdio.c
@@ -103,12 +103,12 @@ static int uv__create_stdio_pipe_pair(uv_loop_t* loop,
DWORD client_access = 0;
HANDLE child_pipe = INVALID_HANDLE_VALUE;
int err;
+ int overlap;
if (flags & UV_READABLE_PIPE) {
- /* The server needs inbound access too, otherwise CreateNamedPipe() */
- /* won't give us the FILE_READ_ATTRIBUTES permission. We need that to */
- /* probe the state of the write buffer when we're trying to shutdown */
- /* the pipe. */
+ /* The server needs inbound access too, otherwise CreateNamedPipe() won't
+ * give us the FILE_READ_ATTRIBUTES permission. We need that to probe the
+ * state of the write buffer when we're trying to shutdown the pipe. */
server_access |= PIPE_ACCESS_OUTBOUND | PIPE_ACCESS_INBOUND;
client_access |= GENERIC_READ | FILE_WRITE_ATTRIBUTES;
}
@@ -131,12 +131,13 @@ static int uv__create_stdio_pipe_pair(uv_loop_t* loop,
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = TRUE;
+ overlap = server_pipe->ipc || (flags & UV_OVERLAPPED_PIPE);
child_pipe = CreateFileA(pipe_name,
client_access,
0,
&sa,
OPEN_EXISTING,
- server_pipe->ipc ? FILE_FLAG_OVERLAPPED : 0,
+ overlap ? FILE_FLAG_OVERLAPPED : 0,
NULL);
if (child_pipe == INVALID_HANDLE_VALUE) {
err = GetLastError();
@@ -159,8 +160,8 @@ static int uv__create_stdio_pipe_pair(uv_loop_t* loop,
}
#endif
- /* Do a blocking ConnectNamedPipe. This should not block because we have */
- /* both ends of the pipe created. */
+ /* Do a blocking ConnectNamedPipe. This should not block because we have both
+ * ends of the pipe created. */
if (!ConnectNamedPipe(server_pipe->handle, NULL)) {
if (GetLastError() != ERROR_PIPE_CONNECTED) {
err = GetLastError();
@@ -194,11 +195,11 @@ static int uv__duplicate_handle(uv_loop_t* loop, HANDLE handle, HANDLE* dup) {
HANDLE current_process;
- /* _get_osfhandle will sometimes return -2 in case of an error. This seems */
- /* to happen when fd <= 2 and the process' corresponding stdio handle is */
- /* set to NULL. Unfortunately DuplicateHandle will happily duplicate */
- /* (HANDLE) -2, so this situation goes unnoticed until someone tries to */
- /* use the duplicate. Therefore we filter out known-invalid handles here. */
+ /* _get_osfhandle will sometimes return -2 in case of an error. This seems to
+ * happen when fd <= 2 and the process' corresponding stdio handle is set to
+ * NULL. Unfortunately DuplicateHandle will happily duplicate (HANDLE) -2, so
+ * this situation goes unnoticed until someone tries to use the duplicate.
+ * Therefore we filter out known-invalid handles here. */
if (handle == INVALID_HANDLE_VALUE ||
handle == NULL ||
handle == (HANDLE) -2) {
@@ -284,8 +285,8 @@ int uv__stdio_create(uv_loop_t* loop,
return ERROR_OUTOFMEMORY;
}
- /* Prepopulate the buffer with INVALID_HANDLE_VALUE handles so we can */
- /* clean up on failure. */
+ /* Prepopulate the buffer with INVALID_HANDLE_VALUE handles so we can clean
+ * up on failure. */
CHILD_STDIO_COUNT(buffer) = count;
for (i = 0; i < count; i++) {
CHILD_STDIO_CRT_FLAGS(buffer, i) = 0;
@@ -303,12 +304,12 @@ int uv__stdio_create(uv_loop_t* loop,
switch (fdopt.flags & (UV_IGNORE | UV_CREATE_PIPE | UV_INHERIT_FD |
UV_INHERIT_STREAM)) {
case UV_IGNORE:
- /* Starting a process with no stdin/stout/stderr can confuse it. */
- /* So no matter what the user specified, we make sure the first */
- /* three FDs are always open in their typical modes, e.g. stdin */
- /* be readable and stdout/err should be writable. For FDs > 2, don't */
- /* do anything - all handles in the stdio buffer are initialized with */
- /* INVALID_HANDLE_VALUE, which should be okay. */
+ /* Starting a process with no stdin/stout/stderr can confuse it. So no
+ * matter what the user specified, we make sure the first three FDs are
+ * always open in their typical modes, e. g. stdin be readable and
+ * stdout/err should be writable. For FDs > 2, don't do anything - all
+ * handles in the stdio buffer are initialized with.
+ * INVALID_HANDLE_VALUE, which should be okay. */
if (i <= 2) {
DWORD access = (i == 0) ? FILE_GENERIC_READ :
FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES;
@@ -323,14 +324,14 @@ int uv__stdio_create(uv_loop_t* loop,
break;
case UV_CREATE_PIPE: {
- /* Create a pair of two connected pipe ends; one end is turned into */
- /* an uv_pipe_t for use by the parent. The other one is given to */
- /* the child. */
+ /* Create a pair of two connected pipe ends; one end is turned into an
+ * uv_pipe_t for use by the parent. The other one is given to the
+ * child. */
uv_pipe_t* parent_pipe = (uv_pipe_t*) fdopt.data.stream;
HANDLE child_pipe = INVALID_HANDLE_VALUE;
- /* Create a new, connected pipe pair. stdio[i].stream should point */
- /* to an uninitialized, but not connected pipe handle. */
+ /* Create a new, connected pipe pair. stdio[i]. stream should point to
+ * an uninitialized, but not connected pipe handle. */
assert(fdopt.data.stream->type == UV_NAMED_PIPE);
assert(!(fdopt.data.stream->flags & UV_HANDLE_CONNECTION));
assert(!(fdopt.data.stream->flags & UV_HANDLE_PIPESERVER));
@@ -354,8 +355,8 @@ int uv__stdio_create(uv_loop_t* loop,
/* Make an inheritable duplicate of the handle. */
err = uv__duplicate_fd(loop, fdopt.data.fd, &child_handle);
if (err) {
- /* If fdopt.data.fd is not valid and fd fd <= 2, then ignore the */
- /* error. */
+ /* If fdopt. data. fd is not valid and fd <= 2, then ignore the
+ * error. */
if (fdopt.data.fd <= 2 && err == ERROR_INVALID_HANDLE) {
CHILD_STDIO_CRT_FLAGS(buffer, i) = 0;
CHILD_STDIO_HANDLE(buffer, i) = INVALID_HANDLE_VALUE;
@@ -418,8 +419,8 @@ int uv__stdio_create(uv_loop_t* loop,
if (stream_handle == NULL ||
stream_handle == INVALID_HANDLE_VALUE) {
- /* The handle is already closed, or not yet created, or the */
- /* stream type is not supported. */
+ /* The handle is already closed, or not yet created, or the stream
+ * type is not supported. */
err = ERROR_NOT_SUPPORTED;
goto error;
}
diff --git a/Utilities/cmlibuv/src/win/process.c b/Utilities/cmlibuv/src/win/process.c
index 25cfe87c4..24037b302 100644
--- a/Utilities/cmlibuv/src/win/process.c
+++ b/Utilities/cmlibuv/src/win/process.c
@@ -360,8 +360,8 @@ static WCHAR* search_path(const WCHAR *file,
return NULL;
}
- /* Find the start of the filename so we can split the directory from the */
- /* name. */
+ /* Find the start of the filename so we can split the directory from the
+ * name. */
for (file_name_start = (WCHAR*)file + file_len;
file_name_start > file
&& file_name_start[-1] != L'\\'
@@ -556,8 +556,8 @@ int make_program_args(char** args, int verbatim_arguments, WCHAR** dst_ptr) {
arg_count++;
}
- /* Adjust for potential quotes. Also assume the worst-case scenario */
- /* that every character needs escaping, so we need twice as much space. */
+ /* Adjust for potential quotes. Also assume the worst-case scenario that
+ * every character needs escaping, so we need twice as much space. */
dst_len = dst_len * 2 + arg_count * 2;
/* Allocate buffer for the final command line. */
@@ -739,7 +739,7 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) {
}
}
*ptr_copy = NULL;
- assert(env_len == ptr - dst_copy);
+ assert(env_len == (size_t) (ptr - dst_copy));
/* sort our (UTF-16) copy */
qsort(env_copy, env_block_count-1, sizeof(wchar_t*), qsort_wcscmp);
@@ -799,7 +799,7 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) {
var_size = GetEnvironmentVariableW(required_vars[i].wide,
ptr,
(int) (env_len - (ptr - dst)));
- if (var_size != len-1) { /* race condition? */
+ if (var_size != (DWORD) (len - 1)) { /* TODO: handle race condition? */
uv_fatal_error(GetLastError(), "GetEnvironmentVariableW");
}
}
@@ -815,7 +815,7 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) {
}
/* Terminate with an extra NULL. */
- assert(env_len == (ptr - dst));
+ assert(env_len == (size_t) (ptr - dst));
*ptr = L'\0';
uv__free(dst_copy);
@@ -831,8 +831,13 @@ int make_program_env(char* env_block[], WCHAR** dst_ptr) {
*/
static WCHAR* find_path(WCHAR *env) {
for (; env != NULL && *env != 0; env += wcslen(env) + 1) {
- if (wcsncmp(env, L"PATH=", 5) == 0)
+ if ((env[0] == L'P' || env[0] == L'p') &&
+ (env[1] == L'A' || env[1] == L'a') &&
+ (env[2] == L'T' || env[2] == L't') &&
+ (env[3] == L'H' || env[3] == L'h') &&
+ (env[4] == L'=')) {
return &env[5];
+ }
}
return NULL;
@@ -865,9 +870,9 @@ void uv_process_proc_exit(uv_loop_t* loop, uv_process_t* handle) {
assert(handle->exit_cb_pending);
handle->exit_cb_pending = 0;
- /* If we're closing, don't call the exit callback. Just schedule a close */
- /* callback now. */
- if (handle->flags & UV__HANDLE_CLOSING) {
+ /* If we're closing, don't call the exit callback. Just schedule a close
+ * callback now. */
+ if (handle->flags & UV_HANDLE_CLOSING) {
uv_want_endgame(loop, (uv_handle_t*) handle);
return;
}
@@ -878,14 +883,14 @@ void uv_process_proc_exit(uv_loop_t* loop, uv_process_t* handle) {
handle->wait_handle = INVALID_HANDLE_VALUE;
}
- /* Set the handle to inactive: no callbacks will be made after the exit */
- /* callback.*/
+ /* Set the handle to inactive: no callbacks will be made after the exit
+ * callback. */
uv__handle_stop(handle);
if (GetExitCodeProcess(handle->process_handle, &status)) {
exit_code = status;
} else {
- /* Unable to to obtain the exit code. This should never happen. */
+ /* Unable to obtain the exit code. This should never happen. */
exit_code = uv_translate_sys_error(GetLastError());
}
@@ -900,8 +905,8 @@ void uv_process_close(uv_loop_t* loop, uv_process_t* handle) {
uv__handle_closing(handle);
if (handle->wait_handle != INVALID_HANDLE_VALUE) {
- /* This blocks until either the wait was cancelled, or the callback has */
- /* completed. */
+ /* This blocks until either the wait was cancelled, or the callback has
+ * completed. */
BOOL r = UnregisterWaitEx(handle->wait_handle, INVALID_HANDLE_VALUE);
if (!r) {
/* This should never happen, and if it happens, we can't recover... */
@@ -919,7 +924,7 @@ void uv_process_close(uv_loop_t* loop, uv_process_t* handle) {
void uv_process_endgame(uv_loop_t* loop, uv_process_t* handle) {
assert(!handle->exit_cb_pending);
- assert(handle->flags & UV__HANDLE_CLOSING);
+ assert(handle->flags & UV_HANDLE_CLOSING);
assert(!(handle->flags & UV_HANDLE_CLOSED));
/* Clean-up the process handle. */
@@ -965,6 +970,8 @@ int uv_spawn(uv_loop_t* loop,
UV_PROCESS_SETGID |
UV_PROCESS_SETUID |
UV_PROCESS_WINDOWS_HIDE |
+ UV_PROCESS_WINDOWS_HIDE_CONSOLE |
+ UV_PROCESS_WINDOWS_HIDE_GUI |
UV_PROCESS_WINDOWS_VERBATIM_ARGUMENTS)));
err = uv_utf8_to_utf16_alloc(options->file, &application);
@@ -1066,7 +1073,8 @@ int uv_spawn(uv_loop_t* loop,
process_flags = CREATE_UNICODE_ENVIRONMENT;
- if (options->flags & UV_PROCESS_WINDOWS_HIDE) {
+ if ((options->flags & UV_PROCESS_WINDOWS_HIDE_CONSOLE) ||
+ (options->flags & UV_PROCESS_WINDOWS_HIDE)) {
/* Avoid creating console window if stdio is not inherited. */
for (i = 0; i < options->stdio_count; i++) {
if (options->stdio[i].flags & UV_INHERIT_FD)
@@ -1074,7 +1082,9 @@ int uv_spawn(uv_loop_t* loop,
if (i == options->stdio_count - 1)
process_flags |= CREATE_NO_WINDOW;
}
-
+ }
+ if ((options->flags & UV_PROCESS_WINDOWS_HIDE_GUI) ||
+ (options->flags & UV_PROCESS_WINDOWS_HIDE)) {
/* Use SW_HIDE to avoid any potential process window. */
startup.wShowWindow = SW_HIDE;
} else {
@@ -1160,14 +1170,13 @@ int uv_spawn(uv_loop_t* loop,
}
}
- /* Spawn succeeded */
- /* Beyond this point, failure is reported asynchronously. */
+ /* Spawn succeeded. Beyond this point, failure is reported asynchronously. */
process->process_handle = info.hProcess;
process->pid = info.dwProcessId;
- /* If the process isn't spawned as detached, assign to the global job */
- /* object so windows will kill it when the parent process dies. */
+ /* If the process isn't spawned as detached, assign to the global job object
+ * so windows will kill it when the parent process dies. */
if (!(options->flags & UV_PROCESS_DETACHED)) {
uv_once(&uv_global_job_handle_init_guard_, uv__init_global_job_handle);
@@ -1194,7 +1203,8 @@ int uv_spawn(uv_loop_t* loop,
if (fdopt->flags & UV_CREATE_PIPE &&
fdopt->data.stream->type == UV_NAMED_PIPE &&
((uv_pipe_t*) fdopt->data.stream)->ipc) {
- ((uv_pipe_t*) fdopt->data.stream)->pipe.conn.ipc_pid = info.dwProcessId;
+ ((uv_pipe_t*) fdopt->data.stream)->pipe.conn.ipc_remote_pid =
+ info.dwProcessId;
}
}
@@ -1210,8 +1220,8 @@ int uv_spawn(uv_loop_t* loop,
assert(!err);
- /* Make the handle active. It will remain active until the exit callback */
- /* is made or the handle is closed, whichever happens first. */
+ /* Make the handle active. It will remain active until the exit callback is
+ * made or the handle is closed, whichever happens first. */
uv__handle_start(process);
/* Cleanup, whether we succeeded or failed. */
@@ -1242,16 +1252,16 @@ static int uv__kill(HANDLE process_handle, int signum) {
case SIGTERM:
case SIGKILL:
case SIGINT: {
- /* Unconditionally terminate the process. On Windows, killed processes */
- /* normally return 1. */
+ /* Unconditionally terminate the process. On Windows, killed processes
+ * normally return 1. */
DWORD status;
int err;
if (TerminateProcess(process_handle, 1))
return 0;
- /* If the process already exited before TerminateProcess was called, */
- /* TerminateProcess will fail with ERROR_ACCESS_DENIED. */
+ /* If the process already exited before TerminateProcess was called,.
+ * TerminateProcess will fail with ERROR_ACCESS_DENIED. */
err = GetLastError();
if (err == ERROR_ACCESS_DENIED &&
GetExitCodeProcess(process_handle, &status) &&
diff --git a/Utilities/cmlibuv/src/win/req.c b/Utilities/cmlibuv/src/win/req.c
deleted file mode 100644
index 111cc5e28..000000000
--- a/Utilities/cmlibuv/src/win/req.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include <assert.h>
-
-#include "uv.h"
-#include "internal.h"
diff --git a/Utilities/cmlibuv/src/win/signal.c b/Utilities/cmlibuv/src/win/signal.c
index a174da1f7..276dc6097 100644
--- a/Utilities/cmlibuv/src/win/signal.c
+++ b/Utilities/cmlibuv/src/win/signal.c
@@ -47,13 +47,13 @@ void uv_signals_init(void) {
static int uv__signal_compare(uv_signal_t* w1, uv_signal_t* w2) {
- /* Compare signums first so all watchers with the same signnum end up */
- /* adjacent. */
+ /* Compare signums first so all watchers with the same signnum end up
+ * adjacent. */
if (w1->signum < w2->signum) return -1;
if (w1->signum > w2->signum) return 1;
- /* Sort by loop pointer, so we can easily look up the first item after */
- /* { .signum = x, .loop = NULL } */
+ /* Sort by loop pointer, so we can easily look up the first item after
+ * { .signum = x, .loop = NULL }. */
if ((uintptr_t) w1->loop < (uintptr_t) w2->loop) return -1;
if ((uintptr_t) w1->loop > (uintptr_t) w2->loop) return 1;
@@ -90,7 +90,7 @@ int uv__signal_dispatch(int signum) {
unsigned long previous = InterlockedExchange(
(volatile LONG*) &handle->pending_signum, signum);
- if (handle->flags & UV__SIGNAL_ONE_SHOT_DISPATCHED)
+ if (handle->flags & UV_SIGNAL_ONE_SHOT_DISPATCHED)
continue;
if (!previous) {
@@ -98,8 +98,8 @@ int uv__signal_dispatch(int signum) {
}
dispatched = 1;
- if (handle->flags & UV__SIGNAL_ONE_SHOT)
- handle->flags |= UV__SIGNAL_ONE_SHOT_DISPATCHED;
+ if (handle->flags & UV_SIGNAL_ONE_SHOT)
+ handle->flags |= UV_SIGNAL_ONE_SHOT_DISPATCHED;
}
LeaveCriticalSection(&uv__signal_lock);
@@ -118,10 +118,10 @@ static BOOL WINAPI uv__signal_control_handler(DWORD type) {
case CTRL_CLOSE_EVENT:
if (uv__signal_dispatch(SIGHUP)) {
- /* Windows will terminate the process after the control handler */
- /* returns. After that it will just terminate our process. Therefore */
- /* block the signal handler so the main loop has some time to pick */
- /* up the signal and do something for a few seconds. */
+ /* Windows will terminate the process after the control handler
+ * returns. After that it will just terminate our process. Therefore
+ * block the signal handler so the main loop has some time to pick up
+ * the signal and do something for a few seconds. */
Sleep(INFINITE);
return TRUE;
}
@@ -129,8 +129,8 @@ static BOOL WINAPI uv__signal_control_handler(DWORD type) {
case CTRL_LOGOFF_EVENT:
case CTRL_SHUTDOWN_EVENT:
- /* These signals are only sent to services. Services have their own */
- /* notification mechanism, so there's no point in handling these. */
+ /* These signals are only sent to services. Services have their own
+ * notification mechanism, so there's no point in handling these. */
default:
/* We don't handle these. */
@@ -190,13 +190,13 @@ int uv__signal_start(uv_signal_t* handle,
int signum,
int oneshot) {
/* Test for invalid signal values. */
- if (signum != SIGWINCH && (signum <= 0 || signum >= NSIG))
+ if (signum <= 0 || signum >= NSIG)
return UV_EINVAL;
- /* Short circuit: if the signal watcher is already watching {signum} don't */
- /* go through the process of deregistering and registering the handler. */
- /* Additionally, this avoids pending signals getting lost in the (small) */
- /* time frame that handle->signum == 0. */
+ /* Short circuit: if the signal watcher is already watching {signum} don't go
+ * through the process of deregistering and registering the handler.
+ * Additionally, this avoids pending signals getting lost in the (small) time
+ * frame that handle->signum == 0. */
if (signum == handle->signum) {
handle->signal_cb = signal_cb;
return 0;
@@ -213,7 +213,7 @@ int uv__signal_start(uv_signal_t* handle,
handle->signum = signum;
if (oneshot)
- handle->flags |= UV__SIGNAL_ONE_SHOT;
+ handle->flags |= UV_SIGNAL_ONE_SHOT;
RB_INSERT(uv_signal_tree_s, &uv__signal_tree, handle);
@@ -237,16 +237,16 @@ void uv_process_signal_req(uv_loop_t* loop, uv_signal_t* handle,
(volatile LONG*) &handle->pending_signum, 0);
assert(dispatched_signum != 0);
- /* Check if the pending signal equals the signum that we are watching for. */
- /* These can get out of sync when the handler is stopped and restarted */
- /* while the signal_req is pending. */
+ /* Check if the pending signal equals the signum that we are watching for.
+ * These can get out of sync when the handler is stopped and restarted while
+ * the signal_req is pending. */
if (dispatched_signum == handle->signum)
handle->signal_cb(handle, dispatched_signum);
- if (handle->flags & UV__SIGNAL_ONE_SHOT)
+ if (handle->flags & UV_SIGNAL_ONE_SHOT)
uv_signal_stop(handle);
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
/* When it is closing, it must be stopped at this point. */
assert(handle->signum == 0);
uv_want_endgame(loop, (uv_handle_t*) handle);
@@ -265,7 +265,7 @@ void uv_signal_close(uv_loop_t* loop, uv_signal_t* handle) {
void uv_signal_endgame(uv_loop_t* loop, uv_signal_t* handle) {
- assert(handle->flags & UV__HANDLE_CLOSING);
+ assert(handle->flags & UV_HANDLE_CLOSING);
assert(!(handle->flags & UV_HANDLE_CLOSED));
assert(handle->signum == 0);
diff --git a/Utilities/cmlibuv/src/win/stream.c b/Utilities/cmlibuv/src/win/stream.c
index 13cbfdcb9..7656627e9 100644
--- a/Utilities/cmlibuv/src/win/stream.c
+++ b/Utilities/cmlibuv/src/win/stream.c
@@ -105,12 +105,10 @@ int uv_read_stop(uv_stream_t* handle) {
err = 0;
if (handle->type == UV_TTY) {
err = uv_tty_read_stop((uv_tty_t*) handle);
+ } else if (handle->type == UV_NAMED_PIPE) {
+ uv__pipe_read_stop((uv_pipe_t*) handle);
} else {
- if (handle->type == UV_NAMED_PIPE) {
- uv__pipe_stop_read((uv_pipe_t*) handle);
- } else {
- handle->flags &= ~UV_HANDLE_READING;
- }
+ handle->flags &= ~UV_HANDLE_READING;
DECREASE_ACTIVE_COUNT(handle->loop, handle);
}
@@ -136,7 +134,8 @@ int uv_write(uv_write_t* req,
err = uv_tcp_write(loop, req, (uv_tcp_t*) handle, bufs, nbufs, cb);
break;
case UV_NAMED_PIPE:
- err = uv_pipe_write(loop, req, (uv_pipe_t*) handle, bufs, nbufs, cb);
+ err = uv__pipe_write(
+ loop, req, (uv_pipe_t*) handle, bufs, nbufs, NULL, cb);
break;
case UV_TTY:
err = uv_tty_write(loop, req, (uv_tty_t*) handle, bufs, nbufs, cb);
@@ -158,25 +157,18 @@ int uv_write2(uv_write_t* req,
uv_loop_t* loop = handle->loop;
int err;
- if (!(handle->flags & UV_HANDLE_WRITABLE)) {
- return UV_EPIPE;
+ if (send_handle == NULL) {
+ return uv_write(req, handle, bufs, nbufs, cb);
}
- err = ERROR_INVALID_PARAMETER;
- switch (handle->type) {
- case UV_NAMED_PIPE:
- err = uv_pipe_write2(loop,
- req,
- (uv_pipe_t*) handle,
- bufs,
- nbufs,
- send_handle,
- cb);
- break;
- default:
- assert(0);
+ if (handle->type != UV_NAMED_PIPE || !((uv_pipe_t*) handle)->ipc) {
+ return UV_EINVAL;
+ } else if (!(handle->flags & UV_HANDLE_WRITABLE)) {
+ return UV_EPIPE;
}
+ err = uv__pipe_write(
+ loop, req, (uv_pipe_t*) handle, bufs, nbufs, send_handle, cb);
return uv_translate_sys_error(err);
}
@@ -184,7 +176,7 @@ int uv_write2(uv_write_t* req,
int uv_try_write(uv_stream_t* stream,
const uv_buf_t bufs[],
unsigned int nbufs) {
- if (stream->flags & UV__HANDLE_CLOSING)
+ if (stream->flags & UV_HANDLE_CLOSING)
return UV_EBADF;
if (!(stream->flags & UV_HANDLE_WRITABLE))
return UV_EPIPE;
diff --git a/Utilities/cmlibuv/src/win/tcp.c b/Utilities/cmlibuv/src/win/tcp.c
index 39c1ff056..3ce5548c0 100644
--- a/Utilities/cmlibuv/src/win/tcp.c
+++ b/Utilities/cmlibuv/src/win/tcp.c
@@ -99,8 +99,8 @@ static int uv_tcp_set_socket(uv_loop_t* loop,
if (!SetHandleInformation((HANDLE) socket, HANDLE_FLAG_INHERIT, 0))
return GetLastError();
- /* Associate it with the I/O completion port. */
- /* Use uv_handle_t pointer as completion key. */
+ /* Associate it with the I/O completion port. Use uv_handle_t pointer as
+ * completion key. */
if (CreateIoCompletionPort((HANDLE)socket,
loop->iocp,
(ULONG_PTR)socket,
@@ -118,15 +118,12 @@ static int uv_tcp_set_socket(uv_loop_t* loop,
non_ifs_lsp = uv_tcp_non_ifs_lsp_ipv4;
}
- if (pSetFileCompletionNotificationModes &&
- !(handle->flags & UV_HANDLE_EMULATE_IOCP) && !non_ifs_lsp) {
- if (pSetFileCompletionNotificationModes((HANDLE) socket,
- FILE_SKIP_SET_EVENT_ON_HANDLE |
- FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) {
- handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP;
- } else if (GetLastError() != ERROR_INVALID_FUNCTION) {
+ if (!(handle->flags & UV_HANDLE_EMULATE_IOCP) && !non_ifs_lsp) {
+ UCHAR sfcnm_flags =
+ FILE_SKIP_SET_EVENT_ON_HANDLE | FILE_SKIP_COMPLETION_PORT_ON_SUCCESS;
+ if (!SetFileCompletionNotificationModes((HANDLE) socket, sfcnm_flags))
return GetLastError();
- }
+ handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP;
}
if (handle->flags & UV_HANDLE_TCP_NODELAY) {
@@ -220,7 +217,7 @@ void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) {
UNREGISTER_HANDLE_REQ(loop, handle, handle->stream.conn.shutdown_req);
err = 0;
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
err = ERROR_OPERATION_ABORTED;
} else if (shutdown(handle->socket, SD_SEND) == SOCKET_ERROR) {
err = WSAGetLastError();
@@ -236,7 +233,7 @@ void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) {
return;
}
- if (handle->flags & UV__HANDLE_CLOSING &&
+ if (handle->flags & UV_HANDLE_CLOSING &&
handle->reqs_pending == 0) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
@@ -326,9 +323,9 @@ static int uv_tcp_try_bind(uv_tcp_t* handle,
on = (flags & UV_TCP_IPV6ONLY) != 0;
- /* TODO: how to handle errors? This may fail if there is no ipv4 stack */
- /* available, or when run on XP/2003 which have no support for dualstack */
- /* sockets. For now we're silently ignoring the error. */
+ /* TODO: how to handle errors? This may fail if there is no ipv4 stack
+ * available, or when run on XP/2003 which have no support for dualstack
+ * sockets. For now we're silently ignoring the error. */
setsockopt(handle->socket,
IPPROTO_IPV6,
IPV6_V6ONLY,
@@ -626,9 +623,9 @@ int uv_tcp_listen(uv_tcp_t* handle, int backlog, uv_connection_cb cb) {
uv_tcp_queue_accept(handle, req);
}
- /* Initialize other unused requests too, because uv_tcp_endgame */
- /* doesn't know how how many requests were initialized, so it will */
- /* try to clean up {uv_simultaneous_server_accepts} requests. */
+ /* Initialize other unused requests too, because uv_tcp_endgame doesn't
+ * know how many requests were initialized, so it will try to clean up
+ * {uv_simultaneous_server_accepts} requests. */
for (i = simultaneous_accepts; i < uv_simultaneous_server_accepts; i++) {
req = &handle->tcp.serv.accept_reqs[i];
UV_REQ_INIT(req, UV_ACCEPT);
@@ -683,7 +680,7 @@ int uv_tcp_accept(uv_tcp_t* server, uv_tcp_t* client) {
req->next_pending = NULL;
req->accept_socket = INVALID_SOCKET;
- if (!(server->flags & UV__HANDLE_CLOSING)) {
+ if (!(server->flags & UV_HANDLE_CLOSING)) {
/* Check if we're in a middle of changing the number of pending accepts. */
if (!(server->flags & UV_HANDLE_TCP_ACCEPT_STATE_CHANGING)) {
uv_tcp_queue_accept(server, req);
@@ -721,8 +718,8 @@ int uv_tcp_read_start(uv_tcp_t* handle, uv_alloc_cb alloc_cb,
handle->alloc_cb = alloc_cb;
INCREASE_ACTIVE_COUNT(loop, handle);
- /* If reading was stopped and then started again, there could still be a */
- /* read request pending. */
+ /* If reading was stopped and then started again, there could still be a read
+ * request pending. */
if (!(handle->flags & UV_HANDLE_READ_PENDING)) {
if (handle->flags & UV_HANDLE_EMULATE_IOCP &&
!handle->read_req.event_handle) {
@@ -948,6 +945,7 @@ void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,
uv_req_t* req) {
DWORD bytes, flags, err;
uv_buf_t buf;
+ int count;
assert(handle->type == UV_TCP);
@@ -965,8 +963,7 @@ void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,
err = GET_REQ_SOCK_ERROR(req);
if (err == WSAECONNABORTED) {
- /*
- * Turn WSAECONNABORTED into UV_ECONNRESET to be consistent with Unix.
+ /* Turn WSAECONNABORTED into UV_ECONNRESET to be consistent with Unix.
*/
err = WSAECONNRESET;
}
@@ -1003,7 +1000,8 @@ void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,
}
/* Do nonblocking reads until the buffer is empty */
- while (handle->flags & UV_HANDLE_READING) {
+ count = 32;
+ while ((handle->flags & UV_HANDLE_READING) && (count-- > 0)) {
buf = uv_buf_init(NULL, 0);
handle->alloc_cb((uv_handle_t*) handle, 65536, &buf);
if (buf.base == NULL || buf.len == 0) {
@@ -1046,8 +1044,8 @@ void uv_process_tcp_read_req(uv_loop_t* loop, uv_tcp_t* handle,
DECREASE_ACTIVE_COUNT(loop, handle);
if (err == WSAECONNABORTED) {
- /* Turn WSAECONNABORTED into UV_ECONNRESET to be consistent with */
- /* Unix. */
+ /* Turn WSAECONNABORTED into UV_ECONNRESET to be consistent with
+ * Unix. */
err = WSAECONNRESET;
}
@@ -1119,10 +1117,9 @@ void uv_process_tcp_accept_req(uv_loop_t* loop, uv_tcp_t* handle,
assert(handle->type == UV_TCP);
- /* If handle->accepted_socket is not a valid socket, then */
- /* uv_queue_accept must have failed. This is a serious error. We stop */
- /* accepting connections and report this error to the connection */
- /* callback. */
+ /* If handle->accepted_socket is not a valid socket, then uv_queue_accept
+ * must have failed. This is a serious error. We stop accepting connections
+ * and report this error to the connection callback. */
if (req->accept_socket == INVALID_SOCKET) {
if (handle->flags & UV_HANDLE_LISTENING) {
handle->flags &= ~UV_HANDLE_LISTENING;
@@ -1147,9 +1144,9 @@ void uv_process_tcp_accept_req(uv_loop_t* loop, uv_tcp_t* handle,
handle->stream.serv.connection_cb((uv_stream_t*)handle, 0);
}
} else {
- /* Error related to accepted socket is ignored because the server */
- /* socket may still be healthy. If the server socket is broken */
- /* uv_queue_accept will detect it. */
+ /* Error related to accepted socket is ignored because the server socket
+ * may still be healthy. If the server socket is broken uv_queue_accept
+ * will detect it. */
closesocket(req->accept_socket);
req->accept_socket = INVALID_SOCKET;
if (handle->flags & UV_HANDLE_LISTENING) {
@@ -1171,7 +1168,7 @@ void uv_process_tcp_connect_req(uv_loop_t* loop, uv_tcp_t* handle,
err = 0;
if (REQ_SUCCESS(req)) {
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
/* use UV_ECANCELED for consistency with Unix */
err = ERROR_OPERATION_ABORTED;
} else if (setsockopt(handle->socket,
@@ -1194,40 +1191,76 @@ void uv_process_tcp_connect_req(uv_loop_t* loop, uv_tcp_t* handle,
}
-int uv_tcp_import(uv_tcp_t* tcp, uv__ipc_socket_info_ex* socket_info_ex,
- int tcp_connection) {
+int uv__tcp_xfer_export(uv_tcp_t* handle,
+ int target_pid,
+ uv__ipc_socket_xfer_type_t* xfer_type,
+ uv__ipc_socket_xfer_info_t* xfer_info) {
+ if (handle->flags & UV_HANDLE_CONNECTION) {
+ *xfer_type = UV__IPC_SOCKET_XFER_TCP_CONNECTION;
+ } else {
+ *xfer_type = UV__IPC_SOCKET_XFER_TCP_SERVER;
+ /* We're about to share the socket with another process. Because this is a
+ * listening socket, we assume that the other process will be accepting
+ * connections on it. Thus, before sharing the socket with another process,
+ * we call listen here in the parent process. */
+ if (!(handle->flags & UV_HANDLE_LISTENING)) {
+ if (!(handle->flags & UV_HANDLE_BOUND)) {
+ return ERROR_NOT_SUPPORTED;
+ }
+ if (handle->delayed_error == 0 &&
+ listen(handle->socket, SOMAXCONN) == SOCKET_ERROR) {
+ handle->delayed_error = WSAGetLastError();
+ }
+ }
+ }
+
+ if (WSADuplicateSocketW(handle->socket, target_pid, &xfer_info->socket_info))
+ return WSAGetLastError();
+ xfer_info->delayed_error = handle->delayed_error;
+
+ /* Mark the local copy of the handle as 'shared' so we behave in a way that's
+ * friendly to the process(es) that we share the socket with. */
+ handle->flags |= UV_HANDLE_SHARED_TCP_SOCKET;
+
+ return 0;
+}
+
+
+int uv__tcp_xfer_import(uv_tcp_t* tcp,
+ uv__ipc_socket_xfer_type_t xfer_type,
+ uv__ipc_socket_xfer_info_t* xfer_info) {
int err;
- SOCKET socket = WSASocketW(FROM_PROTOCOL_INFO,
- FROM_PROTOCOL_INFO,
- FROM_PROTOCOL_INFO,
- &socket_info_ex->socket_info,
- 0,
- WSA_FLAG_OVERLAPPED);
+ SOCKET socket;
+
+ assert(xfer_type == UV__IPC_SOCKET_XFER_TCP_SERVER ||
+ xfer_type == UV__IPC_SOCKET_XFER_TCP_CONNECTION);
+
+ socket = WSASocketW(FROM_PROTOCOL_INFO,
+ FROM_PROTOCOL_INFO,
+ FROM_PROTOCOL_INFO,
+ &xfer_info->socket_info,
+ 0,
+ WSA_FLAG_OVERLAPPED);
if (socket == INVALID_SOCKET) {
return WSAGetLastError();
}
- err = uv_tcp_set_socket(tcp->loop,
- tcp,
- socket,
- socket_info_ex->socket_info.iAddressFamily,
- 1);
+ err = uv_tcp_set_socket(
+ tcp->loop, tcp, socket, xfer_info->socket_info.iAddressFamily, 1);
if (err) {
closesocket(socket);
return err;
}
- if (tcp_connection) {
+ tcp->delayed_error = xfer_info->delayed_error;
+ tcp->flags |= UV_HANDLE_BOUND | UV_HANDLE_SHARED_TCP_SOCKET;
+
+ if (xfer_type == UV__IPC_SOCKET_XFER_TCP_CONNECTION) {
uv_connection_init((uv_stream_t*)tcp);
tcp->flags |= UV_HANDLE_READABLE | UV_HANDLE_WRITABLE;
}
- tcp->flags |= UV_HANDLE_BOUND;
- tcp->flags |= UV_HANDLE_SHARED_TCP_SOCKET;
-
- tcp->delayed_error = socket_info_ex->delayed_error;
-
tcp->loop->active_tcp_streams++;
return 0;
}
@@ -1273,39 +1306,6 @@ int uv_tcp_keepalive(uv_tcp_t* handle, int enable, unsigned int delay) {
}
-int uv_tcp_duplicate_socket(uv_tcp_t* handle, int pid,
- LPWSAPROTOCOL_INFOW protocol_info) {
- if (!(handle->flags & UV_HANDLE_CONNECTION)) {
- /*
- * We're about to share the socket with another process. Because
- * this is a listening socket, we assume that the other process will
- * be accepting connections on it. So, before sharing the socket
- * with another process, we call listen here in the parent process.
- */
-
- if (!(handle->flags & UV_HANDLE_LISTENING)) {
- if (!(handle->flags & UV_HANDLE_BOUND)) {
- return ERROR_INVALID_PARAMETER;
- }
-
- if (!(handle->delayed_error)) {
- if (listen(handle->socket, SOMAXCONN) == SOCKET_ERROR) {
- handle->delayed_error = WSAGetLastError();
- }
- }
- }
- }
-
- if (WSADuplicateSocketW(handle->socket, pid, protocol_info)) {
- return WSAGetLastError();
- }
-
- handle->flags |= UV_HANDLE_SHARED_TCP_SOCKET;
-
- return 0;
-}
-
-
int uv_tcp_simultaneous_accepts(uv_tcp_t* handle, int enable) {
if (handle->flags & UV_HANDLE_CONNECTION) {
return UV_EINVAL;
@@ -1346,8 +1346,8 @@ static int uv_tcp_try_cancel_io(uv_tcp_t* tcp) {
non_ifs_lsp = (tcp->flags & UV_HANDLE_IPV6) ? uv_tcp_non_ifs_lsp_ipv6 :
uv_tcp_non_ifs_lsp_ipv4;
- /* If there are non-ifs LSPs then try to obtain a base handle for the */
- /* socket. This will always fail on Windows XP/3k. */
+ /* If there are non-ifs LSPs then try to obtain a base handle for the socket.
+ * This will always fail on Windows XP/3k. */
if (non_ifs_lsp) {
DWORD bytes;
if (WSAIoctl(socket,
@@ -1379,38 +1379,37 @@ void uv_tcp_close(uv_loop_t* loop, uv_tcp_t* tcp) {
int close_socket = 1;
if (tcp->flags & UV_HANDLE_READ_PENDING) {
- /* In order for winsock to do a graceful close there must not be any */
- /* any pending reads, or the socket must be shut down for writing */
+ /* In order for winsock to do a graceful close there must not be any any
+ * pending reads, or the socket must be shut down for writing */
if (!(tcp->flags & UV_HANDLE_SHARED_TCP_SOCKET)) {
/* Just do shutdown on non-shared sockets, which ensures graceful close. */
shutdown(tcp->socket, SD_SEND);
} else if (uv_tcp_try_cancel_io(tcp) == 0) {
- /* In case of a shared socket, we try to cancel all outstanding I/O, */
- /* If that works, don't close the socket yet - wait for the read req to */
- /* return and close the socket in uv_tcp_endgame. */
+ /* In case of a shared socket, we try to cancel all outstanding I/O,. If
+ * that works, don't close the socket yet - wait for the read req to
+ * return and close the socket in uv_tcp_endgame. */
close_socket = 0;
} else {
- /* When cancelling isn't possible - which could happen when an LSP is */
- /* present on an old Windows version, we will have to close the socket */
- /* with a read pending. That is not nice because trailing sent bytes */
- /* may not make it to the other side. */
+ /* When cancelling isn't possible - which could happen when an LSP is
+ * present on an old Windows version, we will have to close the socket
+ * with a read pending. That is not nice because trailing sent bytes may
+ * not make it to the other side. */
}
} else if ((tcp->flags & UV_HANDLE_SHARED_TCP_SOCKET) &&
tcp->tcp.serv.accept_reqs != NULL) {
- /* Under normal circumstances closesocket() will ensure that all pending */
- /* accept reqs are canceled. However, when the socket is shared the */
- /* presence of another reference to the socket in another process will */
- /* keep the accept reqs going, so we have to ensure that these are */
- /* canceled. */
+ /* Under normal circumstances closesocket() will ensure that all pending
+ * accept reqs are canceled. However, when the socket is shared the
+ * presence of another reference to the socket in another process will keep
+ * the accept reqs going, so we have to ensure that these are canceled. */
if (uv_tcp_try_cancel_io(tcp) != 0) {
- /* When cancellation is not possible, there is another option: we can */
- /* close the incoming sockets, which will also cancel the accept */
- /* operations. However this is not cool because we might inadvertently */
- /* close a socket that just accepted a new connection, which will */
- /* cause the connection to be aborted. */
+ /* When cancellation is not possible, there is another option: we can
+ * close the incoming sockets, which will also cancel the accept
+ * operations. However this is not cool because we might inadvertently
+ * close a socket that just accepted a new connection, which will cause
+ * the connection to be aborted. */
unsigned int i;
for (i = 0; i < uv_simultaneous_server_accepts; i++) {
uv_tcp_accept_t* req = &tcp->tcp.serv.accept_reqs[i];
diff --git a/Utilities/cmlibuv/src/win/thread.c b/Utilities/cmlibuv/src/win/thread.c
index 9eaad77cd..fd4b7c986 100644
--- a/Utilities/cmlibuv/src/win/thread.c
+++ b/Utilities/cmlibuv/src/win/thread.c
@@ -23,29 +23,15 @@
#include <limits.h>
#include <stdlib.h>
+#if defined(__MINGW64_VERSION_MAJOR)
+/* MemoryBarrier expands to __mm_mfence in some cases (x86+sse2), which may
+ * require this header in some versions of mingw64. */
+#include <intrin.h>
+#endif
+
#include "uv.h"
#include "internal.h"
-
-#define HAVE_CONDVAR_API() (pInitializeConditionVariable != NULL)
-
-static int uv_cond_fallback_init(uv_cond_t* cond);
-static void uv_cond_fallback_destroy(uv_cond_t* cond);
-static void uv_cond_fallback_signal(uv_cond_t* cond);
-static void uv_cond_fallback_broadcast(uv_cond_t* cond);
-static void uv_cond_fallback_wait(uv_cond_t* cond, uv_mutex_t* mutex);
-static int uv_cond_fallback_timedwait(uv_cond_t* cond,
- uv_mutex_t* mutex, uint64_t timeout);
-
-static int uv_cond_condvar_init(uv_cond_t* cond);
-static void uv_cond_condvar_destroy(uv_cond_t* cond);
-static void uv_cond_condvar_signal(uv_cond_t* cond);
-static void uv_cond_condvar_broadcast(uv_cond_t* cond);
-static void uv_cond_condvar_wait(uv_cond_t* cond, uv_mutex_t* mutex);
-static int uv_cond_condvar_timedwait(uv_cond_t* cond,
- uv_mutex_t* mutex, uint64_t timeout);
-
-
static void uv__once_inner(uv_once_t* guard, void (*callback)(void)) {
DWORD result;
HANDLE existing_event, created_event;
@@ -69,8 +55,8 @@ static void uv__once_inner(uv_once_t* guard, void (*callback)(void)) {
guard->ran = 1;
} else {
- /* We lost the race. Destroy the event we created and wait for the */
- /* existing one to become signaled. */
+ /* We lost the race. Destroy the event we created and wait for the existing
+ * one to become signaled. */
CloseHandle(created_event);
result = WaitForSingleObject(existing_event, INFINITE);
assert(result == WAIT_OBJECT_0);
@@ -138,7 +124,7 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) {
ctx->arg = arg;
/* Create the thread in suspended state so we have a chance to pass
- * its own creation handle to it */
+ * its own creation handle to it */
thread = (HANDLE) _beginthreadex(NULL,
0,
uv__thread_start,
@@ -377,220 +363,35 @@ int uv_sem_trywait(uv_sem_t* sem) {
}
-/* This condition variable implementation is based on the SetEvent solution
- * (section 3.2) at http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
- * We could not use the SignalObjectAndWait solution (section 3.4) because
- * it want the 2nd argument (type uv_mutex_t) of uv_cond_wait() and
- * uv_cond_timedwait() to be HANDLEs, but we use CRITICAL_SECTIONs.
- */
-
-static int uv_cond_fallback_init(uv_cond_t* cond) {
- int err;
-
- /* Initialize the count to 0. */
- cond->fallback.waiters_count = 0;
-
- InitializeCriticalSection(&cond->fallback.waiters_count_lock);
-
- /* Create an auto-reset event. */
- cond->fallback.signal_event = CreateEvent(NULL, /* no security */
- FALSE, /* auto-reset event */
- FALSE, /* non-signaled initially */
- NULL); /* unnamed */
- if (!cond->fallback.signal_event) {
- err = GetLastError();
- goto error2;
- }
-
- /* Create a manual-reset event. */
- cond->fallback.broadcast_event = CreateEvent(NULL, /* no security */
- TRUE, /* manual-reset */
- FALSE, /* non-signaled */
- NULL); /* unnamed */
- if (!cond->fallback.broadcast_event) {
- err = GetLastError();
- goto error;
- }
-
- return 0;
-
-error:
- CloseHandle(cond->fallback.signal_event);
-error2:
- DeleteCriticalSection(&cond->fallback.waiters_count_lock);
- return uv_translate_sys_error(err);
-}
-
-
-static int uv_cond_condvar_init(uv_cond_t* cond) {
- pInitializeConditionVariable(&cond->cond_var);
- return 0;
-}
-
-
int uv_cond_init(uv_cond_t* cond) {
- uv__once_init();
-
- if (HAVE_CONDVAR_API())
- return uv_cond_condvar_init(cond);
- else
- return uv_cond_fallback_init(cond);
-}
-
-
-static void uv_cond_fallback_destroy(uv_cond_t* cond) {
- if (!CloseHandle(cond->fallback.broadcast_event))
- abort();
- if (!CloseHandle(cond->fallback.signal_event))
- abort();
- DeleteCriticalSection(&cond->fallback.waiters_count_lock);
-}
-
-
-static void uv_cond_condvar_destroy(uv_cond_t* cond) {
- /* nothing to do */
+ InitializeConditionVariable(&cond->cond_var);
+ return 0;
}
void uv_cond_destroy(uv_cond_t* cond) {
- if (HAVE_CONDVAR_API())
- uv_cond_condvar_destroy(cond);
- else
- uv_cond_fallback_destroy(cond);
-}
-
-
-static void uv_cond_fallback_signal(uv_cond_t* cond) {
- int have_waiters;
-
- /* Avoid race conditions. */
- EnterCriticalSection(&cond->fallback.waiters_count_lock);
- have_waiters = cond->fallback.waiters_count > 0;
- LeaveCriticalSection(&cond->fallback.waiters_count_lock);
-
- if (have_waiters)
- SetEvent(cond->fallback.signal_event);
-}
-
-
-static void uv_cond_condvar_signal(uv_cond_t* cond) {
- pWakeConditionVariable(&cond->cond_var);
+ /* nothing to do */
+ (void) &cond;
}
void uv_cond_signal(uv_cond_t* cond) {
- if (HAVE_CONDVAR_API())
- uv_cond_condvar_signal(cond);
- else
- uv_cond_fallback_signal(cond);
-}
-
-
-static void uv_cond_fallback_broadcast(uv_cond_t* cond) {
- int have_waiters;
-
- /* Avoid race conditions. */
- EnterCriticalSection(&cond->fallback.waiters_count_lock);
- have_waiters = cond->fallback.waiters_count > 0;
- LeaveCriticalSection(&cond->fallback.waiters_count_lock);
-
- if (have_waiters)
- SetEvent(cond->fallback.broadcast_event);
-}
-
-
-static void uv_cond_condvar_broadcast(uv_cond_t* cond) {
- pWakeAllConditionVariable(&cond->cond_var);
+ WakeConditionVariable(&cond->cond_var);
}
void uv_cond_broadcast(uv_cond_t* cond) {
- if (HAVE_CONDVAR_API())
- uv_cond_condvar_broadcast(cond);
- else
- uv_cond_fallback_broadcast(cond);
-}
-
-
-static int uv_cond_wait_helper(uv_cond_t* cond, uv_mutex_t* mutex,
- DWORD dwMilliseconds) {
- DWORD result;
- int last_waiter;
- HANDLE handles[2] = {
- cond->fallback.signal_event,
- cond->fallback.broadcast_event
- };
-
- /* Avoid race conditions. */
- EnterCriticalSection(&cond->fallback.waiters_count_lock);
- cond->fallback.waiters_count++;
- LeaveCriticalSection(&cond->fallback.waiters_count_lock);
-
- /* It's ok to release the <mutex> here since Win32 manual-reset events */
- /* maintain state when used with <SetEvent>. This avoids the "lost wakeup" */
- /* bug. */
- uv_mutex_unlock(mutex);
-
- /* Wait for either event to become signaled due to <uv_cond_signal> being */
- /* called or <uv_cond_broadcast> being called. */
- result = WaitForMultipleObjects(2, handles, FALSE, dwMilliseconds);
-
- EnterCriticalSection(&cond->fallback.waiters_count_lock);
- cond->fallback.waiters_count--;
- last_waiter = result == WAIT_OBJECT_0 + 1
- && cond->fallback.waiters_count == 0;
- LeaveCriticalSection(&cond->fallback.waiters_count_lock);
-
- /* Some thread called <pthread_cond_broadcast>. */
- if (last_waiter) {
- /* We're the last waiter to be notified or to stop waiting, so reset the */
- /* the manual-reset event. */
- ResetEvent(cond->fallback.broadcast_event);
- }
-
- /* Reacquire the <mutex>. */
- uv_mutex_lock(mutex);
-
- if (result == WAIT_OBJECT_0 || result == WAIT_OBJECT_0 + 1)
- return 0;
-
- if (result == WAIT_TIMEOUT)
- return UV_ETIMEDOUT;
-
- abort();
- return -1; /* Satisfy the compiler. */
-}
-
-
-static void uv_cond_fallback_wait(uv_cond_t* cond, uv_mutex_t* mutex) {
- if (uv_cond_wait_helper(cond, mutex, INFINITE))
- abort();
-}
-
-
-static void uv_cond_condvar_wait(uv_cond_t* cond, uv_mutex_t* mutex) {
- if (!pSleepConditionVariableCS(&cond->cond_var, mutex, INFINITE))
- abort();
+ WakeAllConditionVariable(&cond->cond_var);
}
void uv_cond_wait(uv_cond_t* cond, uv_mutex_t* mutex) {
- if (HAVE_CONDVAR_API())
- uv_cond_condvar_wait(cond, mutex);
- else
- uv_cond_fallback_wait(cond, mutex);
-}
-
-
-static int uv_cond_fallback_timedwait(uv_cond_t* cond,
- uv_mutex_t* mutex, uint64_t timeout) {
- return uv_cond_wait_helper(cond, mutex, (DWORD)(timeout / 1e6));
+ if (!SleepConditionVariableCS(&cond->cond_var, mutex, INFINITE))
+ abort();
}
-
-static int uv_cond_condvar_timedwait(uv_cond_t* cond,
- uv_mutex_t* mutex, uint64_t timeout) {
- if (pSleepConditionVariableCS(&cond->cond_var, mutex, (DWORD)(timeout / 1e6)))
+int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex, uint64_t timeout) {
+ if (SleepConditionVariableCS(&cond->cond_var, mutex, (DWORD)(timeout / 1e6)))
return 0;
if (GetLastError() != ERROR_TIMEOUT)
abort();
@@ -598,15 +399,6 @@ static int uv_cond_condvar_timedwait(uv_cond_t* cond,
}
-int uv_cond_timedwait(uv_cond_t* cond, uv_mutex_t* mutex,
- uint64_t timeout) {
- if (HAVE_CONDVAR_API())
- return uv_cond_condvar_timedwait(cond, mutex, timeout);
- else
- return uv_cond_fallback_timedwait(cond, mutex, timeout);
-}
-
-
int uv_barrier_init(uv_barrier_t* barrier, unsigned int count) {
int err;
diff --git a/Utilities/cmlibuv/src/win/timer.c b/Utilities/cmlibuv/src/win/timer.c
deleted file mode 100644
index 7e006fedf..000000000
--- a/Utilities/cmlibuv/src/win/timer.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include <assert.h>
-#include <limits.h>
-
-#include "uv.h"
-#include "internal.h"
-#include "tree.h"
-#include "handle-inl.h"
-
-
-/* The number of milliseconds in one second. */
-#define UV__MILLISEC 1000
-
-
-void uv_update_time(uv_loop_t* loop) {
- uint64_t new_time = uv__hrtime(UV__MILLISEC);
- assert(new_time >= loop->time);
- loop->time = new_time;
-}
-
-
-static int uv_timer_compare(uv_timer_t* a, uv_timer_t* b) {
- if (a->due < b->due)
- return -1;
- if (a->due > b->due)
- return 1;
- /*
- * compare start_id when both has the same due. start_id is
- * allocated with loop->timer_counter in uv_timer_start().
- */
- if (a->start_id < b->start_id)
- return -1;
- if (a->start_id > b->start_id)
- return 1;
- return 0;
-}
-
-
-RB_GENERATE_STATIC(uv_timer_tree_s, uv_timer_s, tree_entry, uv_timer_compare)
-
-
-int uv_timer_init(uv_loop_t* loop, uv_timer_t* handle) {
- uv__handle_init(loop, (uv_handle_t*) handle, UV_TIMER);
- handle->timer_cb = NULL;
- handle->repeat = 0;
-
- return 0;
-}
-
-
-void uv_timer_endgame(uv_loop_t* loop, uv_timer_t* handle) {
- if (handle->flags & UV__HANDLE_CLOSING) {
- assert(!(handle->flags & UV_HANDLE_CLOSED));
- uv__handle_close(handle);
- }
-}
-
-
-static uint64_t get_clamped_due_time(uint64_t loop_time, uint64_t timeout) {
- uint64_t clamped_timeout;
-
- clamped_timeout = loop_time + timeout;
- if (clamped_timeout < timeout)
- clamped_timeout = (uint64_t) -1;
-
- return clamped_timeout;
-}
-
-
-int uv_timer_start(uv_timer_t* handle, uv_timer_cb timer_cb, uint64_t timeout,
- uint64_t repeat) {
- uv_loop_t* loop = handle->loop;
- uv_timer_t* old;
-
- if (timer_cb == NULL)
- return UV_EINVAL;
-
- if (uv__is_active(handle))
- uv_timer_stop(handle);
-
- handle->timer_cb = timer_cb;
- handle->due = get_clamped_due_time(loop->time, timeout);
- handle->repeat = repeat;
- uv__handle_start(handle);
-
- /* start_id is the second index to be compared in uv__timer_cmp() */
- handle->start_id = handle->loop->timer_counter++;
-
- old = RB_INSERT(uv_timer_tree_s, &loop->timers, handle);
- assert(old == NULL);
-
- return 0;
-}
-
-
-int uv_timer_stop(uv_timer_t* handle) {
- uv_loop_t* loop = handle->loop;
-
- if (!uv__is_active(handle))
- return 0;
-
- RB_REMOVE(uv_timer_tree_s, &loop->timers, handle);
- uv__handle_stop(handle);
-
- return 0;
-}
-
-
-int uv_timer_again(uv_timer_t* handle) {
- /* If timer_cb is NULL that means that the timer was never started. */
- if (!handle->timer_cb) {
- return UV_EINVAL;
- }
-
- if (handle->repeat) {
- uv_timer_stop(handle);
- uv_timer_start(handle, handle->timer_cb, handle->repeat, handle->repeat);
- }
-
- return 0;
-}
-
-
-void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat) {
- assert(handle->type == UV_TIMER);
- handle->repeat = repeat;
-}
-
-
-uint64_t uv_timer_get_repeat(const uv_timer_t* handle) {
- assert(handle->type == UV_TIMER);
- return handle->repeat;
-}
-
-
-DWORD uv__next_timeout(const uv_loop_t* loop) {
- uv_timer_t* timer;
- int64_t delta;
-
- /* Check if there are any running timers
- * Need to cast away const first, since RB_MIN doesn't know what we are
- * going to do with this return value, it can't be marked const
- */
- timer = RB_MIN(uv_timer_tree_s, &((uv_loop_t*)loop)->timers);
- if (timer) {
- delta = timer->due - loop->time;
- if (delta >= UINT_MAX - 1) {
- /* A timeout value of UINT_MAX means infinite, so that's no good. */
- return UINT_MAX - 1;
- } else if (delta < 0) {
- /* Negative timeout values are not allowed */
- return 0;
- } else {
- return (DWORD)delta;
- }
- } else {
- /* No timers */
- return INFINITE;
- }
-}
-
-
-void uv_process_timers(uv_loop_t* loop) {
- uv_timer_t* timer;
-
- /* Call timer callbacks */
- for (timer = RB_MIN(uv_timer_tree_s, &loop->timers);
- timer != NULL && timer->due <= loop->time;
- timer = RB_MIN(uv_timer_tree_s, &loop->timers)) {
-
- uv_timer_stop(timer);
- uv_timer_again(timer);
- timer->timer_cb((uv_timer_t*) timer);
- }
-}
diff --git a/Utilities/cmlibuv/src/win/tty.c b/Utilities/cmlibuv/src/win/tty.c
index ecf7bc9b5..f38e9a886 100644
--- a/Utilities/cmlibuv/src/win/tty.c
+++ b/Utilities/cmlibuv/src/win/tty.c
@@ -25,7 +25,7 @@
#include <stdlib.h>
#if defined(_MSC_VER) && _MSC_VER < 1600
-# include "stdint-msvc2008.h"
+# include "uv/stdint-msvc2008.h"
#else
# include <stdint.h>
#endif
@@ -164,7 +164,7 @@ void uv_console_init(void) {
OPEN_EXISTING,
0,
0);
- if (uv__tty_console_handle != NULL) {
+ if (uv__tty_console_handle != INVALID_HANDLE_VALUE) {
QueueUserWorkItem(uv__tty_console_resize_message_loop_thread,
NULL,
WT_EXECUTELONGFUNCTION);
@@ -172,9 +172,12 @@ void uv_console_init(void) {
}
-int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) {
+int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int unused) {
+ BOOL readable;
+ DWORD NumberOfEvents;
HANDLE handle;
CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info;
+ (void)unused;
uv__once_init();
handle = (HANDLE) uv__get_osfhandle(fd);
@@ -199,14 +202,15 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) {
fd = -1;
}
+ readable = GetNumberOfConsoleInputEvents(handle, &NumberOfEvents);
if (!readable) {
/* Obtain the screen buffer info with the output handle. */
if (!GetConsoleScreenBufferInfo(handle, &screen_buffer_info)) {
return uv_translate_sys_error(GetLastError());
}
- /* Obtain the the tty_output_lock because the virtual window state is */
- /* shared between all uv_tty_t handles. */
+ /* Obtain the tty_output_lock because the virtual window state is shared
+ * between all uv_tty_t handles. */
uv_sem_wait(&uv_tty_output_lock);
if (uv__vterm_state == UV_UNCHECKED)
@@ -356,6 +360,8 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
}
} else {
was_reading = 0;
+ alloc_cb = NULL;
+ read_cb = NULL;
}
uv_sem_wait(&uv_tty_output_lock);
@@ -382,12 +388,6 @@ int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) {
}
-int uv_is_tty(uv_file file) {
- DWORD result;
- return GetConsoleMode((HANDLE) _get_osfhandle(file), &result) != 0;
-}
-
-
int uv_tty_get_winsize(uv_tty_t* tty, int* width, int* height) {
CONSOLE_SCREEN_BUFFER_INFO info;
@@ -484,8 +484,8 @@ static DWORD CALLBACK uv_tty_line_read_thread(void* data) {
bytes = MAX_INPUT_BUFFER_LENGTH;
}
- /* At last, unicode! */
- /* One utf-16 codeunit never takes more than 3 utf-8 codeunits to encode */
+ /* At last, unicode! One utf-16 codeunit never takes more than 3 utf-8
+ * codeunits to encode. */
chars = bytes / 3;
status = InterlockedExchange(&uv__read_console_status, IN_PROGRESS);
@@ -620,10 +620,10 @@ static const char* get_vt100_fn_key(DWORD code, char shift, char ctrl,
}
switch (code) {
- /* These mappings are the same as Cygwin's. Unmodified and alt-modified */
- /* keypad keys comply with linux console, modifiers comply with xterm */
- /* modifier usage. F1..f12 and shift-f1..f10 comply with linux console, */
- /* f6..f12 with and without modifiers comply with rxvt. */
+ /* These mappings are the same as Cygwin's. Unmodified and alt-modified
+ * keypad keys comply with linux console, modifiers comply with xterm
+ * modifier usage. F1. f12 and shift-f1. f10 comply with linux console, f6.
+ * f12 with and without modifiers comply with rxvt. */
VK_CASE(VK_INSERT, "[2~", "[2;2~", "[2;5~", "[2;6~")
VK_CASE(VK_END, "[4~", "[4;2~", "[4;5~", "[4;6~")
VK_CASE(VK_DOWN, "[B", "[1;2B", "[1;5B", "[1;6B")
@@ -706,8 +706,8 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle,
goto out;
}
- /* Windows sends a lot of events that we're not interested in, so buf */
- /* will be allocated on demand, when there's actually something to emit. */
+ /* Windows sends a lot of events that we're not interested in, so buf will be
+ * allocated on demand, when there's actually something to emit. */
buf = uv_null_buf_;
buf_used = 0;
@@ -733,16 +733,17 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle,
continue;
}
- /* Ignore keyup events, unless the left alt key was held and a valid */
- /* unicode character was emitted. */
- if (!KEV.bKeyDown && !(((KEV.dwControlKeyState & LEFT_ALT_PRESSED) ||
- KEV.wVirtualKeyCode==VK_MENU) && KEV.uChar.UnicodeChar != 0)) {
+ /* Ignore keyup events, unless the left alt key was held and a valid
+ * unicode character was emitted. */
+ if (!KEV.bKeyDown &&
+ KEV.wVirtualKeyCode != VK_MENU &&
+ KEV.uChar.UnicodeChar != 0) {
continue;
}
- /* Ignore keypresses to numpad number keys if the left alt is held */
- /* because the user is composing a character, or windows simulating */
- /* this. */
+ /* Ignore keypresses to numpad number keys if the left alt is held
+ * because the user is composing a character, or windows simulating this.
+ */
if ((KEV.dwControlKeyState & LEFT_ALT_PRESSED) &&
!(KEV.dwControlKeyState & ENHANCED_KEY) &&
(KEV.wVirtualKeyCode == VK_INSERT ||
@@ -779,8 +780,8 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle,
continue;
}
- /* Prefix with \u033 if alt was held, but alt was not used as part */
- /* a compose sequence. */
+ /* Prefix with \u033 if alt was held, but alt was not used as part a
+ * compose sequence. */
if ((KEV.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED))
&& !(KEV.dwControlKeyState & (LEFT_CTRL_PRESSED |
RIGHT_CTRL_PRESSED)) && KEV.bKeyDown) {
@@ -793,8 +794,9 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle,
if (KEV.uChar.UnicodeChar >= 0xDC00 &&
KEV.uChar.UnicodeChar < 0xE000) {
/* UTF-16 surrogate pair */
- WCHAR utf16_buffer[2] = { handle->tty.rd.last_utf16_high_surrogate,
- KEV.uChar.UnicodeChar};
+ WCHAR utf16_buffer[2];
+ utf16_buffer[0] = handle->tty.rd.last_utf16_high_surrogate;
+ utf16_buffer[1] = KEV.uChar.UnicodeChar;
char_len = WideCharToMultiByte(CP_UTF8,
0,
utf16_buffer,
@@ -818,8 +820,8 @@ void uv_process_tty_read_raw_req(uv_loop_t* loop, uv_tty_t* handle,
/* Whatever happened, the last character wasn't a high surrogate. */
handle->tty.rd.last_utf16_high_surrogate = 0;
- /* If the utf16 character(s) couldn't be converted something must */
- /* be wrong. */
+ /* If the utf16 character(s) couldn't be converted something must be
+ * wrong. */
if (!char_len) {
handle->flags &= ~UV_HANDLE_READING;
DECREASE_ACTIVE_COUNT(loop, handle);
@@ -943,21 +945,15 @@ void uv_process_tty_read_line_req(uv_loop_t* loop, uv_tty_t* handle,
handle->read_cb((uv_stream_t*) handle,
uv_translate_sys_error(GET_REQ_ERROR(req)),
&buf);
- } else {
- /* The read was cancelled, or whatever we don't care */
- handle->read_cb((uv_stream_t*) handle, 0, &buf);
}
-
} else {
- if (!(handle->flags & UV_HANDLE_CANCELLATION_PENDING)) {
- /* Read successful */
- /* TODO: read unicode, convert to utf-8 */
+ if (!(handle->flags & UV_HANDLE_CANCELLATION_PENDING) &&
+ req->u.io.overlapped.InternalHigh != 0) {
+ /* Read successful. TODO: read unicode, convert to utf-8 */
DWORD bytes = req->u.io.overlapped.InternalHigh;
handle->read_cb((uv_stream_t*) handle, bytes, &buf);
- } else {
- handle->flags &= ~UV_HANDLE_CANCELLATION_PENDING;
- handle->read_cb((uv_stream_t*) handle, 0, &buf);
}
+ handle->flags &= ~UV_HANDLE_CANCELLATION_PENDING;
}
/* Wait for more input events. */
@@ -975,9 +971,9 @@ void uv_process_tty_read_req(uv_loop_t* loop, uv_tty_t* handle,
assert(handle->type == UV_TTY);
assert(handle->flags & UV_HANDLE_TTY_READABLE);
- /* If the read_line_buffer member is zero, it must have been an raw read. */
- /* Otherwise it was a line-buffered read. */
- /* FIXME: This is quite obscure. Use a flag or something. */
+ /* If the read_line_buffer member is zero, it must have been an raw read.
+ * Otherwise it was a line-buffered read. FIXME: This is quite obscure. Use a
+ * flag or something. */
if (handle->tty.rd.read_line_buffer.len == 0) {
uv_process_tty_read_raw_req(loop, handle, req);
} else {
@@ -999,14 +995,14 @@ int uv_tty_read_start(uv_tty_t* handle, uv_alloc_cb alloc_cb,
handle->read_cb = read_cb;
handle->alloc_cb = alloc_cb;
- /* If reading was stopped and then started again, there could still be a */
- /* read request pending. */
+ /* If reading was stopped and then started again, there could still be a read
+ * request pending. */
if (handle->flags & UV_HANDLE_READ_PENDING) {
return 0;
}
- /* Maybe the user stopped reading half-way while processing key events. */
- /* Short-circuit if this could be the case. */
+ /* Maybe the user stopped reading half-way while processing key events.
+ * Short-circuit if this could be the case. */
if (handle->tty.rd.last_key_len > 0) {
SET_REQ_SUCCESS(&handle->read_req);
uv_insert_pending_req(handle->loop, (uv_req_t*) &handle->read_req);
@@ -1033,9 +1029,10 @@ int uv_tty_read_stop(uv_tty_t* handle) {
return 0;
if (handle->flags & UV_HANDLE_TTY_RAW) {
- /* Cancel raw read */
- /* Write some bullshit event to force the console wait to return. */
+ /* Cancel raw read. Write some bullshit event to force the console wait to
+ * return. */
memset(&record, 0, sizeof record);
+ record.EventType = FOCUS_EVENT;
if (!WriteConsoleInputW(handle->handle, &record, 1, &written)) {
return GetLastError();
}
@@ -1116,8 +1113,8 @@ static void uv_tty_update_virtual_window(CONSOLE_SCREEN_BUFFER_INFO* info) {
uv_tty_virtual_offset = info->dwCursorPosition.Y;
} else if (uv_tty_virtual_offset < info->dwCursorPosition.Y -
uv_tty_virtual_height + 1) {
- /* If suddenly find the cursor outside of the virtual window, it must */
- /* have somehow scrolled. Update the virtual window offset. */
+ /* If suddenly find the cursor outside of the virtual window, it must have
+ * somehow scrolled. Update the virtual window offset. */
uv_tty_virtual_offset = info->dwCursorPosition.Y -
uv_tty_virtual_height + 1;
}
@@ -1304,8 +1301,8 @@ static int uv_tty_clear(uv_tty_t* handle, int dir, char entire_screen,
x2 = 0;
x2r = 1;
} else {
- /* Clear to end of row. We pretend the console is 65536 characters wide, */
- /* uv_tty_make_real_coord will clip it to the actual console width. */
+ /* Clear to end of row. We pretend the console is 65536 characters wide,
+ * uv_tty_make_real_coord will clip it to the actual console width. */
x2 = 0xffff;
x2r = 0;
}
@@ -1613,8 +1610,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
const uv_buf_t bufs[],
unsigned int nbufs,
DWORD* error) {
- /* We can only write 8k characters at a time. Windows can't handle */
- /* much more characters in a single console write anyway. */
+ /* We can only write 8k characters at a time. Windows can't handle much more
+ * characters in a single console write anyway. */
WCHAR utf16_buf[MAX_CONSOLE_CHAR];
WCHAR* utf16_buffer;
DWORD utf16_buf_used = 0;
@@ -1650,9 +1647,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
unsigned char previous_eol = handle->tty.wr.previous_eol;
unsigned char ansi_parser_state = handle->tty.wr.ansi_parser_state;
- /* Store the error here. If we encounter an error, stop trying to do i/o */
- /* but keep parsing the buffer so we leave the parser in a consistent */
- /* state. */
+ /* Store the error here. If we encounter an error, stop trying to do i/o but
+ * keep parsing the buffer so we leave the parser in a consistent state. */
*error = ERROR_SUCCESS;
utf16_buffer = utf16_buf;
@@ -1700,9 +1696,9 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
for (j = 0; j < buf.len; j++) {
unsigned char c = buf.base[j];
- /* Run the character through the utf8 decoder We happily accept non */
- /* shortest form encodings and invalid code points - there's no real */
- /* harm that can be done. */
+ /* Run the character through the utf8 decoder We happily accept non
+ * shortest form encodings and invalid code points - there's no real harm
+ * that can be done. */
if (utf8_bytes_left == 0) {
/* Read utf-8 start byte */
DWORD first_zero_bit;
@@ -1742,8 +1738,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
/* Start byte where continuation was expected. */
utf8_bytes_left = 0;
utf8_codepoint = UNICODE_REPLACEMENT_CHARACTER;
- /* Patch buf offset so this character will be parsed again as a */
- /* start byte. */
+ /* Patch buf offset so this character will be parsed again as a start
+ * byte. */
j--;
}
@@ -1776,8 +1772,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
case '_':
case 'P':
case ']':
- /* Not supported, but we'll have to parse until we see a stop */
- /* code, e.g. ESC \ or BEL. */
+ /* Not supported, but we'll have to parse until we see a stop code,
+ * e. g. ESC \ or BEL. */
ansi_parser_state = ANSI_ST_CONTROL;
continue;
@@ -1859,8 +1855,9 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
continue;
} else {
- /* If ANSI_IN_ARG is not set, add another argument and */
- /* default it to 0. */
+ /* If ANSI_IN_ARG is not set, add another argument and default it
+ * to 0. */
+
/* Check for too many arguments */
if (handle->tty.wr.ansi_csi_argc >= ARRAY_SIZE(handle->tty.wr.ansi_csi_argv)) {
ansi_parser_state |= ANSI_IGNORE;
@@ -1874,9 +1871,9 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
} else if (utf8_codepoint == '?' && !(ansi_parser_state & ANSI_IN_ARG) &&
handle->tty.wr.ansi_csi_argc == 0) {
- /* Ignores '?' if it is the first character after CSI[ */
- /* This is an extension character from the VT100 codeset */
- /* that is supported and used by most ANSI terminals today. */
+ /* Ignores '?' if it is the first character after CSI[. This is an
+ * extension character from the VT100 codeset that is supported and
+ * used by most ANSI terminals today. */
continue;
} else if (utf8_codepoint >= '@' && utf8_codepoint <= '~' &&
@@ -2006,8 +2003,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
continue;
} else {
- /* We don't support commands that use private mode characters or */
- /* intermediaries. Ignore the rest of the sequence. */
+ /* We don't support commands that use private mode characters or
+ * intermediaries. Ignore the rest of the sequence. */
ansi_parser_state |= ANSI_IGNORE;
continue;
}
@@ -2020,8 +2017,8 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
}
} else if (ansi_parser_state & ANSI_ST_CONTROL) {
- /* Unsupported control code */
- /* Ignore everything until we see BEL or ESC \ */
+ /* Unsupported control code.
+ * Ignore everything until we see `BEL` or `ESC \`. */
if (ansi_parser_state & ANSI_IN_STRING) {
if (!(ansi_parser_state & ANSI_BACKSLASH_SEEN)) {
if (utf8_codepoint == '"') {
@@ -2055,9 +2052,9 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
abort();
}
- /* We wouldn't mind emitting utf-16 surrogate pairs. Too bad, the */
- /* windows console doesn't really support UTF-16, so just emit the */
- /* replacement character. */
+ /* We wouldn't mind emitting utf-16 surrogate pairs. Too bad, the windows
+ * console doesn't really support UTF-16, so just emit the replacement
+ * character. */
if (utf8_codepoint > 0xffff) {
utf8_codepoint = UNICODE_REPLACEMENT_CHARACTER;
}
@@ -2071,10 +2068,10 @@ static int uv_tty_write_bufs(uv_tty_t* handle,
utf16_buf[utf16_buf_used++] = L'\r';
utf16_buf[utf16_buf_used++] = L'\n';
} else if (utf8_codepoint == 0x0d && previous_eol == 0x0a) {
- /* \n was followed by \r; do not print the \r, since */
- /* the source was either \r\n\r (so the second \r is */
- /* redundant) or was \n\r (so the \n was processed */
- /* by the last case and an \r automatically inserted). */
+ /* \n was followed by \r; do not print the \r, since the source was
+ * either \r\n\r (so the second \r is redundant) or was \n\r (so the
+ * \n was processed by the last case and an \r automatically
+ * inserted). */
} else {
/* \r without \n; print \r as-is. */
ENSURE_BUFFER_SPACE(1);
@@ -2182,14 +2179,14 @@ void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle,
void uv_tty_close(uv_tty_t* handle) {
assert(handle->u.fd == -1 || handle->u.fd > 2);
+ if (handle->flags & UV_HANDLE_READING)
+ uv_tty_read_stop(handle);
+
if (handle->u.fd == -1)
CloseHandle(handle->handle);
else
close(handle->u.fd);
- if (handle->flags & UV_HANDLE_READING)
- uv_tty_read_stop(handle);
-
handle->u.fd = -1;
handle->handle = INVALID_HANDLE_VALUE;
handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE);
@@ -2209,7 +2206,7 @@ void uv_tty_endgame(uv_loop_t* loop, uv_tty_t* handle) {
/* TTY shutdown is really just a no-op */
if (handle->stream.conn.shutdown_req->cb) {
- if (handle->flags & UV__HANDLE_CLOSING) {
+ if (handle->flags & UV_HANDLE_CLOSING) {
handle->stream.conn.shutdown_req->cb(handle->stream.conn.shutdown_req, UV_ECANCELED);
} else {
handle->stream.conn.shutdown_req->cb(handle->stream.conn.shutdown_req, 0);
@@ -2222,10 +2219,10 @@ void uv_tty_endgame(uv_loop_t* loop, uv_tty_t* handle) {
return;
}
- if (handle->flags & UV__HANDLE_CLOSING &&
+ if (handle->flags & UV_HANDLE_CLOSING &&
handle->reqs_pending == 0) {
- /* The wait handle used for raw reading should be unregistered when the */
- /* wait callback runs. */
+ /* The wait handle used for raw reading should be unregistered when the
+ * wait callback runs. */
assert(!(handle->flags & UV_HANDLE_TTY_READABLE) ||
handle->tty.rd.read_raw_wait == NULL);
diff --git a/Utilities/cmlibuv/src/win/udp.c b/Utilities/cmlibuv/src/win/udp.c
index cd1d0e07b..37df849f8 100644
--- a/Utilities/cmlibuv/src/win/udp.c
+++ b/Utilities/cmlibuv/src/win/udp.c
@@ -74,8 +74,8 @@ static int uv_udp_set_socket(uv_loop_t* loop, uv_udp_t* handle, SOCKET socket,
return GetLastError();
}
- /* Associate it with the I/O completion port. */
- /* Use uv_handle_t pointer as completion key. */
+ /* Associate it with the I/O completion port. Use uv_handle_t pointer as
+ * completion key. */
if (CreateIoCompletionPort((HANDLE)socket,
loop->iocp,
(ULONG_PTR)socket,
@@ -83,31 +83,28 @@ static int uv_udp_set_socket(uv_loop_t* loop, uv_udp_t* handle, SOCKET socket,
return GetLastError();
}
- if (pSetFileCompletionNotificationModes) {
- /* All known Windows that support SetFileCompletionNotificationModes */
- /* have a bug that makes it impossible to use this function in */
- /* conjunction with datagram sockets. We can work around that but only */
- /* if the user is using the default UDP driver (AFD) and has no other */
- /* LSPs stacked on top. Here we check whether that is the case. */
- opt_len = (int) sizeof info;
- if (getsockopt(socket,
- SOL_SOCKET,
- SO_PROTOCOL_INFOW,
- (char*) &info,
- &opt_len) == SOCKET_ERROR) {
- return GetLastError();
- }
+ /* All known Windows that support SetFileCompletionNotificationModes have a
+ * bug that makes it impossible to use this function in conjunction with
+ * datagram sockets. We can work around that but only if the user is using
+ * the default UDP driver (AFD) and has no other. LSPs stacked on top. Here
+ * we check whether that is the case. */
+ opt_len = (int) sizeof info;
+ if (getsockopt(
+ socket, SOL_SOCKET, SO_PROTOCOL_INFOW, (char*) &info, &opt_len) ==
+ SOCKET_ERROR) {
+ return GetLastError();
+ }
- if (info.ProtocolChain.ChainLen == 1) {
- if (pSetFileCompletionNotificationModes((HANDLE)socket,
- FILE_SKIP_SET_EVENT_ON_HANDLE |
- FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) {
- handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP;
- handle->func_wsarecv = uv_wsarecv_workaround;
- handle->func_wsarecvfrom = uv_wsarecvfrom_workaround;
- } else if (GetLastError() != ERROR_INVALID_FUNCTION) {
- return GetLastError();
- }
+ if (info.ProtocolChain.ChainLen == 1) {
+ if (SetFileCompletionNotificationModes(
+ (HANDLE) socket,
+ FILE_SKIP_SET_EVENT_ON_HANDLE |
+ FILE_SKIP_COMPLETION_PORT_ON_SUCCESS)) {
+ handle->flags |= UV_HANDLE_SYNC_BYPASS_IOCP;
+ handle->func_wsarecv = uv_wsarecv_workaround;
+ handle->func_wsarecvfrom = uv_wsarecvfrom_workaround;
+ } else if (GetLastError() != ERROR_INVALID_FUNCTION) {
+ return GetLastError();
}
}
@@ -191,7 +188,7 @@ void uv_udp_close(uv_loop_t* loop, uv_udp_t* handle) {
void uv_udp_endgame(uv_loop_t* loop, uv_udp_t* handle) {
- if (handle->flags & UV__HANDLE_CLOSING &&
+ if (handle->flags & UV_HANDLE_CLOSING &&
handle->reqs_pending == 0) {
assert(!(handle->flags & UV_HANDLE_CLOSED));
uv__handle_close(handle);
@@ -245,12 +242,12 @@ static int uv_udp_maybe_bind(uv_udp_t* handle,
handle->flags |= UV_HANDLE_IPV6;
if (addr->sa_family == AF_INET6 && !(flags & UV_UDP_IPV6ONLY)) {
- /* On windows IPV6ONLY is on by default. */
- /* If the user doesn't specify it libuv turns it off. */
+ /* On windows IPV6ONLY is on by default. If the user doesn't specify it
+ * libuv turns it off. */
- /* TODO: how to handle errors? This may fail if there is no ipv4 stack */
- /* available, or when run on XP/2003 which have no support for dualstack */
- /* sockets. For now we're silently ignoring the error. */
+ /* TODO: how to handle errors? This may fail if there is no ipv4 stack
+ * available, or when run on XP/2003 which have no support for dualstack
+ * sockets. For now we're silently ignoring the error. */
setsockopt(handle->socket,
IPPROTO_IPV6,
IPV6_V6ONLY,
@@ -369,7 +366,7 @@ int uv__udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
int err;
if (handle->flags & UV_HANDLE_READING) {
- return WSAEALREADY;
+ return UV_EALREADY;
}
err = uv_udp_maybe_bind(handle,
@@ -377,7 +374,7 @@ int uv__udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
sizeof(uv_addr_ip4_any_),
0);
if (err)
- return err;
+ return uv_translate_sys_error(err);
handle->flags |= UV_HANDLE_READING;
INCREASE_ACTIVE_COUNT(loop, handle);
@@ -386,8 +383,8 @@ int uv__udp_recv_start(uv_udp_t* handle, uv_alloc_cb alloc_cb,
handle->recv_cb = recv_cb;
handle->alloc_cb = alloc_cb;
- /* If reading was stopped and then started again, there could still be a */
- /* recv request pending. */
+ /* If reading was stopped and then started again, there could still be a recv
+ * request pending. */
if (!(handle->flags & UV_HANDLE_READ_PENDING))
uv_udp_queue_recv(loop, handle);
@@ -467,19 +464,19 @@ void uv_process_udp_recv_req(uv_loop_t* loop, uv_udp_t* handle,
if (!REQ_SUCCESS(req)) {
DWORD err = GET_REQ_SOCK_ERROR(req);
if (err == WSAEMSGSIZE) {
- /* Not a real error, it just indicates that the received packet */
- /* was bigger than the receive buffer. */
+ /* Not a real error, it just indicates that the received packet was
+ * bigger than the receive buffer. */
} else if (err == WSAECONNRESET || err == WSAENETRESET) {
- /* A previous sendto operation failed; ignore this error. If */
- /* zero-reading we need to call WSARecv/WSARecvFrom _without_ the */
- /* MSG_PEEK flag to clear out the error queue. For nonzero reads, */
- /* immediately queue a new receive. */
+ /* A previous sendto operation failed; ignore this error. If zero-reading
+ * we need to call WSARecv/WSARecvFrom _without_ the. MSG_PEEK flag to
+ * clear out the error queue. For nonzero reads, immediately queue a new
+ * receive. */
if (!(handle->flags & UV_HANDLE_ZERO_READ)) {
goto done;
}
} else {
- /* A real error occurred. Report the error to the user only if we're */
- /* currently reading. */
+ /* A real error occurred. Report the error to the user only if we're
+ * currently reading. */
if (handle->flags & UV_HANDLE_READING) {
uv_udp_recv_stop(handle);
buf = (handle->flags & UV_HANDLE_ZERO_READ) ?
@@ -503,8 +500,8 @@ void uv_process_udp_recv_req(uv_loop_t* loop, uv_udp_t* handle,
struct sockaddr_storage from;
int from_len;
- /* Do a nonblocking receive */
- /* TODO: try to read multiple datagrams at once. FIONREAD maybe? */
+ /* Do a nonblocking receive.
+ * TODO: try to read multiple datagrams at once. FIONREAD maybe? */
buf = uv_buf_init(NULL, 0);
handle->alloc_cb((uv_handle_t*) handle, 65536, &buf);
if (buf.base == NULL || buf.len == 0) {
@@ -741,7 +738,7 @@ int uv_udp_set_multicast_interface(uv_udp_t* handle, const char* interface_addr)
return UV_EINVAL;
}
- if (!(handle->flags & UV_HANDLE_BOUND))
+ if (handle->socket == INVALID_SOCKET)
return UV_EBADF;
if (addr_st.ss_family == AF_INET) {
@@ -772,7 +769,7 @@ int uv_udp_set_multicast_interface(uv_udp_t* handle, const char* interface_addr)
int uv_udp_set_broadcast(uv_udp_t* handle, int value) {
BOOL optval = (BOOL) value;
- if (!(handle->flags & UV_HANDLE_BOUND))
+ if (handle->socket == INVALID_SOCKET)
return UV_EBADF;
if (setsockopt(handle->socket,
@@ -818,7 +815,7 @@ int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) {
return UV_EINVAL; \
} \
\
- if (!(handle->flags & UV_HANDLE_BOUND)) \
+ if (handle->socket == INVALID_SOCKET) \
return UV_EBADF; \
\
if (!(handle->flags & UV_HANDLE_IPV6)) { \
diff --git a/Utilities/cmlibuv/src/win/util.c b/Utilities/cmlibuv/src/win/util.c
index 49b5bc720..923789129 100644
--- a/Utilities/cmlibuv/src/win/util.c
+++ b/Utilities/cmlibuv/src/win/util.c
@@ -74,10 +74,6 @@
static char *process_title;
static CRITICAL_SECTION process_title_lock;
-/* Cached copy of the process id, written once. */
-static DWORD current_pid = 0;
-
-
/* Interval (in seconds) of the high-resolution clock. */
static double hrtime_interval_ = 0;
@@ -149,8 +145,8 @@ int uv_exepath(char* buffer, size_t* size_ptr) {
uv__free(utf16_buffer);
- /* utf8_len *does* include the terminating null at this point, but the */
- /* returned size shouldn't. */
+ /* utf8_len *does* include the terminating null at this point, but the
+ * returned size shouldn't. */
*size_ptr = utf8_len - 1;
return 0;
@@ -173,16 +169,16 @@ int uv_cwd(char* buffer, size_t* size) {
if (utf16_len == 0) {
return uv_translate_sys_error(GetLastError());
} else if (utf16_len > MAX_PATH) {
- /* This should be impossible; however the CRT has a code path to deal */
- /* with this scenario, so I added a check anyway. */
+ /* This should be impossible; however the CRT has a code path to deal with
+ * this scenario, so I added a check anyway. */
return UV_EIO;
}
/* utf16_len contains the length, *not* including the terminating null. */
utf16_buffer[utf16_len] = L'\0';
- /* The returned directory should not have a trailing slash, unless it */
- /* points at a drive root, like c:\. Remove it if needed.*/
+ /* The returned directory should not have a trailing slash, unless it points
+ * at a drive root, like c:\. Remove it if needed. */
if (utf16_buffer[utf16_len - 1] == L'\\' &&
!(utf16_len == 3 && utf16_buffer[1] == L':')) {
utf16_len--;
@@ -239,9 +235,9 @@ int uv_chdir(const char* dir) {
utf16_buffer,
MAX_PATH) == 0) {
DWORD error = GetLastError();
- /* The maximum length of the current working directory is 260 chars, */
- /* including terminating null. If it doesn't fit, the path name must be */
- /* too long. */
+ /* The maximum length of the current working directory is 260 chars,
+ * including terminating null. If it doesn't fit, the path name must be too
+ * long. */
if (error == ERROR_INSUFFICIENT_BUFFER) {
return UV_ENAMETOOLONG;
} else {
@@ -253,9 +249,9 @@ int uv_chdir(const char* dir) {
return uv_translate_sys_error(GetLastError());
}
- /* Windows stores the drive-local path in an "hidden" environment variable, */
- /* which has the form "=C:=C:\Windows". SetCurrentDirectory does not */
- /* update this, so we'll have to do it. */
+ /* Windows stores the drive-local path in an "hidden" environment variable,
+ * which has the form "=C:=C:\Windows". SetCurrentDirectory does not update
+ * this, so we'll have to do it. */
utf16_len = GetCurrentDirectoryW(MAX_PATH, utf16_buffer);
if (utf16_len == 0) {
return uv_translate_sys_error(GetLastError());
@@ -263,8 +259,8 @@ int uv_chdir(const char* dir) {
return UV_EIO;
}
- /* The returned directory should not have a trailing slash, unless it */
- /* points at a drive root, like c:\. Remove it if needed. */
+ /* The returned directory should not have a trailing slash, unless it points
+ * at a drive root, like c:\. Remove it if needed. */
if (utf16_buffer[utf16_len - 1] == L'\\' &&
!(utf16_len == 3 && utf16_buffer[1] == L':')) {
utf16_len--;
@@ -272,8 +268,8 @@ int uv_chdir(const char* dir) {
}
if (utf16_len < 2 || utf16_buffer[1] != L':') {
- /* Doesn't look like a drive letter could be there - probably an UNC */
- /* path. TODO: Need to handle win32 namespaces like \\?\C:\ ? */
+ /* Doesn't look like a drive letter could be there - probably an UNC path.
+ * TODO: Need to handle win32 namespaces like \\?\C:\ ? */
drive_letter = 0;
} else if (utf16_buffer[0] >= L'A' && utf16_buffer[0] <= L'Z') {
drive_letter = utf16_buffer[0];
@@ -359,14 +355,6 @@ uv_pid_t uv_os_getppid(void) {
}
-int uv_current_pid(void) {
- if (current_pid == 0) {
- current_pid = GetCurrentProcessId();
- }
- return current_pid;
-}
-
-
char** uv_setup_args(int argc, char** argv) {
return argv;
}
@@ -828,6 +816,9 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr,
int is_vista_or_greater;
ULONG flags;
+ *addresses_ptr = NULL;
+ *count_ptr = 0;
+
is_vista_or_greater = is_windows_version_or_greater(6, 0, 0, 0);
if (is_vista_or_greater) {
flags = GAA_FLAG_SKIP_ANYCAST | GAA_FLAG_SKIP_MULTICAST |
@@ -842,17 +833,17 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr,
}
- /* Fetch the size of the adapters reported by windows, and then get the */
- /* list itself. */
+ /* Fetch the size of the adapters reported by windows, and then get the list
+ * itself. */
win_address_buf_size = 0;
win_address_buf = NULL;
for (;;) {
ULONG r;
- /* If win_address_buf is 0, then GetAdaptersAddresses will fail with */
- /* ERROR_BUFFER_OVERFLOW, and the required buffer size will be stored in */
- /* win_address_buf_size. */
+ /* If win_address_buf is 0, then GetAdaptersAddresses will fail with.
+ * ERROR_BUFFER_OVERFLOW, and the required buffer size will be stored in
+ * win_address_buf_size. */
r = GetAdaptersAddresses(AF_UNSPEC,
flags,
NULL,
@@ -866,8 +857,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr,
switch (r) {
case ERROR_BUFFER_OVERFLOW:
- /* This happens when win_address_buf is NULL or too small to hold */
- /* all adapters. */
+ /* This happens when win_address_buf is NULL or too small to hold all
+ * adapters. */
win_address_buf = uv__malloc(win_address_buf_size);
if (win_address_buf == NULL)
return UV_ENOMEM;
@@ -901,15 +892,15 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr,
return UV_ENOBUFS;
default:
- /* Other (unspecified) errors can happen, but we don't have any */
- /* special meaning for them. */
+ /* Other (unspecified) errors can happen, but we don't have any special
+ * meaning for them. */
assert(r != ERROR_SUCCESS);
return uv_translate_sys_error(r);
}
}
- /* Count the number of enabled interfaces and compute how much space is */
- /* needed to store their info. */
+ /* Count the number of enabled interfaces and compute how much space is
+ * needed to store their info. */
count = 0;
uv_address_buf_size = 0;
@@ -919,9 +910,9 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr,
IP_ADAPTER_UNICAST_ADDRESS* unicast_address;
int name_size;
- /* Interfaces that are not 'up' should not be reported. Also skip */
- /* interfaces that have no associated unicast address, as to avoid */
- /* allocating space for the name for this interface. */
+ /* Interfaces that are not 'up' should not be reported. Also skip
+ * interfaces that have no associated unicast address, as to avoid
+ * allocating space for the name for this interface. */
if (adapter->OperStatus != IfOperStatusUp ||
adapter->FirstUnicastAddress == NULL)
continue;
@@ -941,8 +932,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr,
}
uv_address_buf_size += name_size;
- /* Count the number of addresses associated with this interface, and */
- /* compute the size. */
+ /* Count the number of addresses associated with this interface, and
+ * compute the size. */
for (unicast_address = (IP_ADAPTER_UNICAST_ADDRESS*)
adapter->FirstUnicastAddress;
unicast_address != NULL;
@@ -959,8 +950,8 @@ int uv_interface_addresses(uv_interface_address_t** addresses_ptr,
return UV_ENOMEM;
}
- /* Compute the start of the uv_interface_address_t array, and the place in */
- /* the buffer where the interface names will be stored. */
+ /* Compute the start of the uv_interface_address_t array, and the place in
+ * the buffer where the interface names will be stored. */
uv_address = uv_address_buf;
name_buf = (char*) (uv_address_buf + count);
@@ -1199,8 +1190,8 @@ int uv_os_tmpdir(char* buffer, size_t* size) {
return UV_EIO;
}
- /* The returned directory should not have a trailing slash, unless it */
- /* points at a drive root, like c:\. Remove it if needed.*/
+ /* The returned directory should not have a trailing slash, unless it points
+ * at a drive root, like c:\. Remove it if needed. */
if (path[len - 1] == L'\\' &&
!(len == 3 && path[1] == L':')) {
len--;
@@ -1542,3 +1533,214 @@ int uv_os_gethostname(char* buffer, size_t* size) {
*size = len;
return 0;
}
+
+
+static int uv__get_handle(uv_pid_t pid, int access, HANDLE* handle) {
+ int r;
+
+ if (pid == 0)
+ *handle = GetCurrentProcess();
+ else
+ *handle = OpenProcess(access, FALSE, pid);
+
+ if (*handle == NULL) {
+ r = GetLastError();
+
+ if (r == ERROR_INVALID_PARAMETER)
+ return UV_ESRCH;
+ else
+ return uv_translate_sys_error(r);
+ }
+
+ return 0;
+}
+
+
+int uv_os_getpriority(uv_pid_t pid, int* priority) {
+ HANDLE handle;
+ int r;
+
+ if (priority == NULL)
+ return UV_EINVAL;
+
+ r = uv__get_handle(pid, PROCESS_QUERY_LIMITED_INFORMATION, &handle);
+
+ if (r != 0)
+ return r;
+
+ r = GetPriorityClass(handle);
+
+ if (r == 0) {
+ r = uv_translate_sys_error(GetLastError());
+ } else {
+ /* Map Windows priority classes to Unix nice values. */
+ if (r == REALTIME_PRIORITY_CLASS)
+ *priority = UV_PRIORITY_HIGHEST;
+ else if (r == HIGH_PRIORITY_CLASS)
+ *priority = UV_PRIORITY_HIGH;
+ else if (r == ABOVE_NORMAL_PRIORITY_CLASS)
+ *priority = UV_PRIORITY_ABOVE_NORMAL;
+ else if (r == NORMAL_PRIORITY_CLASS)
+ *priority = UV_PRIORITY_NORMAL;
+ else if (r == BELOW_NORMAL_PRIORITY_CLASS)
+ *priority = UV_PRIORITY_BELOW_NORMAL;
+ else /* IDLE_PRIORITY_CLASS */
+ *priority = UV_PRIORITY_LOW;
+
+ r = 0;
+ }
+
+ CloseHandle(handle);
+ return r;
+}
+
+
+int uv_os_setpriority(uv_pid_t pid, int priority) {
+ HANDLE handle;
+ int priority_class;
+ int r;
+
+ /* Map Unix nice values to Windows priority classes. */
+ if (priority < UV_PRIORITY_HIGHEST || priority > UV_PRIORITY_LOW)
+ return UV_EINVAL;
+ else if (priority < UV_PRIORITY_HIGH)
+ priority_class = REALTIME_PRIORITY_CLASS;
+ else if (priority < UV_PRIORITY_ABOVE_NORMAL)
+ priority_class = HIGH_PRIORITY_CLASS;
+ else if (priority < UV_PRIORITY_NORMAL)
+ priority_class = ABOVE_NORMAL_PRIORITY_CLASS;
+ else if (priority < UV_PRIORITY_BELOW_NORMAL)
+ priority_class = NORMAL_PRIORITY_CLASS;
+ else if (priority < UV_PRIORITY_LOW)
+ priority_class = BELOW_NORMAL_PRIORITY_CLASS;
+ else
+ priority_class = IDLE_PRIORITY_CLASS;
+
+ r = uv__get_handle(pid, PROCESS_SET_INFORMATION, &handle);
+
+ if (r != 0)
+ return r;
+
+ if (SetPriorityClass(handle, priority_class) == 0)
+ r = uv_translate_sys_error(GetLastError());
+
+ CloseHandle(handle);
+ return r;
+}
+
+
+int uv_os_uname(uv_utsname_t* buffer) {
+ /* Implementation loosely based on
+ https://github.com/gagern/gnulib/blob/master/lib/uname.c */
+ OSVERSIONINFOW os_info;
+ SYSTEM_INFO system_info;
+ int processor_level;
+ int r;
+
+ if (buffer == NULL)
+ return UV_EINVAL;
+
+ uv__once_init();
+ os_info.dwOSVersionInfoSize = sizeof(os_info);
+ os_info.szCSDVersion[0] = L'\0';
+
+ /* Try calling RtlGetVersion(), and fall back to the deprecated GetVersionEx()
+ if RtlGetVersion() is not available. */
+ if (pRtlGetVersion) {
+ pRtlGetVersion(&os_info);
+ } else {
+ /* Silence GetVersionEx() deprecation warning. */
+ #pragma warning(suppress : 4996)
+ if (GetVersionExW(&os_info) == 0) {
+ r = uv_translate_sys_error(GetLastError());
+ goto error;
+ }
+ }
+
+ /* Populate the version field. */
+ if (WideCharToMultiByte(CP_UTF8,
+ 0,
+ os_info.szCSDVersion,
+ -1,
+ buffer->version,
+ sizeof(buffer->version),
+ NULL,
+ NULL) == 0) {
+ r = uv_translate_sys_error(GetLastError());
+ goto error;
+ }
+
+ /* Populate the sysname field. */
+#ifdef __MINGW32__
+ r = snprintf(buffer->sysname,
+ sizeof(buffer->sysname),
+ "MINGW32_NT-%u.%u",
+ (unsigned int) os_info.dwMajorVersion,
+ (unsigned int) os_info.dwMinorVersion);
+ assert(r < sizeof(buffer->sysname));
+#else
+ uv__strscpy(buffer->sysname, "Windows_NT", sizeof(buffer->sysname));
+#endif
+
+ /* Populate the release field. */
+ r = snprintf(buffer->release,
+ sizeof(buffer->release),
+ "%d.%d.%d",
+ (unsigned int) os_info.dwMajorVersion,
+ (unsigned int) os_info.dwMinorVersion,
+ (unsigned int) os_info.dwBuildNumber);
+ assert(r < sizeof(buffer->release));
+
+ /* Populate the machine field. */
+ GetSystemInfo(&system_info);
+
+ switch (system_info.wProcessorArchitecture) {
+ case PROCESSOR_ARCHITECTURE_AMD64:
+ uv__strscpy(buffer->machine, "x86_64", sizeof(buffer->machine));
+ break;
+ case PROCESSOR_ARCHITECTURE_IA64:
+ uv__strscpy(buffer->machine, "ia64", sizeof(buffer->machine));
+ break;
+ case PROCESSOR_ARCHITECTURE_INTEL:
+ uv__strscpy(buffer->machine, "i386", sizeof(buffer->machine));
+
+ if (system_info.wProcessorLevel > 3) {
+ processor_level = system_info.wProcessorLevel < 6 ?
+ system_info.wProcessorLevel : 6;
+ buffer->machine[1] = '0' + processor_level;
+ }
+
+ break;
+ case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64:
+ uv__strscpy(buffer->machine, "i686", sizeof(buffer->machine));
+ break;
+ case PROCESSOR_ARCHITECTURE_MIPS:
+ uv__strscpy(buffer->machine, "mips", sizeof(buffer->machine));
+ break;
+ case PROCESSOR_ARCHITECTURE_ALPHA:
+ case PROCESSOR_ARCHITECTURE_ALPHA64:
+ uv__strscpy(buffer->machine, "alpha", sizeof(buffer->machine));
+ break;
+ case PROCESSOR_ARCHITECTURE_PPC:
+ uv__strscpy(buffer->machine, "powerpc", sizeof(buffer->machine));
+ break;
+ case PROCESSOR_ARCHITECTURE_SHX:
+ uv__strscpy(buffer->machine, "sh", sizeof(buffer->machine));
+ break;
+ case PROCESSOR_ARCHITECTURE_ARM:
+ uv__strscpy(buffer->machine, "arm", sizeof(buffer->machine));
+ break;
+ default:
+ uv__strscpy(buffer->machine, "unknown", sizeof(buffer->machine));
+ break;
+ }
+
+ return 0;
+
+error:
+ buffer->sysname[0] = '\0';
+ buffer->release[0] = '\0';
+ buffer->version[0] = '\0';
+ buffer->machine[0] = '\0';
+ return r;
+}
diff --git a/Utilities/cmlibuv/src/win/winapi.c b/Utilities/cmlibuv/src/win/winapi.c
index c33078614..fbbbceed9 100644
--- a/Utilities/cmlibuv/src/win/winapi.c
+++ b/Utilities/cmlibuv/src/win/winapi.c
@@ -26,6 +26,7 @@
/* Ntdll function pointers */
+sRtlGetVersion pRtlGetVersion;
sRtlNtStatusToDosError pRtlNtStatusToDosError;
sNtDeviceIoControlFile pNtDeviceIoControlFile;
sNtQueryInformationFile pNtQueryInformationFile;
@@ -34,20 +35,8 @@ sNtQueryVolumeInformationFile pNtQueryVolumeInformationFile;
sNtQueryDirectoryFile pNtQueryDirectoryFile;
sNtQuerySystemInformation pNtQuerySystemInformation;
-
/* Kernel32 function pointers */
sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx;
-sSetFileCompletionNotificationModes pSetFileCompletionNotificationModes;
-sCreateSymbolicLinkW pCreateSymbolicLinkW;
-sCancelIoEx pCancelIoEx;
-sInitializeConditionVariable pInitializeConditionVariable;
-sSleepConditionVariableCS pSleepConditionVariableCS;
-sSleepConditionVariableSRW pSleepConditionVariableSRW;
-sWakeAllConditionVariable pWakeAllConditionVariable;
-sWakeConditionVariable pWakeConditionVariable;
-sCancelSynchronousIo pCancelSynchronousIo;
-sGetFinalPathNameByHandleW pGetFinalPathNameByHandleW;
-
/* Powrprof.dll function pointer */
sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification;
@@ -55,22 +44,21 @@ sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification;
/* User32.dll function pointer */
sSetWinEventHook pSetWinEventHook;
-/* iphlpapi.dll function pointer */
-sConvertInterfaceIndexToLuid pConvertInterfaceIndexToLuid = NULL;
-sConvertInterfaceLuidToNameW pConvertInterfaceLuidToNameW = NULL;
void uv_winapi_init(void) {
HMODULE ntdll_module;
- HMODULE kernel32_module;
HMODULE powrprof_module;
HMODULE user32_module;
- HMODULE iphlpapi_module;
+ HMODULE kernel32_module;
ntdll_module = GetModuleHandleA("ntdll.dll");
if (ntdll_module == NULL) {
uv_fatal_error(GetLastError(), "GetModuleHandleA");
}
+ pRtlGetVersion = (sRtlGetVersion) GetProcAddress(ntdll_module,
+ "RtlGetVersion");
+
pRtlNtStatusToDosError = (sRtlNtStatusToDosError) GetProcAddress(
ntdll_module,
"RtlNtStatusToDosError");
@@ -127,37 +115,6 @@ void uv_winapi_init(void) {
kernel32_module,
"GetQueuedCompletionStatusEx");
- pSetFileCompletionNotificationModes = (sSetFileCompletionNotificationModes)
- GetProcAddress(kernel32_module, "SetFileCompletionNotificationModes");
-
- pCreateSymbolicLinkW = (sCreateSymbolicLinkW)
- GetProcAddress(kernel32_module, "CreateSymbolicLinkW");
-
- pCancelIoEx = (sCancelIoEx)
- GetProcAddress(kernel32_module, "CancelIoEx");
-
- pInitializeConditionVariable = (sInitializeConditionVariable)
- GetProcAddress(kernel32_module, "InitializeConditionVariable");
-
- pSleepConditionVariableCS = (sSleepConditionVariableCS)
- GetProcAddress(kernel32_module, "SleepConditionVariableCS");
-
- pSleepConditionVariableSRW = (sSleepConditionVariableSRW)
- GetProcAddress(kernel32_module, "SleepConditionVariableSRW");
-
- pWakeAllConditionVariable = (sWakeAllConditionVariable)
- GetProcAddress(kernel32_module, "WakeAllConditionVariable");
-
- pWakeConditionVariable = (sWakeConditionVariable)
- GetProcAddress(kernel32_module, "WakeConditionVariable");
-
- pCancelSynchronousIo = (sCancelSynchronousIo)
- GetProcAddress(kernel32_module, "CancelSynchronousIo");
-
- pGetFinalPathNameByHandleW = (sGetFinalPathNameByHandleW)
- GetProcAddress(kernel32_module, "GetFinalPathNameByHandleW");
-
-
powrprof_module = LoadLibraryA("powrprof.dll");
if (powrprof_module != NULL) {
pPowerRegisterSuspendResumeNotification = (sPowerRegisterSuspendResumeNotification)
@@ -170,11 +127,4 @@ void uv_winapi_init(void) {
GetProcAddress(user32_module, "SetWinEventHook");
}
- iphlpapi_module = LoadLibraryA("iphlpapi.dll");
- if (iphlpapi_module != NULL) {
- pConvertInterfaceIndexToLuid = (sConvertInterfaceIndexToLuid)
- GetProcAddress(iphlpapi_module, "ConvertInterfaceIndexToLuid");
- pConvertInterfaceLuidToNameW = (sConvertInterfaceLuidToNameW)
- GetProcAddress(iphlpapi_module, "ConvertInterfaceLuidToNameW");
- }
}
diff --git a/Utilities/cmlibuv/src/win/winapi.h b/Utilities/cmlibuv/src/win/winapi.h
index ae384b71a..1e49b5787 100644
--- a/Utilities/cmlibuv/src/win/winapi.h
+++ b/Utilities/cmlibuv/src/win/winapi.h
@@ -4076,8 +4076,8 @@
# define STATUS_HASH_NOT_PRESENT ((NTSTATUS) 0xC000A101L)
#endif
-/* This is not the NTSTATUS_FROM_WIN32 that the DDK provides, because the */
-/* DDK got it wrong! */
+/* This is not the NTSTATUS_FROM_WIN32 that the DDK provides, because the DDK
+ * got it wrong! */
#ifdef NTSTATUS_FROM_WIN32
# undef NTSTATUS_FROM_WIN32
#endif
@@ -4109,6 +4109,9 @@
#endif
/* from winternl.h */
+#if !defined(__UNICODE_STRING_DEFINED) && defined(__MINGW32_)
+#define __UNICODE_STRING_DEFINED
+#endif
typedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
@@ -4524,6 +4527,9 @@ typedef VOID (NTAPI *PIO_APC_ROUTINE)
PIO_STATUS_BLOCK IoStatusBlock,
ULONG Reserved);
+typedef NTSTATUS (NTAPI *sRtlGetVersion)
+ (PRTL_OSVERSIONINFOW lpVersionInformation);
+
typedef ULONG (NTAPI *sRtlNtStatusToDosError)
(NTSTATUS Status);
@@ -4659,48 +4665,6 @@ typedef BOOL (WINAPI *sGetQueuedCompletionStatusEx)
DWORD dwMilliseconds,
BOOL fAlertable);
-typedef BOOL (WINAPI* sSetFileCompletionNotificationModes)
- (HANDLE FileHandle,
- UCHAR Flags);
-
-typedef BOOLEAN (WINAPI* sCreateSymbolicLinkW)
- (LPCWSTR lpSymlinkFileName,
- LPCWSTR lpTargetFileName,
- DWORD dwFlags);
-
-typedef BOOL (WINAPI* sCancelIoEx)
- (HANDLE hFile,
- LPOVERLAPPED lpOverlapped);
-
-typedef VOID (WINAPI* sInitializeConditionVariable)
- (PCONDITION_VARIABLE ConditionVariable);
-
-typedef BOOL (WINAPI* sSleepConditionVariableCS)
- (PCONDITION_VARIABLE ConditionVariable,
- PCRITICAL_SECTION CriticalSection,
- DWORD dwMilliseconds);
-
-typedef BOOL (WINAPI* sSleepConditionVariableSRW)
- (PCONDITION_VARIABLE ConditionVariable,
- PSRWLOCK SRWLock,
- DWORD dwMilliseconds,
- ULONG Flags);
-
-typedef VOID (WINAPI* sWakeAllConditionVariable)
- (PCONDITION_VARIABLE ConditionVariable);
-
-typedef VOID (WINAPI* sWakeConditionVariable)
- (PCONDITION_VARIABLE ConditionVariable);
-
-typedef BOOL (WINAPI* sCancelSynchronousIo)
- (HANDLE hThread);
-
-typedef DWORD (WINAPI* sGetFinalPathNameByHandleW)
- (HANDLE hFile,
- LPWSTR lpszFilePath,
- DWORD cchFilePath,
- DWORD dwFlags);
-
/* from powerbase.h */
#ifndef DEVICE_NOTIFY_CALLBACK
# define DEVICE_NOTIFY_CALLBACK 2
@@ -4755,6 +4719,7 @@ typedef HWINEVENTHOOK (WINAPI *sSetWinEventHook)
/* Ntdll function pointers */
+extern sRtlGetVersion pRtlGetVersion;
extern sRtlNtStatusToDosError pRtlNtStatusToDosError;
extern sNtDeviceIoControlFile pNtDeviceIoControlFile;
extern sNtQueryInformationFile pNtQueryInformationFile;
@@ -4763,20 +4728,8 @@ extern sNtQueryVolumeInformationFile pNtQueryVolumeInformationFile;
extern sNtQueryDirectoryFile pNtQueryDirectoryFile;
extern sNtQuerySystemInformation pNtQuerySystemInformation;
-
/* Kernel32 function pointers */
extern sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx;
-extern sSetFileCompletionNotificationModes pSetFileCompletionNotificationModes;
-extern sCreateSymbolicLinkW pCreateSymbolicLinkW;
-extern sCancelIoEx pCancelIoEx;
-extern sInitializeConditionVariable pInitializeConditionVariable;
-extern sSleepConditionVariableCS pSleepConditionVariableCS;
-extern sSleepConditionVariableSRW pSleepConditionVariableSRW;
-extern sWakeAllConditionVariable pWakeAllConditionVariable;
-extern sWakeConditionVariable pWakeConditionVariable;
-extern sCancelSynchronousIo pCancelSynchronousIo;
-extern sGetFinalPathNameByHandleW pGetFinalPathNameByHandleW;
-
/* Powrprof.dll function pointer */
extern sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotification;
@@ -4784,19 +4737,4 @@ extern sPowerRegisterSuspendResumeNotification pPowerRegisterSuspendResumeNotifi
/* User32.dll function pointer */
extern sSetWinEventHook pSetWinEventHook;
-/* iphlpapi.dll function pointer */
-union _NET_LUID_LH;
-typedef DWORD (WINAPI *sConvertInterfaceIndexToLuid)(
- ULONG InterfaceIndex,
- union _NET_LUID_LH *InterfaceLuid);
-
-typedef DWORD (WINAPI *sConvertInterfaceLuidToNameW)(
- const union _NET_LUID_LH *InterfaceLuid,
- PWSTR InterfaceName,
- size_t Length);
-
-extern sConvertInterfaceIndexToLuid pConvertInterfaceIndexToLuid;
-extern sConvertInterfaceLuidToNameW pConvertInterfaceLuidToNameW;
-
-
#endif /* UV_WIN_WINAPI_H_ */
diff --git a/Utilities/cmlibuv/src/win/winsock.c b/Utilities/cmlibuv/src/win/winsock.c
index 84188954d..5e7da2a8f 100644
--- a/Utilities/cmlibuv/src/win/winsock.c
+++ b/Utilities/cmlibuv/src/win/winsock.c
@@ -256,8 +256,8 @@ int uv_ntstatus_to_winsock_error(NTSTATUS status) {
default:
if ((status & (FACILITY_NTWIN32 << 16)) == (FACILITY_NTWIN32 << 16) &&
(status & (ERROR_SEVERITY_ERROR | ERROR_SEVERITY_WARNING))) {
- /* It's a windows error that has been previously mapped to an */
- /* ntstatus code. */
+ /* It's a windows error that has been previously mapped to an ntstatus
+ * code. */
return (DWORD) (status & 0xffff);
} else {
/* The default fallback for unmappable ntstatus codes. */
@@ -519,8 +519,8 @@ int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info_in,
sizeof *info_out);
if (overlapped == NULL) {
- /* If this is a blocking operation, wait for the event to become */
- /* signaled, and then grab the real status from the io status block. */
+ /* If this is a blocking operation, wait for the event to become signaled,
+ * and then grab the real status from the io status block. */
if (status == STATUS_PENDING) {
DWORD r = WaitForSingleObject(event, INFINITE);
diff --git a/bootstrap b/bootstrap
index 416a3d678..26c521250 100755
--- a/bootstrap
+++ b/bootstrap
@@ -348,6 +348,7 @@ CMAKE_CXX_SOURCES="\
cmInstallFilesGenerator \
cmInstallGenerator \
cmInstallScriptGenerator \
+ cmInstallSubdirectoryGenerator \
cmInstallTargetGenerator \
cmInstallTargetsCommand \
cmInstalledFile \
@@ -429,6 +430,7 @@ CMAKE_CXX_SOURCES="\
cmake \
cmakemain \
cmcmd \
+ cm_string_view \
"
if ${cmake_system_mingw}; then
@@ -489,8 +491,11 @@ KWSYS_FILES="\
if ${cmake_system_mingw}; then
LIBUV_C_SOURCES="\
src/fs-poll.c \
+ src/idna.c
src/inet.c \
src/threadpool.c \
+ src/strscpy.c \
+ src/timer.c \
src/uv-common.c \
src/win/async.c \
src/win/core.c \
@@ -507,12 +512,10 @@ if ${cmake_system_mingw}; then
src/win/poll.c \
src/win/process-stdio.c \
src/win/process.c \
- src/win/req.c \
src/win/signal.c \
src/win/stream.c \
src/win/tcp.c \
src/win/thread.c \
- src/win/timer.c \
src/win/tty.c \
src/win/udp.c \
src/win/util.c \
@@ -521,6 +524,8 @@ if ${cmake_system_mingw}; then
"
else
LIBUV_C_SOURCES="\
+ src/strscpy.c \
+ src/timer.c \
src/uv-common.c \
src/unix/cmake-bootstrap.c \
src/unix/core.c \
@@ -535,7 +540,6 @@ else
src/unix/process.c \
src/unix/signal.c \
src/unix/stream.c \
- src/unix/timer.c \
"
fi
@@ -1308,11 +1312,11 @@ cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION_PATCH ${cmake_versi
cmake_report cmVersionConfig.h${_tmp} "#define CMake_VERSION \"${cmake_version}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_SOURCE_DIR \"${CMAKE_BOOTSTRAP_SOURCE_DIR}\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_BOOTSTRAP_BINARY_DIR}\""
+cmake_report cmConfigure.h${_tmp} "#define CMake_DEFAULT_RECURSION_LIMIT 400"
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
-cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)"
# Regenerate configured headers
for h in Configure VersionConfig; do