diff options
165 files changed, 1294 insertions, 618 deletions
diff --git a/Help/command/add_subdirectory.rst b/Help/command/add_subdirectory.rst index e979253..012ded4 100644 --- a/Help/command/add_subdirectory.rst +++ b/Help/command/add_subdirectory.rst @@ -30,7 +30,7 @@ project that is useful but not necessary, such as a set of examples. Typically the subdirectory should contain its own :command:`project` command invocation so that a full build system will be generated in the subdirectory (such as a VS IDE solution file). Note that inter-target -dependencies supercede this exclusion. If a target built by the +dependencies supersede this exclusion. If a target built by the parent project depends on a target in the subdirectory, the dependee target will be included in the parent project build system to satisfy the dependency. diff --git a/Help/command/enable_language.rst b/Help/command/enable_language.rst index 4445561..871ac4e 100644 --- a/Help/command/enable_language.rst +++ b/Help/command/enable_language.rst @@ -19,4 +19,5 @@ indirectly through link dependencies. It is simplest to enable all needed languages in the top-level directory of a project. The ``OPTIONAL`` keyword is a placeholder for future implementation and -does not currently work. +does not currently work. Instead you can use the :module:`CheckLanguage` +module to verify support before enabling. diff --git a/Help/command/file.rst b/Help/command/file.rst index 4d4ebb4..5ce86e5 100644 --- a/Help/command/file.rst +++ b/Help/command/file.rst @@ -110,7 +110,7 @@ regular expressions, but much simpler. If ``RELATIVE`` flag is specified, the results will be returned as relative paths to the given path. The results will be ordered lexicographically. -By default ``GLOB`` lists directories - directories are omited in result if +By default ``GLOB`` lists directories - directories are omitted in result if ``LIST_DIRECTORIES`` is set to false. .. note:: diff --git a/Help/command/install.rst b/Help/command/install.rst index 58438b7..9f9ee13 100644 --- a/Help/command/install.rst +++ b/Help/command/install.rst @@ -346,7 +346,7 @@ specified that does not match that given to the targets associated with included in the export but a target to which it links is not included the behavior is unspecified. -In additon to cmake language files, the ``EXPORT_ANDROID_MK`` option maybe +In addition to cmake language files, the ``EXPORT_ANDROID_MK`` option maybe used to specifiy an export to the android ndk build system. The Android NDK supports the use of prebuilt libraries, both static and shared. This allows cmake to build the libraries of a project and make them available diff --git a/Help/dev/testing.rst b/Help/dev/testing.rst index 731930c..1b29acf 100644 --- a/Help/dev/testing.rst +++ b/Help/dev/testing.rst @@ -16,7 +16,7 @@ welcome to provide testing machines in order to help keep support for their platforms working. The `CMake Dashboard Scripts Repository`_ provides CTest scripts to drive -nightly, continous, and experimental testing of CMake. Use the following +nightly, continuous, and experimental testing of CMake. Use the following commands to set up a new integration testing client: .. code-block:: console diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst index 389a6d5..a2fd961 100644 --- a/Help/manual/cmake-server.7.rst +++ b/Help/manual/cmake-server.7.rst @@ -628,6 +628,79 @@ CMake will reply:: ]== "CMake Server" ==] +Type "ctestInfo" +^^^^^^^^^^^^^^^^ + +The "ctestInfo" request can be used after a project was "compute"d successfully. + +It will list the complete project test structure as it is known to cmake. + +The reply will contain a key "configurations", which will contain a list of +configuration objects. Configuration objects are used to destinquish between +different configurations the build directory might have enabled. While most +generators only support one configuration, others might support several. + +Each configuration object can have the following keys: + +"name" + contains the name of the configuration. The name may be empty. +"projects" + contains a list of project objects, one for each build project. + +Project objects define one (sub-)project defined in the cmake build system. + +Each project object can have the following keys: + +"name" + contains the (sub-)projects name. +"targets" + contains a list of build system target objects. + +Target objects define individual build targets for a certain configuration. + +Each target object can have the following keys: + +"name" + contains the name of the target. +"type" + defines the type of build of the target. Possible values are + "STATIC_LIBRARY", "MODULE_LIBRARY", "SHARED_LIBRARY", "OBJECT_LIBRARY", + "EXECUTABLE", "UTILITY" and "INTERFACE_LIBRARY". +"fullName" + contains the full name of the build result (incl. extensions, etc.). +"hasEnabledTests" + true if testing is enabled for this target. +"ctestInfo" + contains a list of test objects for this target. + +Each test object can have the following keys: + +"ctestName" + contains the name of the test. +"ctestCommand" + contains the test command. +"properties" + contains a list of test property objects. +"backtrace" + contains a list of backtrace objects that specify where the test was defined. + +Each backtrace object can have the following keys: + +"path" + contains the full path to the file containing the statement. +"line" + contains the line number in the file where the statement was defined. +"name" + contains the name of the statement that added the test. + +Each test property object can have the following keys: + +"key" + contains the test property key. +"value" + contains the test property value. + + Type "cmakeInputs" ^^^^^^^^^^^^^^^^^^ diff --git a/Help/policy/CMP0037.rst b/Help/policy/CMP0037.rst index 9f8457c..8041960 100644 --- a/Help/policy/CMP0037.rst +++ b/Help/policy/CMP0037.rst @@ -14,7 +14,12 @@ character (_), dot(.), plus(+) and minus(-). As a special case, ALIAS targets and IMPORTED targets may contain two consequtive colons. Target names reserved by one or more CMake generators are not allowed. -Among others these include "all", "help" and "test". +Among others these include "all", "clean", "help", and "install". + +Target names associated with optional features, such as "test" and "package", +may also be reserved. CMake 3.10 and below always reserve them. CMake 3.11 +and above reserve them only when the corresponding feature is enabled +(e.g. by including the :module:`CTest` or :module:`CPack` modules). The OLD behavior for this policy is to allow creating targets with reserved names or which do not match the validity pattern. diff --git a/Help/release/3.4.rst b/Help/release/3.4.rst index 89c5561..468627e 100644 --- a/Help/release/3.4.rst +++ b/Help/release/3.4.rst @@ -66,7 +66,7 @@ Variables Properties ---------- -* :ref:`Visual Studio Generators` learned to support additonal +* :ref:`Visual Studio Generators` learned to support additional target properties to customize projects for NVIDIA Nsight Tegra Visual Studio Edition: diff --git a/Help/release/3.6.rst b/Help/release/3.6.rst index 144537d..a542b77 100644 --- a/Help/release/3.6.rst +++ b/Help/release/3.6.rst @@ -111,7 +111,7 @@ Modules * The :module:`ExternalProject` module learned to initialize Git submodules recursively and also to initialize new submodules on updates. Use the - ``GIT_SUBMODULES`` option to restrict which submodules are initalized and + ``GIT_SUBMODULES`` option to restrict which submodules are initialized and updated. * The :module:`ExternalProject` module leared the ``DOWNLOAD_NO_EXTRACT 1`` diff --git a/Help/release/3.7.rst b/Help/release/3.7.rst index 4c51af4..d4d374b 100644 --- a/Help/release/3.7.rst +++ b/Help/release/3.7.rst @@ -237,7 +237,7 @@ CPack * The :module:`CPackIFW` module :command:`cpack_ifw_configure_component` and :command:`cpack_ifw_configure_component_group` commands gained a new - ``USER_INTERFACES`` option to add a list of additonal pages to the IFW + ``USER_INTERFACES`` option to add a list of additional pages to the IFW installer. * The :module:`CPackRPM` module learned to generate debuginfo diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst new file mode 100644 index 0000000..bcfa70a --- /dev/null +++ b/Help/release/dev/deprecate-policy-old.rst @@ -0,0 +1,8 @@ +deprecate-policy-old +-------------------- + +* An explicit deprecation diagnostic was added for policies ``CMP0037`` + through ``CMP0054`` (``CMP0036`` 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. diff --git a/Help/variable/LIBRARY_OUTPUT_PATH.rst b/Help/variable/LIBRARY_OUTPUT_PATH.rst index ba02911..bb4328f 100644 --- a/Help/variable/LIBRARY_OUTPUT_PATH.rst +++ b/Help/variable/LIBRARY_OUTPUT_PATH.rst @@ -5,5 +5,5 @@ Old library location variable. The target properties :prop_tgt:`ARCHIVE_OUTPUT_DIRECTORY`, :prop_tgt:`LIBRARY_OUTPUT_DIRECTORY`, and :prop_tgt:`RUNTIME_OUTPUT_DIRECTORY` -supercede this variable for a target if they are set. Library targets are +supersede this variable for a target if they are set. Library targets are otherwise placed in this directory. diff --git a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake index 04529b1..fccff67 100644 --- a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake +++ b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake @@ -31,7 +31,7 @@ function(android_push_test_files_to_device) set(out_var ${out_var} PARENT_SCOPE) if(res_var) string(REGEX REPLACE ";" " " com "${ARGN}") - message(FATAL_ERROR "Error occured during adb command: adb ${com}\nError: ${err_var}.") + message(FATAL_ERROR "Error occurred during adb command: adb ${com}\nError: ${err_var}.") endif() endfunction() diff --git a/Modules/CMakeDetermineCSharpCompiler.cmake b/Modules/CMakeDetermineCSharpCompiler.cmake index 55b2fb3..eb825a5 100644 --- a/Modules/CMakeDetermineCSharpCompiler.cmake +++ b/Modules/CMakeDetermineCSharpCompiler.cmake @@ -23,7 +23,7 @@ if(NOT CMAKE_CSharp_COMPILER_ID_RUN) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) CMAKE_DETERMINE_COMPILER_ID(CSharp CSFLAGS CMakeCSharpCompilerId.cs) - execute_process(COMMAND "${CMAKE_CSharp_COMPILER}" "/help" OUTPUT_VARIABLE output) + execute_process(COMMAND "${CMAKE_CSharp_COMPILER}" "/help /preferreduilang:en-US" OUTPUT_VARIABLE output) string(REPLACE "\n" ";" output "${output}") foreach(line ${output}) string(TOUPPER ${line} line) diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 49789f1..da3d953 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -2,6 +2,26 @@ #if 0 ! Identify the compiler #endif +#if defined(_MSC_VER) + PRINT *, 'INFO:simulate[MSVC]' +# if _MSC_VER >= 1900 + PRINT *, 'INFO:simulate_version[019.00]' +# elif _MSC_VER >= 1800 + PRINT *, 'INFO:simulate_version[018.00]' +# elif _MSC_VER >= 1700 + PRINT *, 'INFO:simulate_version[017.00]' +# elif _MSC_VER >= 1600 + PRINT *, 'INFO:simulate_version[016.00]' +# elif _MSC_VER >= 1500 + PRINT *, 'INFO:simulate_version[015.00]' +# elif _MSC_VER >= 1400 + PRINT *, 'INFO:simulate_version[014.00]' +# elif _MSC_VER >= 1310 + PRINT *, 'INFO:simulate_version[013.01]' +# else + PRINT *, 'INFO:simulate_version[013.00]' +# endif +#endif #if defined(__INTEL_COMPILER) || defined(__ICC) PRINT *, 'INFO:compiler[Intel]' # define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) @@ -14,27 +34,6 @@ # if defined(__INTEL_COMPILER_BUILD_DATE) # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) # endif - -# if defined(_MSC_VER) - PRINT *, 'INFO:simulate[MSVC]' -# if _MSC_VER >= 1900 - PRINT *, 'INFO:simulate_version[019.00]' -# elif _MSC_VER >= 1800 - PRINT *, 'INFO:simulate_version[018.00]' -# elif _MSC_VER >= 1700 - PRINT *, 'INFO:simulate_version[017.00]' -# elif _MSC_VER >= 1600 - PRINT *, 'INFO:simulate_version[016.00]' -# elif _MSC_VER >= 1500 - PRINT *, 'INFO:simulate_version[015.00]' -# elif _MSC_VER >= 1400 - PRINT *, 'INFO:simulate_version[014.00]' -# elif _MSC_VER >= 1310 - PRINT *, 'INFO:simulate_version[013.01]' -# else - PRINT *, 'INFO:simulate_version[013.00]' -# endif -# endif #elif defined(__SUNPRO_F95) PRINT *, 'INFO:compiler[SunPro]' # define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F95>>8) diff --git a/Modules/CMakePackageConfigHelpers.cmake b/Modules/CMakePackageConfigHelpers.cmake index 90c2a57..f5a8e59 100644 --- a/Modules/CMakePackageConfigHelpers.cmake +++ b/Modules/CMakePackageConfigHelpers.cmake @@ -154,7 +154,7 @@ # macro. # # Internally, this macro executes :command:`configure_file()` to create the -# resulting version file. Depending on the ``COMPATIBLITY``, either the file +# resulting version file. Depending on the ``COMPATIBILITY``, either the file # ``BasicConfigVersion-SameMajorVersion.cmake.in`` or # ``BasicConfigVersion-AnyNewerVersion.cmake.in`` is used. Please note that # these two files are internal to CMake and you should not call diff --git a/Modules/CMakeParseImplicitLinkInfo.cmake b/Modules/CMakeParseImplicitLinkInfo.cmake index 3b77278..63d18ab 100644 --- a/Modules/CMakeParseImplicitLinkInfo.cmake +++ b/Modules/CMakeParseImplicitLinkInfo.cmake @@ -142,7 +142,7 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj # We remove items that are not language-specific. set(implicit_libs "") foreach(lib IN LISTS implicit_libs_tmp) - if("x${lib}" MATCHES "^x(crt.*\\.o|System.*|.*libclang_rt.*|msvcrt.*|libvcruntime.*|libucrt.*|libcmt.*)$") + if("x${lib}" MATCHES "^x(crt.*\\.o|gcc_eh.*|System.*|.*libclang_rt.*|msvcrt.*|libvcruntime.*|libucrt.*|libcmt.*)$") string(APPEND log " remove lib [${lib}]\n") elseif(IS_ABSOLUTE "${lib}") get_filename_component(abs "${lib}" ABSOLUTE) diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 8d8b070..05a54a0 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -817,7 +817,7 @@ if(CPACK_IFW_INSTALLERBASE_EXECUTABLE AND NOT CPACK_IFW_FRAMEWORK_VERSION_FORCED endif() endif() endforeach() - # Finaly try to get version from executable path + # Finally try to get version from executable path if(NOT CPACK_IFW_FRAMEWORK_VERSION) string(REGEX MATCH "[0-9]+(\\.[0-9]+)*" CPACK_IFW_FRAMEWORK_VERSION "${CPACK_IFW_INSTALLERBASE_EXECUTABLE}") @@ -864,7 +864,7 @@ macro(_cpack_ifw_resolve_script _variable) endif() endmacro() -# Resolve full path to lisense file +# Resolve full path to license file macro(_cpack_ifw_resolve_lisenses _variable) if(${_variable}) set(_ifw_license_file FALSE) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 9f77ec3..c5a27f9 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -545,7 +545,7 @@ # /usr/share/doc # # May be used to exclude path (directories or files) from the auto-generated -# list of paths discovered by CPack RPM. The defaut value contains a +# list of paths discovered by CPack RPM. The default value contains a # reasonable set of values if the variable is not defined by the user. If the # variable is defined by the user then CPackRPM will NOT any of the default # path. If you want to add some path to the default list then you can use @@ -782,7 +782,7 @@ # # .. note:: # -# Each source path prefix is additionaly suffixed by ``src_<index>`` where +# Each source path prefix is additionally suffixed by ``src_<index>`` where # index is index of the path used from :variable:`CPACK_BUILD_SOURCE_DIRS` # variable. This produces ``<CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX>/src_<index>`` # replacement path. @@ -1985,13 +1985,13 @@ function(cpack_rpm_generate_package) # CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE) # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE) # May be used to embed a post (un)installation script in the spec file. - # The refered script file(s) will be read and directly + # The referred script file(s) will be read and directly # put after the %post or %postun section # ---------------------------------------------------------------- # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE) # CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE) # May be used to embed a pre (un)installation script in the spec file. - # The refered script file(s) will be read and directly + # The referred script file(s) will be read and directly # put after the %pre or %preun section foreach(RPM_SCRIPT_FILE_TYPE_ "INSTALL" "UNINSTALL") foreach(RPM_SCRIPT_FILE_TIME_ "PRE" "POST") @@ -2022,7 +2022,7 @@ function(cpack_rpm_generate_package) # CPACK_RPM_CHANGELOG_FILE # May be used to embed a changelog in the spec file. - # The refered file will be read and directly put after the %changelog section + # The referred file will be read and directly put after the %changelog section if(CPACK_RPM_CHANGELOG_FILE) if(EXISTS ${CPACK_RPM_CHANGELOG_FILE}) file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG) @@ -2152,7 +2152,7 @@ function(cpack_rpm_generate_package) string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) # Transform endline separated - string into CMake List string(REPLACE "\n" ";" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}") - # Remove unecessary quotes + # Remove unnecessary quotes string(REPLACE "\"" "" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}") # Remove ABSOLUTE install file from INSTALL FILE LIST list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES_LIST ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}) @@ -2413,7 +2413,7 @@ ${TMP_DEBUGINFO_ADDITIONAL_SOURCES} endif() # Disable debuginfo packages - srpm generates invalid packages due to - # releasing controll to cpack to generate binary packages. + # releasing control to cpack to generate binary packages. # Note however that this doesn't prevent cpack to generate debuginfo # packages when run from srpm with --rebuild. set(TMP_RPM_DISABLE_DEBUGINFO "%define debug_package %{nil}") diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 9370596..a08282e 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -65,7 +65,7 @@ endfunction() include(CTestUseLaunchers) if(BUILD_TESTING) - # Setup some auxilary macros + # Setup some auxiliary macros macro(SET_IF_NOT_SET var val) if(NOT DEFINED "${var}") set("${var}" "${val}") diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index 9f5e921..7ce1adb 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -11,7 +11,8 @@ set(__COMPILER_CLANG 1) include(Compiler/CMakeCommonCompilerMacros) if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" - OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC" + OR "x${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "xMSVC") macro(__compiler_clang lang) endmacro() else() diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake index 2b04795..b29ee81 100644 --- a/Modules/Compiler/IAR-FindBinUtils.cmake +++ b/Modules/Compiler/IAR-FindBinUtils.cmake @@ -17,7 +17,7 @@ if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") find_program(CMAKE_IAR_ARCHIVE iarchive.exe HINTS ${__iar_hints} DOC "The IAR archiver") - # find auxillary tools + # find auxiliary tools find_program(CMAKE_IAR_ELFTOOL ielftool.exe HINTS ${__iar_hints} DOC "The IAR ELF Tool") find_program(CMAKE_IAR_ELFDUMP ielfdumparm.exe HINTS ${__iar_hints} diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake index 52ebaf2..43243b9 100644 --- a/Modules/Compiler/IAR.cmake +++ b/Modules/Compiler/IAR.cmake @@ -29,7 +29,7 @@ # "Silent" Operation # # this really is different to most programs I know. -# nothing meaningfull from the operation is lost, just some redundant +# nothing meaningful from the operation is lost, just some redundant # code and data size printouts (that can be inspected with common tools). # This module is shared by multiple languages; use include blocker. diff --git a/Modules/Documentation.cmake b/Modules/Documentation.cmake index fc398e6..6e21249 100644 --- a/Modules/Documentation.cmake +++ b/Modules/Documentation.cmake @@ -40,7 +40,7 @@ if (BUILD_DOCUMENTATION) ) # - # The documentation process is controled by a batch file. + # The documentation process is controlled by a batch file. # We will probably need bash to create the custom target # diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 1b93304..fbce235 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -493,7 +493,7 @@ endfunction() by the project when available at buildtime, but it also work without. ``RECOMMENDED`` is similar to ``OPTIONAL``, i.e. the project will build if the package is not present, but the functionality of the resulting - binaries will be severly limited. If a ``REQUIRED`` package is not + binaries will be severely limited. If a ``REQUIRED`` package is not available at buildtime, the project may not even build. This can be combined with the ``FATAL_ON_MISSING_REQUIRED_PACKAGES`` argument for ``feature_summary()``. Last, a ``RUNTIME`` package is a package which is diff --git a/Modules/FindBZip2.cmake b/Modules/FindBZip2.cmake index d2307f1..0375b09 100644 --- a/Modules/FindBZip2.cmake +++ b/Modules/FindBZip2.cmake @@ -38,6 +38,8 @@ if (NOT BZIP2_LIBRARIES) include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) SELECT_LIBRARY_CONFIGURATIONS(BZIP2) +else () + file(TO_CMAKE_PATH "${BZIP2_LIBRARIES}" BZIP2_LIBRARIES) endif () if (BZIP2_INCLUDE_DIR AND EXISTS "${BZIP2_INCLUDE_DIR}/bzlib.h") diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 88d14ab..6f60eeb 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -391,13 +391,8 @@ endmacro() # version with a regex. # function(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION) - - exec_program(${CMAKE_CXX_COMPILER} - ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion - OUTPUT_VARIABLE _boost_COMPILER_VERSION - ) - string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" - _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION}) + string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1\\2" + _boost_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) set(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) endfunction() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index d177e5e..8708938 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -581,7 +581,7 @@ mark_as_advanced( # Makefile and similar generators don't define CMAKE_CONFIGURATION_TYPES, so we # need to add another entry for the CMAKE_BUILD_TYPE. We also need to add the # standerd set of 4 build types (Debug, MinSizeRel, Release, and RelWithDebInfo) -# for completeness. We need run this loop in order to accomodate the addition +# for completeness. We need run this loop in order to accommodate the addition # of extra configuration types. Duplicate entries will be removed by # REMOVE_DUPLICATES. set(CUDA_configuration_types ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel Release RelWithDebInfo) diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index f78119d..86051cf 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -181,7 +181,7 @@ cuda_execute_process( set(depends_CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}") set(CUDA_VERSION @CUDA_VERSION@) if(CUDA_VERSION VERSION_LESS "3.0") - # Note that this will remove all occurances of -G. + # Note that this will remove all occurrences of -G. list(REMOVE_ITEM depends_CUDA_NVCC_FLAGS "-G") endif() diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake index 9ba1ff3..2aa5f6f 100644 --- a/Modules/FindCxxTest.cmake +++ b/Modules/FindCxxTest.cmake @@ -145,7 +145,7 @@ # # Version 1.3 (8/19/10) (CMake 2.8.3) # Included patch by Simone Rossetto to check if either Python or Perl -# are present in the system. Whichever intepreter that is detected +# are present in the system. Whichever interpreter that is detected # is now used to run the test generator program. If both interpreters # are detected, the CXXTEST_USE_PYTHON variable is obeyed. # diff --git a/Modules/FindDCMTK.cmake b/Modules/FindDCMTK.cmake index 0d86e8e..f348d3a 100644 --- a/Modules/FindDCMTK.cmake +++ b/Modules/FindDCMTK.cmake @@ -217,7 +217,7 @@ if(EXISTS ${DCMTK_DIR}/CMakeCache.txt) if(NOT EXISTS ${EXTDCMTK_SOURCE_DIR}) message(FATAL_ERROR "DCMTK build directory references -nonexistant DCMTK source directory ${EXTDCMTK_SOURCE_DIR}") +nonexistent DCMTK source directory ${EXTDCMTK_SOURCE_DIR}") endif() endif() diff --git a/Modules/FindDevIL.cmake b/Modules/FindDevIL.cmake index f6c8e3f..e904a30 100644 --- a/Modules/FindDevIL.cmake +++ b/Modules/FindDevIL.cmake @@ -70,5 +70,5 @@ find_library(ILU_LIBRARIES FIND_PACKAGE_HANDLE_STANDARD_ARGS(DevIL DEFAULT_MSG IL_LIBRARIES ILU_LIBRARIES IL_INCLUDE_DIR) -# provide legacy variable for compatiblity +# provide legacy variable for compatibility set(IL_FOUND ${DevIL_FOUND}) diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake index fef7fb4..3945b78 100644 --- a/Modules/FindFLEX.cmake +++ b/Modules/FindFLEX.cmake @@ -52,7 +52,7 @@ # # # -# Flex scanners oftenly use tokens defined by Bison: the code generated +# 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: # diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index de20049..012ae22 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -479,7 +479,7 @@ if(NOT HDF5_FOUND AND NOT HDF5_NO_FIND_PACKAGE_CONFIG_FILE) #if we detect that occurrence clear the suffix if(_suffix AND NOT TARGET ${HDF5_${_lang}_TARGET}${_suffix}) if(NOT TARGET ${HDF5_${_lang}_TARGET}) - #cant find this component with or without the suffix + #can't find this component with or without the suffix #so bail out, and let the following locate HDF5 set(HDF5_FOUND FALSE) break() diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake index cebba10..96e3e21 100644 --- a/Modules/FindJNI.cmake +++ b/Modules/FindJNI.cmake @@ -25,7 +25,7 @@ # JAVA_INCLUDE_PATH2 = the include path to jni_md.h # JAVA_AWT_INCLUDE_PATH = the include path to jawt.h -# Expand {libarch} occurences to java_libarch subdirectory(-ies) and set ${_var} +# Expand {libarch} occurrences to java_libarch subdirectory(-ies) and set ${_var} macro(java_append_library_directories _var) # Determine java arch-specific library subdir # Mostly based on openjdk/jdk/make/common/shared/Platform.gmk as of openjdk @@ -46,7 +46,7 @@ macro(java_append_library_directories _var) set(_java_libarch "arm" "aarch32") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^mips") # mips* machines are bi-endian mostly so processor does not tell - # endianess of the underlying system. + # endianness of the underlying system. set(_java_libarch "${CMAKE_SYSTEM_PROCESSOR}" "mips" "mipsel" "mipseb" "mips64" "mips64el" "mipsn32" "mipsn32el") elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64le") set(_java_libarch "ppc64" "ppc64le") diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 7d4ed6a..c79642d 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -1198,7 +1198,7 @@ if(_numbers_of_matlab_roots EQUAL 0) # At this point, we have no other choice than trying to find it from PATH. - # If set by the user, this wont change + # If set by the user, this won't change find_program( _matlab_main_tmp NAMES matlab) diff --git a/Modules/FindOpenGL.cmake b/Modules/FindOpenGL.cmake index 59bee41..8cceabd 100644 --- a/Modules/FindOpenGL.cmake +++ b/Modules/FindOpenGL.cmake @@ -440,9 +440,10 @@ if(OPENGL_FOUND) endif() # OPENGL_LIBRARIES mirrors OpenGL::GL's logic ... - set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY}) if(TARGET OpenGL::GLX AND TARGET OpenGL::OpenGL) set(OPENGL_LIBRARIES ${OPENGL_opengl_LIBRARY} ${OPENGL_glx_LIBRARY}) + else() + set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY}) endif() # ... and also includes GLU, if available. if(TARGET OpenGL::GLU) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 0187e0d..c358ff1 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -110,7 +110,7 @@ if(WIN32 AND NOT CYGWIN) # * MTd for static-debug # Implementation details: - # We are using the libraries located in the VC subdir instead of the parent directory eventhough : + # We are using the libraries located in the VC subdir instead of the parent directory even though : # libeay32MD.lib is identical to ../libeay32.lib, and # ssleay32MD.lib is identical to ../ssleay32.lib # enable OPENSSL_USE_STATIC_LIBS to use the static libs located in lib/VC/static diff --git a/Modules/FindTCL.cmake b/Modules/FindTCL.cmake index b6e24a3..a711493 100644 --- a/Modules/FindTCL.cmake +++ b/Modules/FindTCL.cmake @@ -26,7 +26,7 @@ # # # In an effort to remove some clutter and clear up some issues for -# people who are not necessarily Tcl/Tk gurus/developpers, some +# people who are not necessarily Tcl/Tk gurus/developers, some # variables were moved or removed. Changes compared to CMake 2.4 are: # # :: diff --git a/Modules/FindTclStub.cmake b/Modules/FindTclStub.cmake index 9711bd6..51fc029 100644 --- a/Modules/FindTclStub.cmake +++ b/Modules/FindTclStub.cmake @@ -32,7 +32,7 @@ # # # In an effort to remove some clutter and clear up some issues for -# people who are not necessarily Tcl/Tk gurus/developpers, some +# people who are not necessarily Tcl/Tk gurus/developers, some # variables were moved or removed. Changes compared to CMake 2.4 are: # # :: diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index be84999..e08afe4 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -915,7 +915,7 @@ if (_wx_lib_missing) endif() unset(_wx_lib_missing) -# Check if a specfic version was requested by find_package(). +# Check if a specific version was requested by find_package(). if(wxWidgets_FOUND) find_file(_filename wx/version.h PATHS ${wxWidgets_INCLUDE_DIRS} NO_DEFAULT_PATH) dbg_msg("_filename: ${_filename}") diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake index 76eb6be..054a1bf 100644 --- a/Modules/FindwxWindows.cmake +++ b/Modules/FindwxWindows.cmake @@ -390,7 +390,7 @@ if(WIN32_STYLE_FIND) if (NOT WXWINDOWS_USE_SHARED_LIBS) set(WXWINDOWS_LIBRARIES ${WXWINDOWS_LIBRARIES} - ## these ones dont seem required, in particular ctl3d32 is not neccesary (Jan Woetzel 07/2003) + ## these ones don't seem required, in particular ctl3d32 is not necessary (Jan Woetzel 07/2003) # ctl3d32 debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_ZLIB} optimized ${WXWINDOWS_STATIC_LIBRARY_ZLIB} debug ${WXWINDOWS_STATIC_DEBUG_LIBRARY_REGEX} optimized ${WXWINDOWS_STATIC_LIBRARY_REGEX} @@ -546,7 +546,7 @@ if(WIN32_STYLE_FIND) endif() - ## not neccessary in wxWindows 2.4.1 and 2.6.2 + ## not necessary in wxWindows 2.4.1 and 2.6.2 ## but it may fix a previous bug, see ## http://lists.wxwindows.org/cgi-bin/ezmlm-cgi?8:mss:37574:200305:mpdioeneabobmgjenoap option(WXWINDOWS_SET_DEFINITIONS "Set additional defines for wxWindows" OFF) diff --git a/Modules/ITKCompatibility.cmake b/Modules/ITKCompatibility.cmake index fef0653..7d211b6 100644 --- a/Modules/ITKCompatibility.cmake +++ b/Modules/ITKCompatibility.cmake @@ -2,6 +2,6 @@ # file Copyright.txt or https://cmake.org/licensing for details. -# work around an old bug in ITK prior to verison 3.0 +# work around an old bug in ITK prior to version 3.0 set(TIFF_RIGHT_VERSION 1) diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index ac8c20b..1ba4877 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -593,15 +593,17 @@ if(_IRSL_HAVE_Intel) endif() endif() if(WIN32) - set(__install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c" - "${_Intel_redistdir}/1033" "${_Intel_redistdir}/1041") + set(__install_dirs "${_Intel_redistdir}/1033") + if(_Intel_compiler_ver VERSION_LESS 18) + list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c" "${_Intel_redistdir}/1041") + endif() foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libgfxoffload.dll libioffload_host.dll libirngmd.dll libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) - foreach(__Intel_lib IN ITEMS libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll) + foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() diff --git a/Modules/Platform/Windows-Flang-Fortran.cmake b/Modules/Platform/Windows-Flang-Fortran.cmake index 9f20e73..a4b1cf1 100644 --- a/Modules/Platform/Windows-Flang-Fortran.cmake +++ b/Modules/Platform/Windows-Flang-Fortran.cmake @@ -1,2 +1,3 @@ include(Platform/Windows-MSVC) __windows_compiler_msvc(Fortran) +set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> ${_COMPILE_Fortran} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 0478918..aee4028 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -151,7 +151,7 @@ macro (QT4_GENERATE_MOC infile outfile ) set(moc_target ${ARGV3}) endif() QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}") - set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file + set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # don't run automoc on this file endmacro () diff --git a/Modules/SquishTestScript.cmake b/Modules/SquishTestScript.cmake index cfdfaec..c0e1bea 100644 --- a/Modules/SquishTestScript.cmake +++ b/Modules/SquishTestScript.cmake @@ -34,7 +34,7 @@ message(STATUS "squish_settingsgroup='${squish_settingsgroup}'") message(STATUS "squish_pre_command='${squish_pre_command}'") message(STATUS "squish_post_command='${squish_post_command}'") -# parse enviornment variables +# parse environment variables foreach(i ${squish_env_vars}) message(STATUS "parsing env var key/value pair ${i}") string(REGEX MATCH "([^=]*)=(.*)" squish_env_name ${i}) diff --git a/Modules/UseEcos.cmake b/Modules/UseEcos.cmake index 942bc38..700bfe6 100644 --- a/Modules/UseEcos.cmake +++ b/Modules/UseEcos.cmake @@ -181,7 +181,7 @@ macro(ECOS_ADD_EXECUTABLE _exe_NAME ) #the executable depends on ecos target.ld ECOS_ADD_TARGET_LIB(${ARGN}) -# when using nmake makefiles, the custom buildtype supresses the default cl.exe flags +# when using nmake makefiles, the custom buildtype suppresses the default cl.exe flags # and the rules for creating objects are adjusted for gcc set(CMAKE_BUILD_TYPE CUSTOM_ECOS_BUILD) set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -c <SOURCE>") diff --git a/Modules/UseJava.cmake b/Modules/UseJava.cmake index 5e06adc..b5fc236 100644 --- a/Modules/UseJava.cmake +++ b/Modules/UseJava.cmake @@ -286,7 +286,7 @@ # # Example: # create_javadoc(my_example_doc -# PACKAGES com.exmaple.foo com.example.bar +# PACKAGES com.example.foo com.example.bar # SOURCEPATH "${CMAKE_CURRENT_SOURCE_DIR}" # CLASSPATH ${CMAKE_JAVA_INCLUDE_PATH} # WINDOWTITLE "My example" diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index f15dff8..a8d77b2 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -593,6 +593,7 @@ set(SRCS cm_utf8.c cm_codecvt.hxx cm_codecvt.cxx + cm_thread.hxx ) SET_PROPERTY(SOURCE cmProcessOutput.cxx APPEND PROPERTY COMPILE_DEFINITIONS diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index e730358..1ecf55d 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 10) -set(CMake_VERSION_PATCH 20171102) +set(CMake_VERSION_PATCH 20171108) #set(CMake_VERSION_RC 1) diff --git a/Source/CPack/WiX/cmWIXPatchParser.cxx b/Source/CPack/WiX/cmWIXPatchParser.cxx index e6aeed3..c6ca944 100644 --- a/Source/CPack/WiX/cmWIXPatchParser.cxx +++ b/Source/CPack/WiX/cmWIXPatchParser.cxx @@ -90,7 +90,7 @@ void cmWIXPatchParser::StartFragment(const char** attributes) } } - /* add any additional attributes for the fragement */ + /* add any additional attributes for the fragment */ if (!new_element) { ReportValidationError("No 'Id' specified for 'CPackWixFragment' element"); } else { diff --git a/Source/CPack/bills-comments.txt b/Source/CPack/bills-comments.txt index c3b4ee8..1aaf9af 100644 --- a/Source/CPack/bills-comments.txt +++ b/Source/CPack/bills-comments.txt @@ -31,7 +31,7 @@ cmCPackGenericGenerator::ProcessGenerator // DoPackage cmCPackGenericGenerator::InstallProject is used for both source and binary -packages. It is controled based on values set in CPACK_ variables. +packages. It is controlled based on values set in CPACK_ variables. InstallProject diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index fdd9622..198f6e5 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -81,7 +81,7 @@ cmCTestScriptHandler::cmCTestScriptHandler() this->ScriptStartTime = 0; - // the *60 is becuase the settings are in minutes but GetTime is seconds + // the *60 is because the settings are in minutes but GetTime is seconds this->MinimumInterval = 30 * 60; this->ContinuousDuration = -1; } @@ -830,7 +830,7 @@ int cmCTestScriptHandler::RunConfigurationDashboard() } } - // if all was succesful, delete the backup dirs to free up disk space + // if all was successful, delete the backup dirs to free up disk space if (this->Backup) { cmSystemTools::RemoveADirectory(this->BackupSourceDir); cmSystemTools::RemoveADirectory(this->BackupBinaryDir); diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index e51e168..719688c 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -1521,7 +1521,7 @@ int cmCTestSubmitHandler::ProcessHandler() this->CTest->GetCTestConfiguration("DropLocation"); // change to the build directory so that we can uses a relative path - // on windows since scp dosn't support "c:" a drive in the path + // on windows since scp doesn't support "c:" a drive in the path cmWorkingDirectory workdir(buildDirectory); if (!this->SubmitUsingSCP(this->CTest->GetCTestConfiguration("ScpCommand"), @@ -1540,7 +1540,7 @@ int cmCTestSubmitHandler::ProcessHandler() std::string location = this->CTest->GetCTestConfiguration("DropLocation"); // change to the build directory so that we can uses a relative path - // on windows since scp dosn't support "c:" a drive in the path + // on windows since scp doesn't support "c:" a drive in the path cmWorkingDirectory workdir(buildDirectory); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " Change directory: " << buildDirectory << std::endl, diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h index 394d20e..620e906 100644 --- a/Source/CTest/cmCTestTestHandler.h +++ b/Source/CTest/cmCTestTestHandler.h @@ -39,7 +39,7 @@ public: int ProcessHandler() override; /** - * When both -R and -I are used should te resulting test list be the + * When both -R and -I are used should the resulting test list be the * intersection or the union of the lists. By default it is the * intersection. */ diff --git a/Source/CTest/cmParseGTMCoverage.cxx b/Source/CTest/cmParseGTMCoverage.cxx index 9948ede..f965048 100644 --- a/Source/CTest/cmParseGTMCoverage.cxx +++ b/Source/CTest/cmParseGTMCoverage.cxx @@ -93,7 +93,7 @@ bool cmParseGTMCoverage::ReadMCovFile(const char* file) // This section accounts for lines that were previously marked // as non-executable code (-1), if the parser comes back with // a non-zero count, increase the count by 1 to push the line - // into the executable code set in addtion to the count found. + // into the executable code set in addition to the count found. if (coverageVector[lineoffset + linenumber] == -1 && count > 0) { coverageVector[lineoffset + linenumber] += count + 1; } else { diff --git a/Source/cmCMakeHostSystemInformationCommand.h b/Source/cmCMakeHostSystemInformationCommand.h index bfff8f1..b871641 100644 --- a/Source/cmCMakeHostSystemInformationCommand.h +++ b/Source/cmCMakeHostSystemInformationCommand.h @@ -20,7 +20,7 @@ class SystemInformation; * \brief Query host system specific information * * cmCMakeHostSystemInformationCommand queries system information of - * the sytem on which CMake runs. + * the system on which CMake runs. */ class cmCMakeHostSystemInformationCommand : public cmCommand { diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h index e9e6570..28cba85 100644 --- a/Source/cmCacheManager.h +++ b/Source/cmCacheManager.h @@ -107,7 +107,7 @@ public: std::set<std::string>& excludes, std::set<std::string>& includes); - ///! Save cache for given makefile. Saves to ouput path/CMakeCache.txt + ///! Save cache for given makefile. Saves to output path/CMakeCache.txt bool SaveCache(const std::string& path); ///! Delete the cache given diff --git a/Source/cmConvertMSBuildXMLToJSON.py b/Source/cmConvertMSBuildXMLToJSON.py index 93ab8a8..92569e7 100644 --- a/Source/cmConvertMSBuildXMLToJSON.py +++ b/Source/cmConvertMSBuildXMLToJSON.py @@ -343,7 +343,7 @@ def __with_argument(node, value): def __preprocess_arguments(root): - """Preprocesses occurrances of Argument within the root. + """Preprocesses occurrences of Argument within the root. Argument XML values reference other values within the document by name. The referenced value does not contain a switch. This function will add the diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 7f0cb97..7985d0f 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -591,7 +591,7 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpression( std::string::size_type commaPos = input.find(',', nameStartPos); std::string::size_type nextOpenPos = input.find("$<", nameStartPos); if (commaPos == std::string::npos // Implied 'this' target - || closePos == std::string::npos // Imcomplete expression. + || closePos == std::string::npos // Incomplete expression. || closePos < commaPos // Implied 'this' target || nextOpenPos < commaPos) // Non-literal { diff --git a/Source/cmFindCommon.cxx b/Source/cmFindCommon.cxx index 8142962..f771150 100644 --- a/Source/cmFindCommon.cxx +++ b/Source/cmFindCommon.cxx @@ -329,7 +329,7 @@ void cmFindCommon::ComputeFinalPaths() std::set<std::string> ignored; this->GetIgnoredPaths(ignored); - // Combine the seperate path types, filtering out ignores + // Combine the separate path types, filtering out ignores this->SearchPaths.clear(); std::vector<PathLabel>& allLabels = this->PathGroupLabelMap[PathGroup::All]; for (PathLabel const& l : allLabels) { diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 5a72655..103dc5f 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -590,7 +590,7 @@ void cmFindPackageCommand::SetModuleVariables(const std::string& components) this->AddFindDefinition(exact, this->VersionExact ? "1" : "0"); } - // Push on to the pacakge stack + // Push on to the package stack this->Makefile->FindPackageModuleStack.push_back(this->Name); } diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 11ea46f..eba95f5 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -962,7 +962,7 @@ std::string cmGlobalGenerator::GetLanguageOutputExtension( } } else { // if no language is found then check to see if it is already an - // ouput extension for some language. In that case it should be ignored + // output extension for some language. In that case it should be ignored // and in this map, so it will not be compiled but will just be used. std::string const& ext = source.GetExtension(); if (!ext.empty()) { diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index b1e630e..80aadb9 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -110,7 +110,7 @@ bool cmGlobalKdevelopGenerator::CreateFilelistFile( nullptr)) { files.insert(tmp); tmp = cmSystemTools::GetFilenameName(tmp); - // add all files which dont match the default + // add all files which don't match the default // */CMakeLists.txt;*cmake; to the file pattern if ((tmp != "CMakeLists.txt") && (strstr(tmp.c_str(), ".cmake") == nullptr)) { diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 3b45c90..8a9a3fb 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -222,7 +222,7 @@ void cmGlobalVisualStudio71Generator::WriteProjectConfigurations( } } -// ouput standard header for dsw file +// 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/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index cc1d1a2..dee874f 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -146,7 +146,7 @@ bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p, } } -// ouput standard header for dsw file +// output standard header for dsw file void cmGlobalVisualStudio8Generator::WriteSLNHeader(std::ostream& fout) { fout << "Microsoft Visual Studio Solution File, Format Version 9.00\n"; diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx index 4c30607..7bd6cb9 100644 --- a/Source/cmIncludeDirectoryCommand.cxx +++ b/Source/cmIncludeDirectoryCommand.cxx @@ -77,7 +77,7 @@ static bool StartsWithGeneratorExpression(const std::string& input) // do a lot of cleanup on the arguments because this is one place where folks // sometimes take the output of a program and pass it directly into this // command not thinking that a single argument could be filled with spaces -// and newlines etc liek below: +// and newlines etc like below: // // " /foo/bar // /boo/hoo /dingle/berry " diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index 8e8a54d..cbcf200 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -438,6 +438,19 @@ void cmListFileBacktrace::PrintCallStack(std::ostream& out) const } } +size_t cmListFileBacktrace::Depth() const +{ + size_t depth = 0; + if (this->Cur == nullptr) { + return 0; + } + + for (Entry* i = this->Cur->Up; i; i = i->Up) { + depth++; + } + return depth; +} + std::ostream& operator<<(std::ostream& os, cmListFileContext const& lfc) { os << lfc.FilePath; diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 349ddef..1f9e374 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -6,6 +6,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include <iosfwd> +#include <stddef.h> #include <string> #include <vector> @@ -138,6 +139,9 @@ public: // Print the call stack below the top of the backtrace. void PrintCallStack(std::ostream& out) const; + // Get the number of 'frames' in this backtrace + size_t Depth() const; + private: struct Entry; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 12c0cfd..55952ef 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -222,7 +222,14 @@ void cmLocalGenerator::TraceDependencies() void cmLocalGenerator::GenerateTestFiles() { + std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary(); + file += "/"; + file += "CTestTestfile.cmake"; + if (!this->Makefile->IsOn("CMAKE_TESTING_ENABLED")) { + if (cmSystemTools::FileExists(file)) { + cmSystemTools::RemoveFile(file); + } return; } @@ -231,10 +238,6 @@ void cmLocalGenerator::GenerateTestFiles() const std::string& config = this->Makefile->GetConfigurations(configurationTypes, false); - std::string file = this->StateSnapshot.GetDirectory().GetCurrentBinary(); - file += "/"; - file += "CTestTestfile.cmake"; - cmGeneratedFileStream fout(file.c_str()); fout.SetCopyIfDifferent(true); diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 43c529c..4109b90 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -599,7 +599,7 @@ void cmMakefile::EnforceDirectoryLevelRules() const << "\"cmake --help-policy CMP0000\"."; switch (this->GetPolicyStatus(cmPolicies::CMP0000)) { case cmPolicies::WARN: - // Warn because the user did not provide a mimimum required + // Warn because the user did not provide a minimum required // version. this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING, msg.str(), this->Backtrace); @@ -3319,6 +3319,13 @@ cmGlobalGenerator* cmMakefile::GetGlobalGenerator() const return this->GlobalGenerator; } +void cmMakefile::GetTestNames(std::vector<std::string>& testNames) +{ + for (const auto& iter : Tests) { + testNames.push_back(iter.first); + } +} + #ifdef CMAKE_BUILD_WITH_CMAKE cmVariableWatch* cmMakefile::GetVariableWatch() const { @@ -4018,7 +4025,7 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id, // Deprecate old policies, especially those that require a lot // of code to maintain the old behavior. - if (status == cmPolicies::OLD && id <= cmPolicies::CMP0036) { + if (status == cmPolicies::OLD && id <= cmPolicies::CMP0054) { this->IssueMessage(cmake::DEPRECATION_WARNING, cmPolicies::GetPolicyDeprecatedWarning(id)); } diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 5e7a361..6867c02 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -561,7 +561,7 @@ public: bool atOnly, bool escapeQuotes) const; /** - * Copy file but change lines acording to ConfigureString + * Copy file but change lines according to ConfigureString */ int ConfigureFile(const char* infile, const char* outfile, bool copyonly, bool atOnly, bool escapeQuotes, @@ -617,6 +617,11 @@ public: cmGlobalGenerator* GetGlobalGenerator() const; /** + * Get all the test names this makefile knows about + */ + void GetTestNames(std::vector<std::string>& testNames); + + /** * Get all the source files this makefile knows about */ const std::vector<cmSourceFile*>& GetSourceFiles() const @@ -800,7 +805,7 @@ public: void RemoveExportBuildFileGeneratorCMP0024(cmExportBuildFileGenerator* gen); void AddExportBuildFileGenerator(cmExportBuildFileGenerator* gen); - // Maintain a stack of pacakge names to determine the depth of find modules + // Maintain a stack of package names to determine the depth of find modules // we are currently being called with std::deque<std::string> FindPackageModuleStack; diff --git a/Source/cmMessageCommand.cxx b/Source/cmMessageCommand.cxx index 43fb5f5..5a341bd 100644 --- a/Source/cmMessageCommand.cxx +++ b/Source/cmMessageCommand.cxx @@ -63,7 +63,7 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args, std::string message = cmJoin(cmMakeRange(i, args.end()), std::string()); if (type != cmake::MESSAGE) { - // we've overriden the message type, above, so display it directly + // we've overridden the message type, above, so display it directly cmMessenger* m = this->Makefile->GetMessenger(); m->DisplayMessage(type, message, this->Makefile->GetBacktrace()); } else { diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index b329d38..28a8df1 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -827,7 +827,7 @@ bool cmQtAutoGenerators::ParseHeaderFile(std::string const& absFilename, bool cmQtAutoGenerators::ParsePostprocess() { bool success = true; - // Read missin dependecies + // Read missing dependencies for (auto& item : this->MocJobsIncluded) { if (!item->DependsValid) { std::string content; @@ -1427,7 +1427,7 @@ bool cmQtAutoGenerators::MocGenerateAll() } } - // Add moc_predefs.h to moc file dependecies + // Add moc_predefs.h to moc file dependencies for (auto const& item : this->MocJobsIncluded) { item->Depends.insert(this->MocPredefsFileAbs); } diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx index e923c22..9af4c0a 100644 --- a/Source/cmServer.cxx +++ b/Source/cmServer.cxx @@ -245,11 +245,10 @@ cmFileMonitor* cmServer::FileMonitor() const void cmServer::WriteJsonObject(const Json::Value& jsonValue, const DebugInfo* debug) const { - uv_rwlock_rdlock(&ConnectionsMutex); + cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex); for (auto& connection : this->Connections) { WriteJsonObject(connection.get(), jsonValue, debug); } - uv_rwlock_rdunlock(&ConnectionsMutex); } void cmServer::WriteJsonObject(cmConnection* connection, @@ -456,14 +455,12 @@ bool cmServerBase::Serve(std::string* errorMessage) OnServeStart(); { - uv_rwlock_rdlock(&ConnectionsMutex); + cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex); for (auto& connection : Connections) { if (!connection->OnServeStart(errorMessage)) { - uv_rwlock_rdunlock(&ConnectionsMutex); return false; } } - uv_rwlock_rdunlock(&ConnectionsMutex); } if (uv_run(&Loop, UV_RUN_DEFAULT) != 0) { @@ -501,12 +498,11 @@ void cmServerBase::StartShutDown() } { - uv_rwlock_wrlock(&ConnectionsMutex); + cm::unique_lock<cm::shared_mutex> lock(ConnectionsMutex); for (auto& connection : Connections) { connection->OnConnectionShuttingDown(); } Connections.clear(); - uv_rwlock_wrunlock(&ConnectionsMutex); } uv_walk(&Loop, on_walk_to_shutdown, nullptr); @@ -525,9 +521,6 @@ cmServerBase::cmServerBase(cmConnection* connection) (void)err; assert(err == 0); - err = uv_rwlock_init(&ConnectionsMutex); - assert(err == 0); - AddNewConnection(connection); } @@ -540,14 +533,14 @@ cmServerBase::~cmServerBase() } uv_loop_close(&Loop); - uv_rwlock_destroy(&ConnectionsMutex); } void cmServerBase::AddNewConnection(cmConnection* ownedConnection) { - uv_rwlock_wrlock(&ConnectionsMutex); - Connections.emplace_back(ownedConnection); - uv_rwlock_wrunlock(&ConnectionsMutex); + { + cm::unique_lock<cm::shared_mutex> lock(ConnectionsMutex); + Connections.emplace_back(ownedConnection); + } ownedConnection->SetServer(this); } @@ -561,11 +554,13 @@ void cmServerBase::OnDisconnect(cmConnection* pConnection) auto pred = [pConnection](const std::unique_ptr<cmConnection>& m) { return m.get() == pConnection; }; - uv_rwlock_wrlock(&ConnectionsMutex); - Connections.erase( - std::remove_if(Connections.begin(), Connections.end(), pred), - Connections.end()); - uv_rwlock_wrunlock(&ConnectionsMutex); + { + cm::unique_lock<cm::shared_mutex> lock(ConnectionsMutex); + Connections.erase( + std::remove_if(Connections.begin(), Connections.end(), pred), + Connections.end()); + } + if (Connections.empty()) { StartShutDown(); } diff --git a/Source/cmServer.h b/Source/cmServer.h index 15fd2ba..6e46f8c 100644 --- a/Source/cmServer.h +++ b/Source/cmServer.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep #include "cm_jsoncpp_value.h" +#include "cm_thread.hxx" #include "cm_uv.h" #include <memory> // IWYU pragma: keep @@ -61,7 +62,7 @@ public: void OnDisconnect(cmConnection* pConnection); protected: - mutable uv_rwlock_t ConnectionsMutex; + mutable cm::shared_mutex ConnectionsMutex; std::vector<std::unique_ptr<cmConnection>> Connections; bool ServeThreadRunning = false; diff --git a/Source/cmServerDictionary.h b/Source/cmServerDictionary.h index 03f1cc1..040c1fd 100644 --- a/Source/cmServerDictionary.h +++ b/Source/cmServerDictionary.h @@ -23,6 +23,7 @@ static const std::string kPROGRESS_TYPE = "progress"; static const std::string kREPLY_TYPE = "reply"; static const std::string kSET_GLOBAL_SETTINGS_TYPE = "setGlobalSettings"; static const std::string kSIGNAL_TYPE = "signal"; +static const std::string kCTEST_INFO_TYPE = "ctestInfo"; static const std::string kARTIFACTS_KEY = "artifacts"; static const std::string kBUILD_DIRECTORY_KEY = "buildDirectory"; @@ -90,6 +91,10 @@ static const std::string kWATCHED_DIRECTORIES_KEY = "watchedDirectories"; static const std::string kWATCHED_FILES_KEY = "watchedFiles"; static const std::string kHAS_INSTALL_RULE = "hasInstallRule"; static const std::string kINSTALL_PATHS = "installPaths"; +static const std::string kHAS_ENABLED_TESTS = "hasEnabledTests"; +static const std::string kCTEST_NAME = "ctestName"; +static const std::string kCTEST_COMMAND = "ctestCommand"; +static const std::string kCTEST_INFO = "ctestInfo"; static const std::string kTARGET_CROSS_REFERENCES_KEY = "crossReferences"; static const std::string kLINE_NUMBER_KEY = "line"; diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index fc06fed..0cb906b 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -14,6 +14,7 @@ #include "cmListFileCache.h" #include "cmLocalGenerator.h" #include "cmMakefile.h" +#include "cmProperty.h" #include "cmServer.h" #include "cmServerDictionary.h" #include "cmSourceFile.h" @@ -23,6 +24,7 @@ #include "cmStateTypes.h" #include "cmSystemTools.h" #include "cmTarget.h" +#include "cmTest.h" #include "cm_uv.h" #include "cmake.h" @@ -479,6 +481,9 @@ const cmServerResponse cmServerProtocol1::Process( if (request.Type == kSET_GLOBAL_SETTINGS_TYPE) { return this->ProcessSetGlobalSettings(request); } + if (request.Type == kCTEST_INFO_TYPE) { + return this->ProcessCTests(request); + } return request.ReportError("Unknown command!"); } @@ -766,6 +771,153 @@ static void DumpBacktraceRange(Json::Value& result, const std::string& type, } } +static Json::Value DumpCTestInfo(const std::string& name, cmTest* testInfo) +{ + Json::Value result = Json::objectValue; + result[kCTEST_NAME] = name; + + // Concat command entries together. After the first should be the arguments + // for the command + std::string command; + for (auto const& cmd : testInfo->GetCommand()) { + command.append(cmd); + command.append(" "); + } + result[kCTEST_COMMAND] = command; + + // Build up the list of properties that may have been specified + Json::Value properties = Json::arrayValue; + for (auto& prop : testInfo->GetProperties()) { + Json::Value entry = Json::objectValue; + entry[kKEY_KEY] = prop.first; + entry[kVALUE_KEY] = prop.second.GetValue(); + properties.append(entry); + } + result[kPROPERTIES_KEY] = properties; + + // Need backtrace to figure out where this test was originally added + result[kBACKTRACE_KEY] = DumpBacktrace(testInfo->GetBacktrace()); + + return result; +} + +static Json::Value DumpCTestTarget(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); + + Json::Value ttl = Json::arrayValue; + ttl.append("EXECUTABLE"); + ttl.append("STATIC_LIBRARY"); + ttl.append("SHARED_LIBRARY"); + ttl.append("MODULE_LIBRARY"); + ttl.append("OBJECT_LIBRARY"); + ttl.append("UTILITY"); + ttl.append("INTERFACE_LIBRARY"); + + if (!hasString(ttl, typeName) || target->IsImported()) { + return Json::Value(); + } + + Json::Value result = Json::objectValue; + result[kNAME_KEY] = target->GetName(); + result[kTYPE_KEY] = typeName; + + if (type == cmStateEnums::INTERFACE_LIBRARY) { + return result; + } + result[kFULL_NAME_KEY] = target->GetFullName(config); + + if (target->Makefile->IsOn("CMAKE_TESTING_ENABLED")) { + result[kHAS_ENABLED_TESTS] = true; + std::vector<std::string> CTestNames; + + Json::Value testInfo = Json::arrayValue; + std::vector<std::string> testNames; + target->Makefile->GetTestNames(testNames); + for (auto& name : testNames) { + auto test = target->Makefile->GetTest(name); + if (test != nullptr) { + testInfo.append(DumpCTestInfo(name, test)); + } + } + result[kCTEST_INFO] = testInfo; + } + + return result; +} + +static Json::Value DumpCTestTargetsList( + const std::vector<cmLocalGenerator*>& generators, const std::string& config) +{ + Json::Value result = Json::arrayValue; + + std::vector<cmGeneratorTarget*> targetList; + for (const auto& lgIt : generators) { + auto list = lgIt->GetGeneratorTargets(); + targetList.insert(targetList.end(), list.begin(), list.end()); + } + std::sort(targetList.begin(), targetList.end()); + + for (cmGeneratorTarget* target : targetList) { + Json::Value tmp = DumpCTestTarget(target, config); + if (!tmp.isNull()) { + result.append(tmp); + } + } + + return result; +} + +static Json::Value DumpCTestProjectList(const cmake* cm, + std::string const& config) +{ + Json::Value result = Json::arrayValue; + + auto globalGen = cm->GetGlobalGenerator(); + + for (const auto& projectIt : globalGen->GetProjectMap()) { + Json::Value pObj = Json::objectValue; + pObj[kNAME_KEY] = projectIt.first; + + // All Projects must have at least one local generator + assert(!projectIt.second.empty()); + + // Project structure information: + pObj[kTARGETS_KEY] = DumpCTestTargetsList(projectIt.second, config); + + result.append(pObj); + } + + return result; +} + +static Json::Value DumpCTestConfiguration(const cmake* cm, + const std::string& config) +{ + Json::Value result = Json::objectValue; + result[kNAME_KEY] = config; + + result[kPROJECTS_KEY] = DumpCTestProjectList(cm, config); + + return result; +} + +static Json::Value DumpCTestConfigurationsList(const cmake* cm) +{ + Json::Value result = Json::arrayValue; + + for (const std::string& c : getConfigurations(cm)) { + result.append(DumpCTestConfiguration(cm, c)); + } + + return result; +} + static Json::Value DumpTarget(cmGeneratorTarget* target, const std::string& config) { @@ -1222,6 +1374,19 @@ cmServerResponse cmServerProtocol1::ProcessFileSystemWatchers( return request.Reply(result); } +cmServerResponse cmServerProtocol1::ProcessCTests( + const cmServerRequest& request) +{ + if (this->m_State < STATE_COMPUTED) { + return request.ReportError("This instance was not yet computed."); + } + + Json::Value result = Json::objectValue; + result[kCONFIGURATIONS_KEY] = + DumpCTestConfigurationsList(this->CMakeInstance()); + return request.Reply(result); +} + cmServerProtocol1::GeneratorInformation::GeneratorInformation( const std::string& generatorName, const std::string& extraGeneratorName, const std::string& toolset, const std::string& platform, diff --git a/Source/cmServerProtocol.h b/Source/cmServerProtocol.h index 124ac7f..df71cff 100644 --- a/Source/cmServerProtocol.h +++ b/Source/cmServerProtocol.h @@ -123,6 +123,7 @@ private: cmServerResponse ProcessGlobalSettings(const cmServerRequest& request); cmServerResponse ProcessSetGlobalSettings(const cmServerRequest& request); cmServerResponse ProcessFileSystemWatchers(const cmServerRequest& request); + cmServerResponse ProcessCTests(const cmServerRequest& request); enum State { diff --git a/Source/cmTargetDepend.h b/Source/cmTargetDepend.h index daa902e..b698db6 100644 --- a/Source/cmTargetDepend.h +++ b/Source/cmTargetDepend.h @@ -16,7 +16,7 @@ class cmTargetDepend cmGeneratorTarget const* Target; // The set order depends only on the Target, so we use - // mutable members to acheive a map with set syntax. + // mutable members to achieve a map with set syntax. mutable bool Link; mutable bool Util; diff --git a/Source/cmTimestamp.cxx b/Source/cmTimestamp.cxx index e747adb..f1e9283 100644 --- a/Source/cmTimestamp.cxx +++ b/Source/cmTimestamp.cxx @@ -153,7 +153,7 @@ std::string cmTimestamp::AddTimestampComponent(char flag, if (unixEpoch == -1) { cmSystemTools::Error( "Error generating UNIX epoch in " - "STRING(TIMESTAMP ...). Please, file a bug report aginst CMake"); + "STRING(TIMESTAMP ...). Please, file a bug report against CMake"); return std::string(); } diff --git a/Source/cmUseMangledMesaCommand.cxx b/Source/cmUseMangledMesaCommand.cxx index c04a683..8d4b018 100644 --- a/Source/cmUseMangledMesaCommand.cxx +++ b/Source/cmUseMangledMesaCommand.cxx @@ -13,8 +13,8 @@ bool cmUseMangledMesaCommand::InitialPass(std::vector<std::string> const& args, cmExecutionStatus&) { // expected two arguments: - // arguement one: the full path to gl_mangle.h - // arguement two : directory for output of edited headers + // argument one: the full path to gl_mangle.h + // argument two : directory for output of edited headers if (args.size() != 2) { this->SetError("called with incorrect number of arguments"); return false; diff --git a/Source/cm_thread.hxx b/Source/cm_thread.hxx new file mode 100644 index 0000000..b8c25c7 --- /dev/null +++ b/Source/cm_thread.hxx @@ -0,0 +1,78 @@ +/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying + file Copyright.txt or https://cmake.org/licensing for details. */ +#ifndef CM_THREAD_HXX +#define CM_THREAD_HXX + +#include "cmConfigure.h" // IWYU pragma: keep +#include "cm_uv.h" + +namespace cm { +class mutex +{ + uv_mutex_t _M_; + +public: + mutex() { uv_mutex_init(&_M_); } + ~mutex() { uv_mutex_destroy(&_M_); } + + void lock() { uv_mutex_lock(&_M_); } + + void unlock() { uv_mutex_unlock(&_M_); } +}; + +template <typename T> +class lock_guard +{ + T& _mutex; + +public: + lock_guard(T& m) + : _mutex(m) + { + _mutex.lock(); + } + ~lock_guard() { _mutex.unlock(); } +}; + +class shared_mutex +{ + uv_rwlock_t _M_; + +public: + shared_mutex() { uv_rwlock_init(&_M_); } + ~shared_mutex() { uv_rwlock_destroy(&_M_); } + + 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_); } +}; + +template <typename T> +class shared_lock +{ + T& _mutex; + +public: + shared_lock(T& m) + : _mutex(m) + { + _mutex.lock_shared(); + } + ~shared_lock() { _mutex.unlock_shared(); } +}; + +template <typename T> +class unique_lock : public lock_guard<T> +{ +public: + unique_lock(T& m) + : lock_guard<T>(m) + { + } +}; +} +#endif diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt index f36f9b6..51f4088 100644 --- a/Source/kwsys/CMakeLists.txt +++ b/Source/kwsys/CMakeLists.txt @@ -1147,17 +1147,22 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET_TESTS_PROPERTIES(kwsys.testProcess-${n} PROPERTIES TIMEOUT 120) ENDFOREACH() + SET(testProcess_COMPILE_FLAGS "") # Some Apple compilers produce bad optimizations in this source. IF(APPLE AND CMAKE_C_COMPILER_ID MATCHES "^(GNU|LLVM)$") - SET_SOURCE_FILES_PROPERTIES(testProcess.c PROPERTIES COMPILE_FLAGS -O0) + SET(testProcess_COMPILE_FLAGS "${testProcess_COMPILE_FLAGS} -O0") ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "XL" AND NOT (CMAKE_SYSTEM MATCHES "Linux.*ppc64le" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "13.1.1")) # Tell IBM XL not to warn about our test infinite loop # v13.1.1 and newer on Linux ppc64le is clang based and does not accept # the -qsuppress option - SET_PROPERTY(SOURCE testProcess.c PROPERTY COMPILE_FLAGS -qsuppress=1500-010) + SET(testProcess_COMPILE_FLAGS "${testProcess_COMPILE_FLAGS} -qsuppress=1500-010") ENDIF() + IF(CMAKE_C_FLAGS MATCHES "-fsanitize=") + SET(testProcess_COMPILE_FLAGS "${testProcess_COMPILE_FLAGS} -DCRASH_USING_ABORT") + ENDIF() + SET_PROPERTY(SOURCE testProcess.c PROPERTY COMPILE_FLAGS "${testProcess_COMPILE_FLAGS}") # Test SharedForward CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/testSharedForward.c.in diff --git a/Source/kwsys/Configure.h.in b/Source/kwsys/Configure.h.in index 0afcae7..224047a 100644 --- a/Source/kwsys/Configure.h.in +++ b/Source/kwsys/Configure.h.in @@ -62,9 +62,6 @@ !defined(@KWSYS_NAMESPACE@_LFS_NO_DEFINE_FILE_OFFSET_BITS) #define _FILE_OFFSET_BITS 64 #endif -#if 0 && (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64) -#error "_FILE_OFFSET_BITS must be defined to at least 64" -#endif #endif #endif diff --git a/Source/kwsys/DynamicLoader.hxx.in b/Source/kwsys/DynamicLoader.hxx.in index 7e71a45..dc34692 100644 --- a/Source/kwsys/DynamicLoader.hxx.in +++ b/Source/kwsys/DynamicLoader.hxx.in @@ -35,7 +35,7 @@ namespace @KWSYS_NAMESPACE@ { * or absolute) pathname. Otherwise, the dynamic linker searches for the * library as follows : see ld.so(8) for further details): * Whereas this distinction does not exist on Win32. Therefore ideally you - * should be doing full path to garantee to have a consistent way of dealing + * should be doing full path to guarantee to have a consistent way of dealing * with dynamic loading of shared library. * * \warning the Cygwin implementation do not use the Win32 HMODULE. Put extra @@ -72,7 +72,7 @@ public: static LibraryHandle OpenLibrary(const std::string&); /** Attempt to detach a dynamic library from the - * process. A value of true is returned if it is sucessful. */ + * process. A value of true is returned if it is successful. */ static int CloseLibrary(LibraryHandle); /** Find the address of the symbol in the given library. */ diff --git a/Source/kwsys/Process.h.in b/Source/kwsys/Process.h.in index 237001c..daf334a 100644 --- a/Source/kwsys/Process.h.in +++ b/Source/kwsys/Process.h.in @@ -77,6 +77,7 @@ #define kwsysProcess_WaitForExit kwsys_ns(Process_WaitForExit) #define kwsysProcess_Interrupt kwsys_ns(Process_Interrupt) #define kwsysProcess_Kill kwsys_ns(Process_Kill) +#define kwsysProcess_KillPID kwsys_ns(Process_KillPID) #define kwsysProcess_ResetStartTime kwsys_ns(Process_ResetStartTime) #endif @@ -420,7 +421,7 @@ enum kwsysProcess_Pipes_e /** * Block until the child process terminates or the given timeout - * expires. If no process is running, returns immediatly. The + * expires. If no process is running, returns immediately. The * argument is: * * timeout = Specifies the maximum time this call may block. Upon @@ -457,6 +458,13 @@ kwsysEXPORT void kwsysProcess_Interrupt(kwsysProcess* cp); kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp); /** + * Same as kwsysProcess_Kill using process ID to locate process to + * terminate. + * @see kwsysProcess_Kill(kwsysProcess* cp) + */ +kwsysEXPORT void kwsysProcess_KillPID(unsigned long); + +/** * Reset the start time of the child process to the current time. */ kwsysEXPORT void kwsysProcess_ResetStartTime(kwsysProcess* cp); diff --git a/Source/kwsys/ProcessUNIX.c b/Source/kwsys/ProcessUNIX.c index e62ef34..718a1aa 100644 --- a/Source/kwsys/ProcessUNIX.c +++ b/Source/kwsys/ProcessUNIX.c @@ -2485,6 +2485,11 @@ static pid_t kwsysProcessFork(kwsysProcess* cp, #define KWSYSPE_PS_FORMAT "%d %d %*[^\n]\n" #endif +void kwsysProcess_KillPID(unsigned long process_id) +{ + kwsysProcessKill((pid_t)process_id); +} + static void kwsysProcessKill(pid_t process_id) { #if defined(__linux__) || defined(__CYGWIN__) diff --git a/Source/kwsys/ProcessWin32.c b/Source/kwsys/ProcessWin32.c index 945fa28..82fdc74 100644 --- a/Source/kwsys/ProcessWin32.c +++ b/Source/kwsys/ProcessWin32.c @@ -1466,6 +1466,11 @@ void kwsysProcess_Kill(kwsysProcess* cp) for them to exit. */ } +void kwsysProcess_KillPID(unsigned long process_id) +{ + kwsysProcessKillTree((DWORD)process_id); +} + /* Function executed for each pipe's thread. Argument is a pointer to the kwsysProcessPipeData instance for this thread. diff --git a/Source/kwsys/RegularExpression.hxx.in b/Source/kwsys/RegularExpression.hxx.in index 606e3da..763fdab 100644 --- a/Source/kwsys/RegularExpression.hxx.in +++ b/Source/kwsys/RegularExpression.hxx.in @@ -109,12 +109,12 @@ namespace @KWSYS_NAMESPACE@ { * object as an argument and creates an object initialized with the * information from the given RegularExpression object. * - * The find member function finds the first occurence of the regualr + * The find member function finds the first occurrence of the regular * expression of that object in the string given to find as an argument. Find * returns a boolean, and if true, mutates the private data appropriately. * Find sets pointers to the beginning and end of the thing last found, they * are pointers into the actual string that was searched. The start and end - * member functions return indicies into the searched string that correspond + * member functions return indices into the searched string that correspond * to the beginning and end pointers respectively. The compile member * function takes a char* and puts the compiled version of the char* argument * into the object's private data fields. The == and != operators only check diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 366fe30..ab1f40a 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -3633,7 +3633,7 @@ SystemInformationImplementation::GetHostMemoryAvailable( // apply resource limits across groups of processes. // this is of use on certain SMP systems (eg. SGI UV) // where the host has a large amount of ram but a given user's - // access to it is severly restricted. The system will + // access to it is severely restricted. The system will // apply a limit across a set of processes. Units are in KiB. if (hostLimitEnvVarName) { const char* hostLimitEnvVarValue = getenv(hostLimitEnvVarName); diff --git a/Source/kwsys/SystemInformation.hxx.in b/Source/kwsys/SystemInformation.hxx.in index 516c505..5678e8a 100644 --- a/Source/kwsys/SystemInformation.hxx.in +++ b/Source/kwsys/SystemInformation.hxx.in @@ -124,7 +124,7 @@ public: // are the processes comprising an mpi program which is running in // parallel. The amount of memory reported may differ from the host // total if a host wide resource limit is applied. Such reource limits - // are reported to us via an applicaiton specified environment variable. + // are reported to us via an application specified environment variable. LongLong GetHostMemoryAvailable(const char* hostLimitEnvVarName = NULL); // Get total system RAM in units of KiB available to this process. diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index a24a326..1f7ee10 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -751,15 +751,15 @@ FILE* SystemTools::Fopen(const std::string& file, const char* mode) #endif } -bool SystemTools::MakeDirectory(const char* path) +bool SystemTools::MakeDirectory(const char* path, const mode_t* mode) { if (!path) { return false; } - return SystemTools::MakeDirectory(std::string(path)); + return SystemTools::MakeDirectory(std::string(path), mode); } -bool SystemTools::MakeDirectory(const std::string& path) +bool SystemTools::MakeDirectory(const std::string& path, const mode_t* mode) { if (SystemTools::PathExists(path)) { return SystemTools::FileIsDirectory(path); @@ -774,8 +774,12 @@ bool SystemTools::MakeDirectory(const std::string& path) std::string topdir; while ((pos = dir.find('/', pos)) != std::string::npos) { topdir = dir.substr(0, pos); - Mkdir(topdir); - pos++; + + if (Mkdir(topdir) == 0 && mode != 0) { + SystemTools::SetPermissions(topdir, *mode); + } + + ++pos; } topdir = dir; if (Mkdir(topdir) != 0) { @@ -790,7 +794,10 @@ bool SystemTools::MakeDirectory(const std::string& path) ) { return false; } + } else if (mode != 0) { + SystemTools::SetPermissions(topdir, *mode); } + return true; } @@ -1684,7 +1691,7 @@ bool SystemTools::StringEndsWith(const std::string& str1, const char* str2) : false; } -// Returns a pointer to the last occurence of str2 in str1 +// Returns a pointer to the last occurrence of str2 in str1 const char* SystemTools::FindLastString(const char* str1, const char* str2) { if (!str1 || !str2) { diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index 35bc1b1..8a02b75 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -107,7 +107,7 @@ public: } /** - * Replace replace all occurences of the string in the source string. + * Replace replace all occurrences of the string in the source string. */ static void ReplaceString(std::string& source, const char* replace, const char* with); @@ -175,7 +175,7 @@ public: static bool StringEndsWith(const std::string& str1, const char* str2); /** - * Returns a pointer to the last occurence of str2 in str1 + * Returns a pointer to the last occurrence of str2 in str1 */ static const char* FindLastString(const char* str1, const char* str2); @@ -553,13 +553,20 @@ public: */ static FILE* Fopen(const std::string& file, const char* mode); +/** + * Visual C++ does not define mode_t (note that Borland does, however). + */ +#if defined(_MSC_VER) + typedef unsigned short mode_t; +#endif + /** * Make a new directory if it is not there. This function * can make a full path even if none of the directories existed * prior to calling this function. */ - static bool MakeDirectory(const char* path); - static bool MakeDirectory(const std::string& path); + static bool MakeDirectory(const char* path, const mode_t* mode = 0); + static bool MakeDirectory(const std::string& path, const mode_t* mode = 0); /** * Copy the source file to the destination file only @@ -749,13 +756,6 @@ public: */ static long int CreationTime(const std::string& filename); -/** - * Visual C++ does not define mode_t (note that Borland does, however). - */ -#if defined(_MSC_VER) - typedef unsigned short mode_t; -#endif - /** * Get and set permissions of the file. If honor_umask is set, the umask * is queried and applied to the given permissions. Returns false if @@ -905,7 +905,7 @@ public: /** * Delay the execution for a specified amount of time specified - * in miliseconds + * in milliseconds */ static void Delay(unsigned int msec); diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx index e67d436..f1f9ed3 100644 --- a/Source/kwsys/kwsysPlatformTestsCXX.cxx +++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx @@ -281,7 +281,7 @@ int main() #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) || \ (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) -backtrace doesnt work with this compiler or os +backtrace does not work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) #define _GNU_SOURCE diff --git a/Source/kwsys/testProcess.c b/Source/kwsys/testProcess.c index cd817d9..4b4978d 100644 --- a/Source/kwsys/testProcess.c +++ b/Source/kwsys/testProcess.c @@ -107,6 +107,7 @@ static int test3(int argc, const char* argv[]) static int test4(int argc, const char* argv[]) { +#ifndef CRASH_USING_ABORT /* Prepare a pointer to an invalid address. Don't use null, because dereferencing null is undefined behaviour and compilers are free to do whatever they want. ex: Clang will warn at compile time, or even @@ -114,6 +115,7 @@ static int test4(int argc, const char* argv[]) 'volatile' and a slightly larger address, based on a runtime value. */ volatile int* invalidAddress = 0; invalidAddress += argc ? 1 : 2; +#endif #if defined(_WIN32) /* Avoid error diagnostic popups since we are crashing on purpose. */ @@ -128,9 +130,13 @@ static int test4(int argc, const char* argv[]) fprintf(stderr, "Output before crash on stderr from crash test.\n"); fflush(stdout); fflush(stderr); +#ifdef CRASH_USING_ABORT + abort(); +#else assert(invalidAddress); /* Quiet Clang scan-build. */ /* Provoke deliberate crash by writing to the invalid address. */ *invalidAddress = 0; +#endif fprintf(stdout, "Output after crash on stdout from crash test.\n"); fprintf(stderr, "Output after crash on stderr from crash test.\n"); return 0; @@ -149,7 +155,12 @@ static int test5(int argc, const char* argv[]) fprintf(stderr, "Output on stderr before recursive test.\n"); fflush(stdout); fflush(stderr); - r = runChild(cmd, kwsysProcess_State_Exception, kwsysProcess_Exception_Fault, + r = runChild(cmd, kwsysProcess_State_Exception, +#ifdef CRASH_USING_ABORT + kwsysProcess_Exception_Other, +#else + kwsysProcess_Exception_Fault, +#endif 1, 1, 1, 0, 15, 0, 1, 0, 0, 0); fprintf(stdout, "Output on stdout after recursive test.\n"); fprintf(stderr, "Output on stderr after recursive test.\n"); @@ -628,11 +639,16 @@ int main(int argc, const char* argv[]) kwsysProcess_State_Exception /* Process group test */ }; int exceptions[10] = { - kwsysProcess_Exception_None, kwsysProcess_Exception_None, - kwsysProcess_Exception_None, kwsysProcess_Exception_Fault, - kwsysProcess_Exception_None, kwsysProcess_Exception_None, - kwsysProcess_Exception_None, kwsysProcess_Exception_None, - kwsysProcess_Exception_None, kwsysProcess_Exception_Interrupt + kwsysProcess_Exception_None, kwsysProcess_Exception_None, + kwsysProcess_Exception_None, +#ifdef CRASH_USING_ABORT + kwsysProcess_Exception_Other, +#else + kwsysProcess_Exception_Fault, +#endif + kwsysProcess_Exception_None, kwsysProcess_Exception_None, + kwsysProcess_Exception_None, kwsysProcess_Exception_None, + kwsysProcess_Exception_None, kwsysProcess_Exception_Interrupt }; int values[10] = { 0, 123, 1, 1, 0, 0, 0, 0, 1, 1 }; int shares[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1 }; diff --git a/Tests/CFBundleTest/np_macmain.cpp b/Tests/CFBundleTest/np_macmain.cpp index b5a4226..e5fd0d7 100644 --- a/Tests/CFBundleTest/np_macmain.cpp +++ b/Tests/CFBundleTest/np_macmain.cpp @@ -4,7 +4,7 @@ Based on the default np_macmain.cpp from FireBreath http://firebreath.googlecode.com - This file has been stripped to prevent it from accidently + This file has been stripped to prevent it from accidentally doing anything useful. \***********************************************************/ diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index c25fc44..1c69805 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -31,7 +31,9 @@ if(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME) set(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one. # But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that # need access to the real HOME directory. -set(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\") +if(NOT DEFINED ENV{CTEST_REAL_HOME}) + set(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\") +endif() set(ENV{HOME} \"${TEST_HOME}\") ") endif() @@ -2830,7 +2832,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release PASS_REGULAR_EXPRESSION "Failed") else() set_tests_properties(CTestTestCrash PROPERTIES - PASS_REGULAR_EXPRESSION "(Illegal|SegFault)") + PASS_REGULAR_EXPRESSION "(Illegal|SegFault|Child aborted)") endif() configure_file( @@ -3386,31 +3388,30 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release set_property(TEST CMakeWizardTest PROPERTY PASS_REGULAR_EXPRESSION "The \"cmake -i\" wizard mode is no longer supported.") - # If the cache variable CMAKE_CONTRACT_PROJECTS is set - # then the dashboard will run a contract with CMake test of that - # name. For example CMAKE_CONTRACT_PROJECTS = vtk542 would run - # the vtk542 contract test. - # For each Contract test, the project should provide a directory - # with at least one CMakeLists.txt file that uses ExternalProject - # to download and configure the project. The directory should also - # contain a RunTest.cmake file that has a single set of the format: - # set(project_RUN_TEST testToRun) - # The testToRun should be a test executable that can be run to - # smoke test the build. - foreach(project ${CMAKE_CONTRACT_PROJECTS}) - include(Contracts/${project}/RunTest.cmake) - ADD_TEST_MACRO(Contracts.${project} - ${${project}_RUN_TEST}) - # Contract test timeout in seconds. - # Default to 6 hours. - if(DEFINED ${project}_TEST_TIMEOUT) - set(timeout ${${project}_TEST_TIMEOUT}) - elseif(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT) - set(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT}) - else() - set(timeout 21600) + # Define a set of "contract" tests, each activated by a cache entry + # named "CMake_TEST_CONTRACT_<project>". For each Contract test, + # the project should provide a directory with a CMakeLists.txt file + # that uses ExternalProject to download and configure the project. + # The directory should also contain a Configure.cmake file that + # sets "CMake_TEST_CONTRACT_<project>_<var>" variables to configure + # the code below. + foreach(project + Trilinos + VTK + ) + if(CMake_TEST_CONTRACT_${project}) + include(Contracts/${project}/Configure.cmake) + ADD_TEST_MACRO(Contracts.${project} ${CMake_TEST_CONTRACT_${project}_RUN_TEST}) + # The external projects may take a long time to build. + if(DEFINED CMake_TEST_CONTRACT_${project}_TIMEOUT) + set(timeout ${CMake_TEST_CONTRACT_${project}_TIMEOUT}) + elseif(CMake_TEST_CONTRACT_DEFAULT_TIMEOUT) + set(timeout ${CMake_TEST_CONTRACT_DEFAULT_TIMEOUT}) + else() + set(timeout 21600) + endif() + set_property(TEST Contracts.${project} PROPERTY TIMEOUT "${timeout}") endif() - set_tests_properties(Contracts.${project} PROPERTIES TIMEOUT ${timeout}) endforeach() if(TEST_CompileCommandOutput) diff --git a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in index d7d881e..65487bb 100644 --- a/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in +++ b/Tests/CMakeTests/ImplicitLinkInfoTest.cmake.in @@ -525,6 +525,27 @@ set(msys_g77_dirs "C:/some-mingw/lib/gcc/mingw32/3.4.5;C:/some-mingw/lib/gcc;/so list(APPEND platforms msys_g77) #----------------------------------------------------------------------------- +# MSYS2 + +# gcc dummy.c -v +set(msys2_gcc_text " C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/collect2.exe -plugin C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/liblto_plugin-0.dll -plugin-opt=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:/msys64/tmp/ccikz9Wf.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=-lpthread -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 -m i386pep -Bdynamic C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtbegin.o -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0 -LC:/msys64/mingw64/bin/../lib/gcc -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../.. C:/msys64/tmp/ccK0dTUv.o -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtend.o") +set(msys2_gcc_libs "mingw32;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;mingw32;gcc;moldname;mingwex") +set(msys2_gcc_dirs "C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0;C:/msys64/mingw64/lib/gcc;C:/msys64/mingw64/x86_64-w64-mingw32/lib;C:/msys64/mingw64/lib") +list(APPEND platforms msys2_gcc) + +# g++ dummy.cxx -v +set(msys2_g++_text " C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/collect2.exe -plugin C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/liblto_plugin-0.dll -plugin-opt=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:/msys64/tmp/ccJQgvbN.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=-lpthread -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 -m i386pep -Bdynamic C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtbegin.o -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0 -LC:/msys64/mingw64/bin/../lib/gcc -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../.. C:/msys64/tmp/ccqPpuVS.o -lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtend.o") +set(msys2_g++_libs "stdc++;mingw32;gcc_s;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;mingw32;gcc_s;gcc;moldname;mingwex") +set(msys2_g++_dirs "C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0;C:/msys64/mingw64/lib/gcc;C:/msys64/mingw64/x86_64-w64-mingw32/lib;C:/msys64/mingw64/lib") +list(APPEND platforms msys2_g++) + +# gfortran dummy.f90 -v +set(msys2_gfortran_text " C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/collect2.exe -plugin C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/liblto_plugin-0.dll -plugin-opt=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:/msys64/tmp/cczOKIDy.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=-lquadmath -plugin-opt=-pass-through=-lm -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=-lpthread -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 -m i386pep -Bdynamic C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtbegin.o -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0 -LC:/msys64/mingw64/bin/../lib/gcc -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../.. C:/msys64/tmp/ccyXuCgD.o -lgfortran -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lquadmath -lm -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.2.0/crtend.o") +set(msys2_gfortran_libs "gfortran;mingw32;gcc_s;gcc;moldname;mingwex;quadmath;m;mingw32;gcc_s;gcc;moldname;mingwex;pthread;advapi32;shell32;user32;kernel32;mingw32;gcc_s;gcc;moldname;mingwex") +set(msys2_gfortran_dirs "C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/7.2.0;C:/msys64/mingw64/lib/gcc;C:/msys64/mingw64/x86_64-w64-mingw32/lib;C:/msys64/mingw64/lib") +list(APPEND platforms msys2_gfortran) + +#----------------------------------------------------------------------------- # MSVC from NVIDIA CUDA set(nvcc_msvc_text [[cuda-fake-ld cl.exe -nologo "tmp/a_dlink.obj" "tmp/CMakeCUDACompilerId.obj" -link -INCREMENTAL:NO "/LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/bin/../lib/x64" cudadevrt.lib cudart_static.lib -Fe"a.exe"]]) @@ -532,7 +553,6 @@ set(nvcc_msvc_libs "cudadevrt.lib;cudart_static.lib") set(nvcc_msvc_dirs "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/lib/x64") list(APPEND platforms nvcc_msvc) - #----------------------------------------------------------------------------- # PGI on Windows diff --git a/Tests/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake index 46ab2fb..64a4fb9 100644 --- a/Tests/CTestTestStopTime/GetDate.cmake +++ b/Tests/CTestTestStopTime/GetDate.cmake @@ -68,7 +68,7 @@ macro(GET_DATE) # # Extract six individual components by matching a regex with paren groupings. - # Use the replace functionality and \\1 thru \\6 to extract components. + # Use the replace functionality and \\1 through \\6 to extract components. # set(${GD_PREFIX}REGEX "([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)") diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake index b1652ba..16a8ed2 100644 --- a/Tests/CheckFortran.cmake +++ b/Tests/CheckFortran.cmake @@ -15,11 +15,18 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\" \"set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 \\\"\${CMAKE_Fortran_COMPILER_SUPPORTS_F90}\\\")\\n\" ) ") + if(CMAKE_GENERATOR_INSTANCE) + set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE:INTERNAL=${CMAKE_GENERATOR_INSTANCE}") + else() + set(_D_CMAKE_GENERATOR_INSTANCE "") + endif() execute_process( WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CheckFortran COMMAND ${CMAKE_COMMAND} . -G ${CMAKE_GENERATOR} -A "${CMAKE_GENERATOR_PLATFORM}" -T "${CMAKE_GENERATOR_TOOLSET}" + ${_D_CMAKE_GENERATOR_INSTANCE} + TIMEOUT 60 OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE result diff --git a/Tests/Contracts/Home.cmake b/Tests/Contracts/Home.cmake new file mode 100644 index 0000000..8b05e81 --- /dev/null +++ b/Tests/Contracts/Home.cmake @@ -0,0 +1,19 @@ +# Find a home in which to build. +if(NOT DEFINED HOME) + if(DEFINED ENV{CTEST_REAL_HOME}) + set(HOME "$ENV{CTEST_REAL_HOME}") + else() + set(HOME "$ENV{HOME}") + endif() + + if(NOT HOME AND WIN32) + # Try for USERPROFILE as HOME equivalent: + string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}") + + # But just use root of SystemDrive if USERPROFILE contains any spaces: + # (Default on XP and earlier...) + if(HOME MATCHES " ") + string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}") + endif() + endif() +endif() diff --git a/Tests/Contracts/Trilinos/CMakeLists.txt b/Tests/Contracts/Trilinos/CMakeLists.txt index 8d74ca5..4d7062b 100644 --- a/Tests/Contracts/Trilinos/CMakeLists.txt +++ b/Tests/Contracts/Trilinos/CMakeLists.txt @@ -6,24 +6,7 @@ include(ExternalProject) include("${CMAKE_CURRENT_SOURCE_DIR}/LocalOverrides.cmake" OPTIONAL) include("${CMAKE_CURRENT_BINARY_DIR}/LocalOverrides.cmake" OPTIONAL) -if(NOT DEFINED HOME) - if(DEFINED ENV{CTEST_REAL_HOME}) - set(HOME "$ENV{CTEST_REAL_HOME}") - else() - set(HOME "$ENV{HOME}") - endif() - - if(NOT HOME AND WIN32) - # Try for USERPROFILE as HOME equivalent: - string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}") - - # But just use root of SystemDrive if USERPROFILE contains any spaces: - # (Default on XP and earlier...) - if(HOME MATCHES " ") - string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}") - endif() - endif() -endif() +include(${CMAKE_CURRENT_SOURCE_DIR}/../Home.cmake) message(STATUS "HOME='${HOME}'") if(NOT DEFINED url) diff --git a/Tests/Contracts/Trilinos/RunTest.cmake b/Tests/Contracts/Trilinos/Configure.cmake index d661a4c..d62eb79 100644 --- a/Tests/Contracts/Trilinos/RunTest.cmake +++ b/Tests/Contracts/Trilinos/Configure.cmake @@ -4,4 +4,4 @@ set(dir "${CMAKE_CURRENT_BINARY_DIR}/Contracts/${project}") set(exe "${CMAKE_COMMAND}") set(args -P "${dir}/ValidateBuild.cmake") -set(Trilinos_RUN_TEST ${exe} ${args}) +set(CMake_TEST_CONTRACT_Trilinos_RUN_TEST ${exe} ${args}) diff --git a/Tests/Contracts/Trilinos/EnvScript.cmake b/Tests/Contracts/Trilinos/EnvScript.cmake deleted file mode 100644 index dacb704..0000000 --- a/Tests/Contracts/Trilinos/EnvScript.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# Site specific settings: -# -if(CTEST_SITE MATCHES "faraway") - set(CTEST_SITE "faraway.kitware") - set(ENV{CTEST_SITE} "${CTEST_SITE}") -endif() - -if(CTEST_SITE STREQUAL "HUT11") - set(CTEST_SITE "hut11.kitware") - set(ENV{CTEST_SITE} "${CTEST_SITE}") - - set(ENV{CLAPACK_DIR} "C:/T/clapack/b/clapack-prefix/src/clapack-build") -endif() - -if(CTEST_SITE MATCHES "qwghlm") - set(CTEST_SITE "qwghlm.kitware") - set(ENV{CTEST_SITE} "${CTEST_SITE}") - - set(ENV{PATH} "/opt/local/bin:$ENV{PATH}") - set(ENV{CC} "gcc-mp-4.3") - set(ENV{CXX} "g++-mp-4.3") - set(ENV{FC} "gfortran-mp-4.3") -endif() - -# Submit to alternate CDash server: -# -#set(ENV{CTEST_DROP_SITE} "localhost") -#set(ENV{CTEST_DROP_LOCATION} "/CDash/submit.php?project=Trilinos") - -# Limit packages built: -# -set(ENV{Trilinos_PACKAGES} "Teuchos;Kokkos") diff --git a/Tests/Contracts/VTK/CMakeLists.txt b/Tests/Contracts/VTK/CMakeLists.txt index ef19325..c946499 100644 --- a/Tests/Contracts/VTK/CMakeLists.txt +++ b/Tests/Contracts/VTK/CMakeLists.txt @@ -5,24 +5,7 @@ project(VTK) include(ExternalProject) # find "HOME". VTK will be downloaded & built within a subdirectory. -if(NOT DEFINED HOME) - if(DEFINED ENV{CTEST_REAL_HOME}) - set(HOME "$ENV{CTEST_REAL_HOME}") - else() - set(HOME "$ENV{HOME}") - endif() - - if(NOT HOME AND WIN32) - # Try for USERPROFILE as HOME equivalent: - string(REPLACE "\\" "/" HOME "$ENV{USERPROFILE}") - - # But just use root of SystemDrive if USERPROFILE contains any spaces: - # (Default on XP and earlier...) - if(HOME MATCHES " ") - string(REPLACE "\\" "/" HOME "$ENV{SystemDrive}") - endif() - endif() -endif() +include(${CMAKE_CURRENT_SOURCE_DIR}/../Home.cmake) set(base_dir "${HOME}/.cmake/Contracts/VTK") diff --git a/Tests/Contracts/VTK/RunTest.cmake b/Tests/Contracts/VTK/Configure.cmake index 65285cf..037d75a 100644 --- a/Tests/Contracts/VTK/RunTest.cmake +++ b/Tests/Contracts/VTK/Configure.cmake @@ -1,3 +1,3 @@ set(exe "$ENV{HOME}/.cmake/Contracts/VTK/VTK-build/bin/vtkCommonCoreCxxTests") set(args otherArrays) -set(VTK_RUN_TEST ${exe} ${args}) +set(CMake_TEST_CONTRACT_VTK_RUN_TEST ${exe} ${args}) diff --git a/Tests/Contracts/cse-snapshot/CMakeLists.txt b/Tests/Contracts/cse-snapshot/CMakeLists.txt deleted file mode 100644 index 9134210..0000000 --- a/Tests/Contracts/cse-snapshot/CMakeLists.txt +++ /dev/null @@ -1,114 +0,0 @@ -cmake_minimum_required(VERSION 2.8) -project(cse-snapshot) - -include(ExternalProject) - -include("${CMAKE_CURRENT_SOURCE_DIR}/LocalOverrides.cmake" OPTIONAL) -include("${CMAKE_CURRENT_BINARY_DIR}/LocalOverrides.cmake" OPTIONAL) - -if(NOT DEFINED HOME) - if(DEFINED ENV{CTEST_REAL_HOME}) - set(HOME "$ENV{CTEST_REAL_HOME}") - else() - set(HOME "$ENV{HOME}") - endif() -endif() -message(STATUS "HOME='${HOME}'") - -if(NOT DEFINED repo) - set(repo "git://public.kitware.com/cse.git") -endif() -message(STATUS "repo='${repo}'") - -if(NOT DEFINED tag) - set(tag "cc1dcb95439a21ab1d58f444d93481598414196e") -endif() -message(STATUS "tag='${tag}'") - -string(SUBSTRING "${tag}" 0 8 shorttag) - -set(base_dir "${HOME}/.cmake/Contracts/${PROJECT_NAME}/${shorttag}") -set(binary_dir "${base_dir}/build") -set(script_dir "${base_dir}") -set(source_dir "${base_dir}/src") - -if(NOT DEFINED BUILDNAME) - set(BUILDNAME "CMakeContract-${shorttag}") -endif() -message(STATUS "BUILDNAME='${BUILDNAME}'") - -if(NOT DEFINED SITE) - site_name(SITE) -endif() -message(STATUS "SITE='${SITE}'") - -if(NOT DEFINED PROCESSOR_COUNT) - # Unknown: - set(PROCESSOR_COUNT 0) - - # Linux: - set(cpuinfo_file "/proc/cpuinfo") - if(EXISTS "${cpuinfo_file}") - file(STRINGS "${cpuinfo_file}" procs REGEX "^processor.: [0-9]+$") - list(LENGTH procs PROCESSOR_COUNT) - endif() - - # Mac: - if(APPLE) - find_program(cmd_sysctl "sysctl") - if(cmd_sysctl) - execute_process(COMMAND ${cmd_sysctl} -n hw.ncpu - OUTPUT_VARIABLE PROCESSOR_COUNT - OUTPUT_STRIP_TRAILING_WHITESPACE) - endif() - endif() - - # Windows: - if(WIN32) - set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}") - endif() -endif() -message(STATUS "PROCESSOR_COUNT='${PROCESSOR_COUNT}'") - -find_package(Git) -if(NOT GIT_EXECUTABLE) - message(FATAL_ERROR "error: could not find git") - # adjust PATH to find git, or set GIT_EXECUTABLE in LocalOverrides.cmake -endif() -message(STATUS "GIT_EXECUTABLE='${GIT_EXECUTABLE}'") - -configure_file( - "${CMAKE_CURRENT_SOURCE_DIR}/Dashboard.cmake.in" - "${script_dir}/Dashboard.cmake" - @ONLY) - -# Source dir for this project exists outside the CMake build tree because it -# is absolutely huge. -# -if(EXISTS "${source_dir}/.git") - # If it exists already, download is a complete no-op: - ExternalProject_Add(download-${PROJECT_NAME} - DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - ) -else() - # If it does not yet exist, download clones the git repository: - ExternalProject_Add(download-${PROJECT_NAME} - SOURCE_DIR "${source_dir}" - GIT_REPOSITORY "${repo}" - GIT_TAG "${tag}" - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND "" - ) -endif() - -ExternalProject_Add(build-${PROJECT_NAME} - DOWNLOAD_COMMAND "" - CONFIGURE_COMMAND "" - BUILD_COMMAND ${CMAKE_CTEST_COMMAND} -S "${script_dir}/Dashboard.cmake" - INSTALL_COMMAND "" - DEPENDS download-${PROJECT_NAME} - ) diff --git a/Tests/Contracts/cse-snapshot/Dashboard.cmake.in b/Tests/Contracts/cse-snapshot/Dashboard.cmake.in deleted file mode 100644 index 138eb3f..0000000 --- a/Tests/Contracts/cse-snapshot/Dashboard.cmake.in +++ /dev/null @@ -1,76 +0,0 @@ -# This "ctest -S" script may be configured to drive a nightly dashboard on any -# Linux machine. -# -set(CTEST_BINARY_DIRECTORY "@binary_dir@") -set(CTEST_BUILD_NAME "@BUILDNAME@") -set(CTEST_SITE "@SITE@") -set(CTEST_SOURCE_DIRECTORY "@source_dir@") -set(PROCESSOR_COUNT "@PROCESSOR_COUNT@") - -# Assume a Linux build, with a make that supports -j. Modify this script if -# assumption is ever invalid. -# -if(PROCESSOR_COUNT) - set(CTEST_BUILD_FLAGS "-j${PROCESSOR_COUNT}") -endif() - -set(CTEST_CMAKE_GENERATOR "Unix Makefiles") -set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") - -message("Cleaning binary dir '${CTEST_BINARY_DIRECTORY}'") -ctest_empty_binary_directory("${CTEST_BINARY_DIRECTORY}") - -# Intentionally no ctest_update step in this script. This script is run as a -# "Contract" test on a CMake dashboard submission using the just-built ctest -# as the driver. The download step in the Contract CMakeLists file takes care -# of setting up the source tree before calling this ctest -S script. The idea -# is that the source tree will be the same every day, so there should not be -# an "update" step for this build. - -message("Configuring CSE in binary dir '${CTEST_BINARY_DIRECTORY}'") -set_property(GLOBAL PROPERTY SubProject "CSE-toplevel") -set_property(GLOBAL PROPERTY Label "CSE-toplevel") - -ctest_start("Experimental") - -set(CSE_TOPLEVEL_OPTIONS - -DEXTERNAL_PROJECT_DASHBOARD_BUILD:BOOL=ON - -DEXTERNAL_PROJECT_TESTS:BOOL=ON - -DCSE_INSTALL_PREFIX:PATH=${CTEST_BINARY_DIRECTORY}/built - -DCSE_SUBSET:STRING=ALL - -DCTEST_SITE:STRING=${CTEST_SITE} -) - -ctest_configure(OPTIONS "${CSE_TOPLEVEL_OPTIONS}") - -# The configure step produces a file listing the CSE packages and dependencies. -# This file also generates Project.xml and stores it in ${PROJECT_XML}. -# -set(subprojects "") -if(EXISTS "${CTEST_BINARY_DIRECTORY}/CSEBuildtimeDepends.cmake") - message("Including CSEBuildtimeDepends.cmake") - include("${CTEST_BINARY_DIRECTORY}/CSEBuildtimeDepends.cmake") - set(subprojects ${CSE_ALL_SORTED}) - message("Submitting Project.xml") - ctest_submit(FILES ${PROJECT_XML}) -endif() - -message("Submitting CSE configure results") -ctest_submit() - -if(subprojects) - message("Building by looping over subprojects...") - foreach(subproject ${subprojects}) - message("########## ${subproject} ##########") - set_property(GLOBAL PROPERTY SubProject "${subproject}") - set_property(GLOBAL PROPERTY Label "${subproject}") - ctest_build(TARGET "${subproject}" APPEND) - message("Submitting ${subproject} build results") - ctest_submit(PARTS build) - endforeach() -else() - message("Building all...") - ctest_build(APPEND) - message("Submitting build results") - ctest_submit(PARTS build) -endif() diff --git a/Tests/Contracts/cse-snapshot/RunTest.cmake b/Tests/Contracts/cse-snapshot/RunTest.cmake deleted file mode 100644 index 7eb6301..0000000 --- a/Tests/Contracts/cse-snapshot/RunTest.cmake +++ /dev/null @@ -1,3 +0,0 @@ -set(exe "$ENV{HOME}/.cmake/Contracts/cse-snapshot/510345e4/build/built/Release/git-1.6.5.2/bin/git") -set(args help clone) -set(cse-snapshot_RUN_TEST ${exe} ${args}) diff --git a/Tests/FortranModules/test_preprocess.F90 b/Tests/FortranModules/test_preprocess.F90 index 3a09976..c5a5ec3 100644 --- a/Tests/FortranModules/test_preprocess.F90 +++ b/Tests/FortranModules/test_preprocess.F90 @@ -1,5 +1,5 @@ MODULE Available -! no conent +! no content END MODULE PROGRAM PPTEST diff --git a/Tests/FortranModules/test_preprocess_module.F90 b/Tests/FortranModules/test_preprocess_module.F90 index 5849b62..fdbc051 100644 --- a/Tests/FortranModules/test_preprocess_module.F90 +++ b/Tests/FortranModules/test_preprocess_module.F90 @@ -1,5 +1,5 @@ #ifdef FOO MODULE PPAvailable -! no conent +! no content END MODULE #endif diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt index de1603a..4687882 100644 --- a/Tests/OutOfSource/CMakeLists.txt +++ b/Tests/OutOfSource/CMakeLists.txt @@ -1,4 +1,4 @@ -# a simple test cas +# a simple test case cmake_minimum_required (VERSION 2.6) project (OutOfSource) diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-result.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt new file mode 100644 index 0000000..de09351 --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0037-OLD-reserved.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0037 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/CMP0037/CMP0037-OLD-space-result.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0037/CMP0037-OLD-space-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt new file mode 100644 index 0000000..4d13e59 --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-space-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0037-OLD-space.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0037 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/CMP0037/OLD-cond-package-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-package-stderr.txt new file mode 100644 index 0000000..5a29a49 --- /dev/null +++ b/Tests/RunCMake/CMP0037/OLD-cond-package-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at OLD-cond-package.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0037 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/CMP0037/OLD-cond-package_source-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-package_source-stderr.txt new file mode 100644 index 0000000..5f72e16 --- /dev/null +++ b/Tests/RunCMake/CMP0037/OLD-cond-package_source-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at OLD-cond-package_source.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0037 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/CMP0037/OLD-cond-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-stderr.txt new file mode 100644 index 0000000..94e4575 --- /dev/null +++ b/Tests/RunCMake/CMP0037/OLD-cond-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at OLD-cond.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0037 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/CMP0037/OLD-cond-test-stderr.txt b/Tests/RunCMake/CMP0037/OLD-cond-test-stderr.txt new file mode 100644 index 0000000..81e10ce --- /dev/null +++ b/Tests/RunCMake/CMP0037/OLD-cond-test-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at OLD-cond-test.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0037 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/CMP0038/CMP0038-OLD-result.txt b/Tests/RunCMake/CMP0038/CMP0038-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0038/CMP0038-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0038/CMP0038-OLD-stderr.txt b/Tests/RunCMake/CMP0038/CMP0038-OLD-stderr.txt new file mode 100644 index 0000000..c754128 --- /dev/null +++ b/Tests/RunCMake/CMP0038/CMP0038-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0038-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0038 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/CMP0039/CMP0039-OLD-result.txt b/Tests/RunCMake/CMP0039/CMP0039-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0039/CMP0039-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0039/CMP0039-OLD-stderr.txt b/Tests/RunCMake/CMP0039/CMP0039-OLD-stderr.txt new file mode 100644 index 0000000..d7863fd --- /dev/null +++ b/Tests/RunCMake/CMP0039/CMP0039-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0039-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0039 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/CMP0040/CMP0040-OLD-existing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt new file mode 100644 index 0000000..f38c03d --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0040-OLD-existing-target.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0040 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/CMP0040/CMP0040-OLD-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt new file mode 100644 index 0000000..61f4f03 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0040-OLD-missing-target.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0040 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/CMP0041/CMP0041-OLD-result.txt b/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt new file mode 100644 index 0000000..1b736da --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0041-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0041 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/CMP0041/CMP0041-tid-OLD-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt new file mode 100644 index 0000000..dbc5167 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0041-tid-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0041 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/CMP0042/CMP0042-OLD-result.txt b/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0042/CMP0042-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt b/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt new file mode 100644 index 0000000..9d1488d --- /dev/null +++ b/Tests/RunCMake/CMP0042/CMP0042-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0042-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0042 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/CMP0043/CMP0043-OLD-result.txt b/Tests/RunCMake/CMP0043/CMP0043-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0043/CMP0043-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0043/CMP0043-OLD-stderr.txt b/Tests/RunCMake/CMP0043/CMP0043-OLD-stderr.txt new file mode 100644 index 0000000..ebbb361 --- /dev/null +++ b/Tests/RunCMake/CMP0043/CMP0043-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0043-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0043 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/CMP0045/CMP0045-OLD-result.txt b/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0045/CMP0045-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt b/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt new file mode 100644 index 0000000..0dac20f --- /dev/null +++ b/Tests/RunCMake/CMP0045/CMP0045-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0045-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0045 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/CMP0046/CMP0046-OLD-existing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency-stderr.txt new file mode 100644 index 0000000..4444118 --- /dev/null +++ b/Tests/RunCMake/CMP0046/CMP0046-OLD-existing-dependency-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0046-OLD-existing-dependency.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0046 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/CMP0046/CMP0046-OLD-missing-dependency-stderr.txt b/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency-stderr.txt new file mode 100644 index 0000000..525954f --- /dev/null +++ b/Tests/RunCMake/CMP0046/CMP0046-OLD-missing-dependency-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0046-OLD-missing-dependency.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0046 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/CMP0049/CMP0049-OLD-result.txt b/Tests/RunCMake/CMP0049/CMP0049-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0049/CMP0049-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt b/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt new file mode 100644 index 0000000..b373970 --- /dev/null +++ b/Tests/RunCMake/CMP0049/CMP0049-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0049-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0049 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/CMP0050/CMP0050-OLD-result.txt b/Tests/RunCMake/CMP0050/CMP0050-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0050/CMP0050-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0050/CMP0050-OLD-stderr.txt b/Tests/RunCMake/CMP0050/CMP0050-OLD-stderr.txt new file mode 100644 index 0000000..3e7fa97 --- /dev/null +++ b/Tests/RunCMake/CMP0050/CMP0050-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0050-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0050 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/CMP0051/CMP0051-OLD-result.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt deleted file mode 100644 index 573541a..0000000 --- a/Tests/RunCMake/CMP0051/CMP0051-OLD-result.txt +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt index cc17f33..697265e 100644 --- a/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0051/CMP0051-OLD-stderr.txt @@ -1 +1,12 @@ -^Sources: "empty.cpp"$ +^CMake Deprecation Warning at CMP0051-OLD.cmake:2 \(cmake_policy\): + The OLD behavior for policy CMP0051 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\) ++ +Sources: "empty.cpp"$ diff --git a/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt b/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt index 836b0ff..2a0ddbaa 100644 --- a/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0053/CMP0053-OLD-stderr.txt @@ -1,2 +1,13 @@ -^called +^CMake Deprecation Warning at CMP0053-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0053 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\) ++ +called --><--$ diff --git a/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt index f5a8fbe..0500280 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-OLD-stderr.txt @@ -1 +1,10 @@ -$^ +^CMake Deprecation Warning at CMP0054-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0054 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/CMP0054/CMP0054-keywords-OLD-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt index f5a8fbe..60303cd 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-keywords-OLD-stderr.txt @@ -1 +1,10 @@ -$^ +^CMake Deprecation Warning at CMP0054-keywords-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0054 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/CMP0054/CMP0054-policy-command-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt index f5a8fbe..1b35472 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-command-scope-stderr.txt @@ -1 +1,10 @@ -$^ +^CMake Deprecation Warning at CMP0054-policy-command-scope.cmake:25 \(cmake_policy\): + The OLD behavior for policy CMP0054 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/CMP0054/CMP0054-policy-foreach-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt index f5a8fbe..4eac90e 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-foreach-scope-stderr.txt @@ -1 +1,54 @@ -$^ +^CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:14 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:14 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:27 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:48 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-foreach-scope.cmake:48 \(cmake_policy\): + The OLD behavior for policy CMP0054 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/CMP0054/CMP0054-policy-nested-if-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt index f5a8fbe..a2dd62e 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-nested-if-stderr.txt @@ -1 +1,10 @@ -$^ +^CMake Deprecation Warning at CMP0054-policy-nested-if.cmake:23 \(cmake_policy\): + The OLD behavior for policy CMP0054 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/CMP0054/CMP0054-policy-while-scope-stderr.txt b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt index f5a8fbe..718904d 100644 --- a/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt +++ b/Tests/RunCMake/CMP0054/CMP0054-policy-while-scope-stderr.txt @@ -1 +1,54 @@ -$^ +^CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:16 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:16 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:37 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:58 \(cmake_policy\): + The OLD behavior for policy CMP0054 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\) ++ +CMake Deprecation Warning at CMP0054-policy-while-scope.cmake:58 \(cmake_policy\): + The OLD behavior for policy CMP0054 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/CPack/README.txt b/Tests/RunCMake/CPack/README.txt index cf7c02c..5a95927 100644 --- a/Tests/RunCMake/CPack/README.txt +++ b/Tests/RunCMake/CPack/README.txt @@ -149,7 +149,7 @@ this step and must contain NOTE: This variable should be used only as last resort as it sets generator specific regular expression. EXPECTED_FILE_CONTENT_<file_number_starting_with_1>_LIST should be - prefered as it requires a list of expected files and directories that + preferred as it requires a list of expected files and directories that is later changed automatically depending on the generator so expected package content can be written only once per test for all generators. @@ -209,7 +209,7 @@ To add a new generator we must + FILE that will contain the package file for which the package content should be returned. + RESULT_VAR that will tell the function which variable in parent scope - should contain the result (list of pacakge content) + should contain the result (list of package content) - toExpectedContentList: This function should convert an expected package content list into one that is expected for the generator (e.g. rpm packages have install/relocate diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-stderr.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-stderr.txt new file mode 100644 index 0000000..37747a1 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-OLD-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + The OLD behavior for policy CMP0052 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD.$ diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-stderr.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-stderr.txt new file mode 100644 index 0000000..37747a1 --- /dev/null +++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-OLD-stderr.txt @@ -0,0 +1,8 @@ +^CMake Deprecation Warning at CMakeLists.txt:1 \(cmake_minimum_required\): + The OLD behavior for policy CMP0052 will be removed from a future version + of CMake. + + The cmake-policies\(7\) manual explains that the OLD behaviors of all + policies are deprecated and that a policy should be set to OLD only under + specific short-term circumstances. Projects should be ported to the NEW + behavior and not rely on setting a policy to OLD.$ diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt index acfa30a..0dde1bc 100644 --- a/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt +++ b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt @@ -1 +1,12 @@ -^-->wrong<--$ +^CMake Deprecation Warning at CMP0053-At-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0053 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\) ++ +-->wrong<--$ diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake index 2346c86..24dad03 100644 --- a/Tests/RunCMake/message/RunCMakeTest.cmake +++ b/Tests/RunCMake/message/RunCMakeTest.cmake @@ -7,6 +7,6 @@ run_cmake(nomessage-internal-warning) run_cmake(warnmessage) # message command sets fatal occurred flag, so check each type of error -# seperately +# separately run_cmake(errormessage_deprecated) run_cmake(errormessage_dev) diff --git a/Tests/RunCMake/project/CMP0048-OLD-stderr.txt b/Tests/RunCMake/project/CMP0048-OLD-stderr.txt new file mode 100644 index 0000000..1fa70f8 --- /dev/null +++ b/Tests/RunCMake/project/CMP0048-OLD-stderr.txt @@ -0,0 +1,10 @@ +^CMake Deprecation Warning at CMP0048-OLD.cmake:1 \(cmake_policy\): + The OLD behavior for policy CMP0048 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/Server/CMakeLists.txt b/Tests/Server/CMakeLists.txt index 08bef0c..41d1131 100644 --- a/Tests/Server/CMakeLists.txt +++ b/Tests/Server/CMakeLists.txt @@ -3,10 +3,10 @@ project(Server CXX) find_package(PythonInterp REQUIRED) -macro(do_test bsname file) +macro(do_test bsname file type) execute_process(COMMAND ${PYTHON_EXECUTABLE} -B # no .pyc files - "${CMAKE_SOURCE_DIR}/server-test.py" + "${CMAKE_SOURCE_DIR}/${type}-test.py" "${CMAKE_COMMAND}" "${CMAKE_SOURCE_DIR}/${file}" "${CMAKE_SOURCE_DIR}" @@ -20,9 +20,9 @@ macro(do_test bsname file) endif() endmacro() -do_test("test_cache" "tc_cache.json") -do_test("test_handshake" "tc_handshake.json") -do_test("test_globalSettings" "tc_globalSettings.json") -do_test("test_buildsystem1" "tc_buildsystem1.json") +do_test("test_cache" "tc_cache.json" "server") +do_test("test_handshake" "tc_handshake.json" "server") +do_test("test_globalSettings" "tc_globalSettings.json" "server") +do_test("test_buildsystem1" "tc_buildsystem1.json" "server") add_executable(Server empty.cpp) diff --git a/Tests/Server/cmakelib.py b/Tests/Server/cmakelib.py index 2218e02..39e3618 100644 --- a/Tests/Server/cmakelib.py +++ b/Tests/Server/cmakelib.py @@ -1,5 +1,5 @@ from __future__ import print_function -import sys, subprocess, json +import sys, subprocess, json, os, select, shutil, time, socket termwidth = 150 @@ -38,11 +38,50 @@ def col_print(title, array): for index in range(numRows): print(indent + pad.join(item.ljust(maxitemwidth) for item in array[index::numRows])) +filterPacket = lambda x: x + +STDIN = 0 +PIPE = 1 + +communicationMethods = [STDIN] + +if hasattr(socket, 'AF_UNIX'): + communicationMethods.append(PIPE) + +def defaultExitWithError(proc): + data = "" + try: + while select.select([proc.outPipe], [], [], 3.)[0]: + data = data + proc.outPipe.read(1) + if len(data): + print("Rest of raw buffer from server:") + printServer(data) + except: + pass + proc.outPipe.close() + proc.inPipe.close() + proc.kill() + sys.exit(1) + +exitWithError = lambda proc: defaultExitWithError(proc) + +serverTag = "SERVER" + +def printServer(*args): + print(serverTag + ">", *args) + print() + sys.stdout.flush() + +def printClient(*args): + print("CLIENT>", *args) + print() + sys.stdout.flush() + def waitForRawMessage(cmakeCommand): stdoutdata = "" payload = "" while not cmakeCommand.poll(): - stdoutdataLine = cmakeCommand.stdout.readline() + stdoutdataLine = cmakeCommand.outPipe.readline() if stdoutdataLine: stdoutdata += stdoutdataLine.decode('utf-8') else: @@ -50,12 +89,16 @@ def waitForRawMessage(cmakeCommand): begin = stdoutdata.find('[== "CMake Server" ==[\n') end = stdoutdata.find(']== "CMake Server" ==]') - if (begin != -1 and end != -1): + if begin != -1 and end != -1: begin += len('[== "CMake Server" ==[\n') payload = stdoutdata[begin:end] - if print_communication: - print("\nSERVER>", json.loads(payload), "\n") - return json.loads(payload) + jsonPayload = json.loads(payload) + filteredPayload = filterPacket(jsonPayload) + if print_communication and filteredPayload: + printServer(filteredPayload) + if filteredPayload is not None or jsonPayload is None: + return jsonPayload + stdoutdata = stdoutdata[(end+len(']== "CMake Server" ==]')):] def writeRawData(cmakeCommand, content): writeRawData.counter += 1 @@ -71,27 +114,53 @@ def writeRawData(cmakeCommand, content): payload = payload.replace('\n', '\r\n') if print_communication: - print("\nCLIENT>", content, "(Use \\r\\n:", rn, ")\n") - cmakeCommand.stdin.write(payload.encode('utf-8')) - cmakeCommand.stdin.flush() + printClient(content, "(Use \\r\\n:", rn, ")") + + cmakeCommand.write(payload.encode('utf-8')) + writeRawData.counter = 0 def writePayload(cmakeCommand, obj): writeRawData(cmakeCommand, json.dumps(obj)) -def initProc(cmakeCommand): - cmakeCommand = subprocess.Popen([cmakeCommand, "-E", "server", "--experimental", "--debug"], - stdin=subprocess.PIPE, - stdout=subprocess.PIPE) +def getPipeName(): + return "/tmp/server-test-socket" + +def attachPipe(cmakeCommand, pipeName): + time.sleep(1) + sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) + sock.connect(pipeName) + global serverTag + serverTag = "SERVER(PIPE)" + cmakeCommand.outPipe = sock.makefile() + cmakeCommand.inPipe = sock + cmakeCommand.write = cmakeCommand.inPipe.sendall + +def writeAndFlush(pipe, val): + pipe.write(val) + pipe.flush() + +def initServerProc(cmakeCommand, comm): + if comm == PIPE: + pipeName = getPipeName() + cmakeCommand = subprocess.Popen([cmakeCommand, "-E", "server", "--experimental", "--pipe=" + pipeName]) + attachPipe(cmakeCommand, pipeName) + else: + cmakeCommand = subprocess.Popen([cmakeCommand, "-E", "server", "--experimental", "--debug"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE) + cmakeCommand.outPipe = cmakeCommand.stdout + cmakeCommand.inPipe = cmakeCommand.stdin + cmakeCommand.write = lambda val: writeAndFlush(cmakeCommand.inPipe, val) packet = waitForRawMessage(cmakeCommand) if packet == None: print("Not in server mode") - sys.exit(1) + sys.exit(2) if packet['type'] != 'hello': print("No hello message") - sys.exit(1) + sys.exit(3) return cmakeCommand @@ -115,7 +184,8 @@ def waitForMessage(cmakeCommand, expected): packet = ordered(waitForRawMessage(cmakeCommand)) if packet != data: - sys.exit(-1) + print ("Received unexpected message; test failed") + exitWithError(cmakeCommand) return packet def waitForReply(cmakeCommand, originalType, cookie, skipProgress): @@ -124,25 +194,27 @@ def waitForReply(cmakeCommand, originalType, cookie, skipProgress): packet = waitForRawMessage(cmakeCommand) t = packet['type'] if packet['cookie'] != cookie or packet['inReplyTo'] != originalType: - sys.exit(1) + print("cookie or inReplyTo mismatch") + sys.exit(4) if t == 'message' or t == 'progress': if skipProgress: continue if t == 'reply': break - sys.exit(1) + print("Unrecognized message", packet) + sys.exit(5) return packet def waitForError(cmakeCommand, originalType, cookie, message): packet = waitForRawMessage(cmakeCommand) if packet['cookie'] != cookie or packet['type'] != 'error' or packet['inReplyTo'] != originalType or packet['errorMessage'] != message: - sys.exit(1) + sys.exit(6) def waitForProgress(cmakeCommand, originalType, cookie, current, message): packet = waitForRawMessage(cmakeCommand) if packet['cookie'] != cookie or packet['type'] != 'progress' or packet['inReplyTo'] != originalType or packet['progressCurrent'] != current or packet['progressMessage'] != message: - sys.exit(1) + sys.exit(7) def handshake(cmakeCommand, major, minor, source, build, generator, extraGenerator): version = { 'major': major } @@ -167,9 +239,9 @@ def validateGlobalSettings(cmakeCommand, cmakeCommandPath, data): versionString = version['string'] vs = str(version['major']) + '.' + str(version['minor']) + '.' + str(version['patch']) if (versionString != vs and not versionString.startswith(vs + '-')): - sys.exit(1) + sys.exit(8) if (versionString != cmakeVersion): - sys.exit(1) + sys.exit(9) # validate generators: generatorObjects = capabilities['generators'] @@ -202,16 +274,16 @@ def validateGlobalSettings(cmakeCommand, cmakeCommandPath, data): for gen in cmakeGenerators: if (not gen in generators): - sys.exit(1) + sys.exit(10) gen = packet['generator'] if (gen != '' and not (gen in generators)): - sys.exit(1) + sys.exit(11) for i in data: print("Validating", i) if (packet[i] != data[i]): - sys.exit(1) + sys.exit(12) def validateCache(cmakeCommand, data): packet = waitForReply(cmakeCommand, 'cache', '', False) @@ -236,3 +308,43 @@ def validateCache(cmakeCommand, data): if (not hadHomeDir): print('No CMAKE_HOME_DIRECTORY found in cache.') sys.exit(1) + +def handleBasicMessage(proc, obj, debug): + if 'sendRaw' in obj: + data = obj['sendRaw'] + if debug: print("Sending raw:", data) + writeRawData(proc, data) + return True + elif 'send' in obj: + data = obj['send'] + if debug: print("Sending:", json.dumps(data)) + writePayload(proc, data) + return True + elif 'recv' in obj: + data = obj['recv'] + if debug: print("Waiting for:", json.dumps(data)) + waitForMessage(proc, data) + return True + elif 'message' in obj: + print("MESSAGE:", obj["message"]) + sys.stdout.flush() + return True + return False + +def shutdownProc(proc): + # Tell the server to exit. + proc.inPipe.close() + proc.outPipe.close() + + # Wait for the server to exit. + # If this version of python supports it, terminate the server after a timeout. + try: + proc.wait(timeout=5) + except TypeError: + proc.wait() + except: + proc.terminate() + raise + + print('cmake-server exited: %d' % proc.returncode) + sys.exit(proc.returncode) diff --git a/Tests/Server/server-test.py b/Tests/Server/server-test.py index 9380910..701c6e9 100644 --- a/Tests/Server/server-test.py +++ b/Tests/Server/server-test.py @@ -9,7 +9,7 @@ sourceDir = sys.argv[3] buildDir = sys.argv[4] + "/" + os.path.splitext(os.path.basename(testFile))[0] cmakeGenerator = sys.argv[5] -print("Test:", testFile, +print("Server Test:", testFile, "\n-- SourceDir:", sourceDir, "\n-- BuildDir:", buildDir, "\n-- Generator:", cmakeGenerator) @@ -17,99 +17,89 @@ print("Test:", testFile, if os.path.exists(buildDir): shutil.rmtree(buildDir) -proc = cmakelib.initProc(cmakeCommand) +cmakelib.filterBase = sourceDir with open(testFile) as f: testData = json.loads(f.read()) -for obj in testData: - if 'sendRaw' in obj: - data = obj['sendRaw'] - if debug: print("Sending raw:", data) - cmakelib.writeRawData(proc, data) - elif 'send' in obj: - data = obj['send'] - if debug: print("Sending:", json.dumps(data)) - cmakelib.writePayload(proc, data) - elif 'recv' in obj: - data = obj['recv'] - if debug: print("Waiting for:", json.dumps(data)) - cmakelib.waitForMessage(proc, data) - elif 'reply' in obj: - data = obj['reply'] - if debug: print("Waiting for reply:", json.dumps(data)) - originalType = "" - cookie = "" - skipProgress = False; - if 'cookie' in data: cookie = data['cookie'] - if 'type' in data: originalType = data['type'] - if 'skipProgress' in data: skipProgress = data['skipProgress'] - cmakelib.waitForReply(proc, originalType, cookie, skipProgress) - elif 'error' in obj: - data = obj['error'] - if debug: print("Waiting for error:", json.dumps(data)) - originalType = "" - cookie = "" - message = "" - if 'cookie' in data: cookie = data['cookie'] - if 'type' in data: originalType = data['type'] - if 'message' in data: message = data['message'] - cmakelib.waitForError(proc, originalType, cookie, message) - elif 'progress' in obj: - data = obj['progress'] - if debug: print("Waiting for progress:", json.dumps(data)) - originalType = '' - cookie = "" - current = 0 - message = "" - if 'cookie' in data: cookie = data['cookie'] - if 'type' in data: originalType = data['type'] - if 'current' in data: current = data['current'] - if 'message' in data: message = data['message'] - cmakelib.waitForProgress(proc, originalType, cookie, current, message) - elif 'handshake' in obj: - data = obj['handshake'] - if debug: print("Doing handshake:", json.dumps(data)) - major = -1 - minor = -1 - generator = cmakeGenerator - extraGenerator = '' - sourceDirectory = sourceDir - buildDirectory = buildDir - if 'major' in data: major = data['major'] - if 'minor' in data: minor = data['minor'] - if 'buildDirectory' in data: buildDirectory = data['buildDirectory'] - if 'sourceDirectory' in data: sourceDirectory = data['sourceDirectory'] - if 'generator' in data: generator = data['generator'] - if 'extraGenerator' in data: extraGenerator = data['extraGenerator'] - if not os.path.isabs(buildDirectory): - buildDirectory = buildDir + "/" + buildDirectory - if sourceDirectory != '' and not os.path.isabs(sourceDirectory): - sourceDirectory = sourceDir + "/" + sourceDirectory - cmakelib.handshake(proc, major, minor, sourceDirectory, buildDirectory, - generator, extraGenerator) - elif 'validateGlobalSettings' in obj: - data = obj['validateGlobalSettings'] - if not 'buildDirectory' in data: data['buildDirectory'] = buildDir - if not 'sourceDirectory' in data: data['sourceDirectory'] = sourceDir - if not 'generator' in data: data['generator'] = cmakeGenerator - if not 'extraGenerator' in data: data['extraGenerator'] = '' - cmakelib.validateGlobalSettings(proc, cmakeCommand, data) - elif 'validateCache' in obj: - data = obj['validateCache'] - if not 'isEmpty' in data: data['isEmpty'] = false - cmakelib.validateCache(proc, data) - elif 'message' in obj: - print("MESSAGE:", obj["message"]) - elif 'reconnect' in obj: - cmakelib.exitProc(proc) - proc = cmakelib.initProc(cmakeCommand) - else: - print("Unknown command:", json.dumps(obj)) - sys.exit(2) +for communicationMethod in cmakelib.communicationMethods: + proc = cmakelib.initServerProc(cmakeCommand, communicationMethod) + if proc is None: + continue - print("Completed") + for obj in testData: + if cmakelib.handleBasicMessage(proc, obj, debug): + pass + elif 'reply' in obj: + data = obj['reply'] + if debug: print("Waiting for reply:", json.dumps(data)) + originalType = "" + cookie = "" + skipProgress = False; + if 'cookie' in data: cookie = data['cookie'] + if 'type' in data: originalType = data['type'] + if 'skipProgress' in data: skipProgress = data['skipProgress'] + cmakelib.waitForReply(proc, originalType, cookie, skipProgress) + elif 'error' in obj: + data = obj['error'] + if debug: print("Waiting for error:", json.dumps(data)) + originalType = "" + cookie = "" + message = "" + if 'cookie' in data: cookie = data['cookie'] + if 'type' in data: originalType = data['type'] + if 'message' in data: message = data['message'] + cmakelib.waitForError(proc, originalType, cookie, message) + elif 'progress' in obj: + data = obj['progress'] + if debug: print("Waiting for progress:", json.dumps(data)) + originalType = '' + cookie = "" + current = 0 + message = "" + if 'cookie' in data: cookie = data['cookie'] + if 'type' in data: originalType = data['type'] + if 'current' in data: current = data['current'] + if 'message' in data: message = data['message'] + cmakelib.waitForProgress(proc, originalType, cookie, current, message) + elif 'handshake' in obj: + data = obj['handshake'] + if debug: print("Doing handshake:", json.dumps(data)) + major = -1 + minor = -1 + generator = cmakeGenerator + extraGenerator = '' + sourceDirectory = sourceDir + buildDirectory = buildDir + if 'major' in data: major = data['major'] + if 'minor' in data: minor = data['minor'] + if 'buildDirectory' in data: buildDirectory = data['buildDirectory'] + if 'sourceDirectory' in data: sourceDirectory = data['sourceDirectory'] + if 'generator' in data: generator = data['generator'] + if 'extraGenerator' in data: extraGenerator = data['extraGenerator'] -cmakelib.exitProc(proc) -print('cmake-server exited: %d' % proc.returncode) -sys.exit(proc.returncode) + if not os.path.isabs(buildDirectory): + buildDirectory = buildDir + "/" + buildDirectory + if sourceDirectory != '' and not os.path.isabs(sourceDirectory): + sourceDirectory = sourceDir + "/" + sourceDirectory + cmakelib.handshake(proc, major, minor, sourceDirectory, buildDirectory, + generator, extraGenerator) + elif 'validateGlobalSettings' in obj: + data = obj['validateGlobalSettings'] + if not 'buildDirectory' in data: data['buildDirectory'] = buildDir + if not 'sourceDirectory' in data: data['sourceDirectory'] = sourceDir + if not 'generator' in data: data['generator'] = cmakeGenerator + if not 'extraGenerator' in data: data['extraGenerator'] = '' + cmakelib.validateGlobalSettings(proc, cmakeCommand, data) + elif 'validateCache' in obj: + data = obj['validateCache'] + if not 'isEmpty' in data: data['isEmpty'] = false + cmakelib.validateCache(proc, data) + elif 'reconnect' in obj: + cmakelib.exitProc(proc) + proc = cmakelib.initServerProc(cmakeCommand, communicationMethod) + else: + print("Unknown command:", json.dumps(obj)) + sys.exit(2) + cmakelib.shutdownProc(proc) + print("Completed") diff --git a/Utilities/cmcurl/CMake/Utilities.cmake b/Utilities/cmcurl/CMake/Utilities.cmake index 8b6276d..005b166 100644 --- a/Utilities/cmcurl/CMake/Utilities.cmake +++ b/Utilities/cmcurl/CMake/Utilities.cmake @@ -19,7 +19,7 @@ function(LIST_SPACES_APPEND_ONCE LIST_NAME) set(${LIST_NAME} "${NEW_LIST_SPACE}" PARENT_SCOPE) endfunction() -# Convinience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value. +# Convenience function that does the same as LIST(FIND ...) but with a TRUE/FALSE return value. # Ex: IN_STR_LIST(MY_LIST "Searched item" WAS_FOUND) function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL) list(FIND ${LIST_NAME} ${ITEM_SEARCHED} FIND_POS) |